.ielts-lr-game {
    margin: 0 auto 40px auto;
    padding: 18px;
    border-radius: 14px;
    background-color: #f4f9ee;
    color: black;
}

.ielts-lr-game [hidden] {
    display: none !important;
}

.ielts-lr-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ielts-lr-game .ielts-lr-source {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: rgb(80, 80, 80);
}

.ielts-lr-source a {
    color: #006666;
    text-decoration: underline;
}

.ielts-lr-game .ielts-lr-help {
    margin: 0 0 14px 0;
    font-size: 16px;
    line-height: 1.5;
}

.ielts-lr-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
}

.ielts-lr-hearts {
    font-size: 22px;
    letter-spacing: 2px;
    color: #c8193c;
}

.ielts-lr-game .ielts-lr-clue {
    min-height: 54px;
    margin: 0 0 10px 0;
    padding: 10px 14px;
    font-size: 17px;
    line-height: 1.5;
    background-color: white;
    border-left: 4px solid #4caf50;
    border-radius: 10px;
}

.ielts-lr-stage {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
}

.ielts-lr-start {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.35);
}

.ielts-lr-game .ielts-lr-start-button,
.ielts-lr-game .ielts-lr-start-button:focus,
.ielts-lr-game .ielts-lr-new,
.ielts-lr-game .ielts-lr-new:focus {
    margin: 0;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.4;
    text-transform: none;
    color: white;
    background-color: teal;
    border: 1px solid teal;
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
}

.ielts-lr-game .ielts-lr-start-button,
.ielts-lr-game .ielts-lr-start-button:focus {
    padding: 12px 40px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ielts-lr-game .ielts-lr-start-button:hover,
.ielts-lr-game .ielts-lr-new:hover {
    color: white;
    background-color: #0a6b6b;
    border: 1px solid #0a6b6b;
}

.ielts-lr-game .ielts-lr-new:disabled,
.ielts-lr-game .ielts-lr-new:disabled:hover {
    color: white;
    background-color: #5c9c9c;
    border: 1px solid #5c9c9c;
    cursor: wait;
}

.ielts-lr-game .ielts-lr-start-button:focus-visible,
.ielts-lr-game .ielts-lr-new:focus-visible {
    outline: 2px solid black;
    outline-offset: 2px;
}

.ielts-lr-game .ielts-lr-status {
    min-height: 24px;
    margin: 10px 0 0 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    text-align: center;
    color: #1d6a39;
}

.ielts-lr-done {
    margin-top: 12px;
    padding: 18px;
    text-align: center;
    background-color: white;
    border: 2px solid #9fd8c5;
    border-radius: 14px;
}

.ielts-lr-game .ielts-lr-done-text {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.5;
}

.ielts-lr-recap {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.ielts-lr-game .ielts-lr-recap-heading {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.5;
}

.ielts-lr-card {
    padding: 12px 16px;
    background-color: white;
    border-left: 4px solid teal;
    border-radius: 10px;
}

.ielts-lr-game .ielts-lr-card p {
    margin: 0;
    line-height: 1.5;
}

.ielts-lr-game .ielts-lr-card .ielts-lr-card-term {
    font-size: 17px;
}

.ielts-lr-card-meta {
    margin-left: 4px;
    font-size: 14px;
    color: rgb(80, 80, 80);
}

.ielts-lr-game .ielts-lr-card .ielts-lr-card-meaning {
    margin-top: 2px;
    font-size: 15px;
}

.ielts-lr-game .ielts-lr-card .ielts-lr-card-example {
    margin-top: 4px;
    font-size: 15px;
    font-style: italic;
    color: rgb(70, 70, 70);
}

.ielts-lr-stage {
    height: 460px;
    background: linear-gradient(90deg, #5f6772, #6b7380 50%, #5f6772);
    touch-action: manipulation;
    cursor: pointer;
}

.ielts-lr-stage::before,
.ielts-lr-stage::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    margin-left: -2px;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0 26px, transparent 26px 52px);
}

.ielts-lr-stage::before {
    left: 33.333%;
}

.ielts-lr-stage::after {
    left: 66.667%;
}

.ielts-lr-stage.is-running::before,
.ielts-lr-stage.is-running::after {
    animation: ielts-lr-road 0.6s linear infinite;
}

.ielts-lr-row {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2;
    display: flex;
}

.ielts-lr-gate {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 62px;
    margin: 0 8px;
    padding: 4px 6px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: black;
    background-color: #fff3c4;
    border: 3px solid #d9a520;
    border-radius: 16px 16px 4px 4px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.ielts-lr-gate.is-right {
    background-color: #bdebbd;
    border-color: #3e9e5a;
}

.ielts-lr-gate.is-wrong {
    background-color: #ffc9d2;
    border-color: #c8193c;
}

.ielts-lr-runner {
    position: absolute;
    bottom: 22px;
    left: 50%;
    z-index: 3;
    width: 52px;
    height: 52px;
    margin-left: -26px;
    background-color: #ff9f43;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
    transition: left 0.15s ease-out;
}

.ielts-lr-runner::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 12px;
    width: 8px;
    height: 8px;
    background-color: black;
    border-radius: 50%;
    box-shadow: 16px 0 0 black;
}

.ielts-lr-runner::after {
    content: "";
    position: absolute;
    top: 28px;
    left: 16px;
    width: 14px;
    height: 7px;
    border-bottom: 3px solid black;
    border-radius: 0 0 10px 10px;
}

.ielts-lr-stage.is-running .ielts-lr-runner {
    animation: ielts-lr-bob 0.4s ease-in-out infinite alternate;
}

.ielts-lr-controls {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
}

.ielts-lr-game .ielts-lr-move,
.ielts-lr-game .ielts-lr-move:focus {
    width: 60px;
    height: 48px;
    margin: 0;
    padding: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: white;
    background-color: teal;
    border: 1px solid teal;
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
}

.ielts-lr-game .ielts-lr-move:hover {
    color: white;
    background-color: #0a6b6b;
    border: 1px solid #0a6b6b;
}

.ielts-lr-game .ielts-lr-move:focus-visible {
    outline: 2px solid black;
    outline-offset: 2px;
}

@keyframes ielts-lr-road {
    from { background-position: 0 0; }
    to { background-position: 0 52px; }
}

@keyframes ielts-lr-bob {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

@media (max-width: 560px) {
    .ielts-lr-game {
        padding: 12px;
    }

    .ielts-lr-stage {
        height: 420px;
    }

    .ielts-lr-gate {
        margin: 0 4px;
        font-size: 14px;
    }
}
