* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f1f2f4;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* White Header Bar - Full Width at Top */
.header-white-bar {
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding-top: 72px;
}

.youkids-logo {
    height: 64px;
}

.game-name {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: opacity 0.2s;
}

.hamburger-menu:hover {
    opacity: 0.7;
}

/* Game Menu Overlay */
.game-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.game-menu-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-menu {
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 90%;
    width: 400px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-menu {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: #666;
    transition: color 0.2s;
}

.close-menu:hover {
    color: #000;
}

.game-menu h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #000;
    text-align: center;
}

.menu-item {
    display: block;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.2s;
    text-align: center;
}

.menu-item:hover {
    background: #e5e7eb;
    transform: translateX(4px);
}

.menu-item.active {
    background: #17a2b8;
    color: white;
}

/* Game Content Area */
.hint-section,
.word-grid,
.keyboard,
.give-up-btn {
    padding-left: 10px;
    padding-right: 10px;
}

/* Hint Section - Compact for mobile */
.hint-section {
    text-align: center;
    margin-bottom: 12px;
    margin-top: 16px;
}

.hint-emoji {
    font-size: 3.5em;
    margin-bottom: 4px;
    line-height: 1;
}

.hint-text {
    font-size: 1.2em;
    color: #555;
    font-weight: 600;
    line-height: 1.2;
    padding: 0 10px;
    margin-bottom: 0;
}

.feedback {
    margin-top: 4px;
    font-size: 1.6em;
    font-weight: 700;
    min-height: 20px;
}

.feedback.correct {
    color: #5cb85c;
}

.feedback.incorrect {
    color: #ff6b35;
}

/* Word Grid - Mobile optimized */
.word-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
    margin-bottom: 18px;
}

.word-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.letter-tile {
    width: calc((100vw - 40px) / 4);
    height: calc((100vw - 40px) / 4);
    max-width: 75px;
    max-height: 75px;
    border: 3px solid #d3d6da;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #000;
    background: white;
    text-transform: uppercase;
}

.letter-tile.filled {
    border-color: #878a8c;
    animation: pop 0.1s;
}

.letter-tile.correct {
    background: #5cb85c;
    border-color: #5cb85c;
    color: white;
}

.letter-tile.present {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.letter-tile.absent {
    background: #95a5a6;
    border-color: #95a5a6;
    color: white;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Keyboard - Mobile optimized */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
}

.keyboard-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.key {
    min-width: 32px;
    height: 52px;
    padding: 0 8px;
    border: none;
    border-radius: 6px;
    background: #d3d6da;
    color: #000;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}

.key:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.key-enter,
.key-delete {
    min-width: 52px;
    font-size: 0.6em;
}

.key.correct {
    background: #5cb85c;
    color: white;
}

.key.present {
    background: #17a2b8;
    color: white;
}

.key.absent {
    background: #95a5a6;
    color: white;
}

/* Give Up Button - Less prominent */
.give-up-btn {
    width: 50%;
    max-width: 250px;
    margin: 0 auto;
    padding: 12px;
    border: 2px solid #ff6b35;
    border-radius: 12px;
    background: white;
    color: #ff6b35;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    display: block;
}

.give-up-btn:active {
    transform: scale(0.98);
    background: #fff5f0;
}

/* Win Screen */
.win-screen {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Responsive - Tablet and Desktop */
@media (min-width: 360px) {
    .keyboard-row {
        gap: 5px;
    }

    .key {
        min-width: 36px;
        height: 54px;
    }
}

@media (min-width: 400px) {
    .game-name {
        font-size: 28px;
    }

    .hint-section {
        margin-bottom: 8px;
    }

    .hint-emoji {
        font-size: 4.5em;
        margin-bottom: 5px;
    }

    .hint-text {
        font-size: 1.5em;
    }

    .feedback {
        font-size: 2em;
        min-height: 25px;
    }

    .word-grid {
        gap: 8px;
        margin-bottom: 20px;
    }

    .word-row {
        gap: 8px;
    }

    .letter-tile {
        max-width: 85px;
        max-height: 85px;
        font-size: 2.5em;
        border-radius: 9px;
    }

    .keyboard {
        gap: 7px;
        margin-bottom: 15px;
    }

    .keyboard-row {
        gap: 6px;
    }

    .key {
        min-width: 38px;
        height: 56px;
        font-size: 1em;
    }

    .key-enter,
    .key-delete {
        min-width: 58px;
        font-size: 0.65em;
    }

    .give-up-btn {
        font-size: 1.1em;
        padding: 14px;
    }
}

@media (min-width: 480px) {
    .header-white-bar {
        padding: 4px 30px;
    }

    .container {
        padding-top: 84px;
    }

    .youkids-logo {
        height: 72px;
    }

    .game-name {
        font-size: 28px;
    }

    .hint-section {
        margin-bottom: 14px;
        margin-top: 20px;
    }

    .word-grid {
        margin-bottom: 20px;
    }

    .hint-emoji {
        font-size: 5em;
        margin-bottom: 6px;
    }

    .hint-text {
        font-size: 1.7em;
    }

    .feedback {
        font-size: 2.2em;
        margin-top: 6px;
        min-height: 27px;
    }

    .word-grid {
        gap: 10px;
        margin-bottom: 25px;
    }

    .word-row {
        gap: 10px;
    }

    .letter-tile {
        max-width: 100px;
        max-height: 100px;
        font-size: 3em;
        border-radius: 10px;
    }

    .keyboard {
        gap: 8px;
        margin-bottom: 18px;
    }

    .keyboard-row {
        gap: 7px;
    }

    .key {
        min-width: 42px;
        height: 58px;
        font-size: 1.1em;
    }

    .key-enter,
    .key-delete {
        min-width: 64px;
        font-size: 0.7em;
    }

    .give-up-btn {
        font-size: 1.15em;
        padding: 15px;
    }
}

@media (min-width: 600px) {
    .hint-section {
        margin-bottom: 16px;
        margin-top: 24px;
    }

    .word-grid {
        margin-bottom: 24px;
    }

    .hint-emoji {
        font-size: 4.5em;
        margin-bottom: 6px;
    }

    .hint-text {
        font-size: 1.6em;
    }

    .feedback {
        font-size: 2em;
        margin-top: 4px;
        min-height: 25px;
    }

    .word-grid {
        gap: 10px;
        margin-bottom: 18px;
    }

    .word-row {
        gap: 10px;
    }

    .letter-tile {
        max-width: 95px;
        max-height: 95px;
        font-size: 3em;
        border-radius: 10px;
    }

    .keyboard {
        gap: 8px;
        margin-bottom: 12px;
    }

    .keyboard-row {
        gap: 7px;
    }

    .key {
        min-width: 44px;
        height: 58px;
    }

    .key-enter,
    .key-delete {
        min-width: 68px;
        font-size: 0.7em;
    }

    .give-up-btn {
        font-size: 1.1em;
        padding: 12px;
    }
}

@media (min-width: 768px) {
    .hint-section {
        margin-bottom: 5px;
    }

    .hint-emoji {
        font-size: 5em;
        margin-bottom: 5px;
    }

    .hint-text {
        font-size: 1.8em;
    }

    .feedback {
        font-size: 2.2em;
        min-height: 26px;
    }

    .word-grid {
        gap: 12px;
        margin-bottom: 20px;
    }

    .word-row {
        gap: 12px;
    }

    .letter-tile {
        max-width: 105px;
        max-height: 105px;
        font-size: 3.3em;
    }

    .keyboard {
        gap: 9px;
        margin-bottom: 14px;
    }

    .keyboard-row {
        gap: 8px;
    }

    .key {
        min-width: 46px;
        height: 60px;
        font-size: 1.15em;
    }

    .key-enter,
    .key-delete {
        min-width: 72px;
        font-size: 0.75em;
    }

    .give-up-btn {
        padding: 13px;
    }
}

/* Prevent zoom on touch (iOS) */
@supports (-webkit-touch-callout: none) {
    button, .key {
        font-size: max(16px, 1em);
    }
}
