/* ============================================
   FIND THE INVISIBLE CAT — Styles
   ============================================ */

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

:root {
    --orange: #FF8C42;
    --orange-dark: #E07030;
    --orange-light: #FFB07C;
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --text-light: #f0f0f0;
    --text-muted: #a0a0b0;
    --accent-blue: #4FC3F7;
    --accent-green: #66BB6A;
    --accent-pink: #FF6B9D;
    --gold: #FFD700;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   START SCREEN
   ============================================ */

#startScreen {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 50%, #0f3460 100%);
    flex-direction: column;
    overflow-y: auto;
}

.start-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-cat {
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

#heroCat {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(255, 140, 66, 0.4));
}

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.title-find {
    display: block;
    font-size: 1.8rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.title-invisible {
    display: block;
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-cat {
    display: block;
    font-size: 4.5rem;
    color: var(--orange);
    text-shadow: 0 4px 20px rgba(255, 140, 66, 0.5);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.subtitle strong {
    color: var(--text-light);
}

.instructions {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    padding: 0 1rem;
}

.instructions strong {
    color: var(--orange);
    font-size: 1.1em;
}

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--gold);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Buttons */
.btn {
    font-family: 'Fredoka One', cursive;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-start {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: white;
    font-size: 1.4rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    box-shadow: 0 6px 25px rgba(255, 140, 66, 0.4);
    letter-spacing: 1px;
}

.btn-start:hover {
    box-shadow: 0 8px 35px rgba(255, 140, 66, 0.6);
}

.btn-emoji {
    font-size: 1.3rem;
}

.btn-small {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sound check */
.sound-check {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.sound-check-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-test {
    background: rgba(79, 195, 247, 0.15);
    color: var(--accent-blue);
    font-size: 1rem;
    padding: 0.55rem 1.5rem;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    border: 1px solid rgba(79, 195, 247, 0.3);
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-test:hover {
    background: rgba(79, 195, 247, 0.25);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.btn-test.playing {
    animation: pulseBtn 0.6s ease-in-out infinite;
}

@keyframes pulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sound-status {
    font-size: 0.8rem;
    min-height: 1.2em;
    transition: opacity 0.3s ease;
}

.sound-status.success {
    color: var(--accent-green);
}

.sound-status.fail {
    color: var(--accent-pink);
}

/* Difficulty picker */
.difficulty-picker {
    margin-bottom: 1.5rem;
}

.difficulty-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-diff {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.7rem 1.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-diff:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-diff.active {
    background: rgba(255, 140, 66, 0.15);
    border-color: var(--orange);
    color: var(--text-light);
    box-shadow: 0 0 15px rgba(255, 140, 66, 0.2);
}

.diff-icon {
    font-size: 1.5rem;
}

.diff-name {
    font-weight: 800;
    font-size: 1rem;
}

.diff-desc {
    font-size: 0.7rem;
    opacity: 0.7;
}

.hint {
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--accent-blue);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ============================================
   GAME SCREEN
   ============================================ */

#gameScreen {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--bg-dark);
}

#gameHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
    flex-shrink: 0;
}

.header-left .game-logo {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: var(--orange);
}

.header-center {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-center .divider {
    color: rgba(255, 255, 255, 0.2);
}

#roundDisplay {
    color: var(--accent-blue);
}

#scoreDisplay {
    color: var(--gold);
}

/* Game Area */
#gameArea {
    flex: 1;
    position: relative;
    cursor: crosshair;
    overflow: hidden;
}

.meow-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    color: var(--orange);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, font-size 0.15s ease;
    text-shadow: 0 0 30px rgba(255, 140, 66, 0.5);
    z-index: 5;
    white-space: nowrap;
}

.meow-text.visible {
    opacity: 1;
}

/* Cat reveal */
.cat-reveal {
    position: absolute;
    z-index: 8;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cat-reveal.hidden {
    opacity: 0;
    transform: scale(0);
}

.cat-reveal.show {
    opacity: 1;
    transform: scale(1);
}

.found-cat-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 140, 66, 0.8));
    animation: bounceIn 0.5s ease-out;
}

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

/* Volume indicator */
.volume-indicator {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.volume-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--orange), var(--accent-pink));
    transition: width 0.1s ease;
    border-radius: 0 3px 3px 0;
}

/* Custom cursors */
#gameArea.cursor-near {
    cursor: pointer;
}

#gameArea.cursor-found {
    cursor: pointer;
}

/* ============================================
   FOUND OVERLAY
   ============================================ */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.overlay.hidden {
    display: none;
}

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

.found-content {
    text-align: center;
    position: relative;
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.found-cat-big {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(255, 140, 66, 0.6));
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.found-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.found-time {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.found-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--orange);
    margin-bottom: 1rem;
}

.found-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.found-stats strong {
    color: var(--gold);
}

#nextRoundBtn {
    margin-bottom: 0.75rem;
}

#backToMenuBtn {
    display: block;
    margin: 0 auto;
}

/* ============================================
   CONFETTI
   ============================================ */

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   FOOTER (SEO)
   ============================================ */

#seoFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.15);
    z-index: 0;
    pointer-events: none;
}

#seoFooter a {
    color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .title-find { font-size: 1.2rem; }
    .title-invisible { font-size: 1.6rem; }
    .title-cat { font-size: 3rem; }

    #heroCat {
        width: 120px;
        height: 120px;
    }

    .btn-start {
        font-size: 1.1rem;
        padding: 0.8rem 2rem;
    }

    .stats-bar {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .meow-text {
        font-size: 2.5rem;
    }

    .found-title {
        font-size: 1.8rem;
    }

    .found-cat-big {
        width: 100px;
        height: 100px;
    }

    .header-left .game-logo {
        font-size: 0.8rem;
    }
}
