/* ==========================================================================
   Treasure Hunt — light UI design system
   ========================================================================== */
:root {
  --bg: #EEF3F1;              /* fog — map paper */
  --surface: #ffffff;
  --surface-2: #F6F9F8;
  --surface-3: #E7EEEB;
  --border: #D6E0DC;
  --border-strong: #BFCCC7;
  --text: #13233A;            /* ink */
  --text-2: #33465C;
  --muted: #5B6B7E;
  --primary: #0B6463;
  --primary-hover: #095251;
  --primary-50: #E3F2F1;
  --primary-100: #C6E5E3;
  --primary-600: #0E7C7B;     /* signal teal */
  --accent: #8A5A00;
  --accent-50: #FFF5DB;
  --accent-200: #F8D88A;
  --marigold: #F4A300;
  --ink: #13233A;
  --success: #12704E;
  --success-50: #E8F6EF;
  --success-200: #B9E4CF;
  --danger: #B42318;
  --danger-50: #FDEDEB;
  --danger-200: #F6C3BD;
  --warning: #8A5A00;
  --warning-50: #FFF5DB;
  --warning-200: #F8D88A;
  --info: #0B6463;
  --info-50: #E3F2F1;
  --info-200: #C6E5E3;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(19, 35, 58, .06);
  --shadow: 0 1px 2px rgba(19, 35, 58, .05), 0 4px 14px -6px rgba(19, 35, 58, .10);
  --shadow-lg: 0 24px 48px -24px rgba(19, 35, 58, .35), 0 2px 6px rgba(19, 35, 58, .05);
  --ring: 0 0 0 3px rgba(14, 124, 123, .28);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --display: "Adventor", "Avant Garde", "Century Gothic", var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@font-face { font-family: "Adventor"; src: url("../fonts/adventor-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.15; letter-spacing: -.02em; color: var(--text); font-family: var(--display); font-weight: 700; }
h1, .h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 800; }
h2, .h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 750; }
h3, .h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1rem; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-xs { width: 13px; height: 13px; flex: none; }
.icon-lg { width: 24px; height: 24px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* ----- layout ------------------------------------------------------------ */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 28px; padding-bottom: 56px; min-height: calc(100vh - 140px); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.medium { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ----- top bar ----------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; letter-spacing: -.01em; min-width: 0; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #0ea5e9); box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .6); flex: none; }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .92rem; }
.topnav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.topnav a.active { background: var(--primary-50); color: var(--primary); }
@media (max-width: 720px) {
  .topbar-inner { height: 58px; gap: 10px; }
  .topnav a span { display: none; }
  .topnav a { padding: 9px; }
  .brand-name { max-width: 42vw; font-size: .95rem; }
}
@media (max-width: 420px) { .topbar .pill { display: none; } .brand-name { max-width: 52vw; } }

/* ----- pills & badges ---------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .78rem; font-weight: 650; border: 1px solid; white-space: nowrap; flex: none; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
.pill-live { color: var(--success); background: var(--success-50); border-color: var(--success-200); }
.pill-soon { color: var(--info); background: var(--info-50); border-color: var(--info-200); }
.pill-closed { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, .45); } 70% { box-shadow: 0 0 0 7px rgba(21, 128, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 650; line-height: 1.6; border: 1px solid transparent; white-space: nowrap; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.badge-success { background: var(--success-50); color: var(--success); border-color: var(--success-200); }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: var(--danger-200); }
.badge-warning { background: var(--warning-50); color: var(--warning); border-color: var(--warning-200); }
.badge-info { background: var(--info-50); color: var(--info); border-color: var(--info-200); }

/* ----- cards ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }
.card-sm { padding: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: 18px 20px 0; }
.center-card { text-align: center; padding: 40px 28px; }
.center-card .btn { margin-top: 8px; }
@media (max-width: 560px) { .card { padding: 18px; border-radius: 14px; } }

/* ----- buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 650; font-size: .93rem; line-height: 1.2; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: 0 1px 2px rgba(67, 56, 202, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #b8c2d1; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-200); }
.btn-danger:hover { background: var(--danger-50); color: var(--danger); }
.btn-danger-solid { background: #dc2626; color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); }
.link-sm { font-size: .82rem; font-weight: 600; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----- forms ------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label, .label { display: block; font-weight: 600; font-size: .88rem; color: var(--text-2); margin-bottom: 6px; }
.help { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.input, input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=email], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-600); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-3); color: var(--muted); }
.input-lg { padding: 13px 14px !important; font-size: 1.05rem !important; }
.pin-input { letter-spacing: .5em; font-family: var(--mono); text-align: center; font-size: 1.2rem !important; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grid .field { margin: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary-600); flex: none; }
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; min-width: 0; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; }
.fieldset legend { font-weight: 700; padding: 0 6px; color: var(--text); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--primary-600); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* ----- alerts ------------------------------------------------------------ */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; font-size: .92rem; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-50); border-color: var(--success-200); color: #14532d; }
.alert-error { background: var(--danger-50); border-color: var(--danger-200); color: #7f1d1d; }
.alert-warning { background: var(--warning-50); border-color: var(--warning-200); color: #78350f; }
.alert-info { background: var(--info-50); border-color: var(--info-200); color: #0c4a6e; }

/* ----- tables ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table-compact td { padding: 8px 12px; }
.rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 750; background: var(--surface-3); color: var(--text-2); font-size: .85rem; }
.rank-1 { background: #fef3c7; color: #92400e; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #fde2cf; color: #9a3412; }
tr.is-me td { background: var(--primary-50); }
@media (max-width: 560px) { .hide-sm { display: none; } .table th, .table td { padding-left: 10px; padding-right: 10px; } }

/* ----- empty state ------------------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin: 0 auto 10px; color: #94a3b8; }

/* ----- stage / play ------------------------------------------------------ */
.stage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.stage-no { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #4f46e5, #0ea5e9); color: #fff; font-weight: 800; font-size: 1.25rem; flex: none; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); }
.stage-head .kicker { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stage-head h1 { font-size: 1.4rem; margin: 0; }
.question { font-size: 1.1rem; font-weight: 550; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--primary-600); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.options { display: grid; gap: 10px; }
.option { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 550; color: var(--text); margin: 0; transition: border-color .15s, background .15s, box-shadow .15s; }
.option:hover { border-color: #a5b4fc; background: #fafaff; }
.option input { position: absolute; opacity: 0; }
.option .opt-key { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-weight: 750; font-size: .85rem; flex: none; }
.option:has(input:checked) { border-color: var(--primary-600); background: var(--primary-50); box-shadow: var(--ring); }
.option:has(input:checked) .opt-key { background: var(--primary-600); color: #fff; }
.option:has(input:focus-visible) { box-shadow: var(--ring); }
.geo-status { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: .88rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); margin: 18px 0; }
.geo-status .icon { flex: none; }
.geo-status.ok { background: var(--success-50); border-color: var(--success-200); color: #14532d; }
.geo-status.warn { background: var(--warning-50); border-color: var(--warning-200); color: #78350f; }
.geo-status.err { background: var(--danger-50); border-color: var(--danger-200); color: #7f1d1d; }
.geo-status .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.attempts { display: flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); }
.attempts .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary-600); }
.attempts .dot.used { background: var(--border-strong); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.result-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.result-icon .icon { width: 36px; height: 36px; }
.result-success { background: var(--success-50); color: #16a34a; box-shadow: 0 0 0 8px #f0fdf480; }
.result-error { background: var(--danger-50); color: #dc2626; box-shadow: 0 0 0 8px #fef2f280; }
.result-warning { background: var(--warning-50); color: #d97706; box-shadow: 0 0 0 8px #fffbeb80; }
.result-info { background: var(--info-50); color: #0284c7; box-shadow: 0 0 0 8px #f0f9ff80; }
.hint-card { text-align: left; background: linear-gradient(180deg, #fffbeb, #fff7e0); border: 1px solid var(--accent-200); border-radius: var(--radius-lg); padding: 18px 20px; margin: 22px 0 8px; }
.hint-card .hint-label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); font-size: .88rem; margin-bottom: 8px; }
.hint-card .hint-text { font-size: 1.05rem; font-weight: 600; color: #451a03; white-space: pre-line; }
.explain { text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text-2); font-size: .92rem; margin-top: 16px; }

/* auth tabs */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-radius: 11px; padding: 4px; margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; padding: 9px; border-radius: 8px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* progress */
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #4f46e5, #0ea5e9); border-radius: inherit; transition: width .4s; }
.progress-sm { height: 6px; }
.stat-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: .78rem; color: var(--muted); }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stage-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stage-item .s-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; flex: none; background: var(--surface-3); color: var(--muted); }
.stage-item.solved .s-badge { background: var(--success-50); color: var(--success); }
.stage-item.locked .s-badge { background: var(--danger-50); color: var(--danger); }
.stage-item .s-body { flex: 1; min-width: 0; }
.stage-item .s-title { font-weight: 650; }
.stage-item .s-hint { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-50); border: 1px solid var(--accent-200); color: #451a03; font-size: .9rem; white-space: pre-line; }

/* podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin-bottom: 20px; }
.podium .place { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.podium .place.p1 { order: 2; padding-top: 28px; border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb, #fff); }
.podium .place.p2 { order: 1; }
.podium .place.p3 { order: 3; }
.podium .medal { width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.podium .p1 .medal { background: #fde68a; color: #92400e; width: 48px; height: 48px; }
.podium .p2 .medal { background: #e2e8f0; color: #334155; }
.podium .p3 .medal { background: #fed7aa; color: #9a3412; }
.podium .pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pmeta { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .podium { gap: 8px; } .podium .place { padding: 14px 6px; } }

/* geo test */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.kv span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.kv b { font-family: var(--mono); font-size: .95rem; }

/* ----- footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }

/* =========================================================================
   Admin
   ========================================================================= */
body.admin { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.sidebar .brand { padding: 4px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .92rem; }
.side-nav a .icon { color: #94a3b8; }
.side-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.side-nav a.active { background: var(--primary-50); color: var(--primary); }
.side-nav a.active .icon { color: var(--primary); }
.count-badge { margin-left: auto; background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 750; border-radius: 99px; padding: 1px 8px; }
.side-status { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 12px; }
.side-status-row { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.side-user { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; font-weight: 600; }
.side-user span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-user a { color: var(--muted); display: grid; place-items: center; padding: 4px; border-radius: 6px; }
.side-user a:hover { background: var(--surface-3); color: var(--text); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: rgba(245, 247, 251, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.admin-topbar h1 { font-size: 1.2rem; margin: 0; font-weight: 750; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.admin-content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 40; }
  .menu-toggle { display: inline-grid; }
  .admin-topbar { padding: 0 16px; }
  .admin-content { padding: 18px 16px 40px; }
  .topbar-actions .btn span { display: none; }
}

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .84rem; font-weight: 600; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.kpi-icon.amber { background: var(--warning-50); color: var(--warning); }
.kpi-icon.green { background: var(--success-50); color: var(--success); }
.kpi-icon.sky { background: var(--info-50); color: var(--info); }
.kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8rem; color: var(--muted); }

/* event control */
.event-control { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.event-control.is-live { border-color: var(--success-200); background: linear-gradient(180deg, #f6fef9, #fff); }
.event-state { display: flex; align-items: center; gap: 16px; }
.event-orb { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.event-orb .icon { width: 28px; height: 28px; }
.event-orb.live { background: #dcfce7; color: #15803d; }
.event-orb.off { background: var(--surface-3); color: var(--muted); }
.event-orb.soon { background: var(--info-50); color: var(--info); }
.event-state h2 { font-size: 1.3rem; margin: 0 0 2px; }
.power-btn { min-width: 190px; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-block; padding: 7px 14px; border-radius: 8px; font-weight: 650; font-size: .88rem; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }
.schedule-box { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
@media (max-width: 720px) { .event-control { grid-template-columns: 1fr; } .power-btn { width: 100%; } }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed .feed-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.feed .sev-block { background: var(--danger-50); color: var(--danger); }
.feed .sev-warn { background: var(--warning-50); color: var(--warning); }
.feed .sev-info { background: var(--surface-3); color: var(--muted); }
.feed .feed-body { flex: 1; min-width: 0; }
.feed .feed-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search-bar { flex: 1; min-width: 220px; max-width: 420px; }
.toolbar select { width: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-top: 1px solid var(--border); }
.page-link { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; font-weight: 600; background: var(--surface); }
.page-link.disabled { color: #cbd5e1; }
.page-info { color: var(--muted); font-size: .85rem; }

.stage-title-cell { display: flex; align-items: center; gap: 12px; }
.stage-title-cell .stage-no { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; box-shadow: none; }
.opt-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt-row .opt-radio { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; width: 48px; flex: none; }
.opt-row .opt-radio input { accent-color: #16a34a; width: 17px; height: 17px; }

/* QR grid */
.qr-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.qr-card img { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); image-rendering: pixelated; }
.qr-card .qr-title { font-weight: 700; display: flex; gap: 8px; align-items: center; min-width: 0; }
.qr-card .qr-title span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.url-box { font-family: var(--mono); font-size: .72rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; word-break: break-all; }

.code-block { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 8px; } }

/* login / install */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(900px 500px at 100% 0%, rgba(14, 165, 233, .10), transparent 60%),
  radial-gradient(900px 500px at 0% 100%, rgba(79, 70, 229, .10), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; font-size: 1.05rem; }
.install-card { max-width: 720px; }

/* ----- posters (print) --------------------------------------------------- */
.poster { width: 100%; max-width: 720px; margin: 0 auto 24px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 40px; text-align: center; page-break-after: always; break-after: page; }
.poster .p-event { font-weight: 700; color: var(--primary); font-size: 1rem; }
.poster .p-stage { font-size: 3.2rem; font-weight: 900; letter-spacing: -.03em; margin: 8px 0 0; }
.poster .p-title { font-size: 1.4rem; font-weight: 650; color: var(--text-2); margin-bottom: 24px; }
.poster .p-qr { width: 70%; max-width: 420px; margin: 0 auto; border: 1px solid var(--border); border-radius: 12px; }
.poster .p-steps { display: flex; justify-content: center; gap: 22px; margin-top: 26px; color: var(--text-2); font-weight: 600; flex-wrap: wrap; }
.poster .p-steps span { display: flex; gap: 8px; align-items: center; }
.poster .p-foot { margin-top: 22px; color: var(--muted); font-size: .85rem; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .no-print, .sidebar, .admin-topbar, .topbar, .site-footer { display: none !important; }
  .admin-content { padding: 0 !important; max-width: none; }
  .poster { border: 0; border-radius: 0; padding: 10mm 0; margin: 0; max-width: none; box-shadow: none; }
}


/* =========================================================================
   v3 — Trail-map theme (public site)
   ========================================================================= */
body.site { background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22640%22%20height%3D%22640%22%20viewBox%3D%220%200%20640%20640%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%230E7C7B%22%20stroke-opacity%3D%22.07%22%20stroke-width%3D%221.2%22%3E%3Cpath%20d%3D%22M185.7%20170.0%20L188.6%20174.1%20L189.1%20178.4%20L187.1%20182.3%20L183.0%20185.3%20L178.0%20187.2%20L172.9%20188.3%20L168.5%20189.2%20L164.6%20190.3%20L161.1%20191.5%20L157.6%20192.7%20L153.9%20193.5%20L150.0%20193.6%20L146.2%20193.1%20L142.5%20192.4%20L138.6%20191.9%20L134.3%20191.7%20L129.4%20191.5%20L123.9%20190.9%20L118.7%20189.2%20L114.8%20186.2%20L113.1%20182.2%20L113.9%20177.7%20L116.8%20173.5%20L120.7%20170.0%20L124.1%20167.3%20L126.3%20164.9%20L127.0%20162.4%20L126.7%20159.3%20L126.4%20155.5%20L127.0%20151.6%20L128.9%20148.0%20L132.1%20145.2%20L136.3%20143.5%20L140.8%20142.5%20L145.4%20141.9%20L150.0%20141.6%20L154.7%20141.6%20L159.3%20142.2%20L163.5%20143.9%20L166.8%20146.7%20L168.9%20150.3%20L169.9%20154.1%20L170.3%20157.5%20L171.1%20160.2%20L173.2%20162.3%20L176.7%20164.3%20L181.3%20166.7%20L185.7%20170.0Z%22/%3E%3Cpath%20d%3D%22M224.3%20170.0%20L227.1%20178.1%20L224.8%20186.0%20L218.2%20192.6%20L209.2%20197.3%20L199.9%20200.6%20L191.5%20203.2%20L184.4%20205.8%20L178.0%20208.8%20L171.6%20211.7%20L164.7%20213.9%20L157.4%20215.0%20L150.0%20214.9%20L142.7%20214.2%20L135.3%20213.9%20L127.1%20214.2%20L117.7%20214.8%20L107.2%20214.7%20L96.7%20212.7%20L88.1%20208.0%20L83.3%20200.8%20L83.1%20192.2%20L87.1%20183.5%20L93.3%20176.0%20L99.3%20170.0%20L103.1%20165.1%20L104.0%20160.1%20L102.7%20154.3%20L101.0%20147.3%20L100.7%20139.7%20L103.1%20132.5%20L108.3%20126.5%20L115.5%20122.2%20L123.8%20119.3%20L132.4%20117.3%20L141.1%20115.8%20L150.0%20114.9%20L159.0%20115.1%20L167.7%20117.3%20L175.0%20121.8%20L180.2%20128.2%20L183.3%20135.3%20L185.1%20142.0%20L187.3%20147.1%20L191.5%20150.8%20L198.6%20153.9%20L207.8%20157.6%20L217.2%20162.9%20L224.3%20170.0Z%22/%3E%3Cpath%20d%3D%22M264.8%20170.0%20L263.8%20182.0%20L256.1%20192.7%20L244.3%20201.2%20L231.2%20207.5%20L219.3%20212.6%20L209.3%20217.4%20L200.5%20222.7%20L191.8%20227.9%20L182.2%20232.2%20L171.7%20234.9%20L160.8%20235.8%20L150.0%20235.9%20L139.1%20236.4%20L127.3%20237.8%20L113.7%20240.1%20L98.3%20241.6%20L82.4%20240.5%20L68.4%20235.3%20L59.2%20225.8%20L56.4%20213.2%20L59.8%20199.9%20L67.1%20187.8%20L74.9%20177.9%20L79.8%20170.0%20L80.4%20162.7%20L77.4%20154.4%20L73.3%20144.6%20L71.0%20133.5%20L72.6%20122.5%20L78.5%20112.8%20L87.9%20105.3%20L99.3%2099.7%20L111.4%2095.5%20L123.8%2091.9%20L136.7%2089.1%20L150.0%2087.9%20L163.2%2089.6%20L175.2%2094.9%20L184.5%20103.3%20L190.8%20113.4%20L195.0%20123.1%20L199.2%20130.6%20L205.9%20135.7%20L216.6%20139.2%20L230.7%20143.2%20L245.8%20149.5%20L258.3%20158.6%20L264.8%20170.0Z%22/%3E%3Cpath%20d%3D%22M302.3%20170.0%20L295.1%20185.3%20L281.6%20198.2%20L265.7%20208.4%20L250.9%20216.6%20L238.5%20224.3%20L227.8%20232.2%20L217.4%20240.2%20L205.7%20247.2%20L192.6%20252.2%20L178.5%20255.0%20L164.2%20256.5%20L150.0%20258.3%20L134.9%20261.6%20L117.8%20266.2%20L98.1%20270.3%20L76.9%20271.3%20L57.1%20266.8%20L42.4%20256.1%20L35.5%20240.3%20L36.7%20222.3%20L43.6%20205.2%20L52.0%20191.0%20L57.3%20179.8%20L57.3%20170.0%20L52.2%20159.7%20L44.9%20147.5%20L39.4%20133.3%20L38.7%20118.6%20L44.1%20105.0%20L54.6%2093.6%20L68.2%2084.7%20L83.2%2077.5%20L98.8%2071.1%20L115.0%2065.6%20L132.3%2062.2%20L150.0%2062.3%20L166.9%2067.2%20L181.2%2076.8%20L191.8%2089.2%20L199.4%20101.6%20L206.3%20111.3%20L215.7%20117.5%20L229.9%20121.0%20L248.9%20124.3%20L270.0%20130.2%20L288.6%20140.3%20L300.2%20154.2%20L302.3%20170.0Z%22/%3E%3Cpath%20d%3D%22M333.1%20170.0%20L319.5%20187.8%20L301.9%20202.6%20L284.9%20214.7%20L270.7%20225.7%20L258.8%20236.8%20L247.4%20247.9%20L234.5%20258.0%20L219.2%20266.0%20L202.4%20271.2%20L185.1%20274.8%20L167.9%20278.6%20L150.0%20284.2%20L130.0%20291.8%20L106.6%20299.4%20L80.8%20303.7%20L55.2%20301.3%20L34.4%20290.5%20L22.0%20272.4%20L19.3%20250.2%20L24.2%20228.1%20L31.9%20209.1%20L37.0%20194.2%20L35.8%20182.0%20L28.1%20170.0%20L17.1%20156.0%20L7.3%20139.4%20L3.2%20121.3%20L6.5%20103.7%20L16.8%2088.3%20L31.7%2075.4%20L48.8%2064.5%20L66.7%2054.6%20L85.7%2045.8%20L106.2%2039.1%20L128.1%2036.7%20L150.0%2040.2%20L169.8%2049.9%20L185.6%2063.8%20L197.5%2078.3%20L207.7%2090.0%20L220.1%2097.0%20L237.6%2099.9%20L261.3%20101.7%20L288.3%20106.1%20L313.7%20115.8%20L331.6%20131.1%20L338.2%20150.2%20L333.1%20170.0Z%22/%3E%3Cpath%20d%3D%22M356.1%20170.0%20L338.2%20189.8%20L320.0%20206.4%20L304.7%20221.3%20L292.4%20235.8%20L280.8%20250.3%20L267.4%20263.9%20L250.9%20275.2%20L232.0%20283.6%20L212.1%20289.9%20L192.3%20296.2%20L172.2%20304.6%20L150.0%20315.7%20L124.1%20327.6%20L94.3%20336.3%20L63.4%20337.2%20L36.1%20327.8%20L17.1%20308.5%20L9.0%20282.8%20L10.2%20255.8%20L15.9%20231.9%20L19.8%20213.2%20L17.0%20198.5%20L6.5%20185.1%20L-8.9%20170.0%20L-23.7%20151.7%20L-32.5%20130.9%20L-32.5%20109.5%20L-23.7%2089.8%20L-8.8%2072.5%20L9.3%2057.4%20L28.8%2043.6%20L49.5%2030.7%20L72.4%2020.1%20L97.8%2014.1%20L124.5%2015.1%20L150.0%2023.7%20L171.7%2038.1%20L188.8%2054.2%20L203.1%2067.5%20L218.6%2075.0%20L239.3%2076.9%20L267.1%2076.3%20L299.8%2078.1%20L332.0%2085.9%20L357.0%20101.4%20L369.6%20122.9%20L368.4%20147.0%20L356.1%20170.0Z%22/%3E%3Cpath%20d%3D%22M507.8%20430.0%20L504.6%20433.6%20L501.1%20436.7%20L498.0%20439.3%20L495.4%20441.8%20L493.2%20444.3%20L490.9%20446.7%20L488.0%20448.8%20L484.7%20450.3%20L481.1%20451.4%20L477.5%20452.3%20L473.9%20453.5%20L470.0%20455.2%20L465.5%20457.1%20L460.4%20458.8%20L454.8%20459.3%20L449.7%20458.2%20L445.8%20455.2%20L443.9%20450.9%20L443.8%20446.1%20L444.9%20441.6%20L446.1%20437.9%20L446.3%20435.1%20L445.1%20432.6%20L442.8%20430.0%20L440.2%20426.9%20L438.3%20423.2%20L437.9%20419.4%20L439.1%20415.8%20L441.7%20412.6%20L444.9%20409.9%20L448.4%20407.5%20L452.2%20405.3%20L456.2%20403.4%20L460.7%20402.1%20L465.4%20402.0%20L470.0%20403.2%20L474.0%20405.6%20L477.2%20408.6%20L479.7%20411.3%20L482.2%20413.2%20L485.4%20414.0%20L489.8%20414.1%20L495.4%20414.4%20L501.2%20415.6%20L506.2%20418.0%20L509.1%20421.6%20L509.6%20425.8%20L507.8%20430.0Z%22/%3E%3Cpath%20d%3D%22M537.7%20430.0%20L531.9%20436.5%20L526.6%20442.1%20L522.3%20447.3%20L518.8%20452.5%20L515.0%20457.6%20L510.2%20462.2%20L504.4%20465.9%20L497.9%20468.6%20L491.2%20471.0%20L484.7%20473.9%20L477.8%20477.6%20L470.0%20482.2%20L460.7%20486.4%20L450.3%20488.7%20L440.1%20487.8%20L431.6%20483.2%20L426.3%20475.5%20L424.6%20466.4%20L425.3%20457.5%20L426.5%20450.1%20L426.4%20444.5%20L423.6%20439.9%20L418.6%20435.4%20L412.7%20430.0%20L407.9%20423.5%20L405.8%20416.2%20L406.9%20409.1%20L410.5%20402.5%20L415.8%20396.7%20L421.9%20391.5%20L428.3%20386.5%20L435.4%20382.0%20L443.4%20378.6%20L452.3%20377.3%20L461.5%20378.5%20L470.0%20382.2%20L477.0%20387.2%20L482.7%20392.1%20L487.9%20395.4%20L494.1%20396.6%20L502.4%20396.2%20L512.9%20395.6%20L524.4%20396.6%20L534.8%20400.1%20L541.8%20406.2%20L544.4%20414.1%20L542.5%20422.4%20L537.7%20430.0Z%22/%3E%3Cpath%20d%3D%22M563.1%20430.0%20L556.4%20439.1%20L551.2%20447.4%20L547.1%20455.5%20L542.7%20463.6%20L536.8%20471.0%20L529.2%20477.3%20L520.2%20482.4%20L511.0%20486.8%20L502.0%20491.8%20L492.8%20498.2%20L482.5%20505.9%20L470.0%20513.5%20L455.4%20518.8%20L440.0%20519.4%20L426.3%20514.4%20L416.4%20504.2%20L411.4%20491.1%20L410.2%20477.8%20L410.5%20466.5%20L409.3%20458.1%20L404.6%20451.7%20L396.5%20445.8%20L386.7%20438.8%20L378.1%20430.0%20L373.0%20419.8%20L372.5%20409.1%20L376.2%20398.9%20L382.5%20389.6%20L390.1%20380.9%20L398.4%20372.7%20L407.6%20365.0%20L418.5%20358.6%20L431.2%20355.0%20L444.9%20355.2%20L458.3%20359.1%20L470.0%20365.5%20L479.5%20372.0%20L487.9%20376.5%20L497.1%20377.7%20L508.9%20376.1%20L524.0%20373.7%20L541.0%20373.2%20L557.3%20376.4%20L569.5%20384.1%20L575.5%20395.0%20L575.2%20407.4%20L570.2%20419.5%20L563.1%20430.0Z%22/%3E%3Cpath%20d%3D%22M586.2%20430.0%20L580.8%20441.7%20L576.8%20452.9%20L572.7%20464.0%20L566.7%20474.6%20L558.0%20484.0%20L547.3%20491.9%20L536.0%20498.8%20L525.1%20506.3%20L514.4%20515.7%20L502.5%20527.0%20L487.9%20538.7%20L470.0%20547.9%20L450.0%20551.4%20L430.7%20547.3%20L415.2%20535.8%20L405.4%20519.5%20L400.9%20502.0%20L399.0%20486.8%20L396.0%20475.4%20L389.1%20467.4%20L377.7%20460.6%20L363.6%20452.8%20L350.3%20442.6%20L341.2%20430.0%20L337.9%20416.1%20L340.2%20402.2%20L346.4%20389.0%20L354.5%20376.6%20L363.6%20364.7%20L374.1%20353.3%20L386.9%20343.3%20L402.6%20336.6%20L420.6%20334.6%20L439.1%20337.7%20L455.9%20344.4%20L470.0%20351.9%20L482.0%20357.1%20L494.1%20358.0%20L509.0%20354.7%20L527.9%20349.7%20L550.1%20346.5%20L572.2%20348.2%20L590.4%20356.1%20L601.3%20369.4%20L604.1%20385.6%20L600.3%20402.1%20L593.3%20417.0%20L586.2%20430.0Z%22/%3E%3Cpath%20d%3D%22M609.6%20430.0%20L606.7%20444.4%20L603.7%20458.7%20L598.4%20472.6%20L589.7%20485.3%20L578.1%20496.3%20L565.4%20506.3%20L553.2%20516.7%20L541.6%20529.3%20L529.3%20544.5%20L513.8%20560.8%20L493.8%20574.8%20L470.0%20582.3%20L445.3%20580.4%20L423.5%20568.8%20L407.7%20550.2%20L398.4%20529.2%20L393.1%20510.2%20L387.5%20496.0%20L378.0%20486.5%20L363.2%20479.3%20L344.6%20471.6%20L326.1%20460.8%20L311.9%20446.6%20L304.6%20430.0%20L304.3%20412.5%20L309.1%20395.5%20L316.6%20379.2%20L325.5%20363.3%20L336.1%20347.8%20L349.7%20333.8%20L367.5%20323.1%20L389.1%20317.9%20L412.5%20319.0%20L434.9%20325.1%20L454.0%20332.8%20L470.0%20338.3%20L485.1%20338.5%20L502.4%20333.1%20L524.5%20324.8%20L550.9%20317.9%20L578.7%20316.6%20L603.2%20323.4%20L620.0%20337.9%20L627.3%20357.3%20L626.4%20378.2%20L620.7%20397.7%20L614.3%20414.8%20L609.6%20430.0Z%22/%3E%3Cpath%20d%3D%22M635.2%20430.0%20L634.3%20447.3%20L630.7%20464.5%20L622.9%20480.7%20L611.3%20495.2%20L597.9%20508.5%20L585.1%20522.1%20L573.6%20538.0%20L561.8%20557.2%20L546.8%20578.4%20L526.2%20597.8%20L499.7%20610.3%20L470.0%20612.1%20L441.7%20601.8%20L419.0%20582.2%20L403.6%20558.3%20L393.5%20536.0%20L384.6%20519.1%20L372.1%20508.3%20L353.8%20501.3%20L330.7%20494.4%20L306.7%20484.1%20L286.8%20469.3%20L274.4%20450.6%20L270.2%20430.0%20L272.4%20409.2%20L278.2%20388.9%20L285.7%20368.9%20L295.2%20349.2%20L308.3%20330.8%20L327.1%20315.6%20L351.4%20306.4%20L379.3%20304.4%20L407.2%20308.6%20L431.7%20315.7%20L452.0%20320.8%20L470.0%20320.1%20L489.4%20312.3%20L513.5%20300.1%20L543.2%20288.6%20L576.0%20283.1%20L606.8%20287.4%20L630.2%20301.8%20L643.4%20323.6%20L646.8%20348.4%20L643.9%20372.4%20L639.4%20393.7%20L636.3%20412.5%20L635.2%20430.0Z%22/%3E%3C/g%3E%3C/svg%3E"); background-size: 640px 640px; background-attachment: fixed; }
.topbar { background: rgba(238, 243, 241, .82); border-bottom-color: rgba(19, 35, 58, .08); }
.brand-name { font-family: var(--display); font-size: 1.05rem; letter-spacing: -.01em; }
.brand-mark { background: var(--ink); color: var(--marigold); box-shadow: 0 6px 14px -6px rgba(19, 35, 58, .55); border-radius: 11px; }
.topnav a.active { background: var(--ink); color: #fff; }
.pill-live { color: #075453; background: var(--primary-50); border-color: var(--primary-100); }
.pill-live .dot { animation: none; position: relative; }
.pill-live .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* buttons: tactile press */
.btn { border-radius: 12px; transition: transform .12s ease, box-shadow .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--primary-600); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px rgba(14, 124, 123, .8); }
.btn-primary:hover { background: var(--primary); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 22px -10px rgba(14, 124, 123, .9); }
.btn-secondary { border-color: var(--border-strong); }

/* ----- hero ------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: center; padding: 28px 0 8px; }
.display { font-family: var(--display); font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.6rem); line-height: .98; letter-spacing: -.035em; margin: 0 0 18px; color: var(--ink); text-wrap: balance; }
.hero .lead { font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); color: var(--text-2); max-width: 28em; margin-bottom: 10px; }
.venue { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 600; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.map-board { position: relative; background: #FBFCFB; border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 18px 18px 0; overflow: hidden; }
.map-board::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(14,124,123,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(14,124,123,.06) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.trail { position: relative; width: 100%; height: auto; display: block; overflow: visible; }
.trail-shadow { fill: none; stroke: rgba(19, 35, 58, .06); stroke-width: 14; stroke-linecap: round; }
.trail-route { fill: none; stroke: var(--primary-600); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1 1; animation: draw-route 2.2s .2s cubic-bezier(.6, .05, .3, 1) both; }
.trail-stitch { fill: none; stroke: #FBFCFB; stroke-width: 6; stroke-dasharray: .007 .011; }
@keyframes draw-route { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.pin .pin-body { transform-box: fill-box; transform-origin: center; animation: pin-pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(.35s + var(--i) * .11s); }
@keyframes pin-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pin-halo { fill: rgba(14, 124, 123, .12); }
.pin-dot { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.pin-no { font-family: var(--display); font-weight: 700; font-size: 17px; fill: var(--ink); }
.pin.found .pin-halo { fill: rgba(244, 163, 0, .28); }
.pin.found .pin-dot { fill: var(--marigold); stroke: var(--ink); }
.trail-x path { stroke: #D9352B; stroke-width: 5; stroke-linecap: round; fill: none; }
.trail-x { animation: pin-pop .5s both; animation-delay: calc(.6s + 2s); transform-box: fill-box; transform-origin: center; }

.beacon { position: relative; margin: 6px -18px 0; padding: 18px 22px 20px; background: var(--ink); color: #DCE7E4; border-radius: 0 0 27px 27px; }
.beacon-head { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; color: #fff; }
.beacon-head strong { font-family: var(--display); letter-spacing: -.01em; font-size: 1.25rem; }
.beacon p { margin: 6px 0 0; color: #C3D3CF; }
.beacon .beacon-sub { font-size: .85rem; margin-top: 12px; }
.beacon-dot { width: 12px; height: 12px; border-radius: 50%; background: #7B8A99; position: relative; flex: none; }
.beacon.is-live .beacon-dot { background: #3DDC97; }
.beacon.is-live .beacon-dot::before, .beacon.is-live .beacon-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #3DDC97; animation: ping 2s ease-out infinite; }
.beacon.is-live .beacon-dot::after { animation-delay: 1s; }
.beacon.is-soon .beacon-dot { background: var(--marigold); }
.beacon-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; color: #AFC1BC; }
.beacon-facts li { display: inline-flex; align-items: center; gap: 6px; }
.beacon .countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; max-width: 360px; }
.beacon .countdown div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px 4px; text-align: center; }
.beacon .countdown b { display: block; font-family: var(--display); font-size: 1.55rem; color: var(--marigold); font-variant-numeric: tabular-nums; }
.beacon .countdown span { font-size: .72rem; color: #9FB2AD; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 8px; }
  .map-board { border-radius: 22px; padding: 12px 12px 0; }
  .beacon { margin: 4px -12px 0; border-radius: 0 0 21px 21px; }
}

/* ----- sections --------------------------------------------------------- */
.section { margin-top: 72px; }
.section-title { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); letter-spacing: -.03em; margin-bottom: 6px; }
.section-intro { color: var(--muted); font-size: 1.05rem; max-width: 40em; }

.route-steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.route-steps::before { content: ""; position: absolute; top: 24px; left: 24px; right: 24px; border-top: 3px dashed var(--primary-100); z-index: 0; }
.route-steps li { position: relative; z-index: 1; }
.route-no { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--ink); font-family: var(--display); font-size: 1.3rem; color: var(--ink); margin-bottom: 14px; box-shadow: 0 0 0 6px var(--bg); }
.route-steps li:last-child .route-no { background: var(--marigold); }
.route-steps h3 { font-size: 1.1rem; margin-bottom: 4px; }
.route-steps p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 760px) {
  .route-steps { grid-template-columns: 1fr; gap: 18px; }
  .route-steps::before { top: 24px; bottom: 24px; left: 24px; right: auto; border-top: 0; border-left: 3px dashed var(--primary-100); }
  .route-steps li { display: grid; grid-template-columns: 50px 1fr; gap: 16px; align-items: start; }
  .route-no { margin: 0; }
}

.rules-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.rules { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.rules > div { padding: 18px 0; border-top: 1px solid var(--border); }
.rules dt { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.rules dt .icon { color: var(--primary-600); }
.rules dd { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .rules-wrap { grid-template-columns: 1fr; gap: 12px; } .rules { grid-template-columns: 1fr; } }

.pinboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(44%, 210px), 1fr)); gap: 26px 20px; margin-top: 26px; }
.pinboard figure { margin: 0; background: #fff; padding: 10px 10px 30px; border-radius: 6px; box-shadow: var(--shadow); transform: rotate(var(--r)); transition: transform .25s ease, box-shadow .25s; position: relative; }
.pinboard figure::before { content: ""; position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--marigold); box-shadow: 0 2px 3px rgba(0,0,0,.25), inset -2px -3px 0 rgba(0,0,0,.12); }
.pinboard figure:hover { transform: rotate(0) scale(1.03); box-shadow: var(--shadow-lg); z-index: 2; }
.pinboard img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.help-line { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--muted); margin-top: 48px; }

/* ----- play screens ------------------------------------------------------ */
.stage-no { background: var(--ink); color: var(--marigold); font-family: var(--display); border-radius: 14px; box-shadow: 0 8px 18px -10px rgba(19,35,58,.7); }
.stage-head h1 { font-size: 1.5rem; }
.question { border-left-color: var(--marigold); background: #FFFDF6; font-size: 1.12rem; }
.option { border-radius: 14px; transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; }
.option:active { transform: scale(.985); }
.option:hover { border-color: var(--primary-100); background: #F7FBFA; }
.option:has(input:checked) { border-color: var(--primary-600); background: var(--primary-50); }
.option:has(input:checked) .opt-key { background: var(--ink); color: var(--marigold); }
.option .opt-key { font-family: var(--display); }
.attempts .dot { background: var(--primary-600); }
.progress > span { background: linear-gradient(90deg, var(--primary-600), var(--marigold)); }
.hint-card { background: #FFF8E6; border-color: var(--accent-200); position: relative; overflow: hidden; }
.hint-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.7) 45%, transparent 60%); transform: translateX(-100%); animation: shine 1.4s .5s ease-out both; }
@keyframes shine { to { transform: translateX(100%); } }
.tabs button.active { color: var(--ink); }
.podium .place.p1 { border-color: var(--accent-200); background: linear-gradient(180deg, #FFF8E6, #fff); }
.podium .p1 .medal { background: var(--marigold); color: var(--ink); }
.medal, .rank, .stat .stat-value, .kpi-value { font-family: var(--display); }
.rank-1 { background: #FFE9B0; color: #6B4600; }

/* result feedback (responds to the player's answer) */
.result-icon.result-success { background: var(--marigold); color: var(--ink); box-shadow: 0 0 0 10px rgba(244,163,0,.18); animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-18deg); opacity: 0; } 60% { transform: scale(.92) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.card.shake { animation: shake .45s ease both; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: .95; animation: fall var(--d) cubic-bezier(.25, .6, .4, 1) forwards; animation-delay: var(--delay); }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--rot)); opacity: .9; } }

/* progress map on "My progress" */
.trail-card { padding: 14px; }
.trail-card .trail { max-height: 340px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .confetti { display: none; }
}
