/* AdGame WP — Game Frontend Styles */
.adgame-container {
    --adgame-color: #FF5252;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    background: #0f0f23;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.adgame-screen { display: none; }
.adgame-screen.active { display: block; }

/* ─── LEAD GATE ──────────────────────────────────────────────── */
.adgame-screen--lead {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a3e 0%, #0f0f23 50%, #1a0a2e 100%);
    padding: 40px 20px;
}
.adgame-screen--lead.active { display: flex; }

.adgame-lead-card {
    background: rgba(255,255,255,.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    color: #fff;
}
.adgame-lead-icon { font-size: 64px; margin-bottom: 16px; }
.adgame-lead-card h2 { margin: 0 0 8px; font-size: 24px; }
.adgame-lead-card p { color: rgba(255,255,255,.7); margin-bottom: 24px; }

.adgame-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 15px;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.adgame-input:focus { outline: none; border-color: var(--adgame-color); }
.adgame-input::placeholder { color: rgba(255,255,255,.4); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.adgame-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all .2s;
    text-decoration: none;
    line-height: 1.2;
}
.adgame-btn--primary {
    background: var(--adgame-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255,82,82,.4);
}
.adgame-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,82,82,.5); color:#fff; }
.adgame-btn--secondary {
    background: rgba(255,255,255,.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
}
.adgame-btn--secondary:hover { background: rgba(255,255,255,.2); }
.adgame-btn--hint {
    background: rgba(255,255,255,.15);
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
}
.adgame-start-btn { width: 100%; margin-top: 8px; }

/* ─── GAME SCREEN ────────────────────────────────────────────── */
.adgame-screen--game.active { display: flex; flex-direction: column; }

/* HUD */
.adgame-hud {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0,0,0,.5);
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-wrap: wrap;
}
.adgame-hud-title {
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}
.adgame-hud-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 150px;
}
.adgame-hud-progress span { color: rgba(255,255,255,.8); font-size: 13px; white-space: nowrap; }
.adgame-found-count { color: var(--adgame-color) !important; font-weight: 700; font-size: 16px !important; }

.adgame-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,.15);
    border-radius: 3px;
    overflow: hidden;
}
.adgame-progress-fill {
    height: 100%;
    background: var(--adgame-color);
    border-radius: 3px;
    transition: width .4s ease;
    width: 0;
}

.adgame-timer {
    font-weight: 900;
    font-size: 18px;
    color: #fff;
    min-width: 48px;
    text-align: center;
    padding: 4px 10px;
    background: rgba(255,255,255,.1);
    border-radius: 8px;
}
.adgame-timer.danger { color: var(--adgame-color); animation: adgame-pulse 0.8s ease-in-out infinite; }

/* PLAY AREA */
.adgame-play-area {
    display: flex;
    flex: 1;
    min-height: 500px;
}

/* SIDEBAR */
.adgame-sidebar {
    width: 200px;
    min-width: 160px;
    background: rgba(0,0,0,.4);
    border-right: 1px solid rgba(255,255,255,.1);
    padding: 16px 12px;
    overflow-y: auto;
    flex-shrink: 0;
}
.adgame-sidebar h4 {
    color: rgba(255,255,255,.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
}
.adgame-checklist { list-style: none; margin: 0; padding: 0; }
.adgame-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: rgba(255,255,255,.8);
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    transition: all .3s;
}
.adgame-checklist-item.found { color: #69F0AE; }
.adgame-check { font-size: 16px; flex-shrink: 0; }

/* SCENE */
.adgame-scene-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    line-height: 0;
    display: flex;
    align-items: flex-start;
}
.adgame-scene-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
.adgame-game-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* POPUP */
.adgame-popup {
    position: absolute;
    width: 230px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    z-index: 100;
    overflow: hidden;
    animation: adgame-popup-in .25s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes adgame-popup-in {
    from { transform: scale(.6) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.adgame-popup-close {
    position: absolute;
    top: 6px; right: 8px;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 12px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.adgame-popup-img-wrap { height: 130px; overflow: hidden; background: #eee; }
.adgame-popup-img { width: 100%; height: 100%; object-fit: cover; }
.adgame-popup-content { padding: 12px; }
.adgame-popup-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.adgame-popup-desc { margin: 0; font-size: 13px; color: #555; line-height: 1.4; }

/* ─── WIN / TIMEOUT ──────────────────────────────────────────── */
.adgame-screen--win,
.adgame-screen--timeout {
    position: relative;
    min-height: 400px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a3e 0%, #0f0f23 100%);
    padding: 40px 20px;
}
.adgame-screen--win.active,
.adgame-screen--timeout.active { display: flex; }

.adgame-confetti-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.adgame-win-card {
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1;
}
.adgame-win-icon { font-size: 80px; margin-bottom: 16px; }
.adgame-win-card h2 { font-size: 28px; margin: 0 0 24px; }
.adgame-win-card p { color: rgba(255,255,255,.7); }
.adgame-win-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}
.adgame-win-stats > div { text-align: center; }
.adgame-win-stats strong { display: block; font-size: 32px; color: var(--adgame-color); }
.adgame-win-stats span { font-size: 13px; color: rgba(255,255,255,.6); }
.adgame-win-card .adgame-btn { margin: 6px; }

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes adgame-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .adgame-sidebar { width: 120px; min-width: 100px; }
    .adgame-hud { padding: 8px 12px; gap: 8px; }
    .adgame-lead-card { padding: 32px 20px; }
    .adgame-popup { width: 200px; }
}
