/* ============================================
   ZCAT SURVIVAL — UI homologada con Flappy ZCAT
   ============================================ */
:root {
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-cream: #FFFDF0;
    --bg-pink: #FFF0F3;
    --border-charcoal: #2D3748;
    --ton-blue: #0098EA;
    --cute-pink: #FF6B8B;
    --cute-yellow: #FFD166;
    --text-primary: #2D3748;
    --text-secondary: rgba(45, 55, 72, 0.8);
    --text-muted: rgba(45, 55, 72, 0.5);
    --font-display: 'Fredoka', system-ui, -apple-system, sans-serif;
    --font-sans: 'Quicksand', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: var(--font-sans);
    color: var(--text-primary);
    touch-action: none;
}

#app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================
   IN-GAME HUD — clean sticky bar at top
   ============================================ */
.zcat-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    pointer-events: none;
}

.zcat-hud.hidden {
    display: none !important;
}

.hud-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 4px solid var(--border-charcoal);
}

.hud-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.hud-label {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.hud-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
}

.hud-timer {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    color: var(--ton-blue);
    letter-spacing: 1px;
}

.hud-exp-track {
    width: 100%;
    height: 8px;
    background: var(--bg-cream);
    border-bottom: 2px solid var(--border-charcoal);
    overflow: hidden;
}

.hud-exp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--ton-blue), #00c6ff);
    transition: width 0.3s ease;
    border-radius: 0 4px 4px 0;
}

/* ============================================
   OVERLAYS — same system as Flappy ZCAT
   ============================================ */
.zcat-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 55, 72, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: fadeIn 0.25s ease;
}

.zcat-overlay.hidden {
    display: none !important;
}

/* Home overlay is opaque to hide the black canvas during load */
#home-overlay {
    background: var(--bg-dark);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.overlay-content {
    text-align: center;
    padding: 20px;
    max-width: 360px;
    width: 95%;
}

/* Meme card — neobrutalism matching Flappy */
.meme-card {
    background: var(--bg-card);
    border: 4px solid var(--border-charcoal);
    border-radius: 32px;
    box-shadow: 8px 8px 0px var(--border-charcoal);
    padding: 22px 20px 18px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================
   HOME SCREEN
   ============================================ */
.game-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.title-highlight {
    color: var(--ton-blue);
    display: inline-block;
    transform: rotate(-2deg);
    background: var(--bg-pink);
    padding: 2px 12px;
    border: 3px solid var(--border-charcoal);
    border-radius: 12px;
    margin-top: 4px;
    box-shadow: 2px 2px 0px var(--border-charcoal);
}

.wojak-preview {
    margin: 8px 0 14px;
    animation: float 2.5s ease-in-out infinite;
}

.wojak-preview-img {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    border: 4px solid var(--border-charcoal);
    box-shadow: 4px 4px 0px var(--border-charcoal);
    object-fit: cover;
    background: var(--bg-cream);
}

.how-to-play {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 14px;
    align-items: center;
    width: 100%;
}

.htp-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: var(--bg-pink);
    border: 2px solid var(--border-charcoal);
    border-radius: 14px;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 700;
    width: 90%;
    max-width: 270px;
    text-align: left;
    box-shadow: 2px 2px 0px var(--border-charcoal);
    font-family: var(--font-sans);
}

.htp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.htp-icon svg, .btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: inherit;
    flex-shrink: 0;
}

/* ============================================
   GAME OVER / CLEAR SCREENS
   ============================================ */
.gameover-wojak {
    margin-bottom: 14px;
    animation: wobble 1s ease-in-out;
}

.gameover-wojak-img {
    width: 90px;
    height: 90px;
    border-radius: 28px;
    border: 4px solid var(--border-charcoal);
    object-fit: cover;
    box-shadow: 4px 4px 0px var(--border-charcoal);
}

.gameover-title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 900;
    color: var(--cute-pink);
    margin-bottom: 18px;
}

.gameclear-title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 900;
    color: var(--ton-blue);
    margin-bottom: 18px;
}

.gameover-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    width: 100%;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    background: var(--bg-cream);
    border: 3px solid var(--border-charcoal);
    border-radius: 18px;
    flex: 1;
    min-width: 62px;
    box-shadow: 2px 2px 0px var(--border-charcoal);
}

.stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    white-space: nowrap;
}

.stat-value.coins-value {
    color: var(--cute-pink);
}

.total-coins-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-pink);
    border: 3px dashed var(--border-charcoal);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 14px;
    font-family: var(--font-sans);
}

.achievement-banner {
    background: var(--cute-yellow);
    border: 3px solid var(--border-charcoal);
    padding: 10px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 900;
    color: var(--text-primary);
    animation: achievementPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 3px 3px 0px var(--border-charcoal);
}

/* ============================================
   PAUSE SCREEN
   ============================================ */
.pause-icon {
    font-size: 48px;
    margin-bottom: 6px;
}

.pause-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 18px;
}

/* ============================================
   LEVEL UP SCREEN
   ============================================ */
.levelup-icon {
    font-size: 52px;
    margin-bottom: 4px;
    animation: achievementPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.levelup-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    color: var(--ton-blue);
    margin-bottom: 6px;
}

.levelup-level {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg-cream);
    padding: 6px 18px;
    border: 3px solid var(--border-charcoal);
    border-radius: 14px;
    margin-bottom: 18px;
    box-shadow: 2px 2px 0px var(--border-charcoal);
}

/* ============================================
   BUTTONS — neobrutalism matching Flappy
   ============================================ */
.game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    background: #ffffff;
    border: 4px solid var(--border-charcoal);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0px var(--border-charcoal);
    margin: 5px;
    width: 90%;
    max-width: 260px;
    text-decoration: none;
}

.game-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-charcoal);
}

.game-btn.primary-ton {
    background: var(--cute-yellow);
    box-shadow: 4px 4px 0px var(--border-charcoal);
}

.game-btn.secondary {
    background: #ffffff;
    border: 3px solid var(--border-charcoal);
    box-shadow: 3px 3px 0px var(--border-charcoal);
    font-size: 14px;
    border-radius: 16px;
    padding: 10px 20px;
}

.game-btn.secondary:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--border-charcoal);
}

.game-btn.pulse {
    animation: btnPulse 2s infinite;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes wobble {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

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

@keyframes achievementPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
