/* Oracle League — functional, mobile-first styling (P8: no polish) */
:root {
  --bg: #0f1420;
  --panel: #1a2233;
  --panel-2: #222d44;
  --text: #e8edf7;
  --muted: #93a0b8;
  --accent: #4f8cff;
  --yes: #2fbf71;
  --no: #e05252;
  --warn: #e0a13c;
  --border: #2c3a57;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a {
  padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600;
  white-space: nowrap;
}
.tabs a.active { background: var(--panel-2); color: var(--text); }
.tabs a:hover { text-decoration: none; }

/* layout */
.view { max-width: 860px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
/* SO11: daily-challenge hero card on home (accent border) */
.card.challenge-card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.challenge-card h3 { color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { flex: 1 1 220px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }

.stat { font-size: 28px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* buttons */
.btn {
  display: inline-block; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); color: var(--text);
  padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; padding: 8px 12px; }
.btn-yes { background: var(--yes); border-color: var(--yes); color: #06281a; }
.btn-no { background: var(--no); border-color: var(--no); color: #2b0808; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* forms */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"],
input[type="search"], input[type="date"],
select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit;
}

/* filter bars (SO14): events list + history */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px;
}
.filter-bar > * { width: auto; flex: 1 1 auto; max-width: 100%; }
.filter-bar .btn { flex: 0 0 auto; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* predict panel */
.side-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.side-btn {
  padding: 22px 10px; font-size: 22px; font-weight: 800; letter-spacing: 0.06em;
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer;
}
.side-btn.selected-yes { border-color: var(--yes); background: rgba(47, 191, 113, 0.15); color: var(--yes); }
.side-btn.selected-no { border-color: var(--no); background: rgba(224, 82, 82, 0.15); color: var(--no); }
.side-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.conf-value { font-size: 24px; font-weight: 800; }

/* badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-OPEN { color: var(--yes); border-color: var(--yes); }
.badge-PUBLISHED { color: var(--accent); border-color: var(--accent); }
.badge-LOCKED, .badge-AWAITING_RESOLUTION { color: var(--warn); border-color: var(--warn); }
.badge-RESOLVED { color: var(--muted); }
.badge-DRAFT, .badge-REVIEW { color: var(--muted); }
.badge-CANCELLED, .badge-VOID { color: var(--no); border-color: var(--no); }
.badge-diff-easy { color: var(--yes); }
.badge-diff-medium { color: var(--warn); }
.badge-diff-hard { color: var(--no); }
/* ADR-025: premium event (higher fee / ×1.5 XP) — gold, no glow (it is a
   toll, not a reward). */
.badge-premium { color: #e8b93d; border-color: #e8b93d; }

/* ADR-025: entry-fee line on the event-detail predict card. */
.entry-fee {
  padding: 8px 10px; margin-top: 8px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 14px;
}

/* ADR-025: admin create-form checkbox row. */
.checkline {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; cursor: pointer;
}

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr.me-row td { background: rgba(79, 140, 255, 0.12); }
/* stacked admin log rows (SO17 smoke-gate fix): audit log + abuse report —
 * text flows within the card width at any viewport; long JSON is expandable */
.log-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: none; }
.log-row-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.log-row-top .k { color: var(--muted); font-size: 12px; }
.log-spacer { margin-left: auto; }
.log-json {
  margin-top: 6px; padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
.log-more summary { cursor: pointer; color: var(--text); }
.log-more summary:hover { color: var(--accent); }

/* result / feedback */
.result-correct { color: var(--yes); font-weight: 800; }
.result-wrong { color: var(--no); font-weight: 800; }
.delta-pos { color: var(--yes); font-weight: 700; }
.delta-neg { color: var(--no); font-weight: 700; }
.banner {
  padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px;
  font-weight: 600; border: 1px solid var(--border);
}
.banner-locked { background: rgba(224, 161, 60, 0.12); border-color: var(--warn); }
.banner-error { background: rgba(224, 82, 82, 0.12); border-color: var(--no); }
.banner-info { background: rgba(79, 140, 255, 0.12); border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 50;
  max-width: 90vw;
}

/* misc */
.event-list-item { display: block; padding: 12px 14px; margin-bottom: 10px; }
.event-list-item:hover { text-decoration: none; background: var(--panel-2); }
.event-title { font-weight: 700; font-size: 16px; color: var(--text); }
.spacer { flex: 1; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--accent); }

/* notifications (SO10, ADR-010) */
.notif-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: var(--no); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}
.notif { margin-bottom: 8px; cursor: pointer; }
.notif-unread { border-left: 3px solid var(--accent); background: rgba(79, 140, 255, 0.07); }

/* achievements (SO15, ADR-014) */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.badge-card {
  border: 1px solid var(--line, #333); border-radius: 8px; padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.badge-card .badge-name { font-weight: 600; }
.badge-card .badge-desc { color: var(--muted); margin-top: 2px; }
.badge-locked { opacity: 0.45; }

/* achievement gems (ADR-023): pure CSS clip-path gems — no image assets.
   One shared silhouette (table / girdle / culet); identity comes from the
   hue ramp. Owned = full color + soft glow; locked = grayscale (the card
   itself is already dimmed). */
.gem {
  display: inline-block; width: 18px; height: 16px; flex: none;
  vertical-align: -3px; margin-right: 6px;
  position: relative;
  clip-path: polygon(25% 0, 75% 0, 100% 40%, 50% 100%, 0 40%);
  background: linear-gradient(135deg, var(--g1), var(--g2) 50%, var(--g3));
}
.gem::after { /* specular glint on the upper-left facet */
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(25% 0, 50% 0, 40% 62%, 0 40%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
}
.gem-silver   { --g1: #f5f8fb; --g2: #c3ceda; --g3: #8fa0b1; --glow: rgba(190, 205, 220, 0.55); }
.gem-gold     { --g1: #fff2c2; --g2: #f2c14e; --g3: #c08a1d; --glow: rgba(242, 193, 78, 0.60); }
.gem-diamond  { --g1: #ffffff; --g2: #c9ecff; --g3: #7db8dd; --glow: rgba(160, 215, 255, 0.70); }
.gem-ruby     { --g1: #ffb3b3; --g2: #d81b5a; --g3: #7e0d31; --glow: rgba(216, 27, 90, 0.55); }
.gem-emerald  { --g1: #b6f2cf; --g2: #2fbf71; --g3: #116e42; --glow: rgba(47, 191, 113, 0.50); }
.gem-fire-opal{ --g1: #ffd9a0; --g2: #ff8a3d; --g3: #d63a26; --glow: rgba(255, 138, 61, 0.60); }
/* Ingot shape (Jason, 2026-09-11 round 2): silver/gold render as bars, the
   other four keep the gem silhouette. */
.gem.gem-bar {
  width: 20px; height: 13px;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, var(--g1), var(--g2) 55%, var(--g3));
}
.gem.gem-bar::after {
  clip-path: polygon(20% 0, 55% 0, 40% 100%, 5% 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0));
}
.badge-card:not(.badge-locked) .gem { filter: drop-shadow(0 0 3px var(--glow)); }
.badge-locked .gem { filter: grayscale(1); }

/* comments (SO23) */
.comment {
  border-top: 1px solid var(--border); padding: 10px 0;
}
.comment:first-child { border-top: none; }
.comment-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-top .badge { margin: 0; }
.cmt-actions { margin-left: auto; display: flex; gap: 10px; }
.comment-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: break-word; }
.link-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 12px; padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--text); }

/* SHELLS economy (ADR-024): Lucky Oracle slot + topbar wallet chip.
   Pure CSS/emoji — no image assets (same discipline as the gems). */
.shell-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); white-space: nowrap;
}
.shell-chip:hover { text-decoration: none; border-color: var(--accent); }

.oracle { max-width: 560px; margin: 0 auto; text-align: center; }
.oracle-sub { color: var(--muted); margin: 0 0 16px; }
.oracle-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
}
.chip b { color: var(--text); }
.chip-shell { border-color: var(--accent); }
.chip-shell b { color: var(--accent); }

.slot {
  display: inline-block; padding: 18px 22px; margin-bottom: 16px;
  background: var(--panel); border: 2px solid var(--border); border-radius: 16px;
}
.slot-reels { display: flex; gap: 10px; }
.slot-reel {
  width: 72px; height: 84px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}
.slot-cell { font-size: 44px; line-height: 1; display: inline-block; }
.slot-cell.slot-land { animation: slot-land 0.45s ease-out; }
@keyframes slot-land {
  0%   { transform: translateY(-40px) rotate(-12deg); opacity: 0.2; }
  60%  { transform: translateY(6px) rotate(3deg); opacity: 1; }
  100% { transform: translateY(0) rotate(0); }
}
.oracle-result {
  margin: 12px 0; font-size: 17px; font-weight: 800; min-height: 24px;
}
.oracle-history {
  list-style: none; margin: 10px 0 0; padding: 0; text-align: left;
}
.oracle-history li {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 14px; background: var(--panel);
}
.oracle-history li:first-child { border-radius: 8px 8px 0 0; }
.oracle-history li:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }

/* ── Insights Shop (SO-L7, ADR-038) ───────────────────────────────────── */

/* A5 reveal: coin burst on purchase — pure CSS, fixed nth-child
 * positions, no RNG, never affects outcomes (anti-gambling). */
#coin-reveal { position: fixed; inset: 0; pointer-events: none; z-index: 99; }
#coin-reveal .coin {
  position: absolute; left: 50%; top: 45%; font-size: 22px; opacity: 0;
}
#coin-reveal.play .coin { animation: coin-burst 1.3s ease-out forwards; }
#coin-reveal.play .coin:nth-child(1)  { --dx: -170px; --dy: -130px; animation-delay: 0ms; }
#coin-reveal.play .coin:nth-child(2)  { --dx: 150px;  --dy: -150px; animation-delay: 30ms; }
#coin-reveal.play .coin:nth-child(3)  { --dx: -90px;  --dy: -180px; animation-delay: 60ms; }
#coin-reveal.play .coin:nth-child(4)  { --dx: 200px;  --dy: -60px;  animation-delay: 0ms; }
#coin-reveal.play .coin:nth-child(5)  { --dx: -210px; --dy: -40px;  animation-delay: 45ms; }
#coin-reveal.play .coin:nth-child(6)  { --dx: 60px;   --dy: -190px; animation-delay: 20ms; }
#coin-reveal.play .coin:nth-child(7)  { --dx: -30px;  --dy: -160px; animation-delay: 75ms; }
#coin-reveal.play .coin:nth-child(8)  { --dx: 110px;  --dy: -120px; animation-delay: 50ms; }
#coin-reveal.play .coin:nth-child(9)  { --dx: -130px; --dy: -90px;  animation-delay: 90ms; }
#coin-reveal.play .coin:nth-child(10) { --dx: 30px;   --dy: -140px; animation-delay: 10ms; }
#coin-reveal.play .coin:nth-child(11) { --dx: 170px;  --dy: -170px; animation-delay: 65ms; }
#coin-reveal.play .coin:nth-child(12) { --dx: -190px; --dy: -160px; animation-delay: 40ms; }
@keyframes coin-burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15) rotate(200deg); }
}

/* per-event shop card */
.shop-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.shop-row:first-of-type { border-top: none; }
.shop-row-col { flex-direction: column; align-items: flex-start; }
.oracle-word {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; max-width: 560px;
}
.league-pulse { padding-top: 6px; }

/* insights board */
.daily-hint {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-top: 8px;
}
.track-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 4px 0; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.track-row:first-child { border-top: none; }
.vault-brief { padding: 10px 0; border-top: 1px solid var(--border); }
.vault-brief:first-of-type { border-top: none; }
.vault-top { display: flex; justify-content: space-between; gap: 8px; }
