/* ═══════════════════════════════════════════════════════════════
   AdGame WP — Frontend Game Styles
   ═══════════════════════════════════════════════════════════════ */

.adgame-root {
    --adgame-accent: #e8414e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    user-select: none;
}

/* ── Lead gate ────────────────────────────────────────────────── */
.adgame-lead-gate {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
}

.adgame-lead-card {
    text-align: center;
    max-width: 420px;
    color: #fff;
}

.adgame-lead-icon {
    font-size: 72px;
    margin-bottom: 16px;
    display: block;
    animation: adgame-bounce 1.5s ease infinite;
}

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

.adgame-lead-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
}

.adgame-lead-desc {
    font-size: 15px;
    color: rgba(255,255,255,.75);
    margin-bottom: 28px;
    line-height: 1.6;
}

.adgame-lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adgame-lead-form input {
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    transition: border-color .2s;
    text-align: center;
}

.adgame-lead-form input::placeholder { color: rgba(255,255,255,.5); }
.adgame-lead-form input:focus {
    border-color: var(--adgame-accent);
    outline: none;
    background: rgba(255,255,255,.18);
}

.adgame-btn-start {
    background: var(--adgame-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(232,65,78,.4);
}

.adgame-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(232,65,78,.5);
}

.adgame-lead-privacy {
    font-size: 11px;
    color: rgba(255,255,255,.4);
    margin-top: 12px;
}

/* ── HUD ──────────────────────────────────────────────────────── */
.adgame-hud {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 20px;
    border-radius: 14px 14px 0 0;
    flex-wrap: wrap;
}

.adgame-hud-title {
    font-weight: 800;
    font-size: 15px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adgame-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,.8);
}

.adgame-progress-bar {
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    overflow: hidden;
}

.adgame-progress-fill {
    height: 100%;
    background: var(--adgame-accent);
    border-radius: 3px;
    transition: width .4s ease;
}

.adgame-found-count { color: var(--adgame-accent); font-weight: 800; font-size: 18px; }

.adgame-timer-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.adgame-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    letter-spacing: .05em;
    transition: color .3s;
}

.adgame-timer.urgent { color: var(--adgame-accent); animation: adgame-pulse 0.5s ease infinite; }

@keyframes adgame-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.adgame-btn-hint {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s;
}

.adgame-btn-hint:hover { background: rgba(255,255,255,.25); }

/* ── Game area ────────────────────────────────────────────────── */
.adgame-game-area {
    display: grid;
    grid-template-columns: 220px 1fr;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    background: #f8fafc;
}

@media (max-width: 600px) {
    .adgame-game-area { grid-template-columns: 1fr; }
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.adgame-sidebar {
    background: #1a1a2e;
    color: #fff;
    padding: 16px;
    min-height: 300px;
}

.adgame-sidebar h3 {
    margin: 0 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.6);
    font-weight: 700;
}

.adgame-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 6px;
    background: rgba(255,255,255,.06);
    transition: background .2s;
    color: rgba(255,255,255,.7);
    cursor: default;
}

.adgame-checklist-item .adgame-check {
    font-size: 16px;
    transition: color .3s;
    min-width: 20px;
    text-align: center;
}

.adgame-checklist-item .adgame-check.found {
    color: #68d391;
    font-size: 18px;
}

.adgame-checklist-item:has(.adgame-check.found) {
    color: #68d391;
    text-decoration: line-through;
    opacity: .6;
}

.adgame-sidebar-tip {
    margin-top: 20px;
    padding: 10px;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    font-size: 11px;
    color: rgba(255,255,255,.4);
    text-align: center;
    line-height: 1.5;
}

/* ── Scene wrap ───────────────────────────────────────────────── */
.adgame-scene-wrap {
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    background: #000;
}

.adgame-scene-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    -webkit-user-drag: none;
}

/* ── Hit popup ────────────────────────────────────────────────── */
.adgame-hit-popup {
    position: absolute;
    width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    overflow: hidden;
    z-index: 50;
    animation: adgame-pop .25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes adgame-pop {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.hit-popup-header {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 12px;
}

.hit-popup-body {
    padding: 10px 12px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

.hit-popup-close {
    position: absolute;
    top: 6px; right: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

/* ── Miss ─────────────────────────────────────────────────────── */
.adgame-miss {
    position: absolute;
    font-size: 20px;
    color: rgba(255,50,50,.8);
    pointer-events: none;
    z-index: 40;
    animation: adgame-miss .5s ease forwards;
}

@keyframes adgame-miss {
    from { opacity: 1; transform: scale(1.2); }
    to   { opacity: 0; transform: scale(0.6) translateY(-20px); }
}

/* ── Flash overlay ────────────────────────────────────────────── */
.adgame-flash {
    position: absolute;
    border: 3px solid;
    border-radius: 4px;
    pointer-events: none;
    z-index: 35;
    animation: adgame-flash .8s ease forwards;
}

@keyframes adgame-flash {
    0%   { opacity: 1; transform: scale(1); }
    50%  { opacity: .8; transform: scale(1.04); }
    100% { opacity: 0; transform: scale(1.08); }
}

/* ── Win screen ───────────────────────────────────────────────── */
.adgame-win-screen,
.adgame-timeup {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.adgame-win-card {
    text-align: center;
    max-width: 400px;
    color: #fff;
    padding: 40px;
    z-index: 1;
}

.adgame-win-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 16px;
    animation: adgame-bounce 1.5s ease infinite;
}

.adgame-win-card h2 {
    font-size: 30px;
    font-weight: 900;
    margin: 0 0 10px;
    color: #fff;
}

.adgame-win-message {
    font-size: 15px;
    color: rgba(255,255,255,.75);
    margin-bottom: 24px;
    line-height: 1.6;
}

.adgame-win-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.win-stat strong {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: var(--adgame-accent);
}

.win-stat span {
    font-size: 12px;
    color: rgba(255,255,255,.5);
}

.adgame-btn-cta {
    display: inline-block;
    background: var(--adgame-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(232,65,78,.4);
}

.adgame-btn-cta:hover {
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

.adgame-btn-replay {
    display: block;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    margin: 0 auto;
    transition: background .2s;
}

.adgame-btn-replay:hover { background: rgba(255,255,255,.2); }

/* ── Confetti canvas ──────────────────────────────────────────── */
.adgame-confetti {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════
   Hit popup — z obrazem produktu
   ═══════════════════════════════════════════ */

.adgame-hit-popup {
    width: 230px;
}

.hit-popup-image {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: #000;
}

.hit-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hit-popup-close {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    background: rgba(0,0,0,.35);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
