/* /places/spot/spot.css — Spot 'Em! mini-game styles */

:root {
    --spot-accent: #3d8bff;
    --spot-accent-dark: #1d6cde;
    --spot-success: #2ea64a;
    --spot-fail:    #c93b3b;
    --spot-bg-sky:  #87ceeb;
    --spot-bg-grass-a: #5c7a38;
    --spot-bg-grass-b: #4a6030;
    --spot-header-h: 50px;
    --spot-footer-h: 40px;
}

body.spot-page {
    background: var(--parchment-dark, #e8e4d8);
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
    /* Reserve space for fixed site header + footer */
    height: 100dvh;
    padding-bottom: 0;
    box-sizing: border-box;
}

.spot-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.spot-stage-container {
    width: 100%;
    max-width: 1400px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* ── Title screen ─────────────────────────────────────────── */
.spot-title-screen[hidden] { display: none; }
.spot-title-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 24px 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(to bottom, #87ceeb 0%, #b8e4f8 22%, var(--spot-bg-grass-a) 22%, var(--spot-bg-grass-b) 100%);
    border: 3px solid var(--ink);
    border-radius: 4px;
}
.spot-title-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
}
.spot-title-card {
    max-width: 30rem;
    width: 100%;
    text-align: center;
    background: var(--parchment, #f4f1e8);
    border: 3px solid var(--ink, #2c2416);
    box-shadow: 0 6px 22px rgba(0,0,0,0.18);
    padding: 28px 24px 30px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}
.spot-title-icon {
    width: 64px; height: 64px;
    color: var(--spot-accent);
    margin: 8px auto 6px;
    display: block;
}
#spot-mascot-canvas {
    width: 48px;
    height: 48px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}
.spot-title-anon-note {
    width: 100%;
    text-align: center;
    color: var(--ink-light);
    font-size: 0.8rem;
    margin: 8px 0 0;
}
.spot-title-brand {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--gold, #c9a227);
    font-weight: bold;
    margin: 0 0 2px;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}
.spot-version {
    position: absolute;
    top: 7px;
    left: 10px;
    font-size: 0.65rem;
    font-family: monospace;
    color: var(--ink-light, #7a6a52);
    opacity: 0.65;
    pointer-events: none;
    user-select: none;
}
.spot-title-card h1 {
    margin: 4px 0 4px;
    font-size: 2.2rem;
    letter-spacing: 0.04em;
    color: var(--spot-accent);
    font-family: Georgia, 'Times New Roman', serif;
}
.spot-tag {
    color: var(--ink-light);
    font-style: italic;
    margin: 0 0 22px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.spot-title-btn-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.spot-title-btn-note {
    color: var(--ink-light);
    font-size: 0.75rem;
    font-weight: 400;
    text-align: center;
    min-height: 1em;
    max-width: 160px;
    width: 100%;
}

/* ── Buttons ──────────────────────────────────────────────── */
.spot-btn {
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 12px 22px;
    border: 2px solid var(--ink, #2c2416);
    cursor: pointer;
    min-height: 44px;
    min-width: 140px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.05s, filter 0.1s;
}
.spot-btn:active { transform: translateY(1px); }
.spot-btn-primary {
    background: var(--spot-accent);
    color: #fff;
    border-color: #1a4fa0;
}
.spot-btn-primary:hover { filter: brightness(1.07); }
.spot-btn-primary:disabled {
    background: #b8c4d6;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
    border-color: #6e7a8c;
}
.spot-btn-secondary {
    background: var(--parchment, #f4f1e8);
    color: var(--ink);
}
.spot-btn-secondary:hover { background: var(--parchment-dark, #e8e4d8); }

/* ── Game layout ──────────────────────────────────────────── */
.spot-game {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    height: 100%;
    min-height: 0;
}
.spot-game[hidden] { display: none; }

.spot-sidebar {
    background: var(--parchment, #f4f1e8);
    border: 2px solid var(--ink, #2c2416);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-height: 0;
}
.spot-side-section {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(44, 36, 22, 0.15);
    padding: 10px;
    border-radius: 4px;
}
.spot-side-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-light);
    font-weight: 700;
    margin-bottom: 6px;
}
.spot-target-box {
    width: 128px;
    height: 128px;
    margin: 0 auto;
    background-image: linear-gradient(to bottom, #87ceeb 0%, #b8e4f8 22%, var(--spot-bg-grass-a) 22%, var(--spot-bg-grass-b) 100%);
    border: 2px solid var(--ink);
    position: relative;
    image-rendering: pixelated;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
}
.spot-target-box .spot-sprite-canvas { display: block; width: 96px; height: 96px; image-rendering: pixelated; flex-shrink: 0; }
.spot-target-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    font: bold 56px/1 system-ui, sans-serif;
    color: var(--ink);
}
.spot-target-overlay.obscure-grey {
    background: rgba(44, 36, 22, 0.55);
    backdrop-filter: grayscale(1) blur(1px);
}
.spot-target-overlay.obscure-grey::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(44, 36, 22, 0.85);
    mix-blend-mode: hue;
}
.spot-target-overlay.obscure-question::before {
    content: '?';
    color: var(--parchment);
    text-shadow: 0 0 6px rgba(0,0,0,0.6);
}
.spot-target-overlay.obscure-question {
    background: rgba(44, 36, 22, 0.85);
}
.spot-target-name {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-top: 6px;
    font-style: italic;
}

/* Clues tab button (mobile only — replaces the ??? name label) */
.spot-clues-tab-btn {
    display: none;
}

/* Clues section header row (label + Back button side-by-side) */
.spot-clues-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.spot-clues-section-header .spot-side-label { margin-bottom: 0; }
#spot-clues-back-btn { display: none; }

.spot-clue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.spot-clue-list li {
    padding: 2px 0 2px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--ink);
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
.spot-clue-list li::before {
    content: '\2022';
    position: absolute;
    left: 2px;
    color: var(--ink-light);
}
.spot-clue-list li::after {
    content: none;
}

.spot-clue-color-swatch {
    width: 0.76rem;
    height: 0.76rem;
    border: 1px solid #000;
    box-sizing: border-box;
    border-radius: 2px;
    flex: 0 0 auto;
}

.spot-selected-box {
    width: 100px;
    height: 100px;
    margin: 6px auto 8px;
    background-image: linear-gradient(to bottom, #87ceeb 0%, #b8e4f8 22%, var(--spot-bg-grass-a) 22%, var(--spot-bg-grass-b) 100%);
    border: 2px solid var(--ink);
    image-rendering: pixelated;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.spot-selected-box canvas {
    image-rendering: pixelated;
    width: 96px; height: 96px;
    display: block;
}
.spot-selected-name {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-light);
    font-style: italic;
    min-height: 1.2em;
}
.spot-btn-confirm {
    width: 100%;
    margin-top: 6px;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 40px;
    letter-spacing: 0.02em;
}
/* Pulse when a character is selected and button becomes active */
@keyframes confirm-ready {
    0%, 100% { box-shadow: 0 0 0 0 rgba(61, 139, 255, 0); }
    50%       { box-shadow: 0 0 0 6px rgba(61, 139, 255, 0.35); }
}
#spot-confirm:not([disabled]),
.spot-mobile-confirm:not([hidden]):not([disabled]) {
    animation: confirm-ready 2s ease-in-out infinite;
}

.spot-status-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    padding: 2px 0;
}
.spot-status-row strong {
    color: var(--ink);
    font-size: 1rem;
}

.spot-side-back {
    background: none;
    border: 1px dashed rgba(44, 36, 22, 0.3);
    padding: 6px 10px;
    font: inherit;
    color: var(--ink-light);
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
}
.spot-side-back:hover { color: var(--ink); border-color: var(--ink); }

/* ── Stage canvas ─────────────────────────────────────────── */
.spot-stage {
    position: relative;
    background: linear-gradient(to bottom, #87ceeb 0%, #b8e4f8 22%, var(--spot-bg-grass-a) 22%, var(--spot-bg-grass-b) 100%);
    border: 3px solid var(--ink);
    border-radius: 4px;
    overflow: hidden;
    min-height: 0;
    image-rendering: pixelated;
}
.spot-scene-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    image-rendering: pixelated;
    touch-action: none;
    user-select: none;
}
.spot-scene-canvas:active { cursor: grabbing; }
.spot-scene-canvas:focus { outline: none; }

.spot-stage-hint {
    position: absolute;
    /* Centered below stat bar */
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    bant-size: 1rem;
    z-index: 20;
}
.spot-loading {
    position: absolute;
    inset: 0;
    background: rgba(244, 241, 232, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    z-index: 25;
    letter-spacing: 0.02em;
    text-align: center;
}
.spot-loading[hidden] { display: none; }
.spot-loading-label { display: inline-flex; align-items: baseline; gap: 0; }
.spot-loading-detail {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink);
    opacity: 0.55;
    letter-spacing: 0.01em;
    min-height: 1em;
}
@keyframes spot-dot-pulse {
    0%, 100% { opacity: 0.15; }
    50%       { opacity: 1; }
}
.spot-loading-dots span {
    display: inline-block;
    animation: spot-dot-pulse 1.2s ease-in-out infinite;
}
.spot-loading-dots span:nth-child(1) { animation-delay: 0s; }
.spot-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.spot-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.spot-sidebar-toggle {
    display: none;
    position: absolute;
    top: 8px; right: 8px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--spot-accent);
    color: #fff;
    border: 2px solid var(--ink);
    cursor: pointer;
    /* Stay below the loading overlay (z-index: 20) */
    z-index: 15;
    align-items: center; justify-content: center;
    padding: 0;
    transition: background 0.2s, box-shadow 0.2s;
}
.spot-sidebar-toggle svg { color: #fff; stroke: currentColor; fill: none; }
.spot-sidebar-toggle.has-selection {
    background: #c9a227;
    animation: spot-pulse-glow 1.2s ease-in-out infinite;
}
@keyframes spot-pulse-glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(201,162,39,0.8); }
    50%      { box-shadow: 0 0 0 10px rgba(201,162,39,0); }
}

/* ── Zoom controls (bottom-left of stage) ──────────────────── */
.spot-zoom-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}
.spot-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(20, 14, 6, 0.72);
    color: var(--parchment, #f5e9c8);
    border: 1.5px solid rgba(255,255,255,0.18);
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.spot-zoom-btn:hover  { background: rgba(40, 28, 10, 0.88); }
.spot-zoom-btn:active { transform: scale(0.92); }

/* ── Mobile floating confirm btn ───────────────────────────── */
.spot-mobile-confirm {
    display: none;
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    white-space: nowrap;
    min-width: 160px;
}
.spot-mobile-confirm[hidden] { display: none; }

/* ── Stat bar HUD ─────────────────────────────────────────── */
.spot-stat-bar {
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 14, 6, 0.7);
    color: var(--parchment);
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}
.spot-stat-bar strong { font-weight: 700; }
.spot-stat-bar[hidden] { display: none; }

/* ── Timer bar ─────────────────────────────────────────────── */
.spot-timer-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background: rgba(0,0,0,0.22);
    z-index: 11;
    pointer-events: none;
    overflow: hidden;
}
.spot-timer-bar[hidden] { display: none; }
.spot-timer-fill {
    height: 100%;
    width: 100%;
    background: rgba(255,255,255,0.9);
    transform-origin: left;
    transition: background 0.4s;
}
.spot-timer-fill.warn   { background: #f5c400; }
.spot-timer-fill.urgent { background: var(--spot-fail); }

/* ── Sidebar backdrop & close ─────────────────────────────── */
.spot-sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.25);
}
.spot-side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.spot-side-header .spot-side-label { margin-bottom: 0; }
.spot-sidebar-close {
    display: none;
    background: none;
    border: 1px dashed rgba(44,36,22,0.28);
    font: inherit;
    font-size: 0.8rem;
    color: var(--ink-light);
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 4px;
    width: 100%;
    margin-top: 6px;
    text-align: center;
}
.spot-sidebar-close:hover { color: var(--ink); border-color: var(--ink); background: rgba(44,36,22,0.04); }

/* ── Modal ────────────────────────────────────────────────── */
.spot-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 6, 0.7);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    /* Block all pointer events on layers below */
    pointer-events: all;
    touch-action: none;
}
.spot-modal[hidden] { display: none; pointer-events: none; }
.spot-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.spot-modal-card {
    position: relative;
    background: var(--parchment, #f4f1e8);
    border: 3px solid var(--ink, #2c2416);
    border-radius: 6px;
    padding: 22px 22px 20px;
    max-width: 32rem;
    width: 100%;
    text-align: center;
    z-index: 2;
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}
.spot-modal-card.success { border-color: var(--spot-success); }
.spot-modal-card.fail    { border-color: var(--spot-fail); }
.spot-modal-card h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-family: Georgia, serif;
    letter-spacing: 0.03em;
}
.spot-modal-card.success h2 { color: var(--spot-success); }
.spot-modal-card.fail    h2 { color: var(--spot-fail); }
.spot-modal-tag {
    color: var(--ink-light);
    font-style: italic;
    margin: 0 auto 14px;
    font-size: 0.9rem;
    max-width: 26rem;
}
.spot-modal-tag strong {
    color: var(--ink);
    font-style: normal;
    font-weight: 700;
}
.spot-modal-sprites {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin: 10px 0 16px;
}
.spot-modal-sprite-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.spot-modal-sprite-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    font-weight: 700;
}
.spot-walk-canvas {
    width: 96px; height: 96px;
    background-image: linear-gradient(to bottom, #87ceeb 0%, #b8e4f8 22%, var(--spot-bg-grass-a) 22%, var(--spot-bg-grass-b) 100%);
    border: 2px solid var(--ink);
    image-rendering: pixelated;
}
.spot-modal-sprite-name {
    font-size: 0.85rem;
    color: var(--ink);
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Clue diff — table-style rows with alternating backgrounds */
.spot-clue-diff {
    list-style: none;
    padding: 0;
    margin: 12px auto 14px;
    text-align: left;
    border: 1px solid rgba(44,36,22,0.15);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}
.spot-clue-diff li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    font-size: 0.88rem;
    line-height: 1.35;
    border-bottom: 1px solid rgba(44,36,22,0.07);
}
.spot-clue-diff li:last-child { border-bottom: none; }
.spot-clue-diff li:nth-child(odd)  { background: rgba(255,255,255,0.75); }
.spot-clue-diff li:nth-child(even) { background: rgba(0,0,0,0.04); }
.spot-clue-diff li.match    { color: var(--spot-success); }
.spot-clue-diff li.nomatch  { color: var(--spot-fail); }
.spot-clue-diff li .mark {
    flex: 0 0 18px;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
}
.spot-clue-diff li.match .mark    { background: var(--spot-success); }
.spot-clue-diff li.nomatch .mark  { background: var(--spot-fail); }

.spot-modal-scores {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(44, 36, 22, 0.12);
    padding: 8px 24px;
    border-radius: 4px;
    margin: 0 auto 14px;
    width: 100%;
}
.spot-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.spot-modal-actions .spot-btn {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    padding-left: 12px;
    padding-right: 12px;
}

/* ── Prize win item block in result modal ─────────────────── */
.spot-modal-prize-win {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fffbe8;
    border: 2px solid #c08820;
    border-radius: 4px;
    padding: 10px 14px 8px;
    color: #7a4a00;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 80px;
}
.spot-modal-prize-win[hidden] { display: none !important; }

/* ── Gold button variant (prize / login CTA) ─────────────── */
.spot-btn-gold {
    background: #c08820;
    border-color: #9a6a12;
    color: #fff;
    font-weight: 700;
}
.spot-btn-gold:hover { filter: brightness(1.08); }

/* ── Anon prize teaser (milestone hit while not logged in) ───── */
.spot-modal-anon-teaser {
    margin: 8px 0 4px;
    background: var(--parchment, #f4f1e8);
    border: 2px solid #c08820;
    border-radius: 6px;
    padding: 14px 16px 16px;
    text-align: center;
}
.spot-modal-anon-teaser[hidden] { display: none !important; }
.spot-modal-anon-teaser-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.spot-modal-anon-teaser-eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c08820;
}
.spot-modal-anon-teaser-icon-wrap {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spot-modal-anon-teaser-title {
    display: block;
    font-size: 0.97rem;
    font-weight: 800;
    color: var(--ink, #2c2416);
    margin: 2px 0 0;
}
.spot-modal-anon-teaser-body {
    margin: 0 0 6px;
    font-size: 0.78rem;
    color: var(--ink-light, #5a4a38);
    line-height: 1.45;
    max-width: 280px;
}
.spot-modal-anon-login-btn {
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

/* ── Prize progress bar in result modal ──────────────────── */
.spot-modal-prize {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: 4px;
}
.spot-modal-prize[hidden] { display: none; }
.spot-modal-prize .spot-prize-bar-track {
    height: 8px;
    background: rgba(30, 20, 50, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.spot-modal-prize .spot-prize-progress-label {
    margin-top: 0;
    color: #7c3aed;
    font-weight: 700;
}

/* ── Timer countdown overlay ───────────────────────────────── */
.spot-timer-countdown {
    position: absolute;
    left: 8px;
    top: 12px; /* offset below thicker 8px bar */
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    transition: opacity 0.4s, background 0.4s, color 0.4s;
    color: var(--ink);
    background: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    letter-spacing: 0.02em;
}
.spot-timer-countdown.visible {
    opacity: 1;
}
.spot-timer-countdown.daily {
    left: 50%;
    transform: translateX(-50%);
}
.spot-timer-countdown.warn {
    color: #1a1200;
    background: #f5c400;
}
.spot-timer-countdown.red {
    color: #fff;
    background: var(--spot-fail, #c93b3b);
}
@keyframes spot-count-flash {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.3; }
}
.spot-timer-countdown.flash {
    animation: spot-count-flash 0.5s ease-in-out;
}
@keyframes spot-shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-5px); }
    40%     { transform: translateX(5px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(4px); }
}
.spot-shake {
    animation: spot-shake 0.35s ease-in-out;
}

/* Bluesky share button */
.spot-btn-bsky {
    background: #0085ff;
    color: #fff;
    border-color: #0065cc;
    width: auto;
    padding-left: 1.4em;
    padding-right: 1.4em;
}
.spot-btn-bsky:hover { filter: brightness(1.1); }

/* Green variant for Try Again button */
.spot-btn-green {
    background: #2d8a4e;
    border-color: #1f6637;
    color: #fff;
}
.spot-btn-green:hover { filter: brightness(1.1); }

/* How To Play / Login button row */
.spot-title-how-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
}
.spot-title-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.spot-title-actions + .spot-title-actions {
    margin-top: 8px;
}
.spot-btn-how {
    min-width: 0;
    font-size: 0.85rem;
    padding: 8px 18px;
    min-height: 36px;
    border-style: dashed;
    opacity: 0.85;
}
.spot-btn-how:hover { opacity: 1; background: var(--parchment-dark, #e8e4d8); }

/* ── Tutorial overlay ─────────────────────────────────────── */
.spot-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: none; /* always pass-through — only the box captures events */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.spot-tutorial-box {
    pointer-events: all;
    background: var(--parchment, #f4f1e8);
    border: 3px solid var(--ink, #2c2416);
    border-radius: 6px;
    padding: 18px 22px 16px;
    max-width: 28rem;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
    text-align: left;
    position: relative;
    animation: tut-slide-up 0.25s ease-out;
}
@keyframes tut-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.spot-tutorial-step-num {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    font-weight: 700;
    margin-bottom: 4px;
}
.spot-tutorial-box h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--ink);
    font-family: Georgia, serif;
}
.spot-tutorial-box p {
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ink);
}
.spot-tutorial-action {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--spot-accent);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(61,139,255,0.08);
    border-left: 3px solid var(--spot-accent);
    border-radius: 2px;
}
.spot-tutorial-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.spot-tutorial-continue {
    font-size: 0.82rem;
    padding: 7px 16px;
    min-height: 34px;
    min-width: 0;
}
.spot-tutorial-continue[hidden] { display: none; }
.spot-tutorial-skip {
    font-size: 0.75rem;
    padding: 6px 14px;
    min-height: 32px;
    min-width: 0;
    opacity: 0.7;
    margin: 0;
}
.spot-tutorial-skip:hover { opacity: 1; }

/* ── Tutorial HUD (in-scene reminder capsule below stat bar) ── */
.spot-tut-hud {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 14, 6, 0.85);
    color: var(--parchment);
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: 4px 18px;
    font-size: 0.75rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 34;
    pointer-events: none;
    user-select: none;
}
.tut-hud-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tut-hud-check::before {
    content: '\25CB'; /* ○ */
    font-size: 0.9em;
    color: rgba(244, 241, 232, 0.45);
    transition: color 0.2s, content 0.2s;
}
.tut-hud-check.done::before {
    content: '\2713'; /* ✓ */
    color: var(--gold);
}
.tut-hud-sep { opacity: 0.35; }
.tut-hud-dimmed { opacity: 0.35; }
@keyframes tut-pulse-hl {
    0%, 100% { box-shadow: 0 0 0 2px rgba(61,139,255,0.5); background-color: rgba(61,139,255,0.06); }
    50%       { box-shadow: 0 0 0 6px rgba(61,139,255,0.18); background-color: rgba(61,139,255,0.13); }
}
.tut-pulse {
    animation: tut-pulse-hl 1.4s ease-in-out infinite !important;
    border-color: var(--spot-accent) !important;
    transition: none !important;
}
/* Stage border glow needs spread on its existing border */
#spot-stage.tut-pulse {
    animation: tut-pulse-hl 1.4s ease-in-out infinite !important;
    border-color: var(--spot-accent) !important;
    transition: none !important;
}
/* Compact variant for in-scene guidance steps */
.spot-tutorial-box.tut-compact {
    max-width: 18rem;
    padding: 14px 18px 12px;
}

@media (max-width: 800px) {
    .spot-wrap { padding: 6px; }
    .spot-mobile-confirm { display: inline-flex; }
    .spot-game {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        position: relative;
    }
    .spot-sidebar {
        position: absolute;
        top: 0; right: 0;
        height: 100%;
        width: min(280px, 86vw);
        z-index: 50;
        transform: translateX(105%);
        transition: transform 0.22s ease-out;
        max-height: none;
        box-shadow: -8px 0 20px rgba(0,0,0,0.18);
        overflow: hidden; /* clues section scrolls internally, not the whole panel */
        padding: 8px;
        gap: 8px;
    }
    /* Clues section hidden by default on mobile; shown only when .showing-clues active */
    .spot-side-clues {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        flex-direction: column;
        display: none;
    }
    .spot-side-section { padding: 7px 8px; }
    .spot-side-label { margin-bottom: 3px; }
    /* Hide sidebar prize bar on mobile — shown in result modal instead */
    .spot-prize-progress { display: none; }
    /* Compact Find sprite */
    .spot-side-target .spot-target-box {
        width: 96px;
        height: 96px;
    }
    .spot-side-target .spot-target-box .spot-sprite-canvas {
        width: 72px;
        height: 72px;
    }
    /* Your Pick: same size as Find sprite on mobile */
    .spot-selected-box {
        width: 96px;
        height: 96px;
        margin: 6px auto 8px;
    }
    .spot-selected-box canvas {
        width: 72px;
        height: 72px;
    }
    .spot-selected-name { font-size: 0.78rem; min-height: 0; }
    .spot-btn-confirm { margin-top: 4px; min-height: 36px; font-size: 0.88rem; padding: 6px 10px; }
    .spot-sidebar.open { transform: translateX(0); }
    .spot-sidebar-toggle { display: inline-flex; }
    .spot-sidebar-close { display: block; }
    .spot-sidebar-backdrop.active { display: block; }
    /* Hide ??? name, show Clues tab button */
    .spot-target-name { display: none; }
    .spot-clues-tab-btn {
        display: block;
        width: fit-content;
        margin: 6px auto 0;
        padding: 7px 10px;
        background: transparent;
        border: 1.5px solid rgba(44,36,22,0.25);
        border-radius: 4px;
        font: inherit;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--ink-light);
        cursor: pointer;
    }
    .spot-clues-tab-btn::after { content: '\25B8'; margin-left: 4px; }
    .spot-clues-tab-btn:hover { border-color: rgba(44,36,22,0.5); color: var(--ink); }
    /* Back button inside Clues panel */
    #spot-clues-back-btn { display: inline-flex; }
    /* Panel-flip: when .showing-clues is on the sidebar */
    .spot-sidebar.showing-clues .spot-side-target,
    .spot-sidebar.showing-clues .spot-side-selected { display: none; }
    .spot-sidebar.showing-clues .spot-side-clues { display: flex; }
    .spot-title-card {
        padding: 18px 14px 20px;
    }
    .spot-title-card h1 { font-size: 1.8rem; }
    .spot-tag { font-size: 0.88rem; margin-bottom: 14px; }
    .spot-title-how-row { gap: 8px; }
    .spot-title-main-actions { flex-wrap: nowrap; gap: 10px; }
    .spot-title-btn-col { flex: 1; min-width: 0; }
    .spot-title-btn-col .spot-btn { width: 100%; font-size: 0.85rem; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
    .spot-title-btn-note { max-width: none; }
    .spot-modal-card { padding: 18px 14px 16px; }
}

@media (max-width: 380px) {
    .spot-modal-sprites { gap: 10px; }
    .spot-walk-canvas   { width: 72px; height: 72px; }
}

/* Desktop only: modal actions centred */
@media (min-width: 801px) {
    /* clue-diff is already full-width within card */
}

/* Spot page: account for fixed header + footer dynamically */
@media (min-width: 901px) {
    /* Footer is fixed at bottom (~38px); header is visible too (inject via JS layout) */
    body.spot-page {
        padding-top: var(--spot-header-height, 0px);
        padding-bottom: 38px;
    }
}
@media (max-width: 900px) {
    /* Header is in flex flow on mobile (not fixed) — no padding-top needed.
       Using padding-top here was double-counting the header height. */
    body.spot-page {
        padding-top: 0;
        /* viewport-fit=cover lets env() return the real nav-bar inset on Android/iOS */
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    /* Also pad the wrap itself so the game border is never under the nav bar */
    .spot-wrap {
        padding-bottom: max(6px, calc(6px + env(safe-area-inset-bottom, 0px)));
    }
    /* Safety net: hide any injected banners (fashion jam etc.) that consume vertical space */
    body.spot-page > .fashion-banner { display: none; }
}

/* ── Toast notification ────────────────────────────────────────────────── */
#spot-toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.55em 1.1em;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
#spot-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Daily Hunt title button ──────────────────────────────── */
.spot-btn-daily {
    background: var(--spot-bg-grass-a, #5a9e3a);
    color: #fff;
    border-color: #1e4a0c;
    position: relative;
}
.spot-btn-daily:hover { filter: brightness(1.1); }
.spot-btn-daily:disabled {
    background: #8fba7a;
    cursor: not-allowed;
    opacity: 0.7;
}
.spot-btn-daily.done {
    background: #849c7a;
    border-color: #4a6640;
    color: rgba(255, 255, 255, 0.8);
}
.spot-btn-daily.done:hover { filter: brightness(1.05); }
.spot-daily-done-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2a8a2a;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.spot-daily-done-badge[hidden] { display: none; }

/* ── Login button (same size as How To Play, gold style) ── */
.spot-btn-login {
    background: #c9a227;
    color: #fff;
    border-color: #7a5800;
    border-style: solid;
    font-weight: 700;
    min-width: 120px;
}
.spot-btn-login:hover { filter: brightness(1.08); opacity: 1; }
.spot-btn-login[hidden] { display: none; }
/* ── Prize progress bar (sidebar) ────────────────────────── */
.spot-prize-progress {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(44, 36, 22, 0.15);
    border-radius: 4px;
}
.spot-prize-progress-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}
.spot-prize-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(44, 36, 22, 0.12);
    border-radius: 4px;
    overflow: hidden;
}
.spot-prize-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #ea580c);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    width: 0%;
}
.spot-prize-progress-label {
    font-size: 0.72rem;
    color: var(--ink-light);
    white-space: nowrap;
    font-weight: 600;
    margin-top: 4px;
    display: block;
    text-align: center;
}

/* ── Daily mode banner (sidebar) ─────────────────────────── */
.spot-daily-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    justify-content: space-between;
    background: rgba(90, 158, 58, 0.15);
    border: 1px solid rgba(58, 112, 34, 0.3);
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3a7022;
}
.spot-daily-banner.challenge {
    background: rgba(0, 133, 255, 0.12);
    border-color: rgba(0, 100, 200, 0.3);
    color: #0055cc;
}
.spot-daily-banner #spot-mode-banner-label { flex: 1; }
.spot-game-quit-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    font: inherit;
    font-size: 0.7rem;
    color: currentColor;
    opacity: 0.65;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 3px;
    flex-shrink: 0;
}
.spot-game-quit-btn:hover { opacity: 1; background: rgba(0,0,0,0.08); }

/* ── Prize round announce overlay ────────────────────────── */
.spot-prize-announce {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 5, 0.75);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spot-prize-announce[hidden] { display: none; }
.spot-prize-announce.is-zen .spot-prize-announce-card { border-color: rgba(80,60,30,0.15); }
#spot-prize-announce-item[hidden] { display: none; }
.spot-prize-announce-card {
    background: var(--parchment, #f4f1e8);
    border: 3px solid #c08820;
    border-radius: 8px;
    padding: 32px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.spot-prize-announce-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    color: var(--ink);
}
.spot-prize-announce-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--ink);
}
.spot-prize-announce-body {
    font-size: 0.95rem;
    color: var(--ink-light);
    margin: 0 0 16px;
    line-height: 1.55;
}
#spot-prize-announce-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 1rem;
    background: #fffbe8;
    border: 2px solid #c08820;
    border-radius: 4px;
    padding: 10px 18px 8px;
    margin-bottom: 20px;
    color: #7a4a00;
}
.spot-prize-item-icon {
    display: block;
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    object-fit: contain;
}
#spot-prize-announce-go {
    width: 100%;
}

/* ── Daily Hunt end screen ────────────────────────────────── */
.spot-daily-end {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 5, 0.82);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spot-daily-end[hidden] { display: none; }
.spot-daily-end .spot-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.spot-daily-end-card {
    position: relative;
    z-index: 2;
    background: var(--parchment, #f4f1e8);
    border: 3px solid #3a7022;
    border-radius: 10px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 92%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}
.spot-daily-end-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 10px;
}
.spot-daily-end-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--ink);
}
.spot-daily-end-sub {
    font-size: 0.95rem;
    color: var(--ink-light);
    margin: 0 0 18px;
    line-height: 1.5;
}
.spot-daily-end-target {
    margin: 0 auto 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.spot-daily-end-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}
.spot-daily-end-stats {
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-bottom: 22px;
    font-weight: 600;
    min-height: 1.2em;
}
.spot-daily-end-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.spot-daily-end-actions .spot-btn {
    width: 100%;
}
