/* ===== COLOR MATCH — style.css ===== */
:root {
    --accent: #3b82f6;
    --bg: #0f0f1e;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: #fff;
}

.game-container {
    padding-top: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.game-container>h1 {
    margin-top: 22px;
    margin-bottom: 14px;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #3b82f6, #ec4899, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.4));
}

#game-ui {
    position: relative;
    width: 420px;
    height: 700px;
    border-radius: 20px;
    overflow: hidden;
    background: #0a0a18;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 0 50px rgba(59, 130, 246, 0.08), 0 20px 60px rgba(0, 0, 0, 0.8);
    margin-bottom: 60px;
}

/* ===== HUD ===== */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    display: flex;
    align-items: stretch;
    z-index: 10;
    background: rgba(8, 8, 22, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.hud-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px 4px;
    gap: 1px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.hud-cell:last-child { border-right: none; }

.hud-big {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    letter-spacing: 0.5px;
}

.hud-label {
    font-size: 0.52rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

/* Timer bar */
.hud-timer-wrap { position: relative; }

#timer-bar-bg {
    width: 70%; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 3px; overflow: hidden;
}
#timer-bar {
    height: 100%; width: 100%; background: #22c55e; border-radius: 2px; transition: width 0.9s linear, background 0.5s;
}

/* Score bar */
#score-bar-bg {
    width: 80%; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 3px; overflow: hidden;
}
#score-bar {
    height: 100%; width: 0%; background: #3b82f6; border-radius: 2px; transition: width 0.3s ease;
}

/* Timer colors */
.timer-ok { color: #fff; }
.timer-warn { color: #fbbf24; }
.timer-danger { color: #ef4444; animation: timerPulse 0.6s ease infinite; }

@keyframes timerPulse {
    0%, 100% { transform: scale(1) }
    50% { transform: scale(1.12) }
}

#target-label {
    font-size: 0.5rem; letter-spacing: 1.5px; color: #3b82f6;
}

/* ===== CANVAS ===== */
#game-canvas {
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100% - 72px);
    display: block;
    touch-action: none;
    cursor: default;
}

/* ===== OVERLAYS ===== */
.overlay {
    position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(8, 8, 20, 0.94); backdrop-filter: blur(10px);
}

.hidden { display: none !important; }

.overlay-inner {
    display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 20px; gap: 10px; width: 100%;
}

.overlay h2 {
    font-size: 1.9rem; font-weight: 900; letter-spacing: 4px; background: linear-gradient(135deg, #3b82f6, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2;
}

/* Level Complete */
.lc-inner { gap: 8px; }
.lc-stars { font-size: 2.4rem; filter: drop-shadow(0 0 12px #ec4899); animation: starPop 0.5s ease; }

@keyframes starPop {
    0% { transform: scale(0) }
    70% { transform: scale(1.2) }
    100% { transform: scale(1) }
}

.lc-score-line { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); margin-top: -4px; }

.lc-next-badge {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); padding: 8px 24px; border-radius: 30px; font-size: 0.9rem; font-weight: 800; letter-spacing: 2px; margin-top: 4px;
}

/* Game Over */
.go-lvl { font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); letter-spacing: 2px; }
.go-score-wrap { margin: 6px 0; }
.go-score {
    font-size: 3.2rem; font-weight: 900; background: linear-gradient(135deg, #3b82f6, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.go-best { font-size: 0.72rem; letter-spacing: 2px; color: rgba(255, 255, 255, 0.3); margin-top: 4px; }

/* Buttons */
.primary-btn {
    padding: 15px 44px; font-size: 0.95rem; font-weight: 800; letter-spacing: 3px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border: none; border-radius: 50px; cursor: pointer; font-family: 'Outfit', sans-serif; box-shadow: 0 0 25px rgba(37, 99, 235, 0.5); transition: all 0.2s; margin: 6px 0;
}
.primary-btn:hover { transform: translateY(-3px) scale(1.04); }

.bonus-btn {
    padding: 11px 28px; font-size: 0.78rem; font-weight: 700; background: linear-gradient(135deg, #059669, #10b981); color: #fff; border: none; border-radius: 50px; cursor: pointer; font-family: 'Outfit', sans-serif; box-shadow: 0 0 18px rgba(16, 185, 129, 0.4); transition: all 0.2s; margin: 2px 0;
}
.bonus-btn:hover { transform: translateY(-2px); }

/* Scroller */
#game-over-scroller {
    display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px; margin-top: 6px; width: 100%; max-width: 370px; scrollbar-width: none;
}
#game-over-scroller::-webkit-scrollbar { display: none; }

.promo-card {
    min-width: 90px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 10px 6px; text-align: center; text-decoration: none; color: #fff; flex-shrink: 0; transition: all 0.2s;
}
.promo-card:hover { transform: scale(1.06); }

.promo-emoji { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.promo-name { font-size: 0.55rem; font-weight: 700; letter-spacing: 0.5px; opacity: 0.8; }

.game-description { max-width: 740px; padding: 36px 20px 80px; opacity: 0.8; }
.game-description h2 { margin-bottom: 14px; font-size: 1.2rem; }
.game-description h3 { margin: 20px 0 10px; }
.game-description ul { list-style: none; }
.game-description li { margin-bottom: 8px; padding-left: 18px; position: relative; line-height: 1.5; }
.game-description li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

footer { text-align: center; padding: 18px; opacity: 0.45; font-size: 0.82rem; }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-bottom: 6px; }
.footer-links a { color: #ccc; text-decoration: none; }

#bottom-ad {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 320px; height: 50px; z-index: 9999;
}
#adsterra-banner {
    position: fixed; bottom: 5px; right: 10px; z-index: 9000; display: none; width: 160px; height: 600px;
}
@media (min-width:1024px) { #adsterra-banner { display: block; } }

@media (max-width:460px) {
    #game-ui { width: 100vw; height: calc(100vw * 700 / 420); border-radius: 0; }
    .game-container>h1 { font-size: 1.3rem; }
}
@media (max-width:400px) { #game-ui { height: 88vh; } }

.merge-demo {
    position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 100; transition: opacity 0.4s ease;
}
.merge-demo.hidden { opacity: 0; pointer-events: none; }

.demo-box {
    background: rgba(20,20,40,0.9); padding: 25px 30px; border-radius: 18px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.demo-tiles { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 12px; }

.tile {
    width: 30px; height: 30px; background: #3b82f6; display: flex; align-items: center; justify-content: center; border-radius: 50%; animation: tilePulse 1s infinite;
}
.tile:nth-child(3) { background: #3b82f6; }
.tile.result { background: #3b82f6; width: 35px; height: 35px;}

.arrow { font-weight: 900; font-size: 20px; color: #fff; }

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