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

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

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

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

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

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

.ielts-wm-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-wm-hearts {
    font-size: 22px;
    letter-spacing: 2px;
    color: #c8193c;
}

.ielts-wm-game .ielts-wm-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 #6c5ce7;
    border-radius: 10px;
}

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

.ielts-wm-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-wm-game .ielts-wm-start-button,
.ielts-wm-game .ielts-wm-start-button:focus,
.ielts-wm-game .ielts-wm-new,
.ielts-wm-game .ielts-wm-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-wm-game .ielts-wm-start-button,
.ielts-wm-game .ielts-wm-start-button:focus {
    padding: 12px 40px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

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

.ielts-wm-game .ielts-wm-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-wm-done {
    margin-top: 12px;
    padding: 18px;
    text-align: center;
    background-color: white;
    border: 2px solid #9fd8c5;
    border-radius: 14px;
}

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

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

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

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

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

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

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

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

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

.ielts-wm-stage {
    height: 420px;
    background:
        radial-gradient(2px 2px at 12% 18%, white 50%, transparent 51%),
        radial-gradient(2px 2px at 30% 40%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
        radial-gradient(2px 2px at 52% 12%, white 50%, transparent 51%),
        radial-gradient(2px 2px at 70% 34%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
        radial-gradient(2px 2px at 86% 20%, white 50%, transparent 51%),
        radial-gradient(2px 2px at 92% 52%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
        radial-gradient(2px 2px at 8% 60%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
        linear-gradient(#1b1d4a, #3b3274 70%, #5d4a8c);
    cursor: text;
}

.ielts-wm-stage.is-hit {
    animation: ielts-wm-shake 0.3s;
}

.ielts-wm-town {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 64px;
    padding: 0 4%;
    background: linear-gradient(transparent 70%, #2a2350 70%);
}

.ielts-wm-town span {
    width: 11%;
    background-color: #4b3f80;
    background-image: linear-gradient(rgba(255, 220, 120, 0.85) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 220, 120, 0.85) 2px, transparent 2px);
    background-size: 10px 10px;
    background-position: 4px 4px;
    border-radius: 3px 3px 0 0;
}

.ielts-wm-town span:nth-child(1) { height: 38px; }
.ielts-wm-town span:nth-child(2) { height: 56px; }
.ielts-wm-town span:nth-child(3) { height: 30px; }
.ielts-wm-town span:nth-child(4) { height: 62px; }
.ielts-wm-town span:nth-child(5) { height: 42px; }
.ielts-wm-town span:nth-child(6) { height: 52px; }
.ielts-wm-town span:nth-child(7) { height: 34px; }

.ielts-wm-meteor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 6px 14px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
    white-space: nowrap;
    color: black;
    background: linear-gradient(#ffd27a, #ff9f43);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(255, 160, 67, 0.8);
}

.ielts-wm-meteor::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 10px;
    height: 40px;
    margin-left: -5px;
    background: linear-gradient(transparent, rgba(255, 190, 110, 0.7));
    border-radius: 999px;
}

.ielts-wm-meteor.is-target {
    background: linear-gradient(#fff3b0, #ffc94d);
    box-shadow: 0 0 18px rgba(255, 230, 120, 1);
}

.ielts-wm-typed {
    color: #b3122e;
    text-decoration: underline;
}

.ielts-wm-meteor.is-blasted {
    animation: ielts-wm-blast 0.45s forwards;
}

.ielts-wm-meteor.is-landed {
    background: #b0a8c8;
    box-shadow: none;
    animation: ielts-wm-blast 0.45s forwards;
}

.ielts-wm-game .ielts-wm-input,
.ielts-wm-game .ielts-wm-input:focus {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 12px auto 0 auto;
    padding: 10px 14px;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
    color: black;
    background-color: white;
    border: 2px solid #6c5ce7;
    border-radius: 999px;
    box-shadow: none;
}

.ielts-wm-game .ielts-wm-input:focus {
    outline: 3px solid rgba(108, 92, 231, 0.35);
    outline-offset: 1px;
}

.ielts-wm-game .ielts-wm-input:disabled {
    color: rgb(90, 90, 90);
    background-color: #ecebf5;
    border: 2px solid #c4bfe8;
}

.ielts-wm-game .ielts-wm-input.is-wrong {
    border: 2px solid #c8193c;
    animation: ielts-wm-shake 0.25s;
}

@keyframes ielts-wm-blast {
    0% { opacity: 1; filter: brightness(1); }
    40% { opacity: 1; filter: brightness(1.6); }
    100% { opacity: 0; filter: brightness(2); }
}

@keyframes ielts-wm-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

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

    .ielts-wm-stage {
        height: 340px;
    }

    .ielts-wm-meteor {
        padding: 5px 10px;
        font-size: 16px;
    }
}
