:root {
  /* Palette aligned to ManaMonday's arcane theme (src/app/globals.css). */
  --bg: #08060f;
  --bg-2: #1a1430;
  --panel: rgba(18, 14, 34, 0.86);
  --panel-border: #2a2348;
  --text: #ece8ff;
  --muted: #9a90c4;
  --gold: #f4c66a;
  --gold-2: #c9a24a;
  --accent: #a779ff;
  --accent-deep: #6d3bd6;
  --yes: #54a663;
  --no: #e0533a;
  --maybe: #f4c66a;
  --unsure: #6b5a8a;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --W: #f8f3d8; --U: #4a9be0; --B: #6b5a8a; --R: #e0533a; --G: #54a663; --C: #b8b3ad;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg);
  /* ManaMonday's layered arcane-nebula glow (globals.css) */
  background-image:
    radial-gradient(60rem 60rem at 80% -10%, rgba(109, 59, 214, 0.18), transparent 60%),
    radial-gradient(50rem 50rem at -10% 20%, rgba(74, 155, 224, 0.12), transparent 55%),
    radial-gradient(40rem 40rem at 50% 120%, rgba(244, 198, 106, 0.08), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sep { color: var(--muted); margin: 0 0.5rem; }
code { background: rgba(255,255,255,0.08); padding: 0.1em 0.4em; border-radius: 6px; font-size: 0.9em; }

.bg-art {
  position: fixed; inset: 0; z-index: -1; opacity: 0.16;
  background-size: cover; background-position: center;
  filter: blur(6px) saturate(1.1);
  transition: background-image 0.6s ease, opacity 0.6s ease;
}

/* ---- Header ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.5rem; position: sticky; top: 0; z-index: 10;
  background: rgba(8, 6, 15, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}
/* Funnel back to the pod/league */
.pod-link { color: var(--gold); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.pod-link:hover { text-decoration: none; color: var(--text); }
.pod-link strong { font-family: "Cinzel", serif; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-orb {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2c8, var(--gold) 45%, #6d3bd6 100%);
  box-shadow: 0 0 18px rgba(232,194,106,0.6);
}
.brand-name { font-family: "Cinzel", serif; font-weight: 700; letter-spacing: 0.06em; font-size: 1.15rem; }
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tabs a {
  color: var(--muted); padding: 0.45rem 0.85rem; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
}
.tabs a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,0.06); }
.tabs a.active { color: #1a1430; background: var(--gold); }

/* ---- Layout ---- */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.screen { animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.panel.center { text-align: center; }
h1 { font-family: "Cinzel", serif; font-weight: 700; margin: 0 0 0.75rem; font-size: 2rem; color: var(--gold); }
h2 { font-family: "Cinzel", serif; font-weight: 600; margin: 0.5rem 0; font-size: 1.4rem; }
h3 { margin: 0 0 0.5rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.row.center { justify-content: center; }
.row.tight { gap: 0.4rem; margin-top: 0; }
.small-row { margin-top: 1.25rem; }
.orb-loader {
  width: 64px; height: 64px; margin: 1.5rem auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2c8, var(--gold) 45%, #6d3bd6 100%);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(0.92); box-shadow: 0 0 10px rgba(232,194,106,0.4);} 50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(232,194,106,0.9);} }

/* ---- Buttons ---- */
.btn {
  appearance: none; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.07); color: var(--text);
  padding: 0.6rem 1.1rem; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.12); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--gold); color: #1a1430; border-color: transparent; }
.btn.primary:hover { background: #f3d283; box-shadow: 0 6px 20px rgba(232,194,106,0.35); }
.btn.big { padding: 0.9rem 1.6rem; font-size: 1.05rem; }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn.small em { font-style: normal; color: var(--muted); font-weight: 500; }
.btn.ghost { background: transparent; }
.btn.yes { background: var(--yes); color: #08231a; border-color: transparent; }
.btn.no { background: var(--no); color: #fff; border-color: transparent; }
.btn.maybe { background: rgba(232,162,58,0.25); border-color: rgba(232,162,58,0.5); }
.btn.unsure { background: rgba(91,107,140,0.35); border-color: rgba(91,107,140,0.6); }
.btn.yes:hover { background: #45d88a; }
.btn.no:hover { background: #ef5f71; }

/* ---- Home ---- */
.hero { text-align: center; padding: 1rem 0 1.5rem; }
.hero h1 { font-size: 2.6rem; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.mode-card {
  position: relative; display: block; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.4rem; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--gold); text-decoration: none; box-shadow: var(--shadow); }
.mode-card h2 { color: var(--gold); font-size: 1.25rem; }
.mode-card p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.mode-icon { font-size: 2rem; }
.badge { position: absolute; top: 1rem; right: 1rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; background: var(--accent); color: #fff; padding: 0.2rem 0.55rem; border-radius: 999px; }
.home-featured { margin-top: 1.5rem; }

/* ---- Oracle ---- */
.oracle-status { display: flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.9rem; flex-wrap: wrap; }
.confidence { flex: 1 1 140px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; margin-left: 1rem; overflow: hidden; }
.confidence div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 0.4s ease; }
.question { font-size: 1.6rem; font-weight: 600; margin: 1.5rem 0; text-align: center; line-height: 1.3; }
.answers { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.answers .btn { min-width: 110px; justify-content: center; }
.suspects { margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; }
.suspects summary { cursor: pointer; }
.suspects ol { margin: 0.5rem 0 0; padding-left: 1.4rem; }
.suspects li span { color: var(--text); }
.card-reveal { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin: 1rem 0; }
.card-reveal > div { flex: 1 1 260px; }
.card-img {
  width: 300px; max-width: 100%; border-radius: 4.75% / 3.5%; box-shadow: 0 14px 40px rgba(0,0,0,0.6);
  background: #1c1638; aspect-ratio: 488 / 680; animation: flip 0.6s ease;
}
@keyframes flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.alt-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.alt-list .btn { font-size: 0.85rem; padding: 0.35rem 0.75rem; }
.oracle-text { white-space: pre-wrap; font-size: 0.95rem; background: rgba(0,0,0,0.25); padding: 0.75rem 1rem; border-radius: 10px; margin: 0.5rem 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0; }
.card-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.card-links .btn { font-size: 0.85rem; padding: 0.35rem 0.8rem; }
.mismatch { list-style: none; padding: 0; margin: 0.5rem 0; }
.mismatch li { padding: 0.4rem 0.6rem; border-radius: 8px; background: rgba(0,0,0,0.25); margin-bottom: 0.35rem; font-size: 0.92rem; }
.mismatch li.bad { border-left: 3px solid var(--no); }
.mismatch li.ok { border-left: 3px solid var(--yes); opacity: 0.7; }

/* ---- Mana symbols ---- */
.ms {
  display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border-radius: 50%;
  font-size: 0.85em; font-weight: 700; color: #111; margin-right: 0.12em; vertical-align: -0.2em;
  box-shadow: -1px 1px 0 rgba(0,0,0,0.6); background: #ccc; font-family: "Inter", sans-serif;
}
.ms-W { background: var(--W); } .ms-U { background: var(--U); color: #fff; } .ms-B { background: var(--B); color: #fff; }
.ms-R { background: var(--R); color: #fff; } .ms-G { background: var(--G); color: #fff; } .ms-C { background: var(--C); }
.ms-gen { background: #cfcac2; } .ms-X { background: #cfcac2; } .ms-T { background: #cfcac2; }
.ms-hybrid { background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); color: #fff; text-shadow: 0 0 2px #000; }
.ms-phy { background: var(--a); color: #fff; }
.ms-big { width: 1.6em; height: 1.6em; font-size: 1em; }

/* ---- Search / autocomplete ---- */
.search-wrap { position: relative; flex: 1 1 260px; }
input[type="text"], select {
  width: 100%; padding: 0.65rem 0.9rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.3); color: var(--text); font: inherit;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
select option { background: #1c1638; }
.autocomplete {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; list-style: none; margin: 0.25rem 0 0; padding: 0.25rem;
  background: #1c1638; border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; max-height: 260px; overflow-y: auto;
  box-shadow: var(--shadow);
}
.autocomplete:empty { display: none; }
.autocomplete li { padding: 0.45rem 0.7rem; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 0.5rem; }
.autocomplete li:hover, .autocomplete li.active { background: rgba(124,92,255,0.35); }
.autocomplete li small { color: var(--muted); }

/* ---- Detective ---- */
.det-modes { display: flex; gap: 1.5rem; align-items: stretch; flex-wrap: wrap; margin: 1.25rem 0; }
.det-modes .btn.primary { flex-direction: column; gap: 0; }
.det-modes .btn.primary small { font-weight: 500; opacity: 0.8; font-size: 0.75rem; }
.det-random { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.det-random label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.stats-row { display: flex; gap: 1.5rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.stats-row strong { color: var(--text); font-size: 1.2rem; display: block; }
.det-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .det-layout { grid-template-columns: 1fr; } }
.det-budget { display: flex; align-items: center; color: var(--muted); margin-bottom: 0.75rem; }
.det-budget strong { color: var(--gold); font-size: 1.2rem; }
.det-clues { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.clue-art {
  width: 150px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; flex: none;
  background: #1c1638 center/cover no-repeat; position: relative; border: 1px solid var(--panel-border);
}
.clue-art.blur { filter: blur(0); }
.clue-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clue-art-veil { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: var(--gold); font-family: "Cinzel", serif; background: radial-gradient(circle, #241d4d, #120f24); }
.clue-lines { flex: 1; min-width: 0; }
.clue-lines p { margin: 0.25rem 0; }
.clue-lines .oracle-text { font-size: 0.88rem; }
.det-guess { display: flex; gap: 0.5rem; align-items: center; }
.hints { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.det-ask input { margin-bottom: 0.5rem; }
.qgroups { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.qgroups button { font-size: 0.75rem; padding: 0.25rem 0.6rem; }
.qgroups button.active { background: var(--accent); border-color: transparent; color: #fff; }
.qlist { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; }
.qlist li { padding: 0.45rem 0.7rem; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.92rem; display: flex; justify-content: space-between; }
.qlist li:hover { background: rgba(124,92,255,0.25); }
.qlist li.asked { opacity: 0.45; cursor: default; }
.qlist li small { color: var(--muted); }
.det-log { margin-top: 1rem; }
.det-log ol { margin: 0; padding-left: 1.3rem; max-height: 280px; overflow-y: auto; font-size: 0.92rem; }
.det-log li { margin-bottom: 0.3rem; }
.det-log .a-yes { color: var(--yes); font-weight: 700; }
.det-log .a-no { color: var(--no); font-weight: 700; }
.det-log .a-hint { color: var(--gold); }
.det-log .a-wrong { color: var(--maybe); }
.feedback { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.2rem; }
.feedback span { font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.08); }
.feedback span.hit { background: rgba(47,191,113,0.3); }
.feedback span.near { background: rgba(232,162,58,0.3); }
.share { background: rgba(0,0,0,0.3); padding: 0.75rem 1rem; border-radius: 10px; white-space: pre-wrap; font-family: inherit; font-size: 0.95rem; }

/* ---- Random ---- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 0.5rem; }
.filter { display: flex; flex-direction: column; gap: 0.4rem; }
.filter > label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.filter label.check { display: flex; align-items: center; gap: 0.5rem; text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 500; color: var(--text); }
.color-chips { display: flex; gap: 0.35rem; }
.chip {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; font-weight: 700; cursor: pointer; opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s; font-family: "Inter", sans-serif;
}
.chip.on { opacity: 1; border-color: var(--gold); transform: scale(1.08); }
.chip.ms-U, .chip.ms-B, .chip.ms-R, .chip.ms-G { color: #fff; }
.history { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.history img { width: 60px; border-radius: 4px; cursor: pointer; opacity: 0.7; transition: opacity 0.15s, transform 0.15s; }
.history img:hover { opacity: 1; transform: translateY(-2px); }

/* ---- Duel ---- */
.duel-score { color: var(--muted); margin-bottom: 1rem; }
.duel-score strong { color: var(--gold); }
.duel-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
@media (max-width: 700px) { .duel-arena { grid-template-columns: 1fr; } .duel-vs { display: none; } }
.duel-vs { font-family: "Cinzel", serif; font-size: 1.6rem; color: var(--gold); }
.duel-card { text-align: center; cursor: pointer; border-radius: 12px; padding: 0.75rem; border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s; }
.duel-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.duel-card.locked { cursor: default; transform: none; }
.duel-card.winner { border-color: var(--yes); }
.duel-card.loser { border-color: var(--no); opacity: 0.7; }
.duel-card img { width: 100%; max-width: 280px; border-radius: 4.75% / 3.5%; box-shadow: 0 14px 40px rgba(0,0,0,0.6); }
.duel-card .rank { margin-top: 0.5rem; font-weight: 700; color: var(--gold); min-height: 1.5em; }

/* ---- Prose / misc ---- */
.prose p { max-width: 70ch; }
.disclaimer { font-size: 0.8rem; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--gold); color: #1a1430; padding: 0.6rem 1.1rem; border-radius: 999px; font-weight: 600; transition: all 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.featured { display: flex; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 1rem; }
.featured img { width: 90px; border-radius: 6px; }
.featured h3 { margin: 0; }
.featured .name { font-weight: 700; font-size: 1.05rem; }
@media (max-width: 600px) {
  .panel { padding: 1.1rem; }
  .question { font-size: 1.3rem; }
  .hero h1 { font-size: 2rem; }
  .topbar { padding: 0.7rem 0.9rem; }
  .tabs a { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
}

/* ManaMonday daily punch card */
.det-punch:empty { display: none; }
.det-punch { margin-top: 0.9rem; }
.punch-card {
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(167, 121, 255, 0.08), rgba(244, 198, 106, 0.05));
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-align: center;
}
.punch-dots { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 0.55rem; }
.punch-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--panel-border);
  background: transparent;
  transition: transform 0.15s ease;
}
.punch-dot.on {
  border-color: var(--gold);
  background: radial-gradient(circle at 35% 30%, var(--gold), var(--gold-2));
  box-shadow: 0 0 8px rgba(244, 198, 106, 0.5);
  transform: scale(1.05);
}
.punch-text { font-size: 0.9rem; color: var(--muted); }
.punch-text strong { color: var(--text); }
.punch-award {
  margin-top: 0.55rem; padding-top: 0.55rem;
  border-top: 1px solid var(--panel-border);
  color: var(--gold); font-weight: 700; font-size: 0.95rem;
}
.punch-note {
  border: 1px dashed var(--panel-border);
  border-radius: 14px; padding: 0.7rem 0.9rem;
  font-size: 0.88rem; color: var(--muted); text-align: center;
}
.punch-note a { font-weight: 600; }
