* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    color: white;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    user-select: none;
    -webkit-user-select: none;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 15px 0;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fde047;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-weight: 600;
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.game-area {
    width: 100%;
    max-width: 800px;
    height: 450px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 20px;
    border: 3px solid #334155;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Scoreboard */
.scoreboard {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 700;
    z-index: 100;
    border: 2px solid #fde047;
}

.score-label {
    color: #94a3b8;
}

.score-value {
    color: #fde047;
    font-size: 1.5rem;
    margin: 0 5px;
}

.score-target {
    color: #64748b;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 30px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.start-screen {
    background: rgba(15, 23, 42, 0.95);
}

.owl-logo {
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

.owl-logo svg {
    width: 120px;
    height: 96px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.start-screen h2 {
    font-size: 2rem;
    color: #fde047;
    margin-bottom: 15px;
}

.start-screen p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.start-screen .hint {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.btn-primary {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    color: #0f172a;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 15px rgba(253, 224, 71, 0.4);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(253, 224, 71, 0.6);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Countdown Screen */
.countdown-screen {
    background: rgba(15, 23, 42, 0.95);
}

.countdown-number {
    font-size: 8rem;
    font-weight: 800;
    color: #fde047;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Play Area */
.play-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Owl */
.owl {
    position: absolute;
    bottom: 20px;
    width: 80px;
    height: 64px;
    transition: left 0.05s linear;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.owl svg {
    width: 100%;
    height: 100%;
}

/* Falling Words */
.word {
    position: absolute;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.word.adjective {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: 2px solid #4ade80;
}

.word.non-adjective {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 2px solid #f87171;
}

/* Feedback Icons */
.feedback {
    position: absolute;
    font-size: 2.5rem;
    z-index: 20;
    animation: feedbackAnim 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes feedbackAnim {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5) translateY(-30px); opacity: 0; }
}

/* Win Screen */
.win-screen {
    background: rgba(15, 23, 42, 0.95);
}

.win-owl {
    margin-bottom: 20px;
    animation: celebrate 0.5s ease-in-out infinite alternate;
}

.win-owl svg {
    width: 120px;
    height: 96px;
}

@keyframes celebrate {
    0% { transform: rotate(-10deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

.win-screen h2 {
    font-size: 2.5rem;
    color: #22c55e;
    margin-bottom: 15px;
}

.win-screen p {
    font-size: 1.3rem;
    color: #cbd5e1;
    margin-bottom: 25px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 15px 0;
}

.controls-hint {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 8px;
}

.controls-hint strong {
    color: #fde047;
}

.brand {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Touch Controls Overlay */
.touch-left, .touch-right {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 50;
    cursor: pointer;
    touch-action: none;
    -webkit-touch-callout: none;
}

.touch-left {
    left: 0;
}

.touch-right {
    right: 0;
}

/* Touch feedback */
.touch-left:active, .touch-right:active {
    background: rgba(253, 224, 71, 0.1);
}

/* Touch indicators for mobile - subtle arrows at edges */
@media (hover: none) and (pointer: coarse) {
    .touch-left::before {
        content: '‹';
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        font-size: 4rem;
        color: rgba(253, 224, 71, 0.3);
        pointer-events: none;
        font-weight: 300;
    }

    .touch-right::before {
        content: '›';
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        font-size: 4rem;
        color: rgba(253, 224, 71, 0.3);
        pointer-events: none;
        font-weight: 300;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .game-area {
        height: 350px;
        border-radius: 15px;
    }

    .owl {
        width: 60px;
        height: 48px;
    }

    .word {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .scoreboard {
        font-size: 1rem;
        padding: 8px 15px;
    }

    .score-value {
        font-size: 1.2rem;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-wrapper {
        padding: 5px 10px;
    }

    .header {
        padding: 8px 0;
    }

    .title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .game-area {
        height: calc(100vh - 140px);
        min-height: 320px;
        max-height: 450px;
    }

    .screen {
        padding: 30px 25px;
    }

    .owl {
        width: 50px;
        height: 40px;
        bottom: 20px;
    }

    .start-screen h2 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .start-screen p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .start-screen .hint {
        margin-bottom: 20px;
    }

    .owl-logo svg {
        width: 70px;
        height: 56px;
    }

    .win-owl svg {
        width: 70px;
        height: 56px;
    }

    .win-screen h2 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .win-screen p {
        margin-bottom: 20px;
    }

    .btn-primary {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .footer {
        padding: 8px 0;
    }

    .controls-hint {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .brand {
        font-size: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .header {
        padding: 5px 0;
    }

    .title {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .game-area {
        height: calc(100vh - 120px);
        min-height: 280px;
        max-height: 400px;
    }

    .screen {
        padding: 25px 20px;
    }

    .owl {
        width: 40px;
        height: 32px;
        bottom: 15px;
    }

    .owl-logo svg, .win-owl svg {
        width: 60px;
        height: 48px;
    }

    .start-screen h2 {
        font-size: 1.2rem;
    }

    .win-screen h2 {
        font-size: 1.6rem;
    }

    .word {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .scoreboard {
        font-size: 0.85rem;
        padding: 6px 12px;
        top: 10px;
        right: 10px;
    }

    .btn-primary {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 5px 0;
    }

    .title {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .subtitle {
        display: none;
    }

    .game-container {
        padding: 5px 0;
    }

    .game-area {
        height: calc(100vh - 100px);
        max-height: 280px;
    }

    .footer {
        padding: 5px 0;
    }

    .controls-hint {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .brand {
        font-size: 0.75rem;
    }

    .owl-logo svg, .win-owl svg {
        width: 60px;
        height: 48px;
    }

    .start-screen h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .start-screen p {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }

    .btn-primary {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}
