/* ===== RESET & BASE ===== */
:where(#app) *,
:where(#app) *::before,
:where(#app) *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


.game-container {
    max-width: 720px;
    width: 100%;
    background: #ffffffea;
    backdrop-filter: blur(2px);
    border-radius: 56px 56px 48px 48px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 2px solid #EFE3CD;
    transition: all 0.2s;
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heart-icon {
    font-size: 32px;
    line-height: 1;
    color: #E95762;
}

.app-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #123B6D;
    background: linear-gradient(135deg, #F5A0A6, #E95762);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.app-title span {
    font-weight: 300;
    -webkit-text-fill-color: #617389;
    color: #617389;
}

.level-badge {
    background: #FFF8EA;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 600;
    color: #123B6D;
    border: 2px solid #EFE3CD;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.level-badge span {
    color: #C13F4A;
}

/* ===== PROGRESS BAR ===== */
.progress-section {
    margin: 8px 0 14px;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.progress-track {
    flex: 1;
    height: 12px;
    background: #EFE3CD;
    border-radius: 100px;
    overflow: hidden;
    min-width: 80px;
    border: 1px solid #EFE3CD;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #F5A0A6, #E95762);
    border-radius: 100px;
    transition: width 0.45s ease;
}

.progress-text {
    font-size: 17px;
    font-weight: 600;
    color: #2F4A6B;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}
.progress-text span {
    color: #C13F4A;
}

/* ===== DOTS ===== */
.dots-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px 0 14px;
    padding: 6px 0;
}

.dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #EFE3CD;
    border: 2.5px solid #EFE3CD;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #617389;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dot.active {
    background: #FDF1D8;
    border-color: #E95762;
    color: #C13F4A;
    transform: scale(1.08);
    box-shadow: 0 0 0 4px #FDF1D8;
}

.dot.done {
    background: #CDE8CF;
    border-color: #429748;
    color: #fff;
}

.dot.helped {
    background: #FDF1D8;
    border-color: #D99F2E;
    color: #fff;
}

/* ===== MAIN CARD ===== */
.word-card {
    background: #FFFFFF;
    border-radius: 40px;
    padding: 28px 24px 24px;
    margin: 6px 0 16px;
    border: 2px solid #EFE3CD;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.word-display-area {
    text-align: center;
    margin-bottom: 12px;
}

.word-big {
    font-size: 44px;
    font-weight: 700;
    color: #123B6D;
    letter-spacing: 3px;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.word-big .letter-highlight {
    display: inline-block;
    padding: 0 2px;
    border-radius: 8px;
    transition: all 0.25s;
}
.word-big .letter-highlight.active-letter {
    background: #FDF1D8;
    color: #2F4A6B;
    transform: scale(1.2);
    box-shadow: 0 0 0 3px #FDF1D8;
}

.speaker-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 6px;
}

.speaker-btn {
    background: #FFF8EA;
    border: 2px solid #EFE3CD;
    border-radius: 60px;
    padding: 10px 22px;
    font-size: 18px;
    font-weight: 600;
    color: #123B6D;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 0 #EFE3CD;
    touch-action: manipulation;
    user-select: none;
}

.speaker-btn:hover {
    background: #EFE3CD;
    transform: translateY(-1px);
}
.speaker-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0px 0 #EFE3CD;
}

.clue-text {
    font-size: 22px;
    color: #2F4A6B;
    background: #FFF8EA;
    padding: 16px 18px;
    border-radius: 28px;
    margin: 8px 0 12px;
    line-height: 1.5;
    border: 1px solid #EFE3CD;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}
.clue-text .blank-highlight {
    display: inline-block;
    min-width: 80px;
    border-bottom: 4px dashed #E95762;
    margin: 0 4px;
    color: #C13F4A;
    font-weight: 700;
}

/* ===== INPUT ===== */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0 4px;
}

.input-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.spell-input {
    flex: 1;
    min-width: 160px;
    padding: 18px 22px;
    font-size: 28px;
    font-weight: 600;
    border: 3px solid #EFE3CD;
    border-radius: 40px;
    background: #fff;
    color: #123B6D;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    font-family: inherit;
    letter-spacing: 1px;
    text-align: center;
}
.spell-input:focus {
    border-color: #E95762;
    box-shadow: 0 0 0 6px #FDF1D8;
}
.spell-input:disabled {
    background: #FFF8EA;
    opacity: 0.7;
}

.check-btn {
    padding: 16px 36px;
    font-size: 24px;
    font-weight: 700;
    background: #F5A0A6;
    color: #fff;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 0 #E95762;
    touch-action: manipulation;
    user-select: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.check-btn:hover {
    background: #E95762;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #E95762;
}
.check-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #E95762;
}
.check-btn:disabled {
    opacity: 0.5;
    transform: translateY(0);
    box-shadow: 0 4px 0 #E95762;
    cursor: not-allowed;
}

/* ===== FEEDBACK ===== */
.feedback-box {
    min-height: 68px;
    padding: 12px 16px;
    border-radius: 28px;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 0;
    background: #FFF8EA;
    border: 1px solid #EFE3CD;
    color: #123B6D;
    transition: all 0.25s;
}

.feedback-box.correct {
    background: #E8F4E9;
    border-color: #429748;
    color: #2A612E;
}
.feedback-box.wrong {
    background: #FDF1D8;
    border-color: #FDE7E9;
    color: #C13F4A;
}
.feedback-box.hint {
    background: #FDF1D8;
    border-color: #EFE3CD;
    color: #617389;
}
.feedback-box.showing {
    background: #E4EFFB;
    border-color: #2778D4;
    color: #17508F;
}
.feedback-box.celebrate {
    background: #fce8d6;
    border-color: #FDF1D8;
    color: #617389;
}

/* ===== HINT ===== */
.hint-display {
    font-size: 20px;
    color: #617389;
    padding: 6px 12px;
    text-align: center;
    min-height: 36px;
    font-weight: 500;
}

/* ===== NEXT / CELEBRATION ===== */
.next-area {
    display: flex;
    justify-content: center;
    margin: 12px 0 4px;
    gap: 16px;
    flex-wrap: wrap;
}

.next-btn {
    padding: 18px 44px;
    font-size: 26px;
    font-weight: 700;
    background: #CDE8CF;
    color: #fff;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 0 #429748;
    touch-action: manipulation;
    user-select: none;
    letter-spacing: 0.5px;
}
.next-btn:hover {
    background: #429748;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #429748;
}
.next-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #429748;
}
.next-btn:disabled {
    opacity: 0.4;
    transform: translateY(0);
    box-shadow: 0 4px 0 #429748;
    cursor: not-allowed;
}

/* ===== FOOTER ===== */
.footer-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.footer-btn {
    padding: 12px 28px;
    font-size: 18px;
    font-weight: 600;
    background: #FFF8EA;
    color: #123B6D;
    border: 2px solid #EFE3CD;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 2px 0 #EFE3CD;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-btn:hover {
    background: #EFE3CD;
    transform: translateY(-1px);
}
.footer-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0px 0 #EFE3CD;
}

.footer-btn.danger {
    background: #FDE7E9;
    border-color: #FDE7E9;
    color: #2F4A6B;
}
.footer-btn.danger:hover {
    background: #FDE7E9;
}

/* ===== CELEBRATION OVERLAY ===== */
.celebration-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 248, 240, 0.92);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.5s ease;
}

.celebration-overlay.open {
    display: flex;
}

.celebration-card {
    background: #fff;
    border-radius: 64px;
    padding: 40px 36px 36px;
    max-width: 540px;
    width: 100%;
    text-align: center;
    border: 3px solid #EFE3CD;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    animation: popIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.celebration-card .big-emoji {
    font-size: 72px;
    display: block;
    margin-bottom: 8px;
}
.celebration-card h2 {
    font-size: 38px;
    color: #123B6D;
    margin: 6px 0 8px;
}
.celebration-card p {
    font-size: 22px;
    color: #2F4A6B;
    margin: 8px 0 16px;
    line-height: 1.5;
}
.celebration-card .celebration-btn {
    padding: 18px 44px;
    font-size: 26px;
    font-weight: 700;
    background: #F5A0A6;
    color: #fff;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 0 #E95762;
    touch-action: manipulation;
    user-select: none;
    margin-top: 8px;
}
.celebration-card .celebration-btn:hover {
    background: #E95762;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #E95762;
}
.celebration-card .celebration-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #E95762;
}
.celebration-card .celebration-btn.secondary {
    background: #CDE8CF;
    box-shadow: 0 4px 0 #429748;
}
.celebration-card .celebration-btn.secondary:hover {
    background: #429748;
    box-shadow: 0 6px 0 #429748;
}
.celebration-card .celebration-btn.secondary:active {
    box-shadow: 0 0px 0 #429748;
}

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.25s ease;
}
.confirm-overlay.open {
    display: flex;
}

.confirm-card {
    background: #fff;
    border-radius: 48px;
    padding: 32px 28px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    border: 2px solid #EFE3CD;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.confirm-card h3 {
    font-size: 28px;
    color: #123B6D;
    margin-bottom: 8px;
}
.confirm-card p {
    font-size: 20px;
    color: #2F4A6B;
    margin: 6px 0 18px;
}
.confirm-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.confirm-btn {
    padding: 14px 32px;
    font-size: 20px;
    font-weight: 600;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
    user-select: none;
    min-width: 100px;
}
.confirm-btn.yes {
    background: #F5A0A6;
    color: #fff;
    box-shadow: 0 4px 0 #E95762;
}
.confirm-btn.yes:hover {
    background: #E95762;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #E95762;
}
.confirm-btn.yes:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #E95762;
}
.confirm-btn.no {
    background: #FFF8EA;
    color: #123B6D;
    box-shadow: 0 4px 0 #EFE3CD;
}
.confirm-btn.no:hover {
    background: #EFE3CD;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #EFE3CD;
}
.confirm-btn.no:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #EFE3CD;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes popIn {
    0% {
        transform: scale(0.88);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes celebratePop {
    0% {
        transform: scale(0.8) rotate(-3deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.05) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebrate-pop {
    animation: celebratePop 0.5s ease forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .game-container {
        padding: 20px 14px 18px;
        border-radius: 36px;
    }
    .app-title {
        font-size: 20px;
    }
    .heart-icon {
        font-size: 26px;
    }
    .level-badge {
        font-size: 15px;
        padding: 6px 14px;
    }
    .word-big {
        font-size: 34px;
        min-height: 52px;
    }
    .clue-text {
        font-size: 18px;
        padding: 12px 14px;
        min-height: 60px;
    }
    .spell-input {
        font-size: 22px;
        padding: 14px 16px;
        min-width: 120px;
    }
    .check-btn {
        font-size: 20px;
        padding: 14px 24px;
    }
    .feedback-box {
        font-size: 18px;
        min-height: 56px;
        padding: 10px 14px;
    }
    .speaker-btn {
        font-size: 16px;
        padding: 8px 16px;
    }
    .dot {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .dots-container {
        gap: 6px;
    }
    .next-btn {
        font-size: 20px;
        padding: 14px 32px;
    }
    .celebration-card {
        padding: 28px 20px 24px;
    }
    .celebration-card h2 {
        font-size: 30px;
    }
    .celebration-card .big-emoji {
        font-size: 56px;
    }
    .confirm-card h3 {
        font-size: 22px;
    }
    .footer-btn {
        font-size: 16px;
        padding: 10px 20px;
    }
    .progress-text {
        font-size: 15px;
        min-width: 60px;
    }
}

@media (max-width: 400px) {
    .game-container {
        padding: 14px 10px 14px;
        border-radius: 28px;
    }
    .word-big {
        font-size: 28px;
    }
    .clue-text {
        font-size: 16px;
        padding: 10px 12px;
    }
    .spell-input {
        font-size: 20px;
        padding: 12px 12px;
        min-width: 100px;
    }
    .check-btn {
        font-size: 18px;
        padding: 12px 18px;
    }
    .feedback-box {
        font-size: 16px;
        min-height: 48px;
    }
    .dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .level-badge {
        font-size: 13px;
        padding: 4px 10px;
    }
    .app-title {
        font-size: 18px;
    }
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}
.text-center {
    text-align: center;
}
.mt-8 {
    margin-top: 8px;
}
.mt-12 {
    margin-top: 12px;
}
.gap-8 {
    gap: 8px;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.w-full {
    width: 100%;
}
    
