/* Cryptex League
   Deep navy ground with layered light, electric blue for anything you can act on,
   one colour per challenge category, green for solved. */
:root {
  --ink: #060b1a;
  --ink-2: #0c1530;
  --ink-3: #132044;
  --line: #213560;
  --line-2: #2f4a85;
  --paper: #eaf0ff;
  --soft: #93a6d1;
  --blue: #4d9bff;
  --blue-2: #76b6ff;
  --cyan: #5fe3ff;
  --mint: #45e0b0;
  --rose: #ff7d95;
  --gold: #ffcf5c;
  --h: var(--blue);
  --display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --glass: rgba(13, 23, 52, 0.72);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; position: relative;
  color: var(--paper); font: 400 1.0625rem/1.6 var(--body);
  background: radial-gradient(1200px 700px at 0% 0%, #0d1c44 0%, transparent 65%), linear-gradient(180deg, #07102a 0%, #050a18 100%);
  background-attachment: fixed;
}
/* The background is one drawing: the logo's labyrinth as fine line work, set off the top right corner
   with a second, smaller one low on the left. */
body::before, body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; aspect-ratio: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 800 800%22 fill=%22none%22 stroke=%22%234d9bff%22 stroke-width=%221.1%22 stroke-linecap=%22round%22%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22380%22 stroke-dasharray=%222317.6 70%22 transform=%22rotate%28-40 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22330%22 stroke-dasharray=%222013.5 60%22 transform=%22rotate%28120 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22280%22 stroke-dasharray=%221695.3 64%22 transform=%22rotate%2810 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22230%22 stroke-dasharray=%221393.1 52%22 transform=%22rotate%28200 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22180%22 stroke-dasharray=%221083.0 48%22 transform=%22rotate%2880 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%22130%22 stroke-dasharray=%22776.8 40%22 transform=%22rotate%28300 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%2280%22 stroke-dasharray=%22468.7 34%22 transform=%22rotate%28160 400 400%29%22/%3E%3Cpath d=%22M400 20V70%22 transform=%22rotate%2830 400 400%29%22/%3E%3Cpath d=%22M400 20V70%22 transform=%22rotate%28150 400 400%29%22/%3E%3Cpath d=%22M400 20V70%22 transform=%22rotate%28255 400 400%29%22/%3E%3Cpath d=%22M400 70V120%22 transform=%22rotate%2880 400 400%29%22/%3E%3Cpath d=%22M400 70V120%22 transform=%22rotate%28215 400 400%29%22/%3E%3Cpath d=%22M400 70V120%22 transform=%22rotate%28320 400 400%29%22/%3E%3Cpath d=%22M400 120V170%22 transform=%22rotate%28130 400 400%29%22/%3E%3Cpath d=%22M400 120V170%22 transform=%22rotate%28290 400 400%29%22/%3E%3Cpath d=%22M400 170V220%22 transform=%22rotate%2820 400 400%29%22/%3E%3Cpath d=%22M400 170V220%22 transform=%22rotate%28170 400 400%29%22/%3E%3Cpath d=%22M400 220V270%22 transform=%22rotate%28240 400 400%29%22/%3E%3Cpath d=%22M400 220V270%22 transform=%22rotate%2860 400 400%29%22/%3E%3Cpath d=%22M400 270V320%22 transform=%22rotate%28110 400 400%29%22/%3E%3Cpath d=%22M400 270V320%22 transform=%22rotate%28330 400 400%29%22/%3E%3Ccircle cx=%22400%22 cy=%22400%22 r=%229%22 fill=%22%23ffcf5c%22 stroke=%22none%22/%3E%3C/svg%3E") center / contain no-repeat;
}
body::before { width: min(1250px, 150vw); top: -420px; right: -380px; opacity: 0.3; }
body::after { width: min(760px, 110vw); bottom: -420px; left: -300px; opacity: 0.2; transform: rotate(140deg); }
.top, main, .foot { position: relative; z-index: 1; }
main { flex: 1; padding-bottom: 5rem; }
a { color: var(--blue-2); text-underline-offset: 0.2em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: 0.94em; }
code { background: var(--ink-3); padding: 0.1em 0.38em; border-radius: 4px; }
.wrap { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); color: var(--ink); padding: 0.5rem 0.8rem; z-index: 10; }
.lede { font-size: 1.12rem; color: var(--soft); max-width: 60ch; }
.fine { font-size: 0.9rem; color: var(--soft); margin: 0; }
.dim { color: var(--soft); }

/* ---- top bar ---- */
.top { border-bottom: 1px solid var(--line); background: rgba(6, 11, 26, 0.78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; flex-wrap: wrap; padding-block: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--paper); text-decoration: none; font: 700 1.25rem/1 var(--display); letter-spacing: 0.02em; }
.mark { width: 2.3rem; height: 2.3rem; flex: none; filter: drop-shadow(0 0 8px rgba(77, 155, 255, 0.7)); }
.crest { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.emblem { width: 7.5rem; height: 7.5rem; filter: drop-shadow(0 0 22px rgba(77, 155, 255, 0.55)); }
.foot-brand { display: flex; align-items: center; gap: 0.7rem; }
.foot-brand .mark { width: 1.9rem; height: 1.9rem; filter: none; }
.links { display: flex; gap: 1.5rem; margin-right: auto; }
.links a { color: var(--soft); text-decoration: none; font-weight: 500; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.links a:hover { color: var(--paper); }
.links a[aria-current] { color: var(--paper); border-bottom-color: var(--blue); }
.who { display: flex; align-items: center; gap: 0.7rem; }
.who form { margin: 0; }
.me { font-family: var(--mono); font-size: 0.95rem; color: var(--paper); text-decoration: none; }
.me:hover { color: var(--blue-2); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font: 600 0.98rem/1 var(--body); text-decoration: none;
  padding: 0.72rem 1.1rem; border-radius: 8px; border: 1.5px solid transparent;
  background: linear-gradient(180deg, #62a9ff, #2f7df0); color: #041029;
  box-shadow: 0 0 0 1px rgba(118, 182, 255, 0.5) inset, 0 8px 24px -8px rgba(47, 125, 240, 0.9);
}
.btn:hover { background: linear-gradient(180deg, #86bfff, #4a92ff); color: #041029; }
.btn.quiet { background: rgba(19, 32, 68, 0.6); color: var(--paper); border-color: var(--line-2); box-shadow: none; }
.btn.quiet:hover { border-color: var(--blue); background: var(--ink-3); color: var(--paper); }
.btn.big { padding: 0.98rem 1.45rem; font-size: 1.05rem; }
.btn.small { padding: 0.45rem 0.7rem; font-size: 0.88rem; border-radius: 6px; }
.btn.warn { background: transparent; border-color: var(--rose); color: var(--rose); box-shadow: none; }
.btn.warn:hover { background: var(--rose); color: #041029; }

/* ---- messages ---- */
.flash { margin: 1.25rem 0 0; padding: 0.85rem 1.1rem; border-radius: 8px; border-left: 4px solid; background: var(--glass); font-weight: 500; }
.flash.ok, .result.ok { border-color: var(--mint); color: var(--mint); }
.flash.err, .result.err { border-color: var(--rose); color: var(--rose); }
.note { border: 1px dashed var(--line-2); background: rgba(77, 155, 255, 0.08); padding: 1rem 1.2rem; border-radius: 8px; margin: 1.5rem 0; overflow-wrap: anywhere; }
.note p:last-child { margin-bottom: 0; }
.empty { color: var(--soft); padding: 2rem 0; font-size: 1.05rem; }
.empty.small { padding: 0.5rem 0; font-size: 0.95rem; margin: 0; }

/* ---- shared pieces ---- */
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.3rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.panel h3 { margin-bottom: 1rem; }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--h); box-shadow: 0 0 10px var(--h); flex: none; }
.bar { display: block; height: 8px; border-radius: 99px; background: rgba(147, 166, 209, 0.18); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--h), #fff); box-shadow: 0 0 12px var(--h); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; column-gap: 0.7rem; align-items: baseline; font-size: 0.95rem; line-height: 1.4; }
.feed .dot { transform: translateY(-1px); }
.feed .gain { font-family: var(--mono); color: var(--mint); font-size: 0.88rem; }
.feed time { grid-column: 2 / 4; color: var(--soft); font-size: 0.82rem; }
.plink { color: var(--paper); font-weight: 600; text-decoration: none; }
.plink:hover { color: var(--blue-2); text-decoration: underline; }
.prog { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 1rem; }
.prog li { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 0.75rem; font-size: 0.95rem; }
.prog .frac { font-family: var(--mono); color: var(--soft); font-size: 0.88rem; }
.prog .bar { grid-column: 1 / 3; }
.avatar {
  display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; flex: none;
  font: 700 1.25rem/1 var(--display); color: #041029; letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--cyan), var(--blue)); 
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}

/* ---- home ---- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
#rain { display: none; }
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem) 2rem; }
.season { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; font-weight: 500; color: var(--paper); border: 1px solid var(--line-2); background: var(--glass); border-radius: 99px; padding: 0.35rem 0.9rem; margin-bottom: 1.5rem; }
.live { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(69, 224, 176, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(69, 224, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(69, 224, 176, 0); } }
.hero h1 { font-size: clamp(2.6rem, 6.6vw, 5rem); line-height: 1.02; letter-spacing: -0.01em; min-height: 3.06em; margin-bottom: 1.5rem; overflow-wrap: break-word; }
.hero h1 .enc { color: var(--cyan); font-family: var(--mono); font-weight: 500; letter-spacing: -0.06em; text-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }
.wheel { justify-self: center; width: min(100%, 440px); aspect-ratio: 1; filter: drop-shadow(0 0 30px rgba(77, 155, 255, 0.35)); }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel text { font-family: var(--mono); font-size: 15px; text-anchor: middle; dominant-baseline: central; }
.wheel .outer text { fill: var(--paper); }
.wheel .inner text { fill: var(--cyan); }
.wheel .ring { fill: #081230; stroke: var(--line-2); stroke-width: 1.5; }
.wheel .inner { transform-origin: 220px 220px; transition: transform 1.9s cubic-bezier(0.3, 0.1, 0.1, 1); }
.wheel .pointer { stroke: var(--mint); stroke-width: 2; }
.statline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.5rem 0 2.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.statline div { padding: 1.1rem 1.4rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.statline div:last-child { border-right: 0; }
.statline dd { margin: 0; font: 700 2rem/1.1 var(--display); color: var(--paper); }
.statline dt { color: var(--soft); font-size: 0.92rem; }
.band { padding-top: clamp(3rem, 6vw, 4.5rem); }
.band h2 { margin-bottom: 1.5rem; }
.two { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps li { counter-increment: step; padding: 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 8px; font: 700 1.05rem/1 var(--display); color: #041029; background: linear-gradient(135deg, var(--cyan), var(--blue)); margin-bottom: 1rem; }
.steps h3 { margin-bottom: 0.5rem; }
.steps p { color: var(--soft); font-size: 0.97rem; margin: 0; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cat { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cat .art { display: block; width: 100%; height: 130px; border-bottom: 1px solid var(--line); }
.cat-body { padding: 1.3rem 1.4rem 1.4rem; }
.cat h3 { font-size: 1.35rem; margin-bottom: 0.6rem; color: var(--h); }
.cat p { color: var(--soft); font-size: 0.97rem; }
.cat .count { margin: 0; color: var(--paper); font-family: var(--mono); font-size: 0.9rem; }

/* ---- page heads, HUD ---- */
.page-head { padding: clamp(2rem, 5vw, 3.25rem) 0 1.75rem; }
.page-head h1 { margin-bottom: 0.6rem; }
.head-in { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.hud { display: flex; gap: 1rem; flex-wrap: wrap; align-items: stretch; }
.level { display: flex; gap: 1rem; align-items: center; border: 1px solid var(--line-2); border-radius: 14px; background: var(--glass); padding: 0.8rem 1.1rem; min-width: 18rem; }
.lv-badge { display: grid; place-items: center; align-content: center; width: 3.6rem; height: 3.6rem; flex: none; color: #041029; background: linear-gradient(135deg, var(--cyan), var(--blue)); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.lv-badge small { font-size: 0.6rem; font-weight: 600; line-height: 1; }
.lv-badge b { font: 700 1.5rem/1 var(--display); }
.lv-body { flex: 1; display: grid; gap: 0.4rem; }
.lv-title { margin: 0; font: 600 1.15rem/1.1 var(--display); }
.mine { display: flex; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.mine div { padding: 0.85rem 1.25rem; border-right: 1px solid var(--line); }
.mine div:last-child { border-right: 0; }
.mine dt { font-size: 0.82rem; color: var(--soft); }
.mine dd { margin: 0; font: 700 1.35rem/1.3 var(--display); white-space: nowrap; }
.ident { display: flex; align-items: center; gap: 1.1rem; }
.ident .avatar { width: 4.6rem; height: 4.6rem; font-size: 1.6rem; }
.ident h1 { margin-bottom: 0.3rem; }
.ident .lede { margin: 0; font-size: 1rem; }
.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter a { text-decoration: none; color: var(--soft); border: 1px solid var(--line); background: var(--glass); padding: 0.4rem 0.95rem; border-radius: 999px; font-size: 0.95rem; font-weight: 500; }
.filter a:hover { color: var(--paper); border-color: var(--blue); }
.filter a[aria-current] { background: var(--blue); color: #041029; border-color: var(--blue); font-weight: 600; }
.arena-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.arena-grid h2 { margin: 0 0 1rem; }
.arena-grid h2:not(:first-child) { margin-top: 2.75rem; }
.side { display: grid; gap: 1rem; position: sticky; top: 5.5rem; }

/* ---- challenge tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.tile {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  color: var(--paper); text-decoration: none; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
a.tile:hover { border-color: var(--h); color: var(--paper); transform: translateY(-3px); box-shadow: 0 14px 36px -16px var(--h); }
.tile-art { position: relative; height: 104px; border-bottom: 1px solid var(--line); }
.art { display: block; width: 100%; height: 100%; }
.tile-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.15rem 1.05rem; }
.tile-top { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.84rem; color: var(--soft); margin-bottom: 0.6rem; align-items: center; }
.catname { color: var(--h); font-weight: 500; }
.tile h3 { font-size: 1.28rem; margin-bottom: 0.45rem; }
.first { font-size: 0.86rem; color: var(--soft); margin: 0 0 auto; padding-bottom: 0.9rem; }
.first b { color: var(--paper); font-weight: 600; }
.tile-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.9rem; color: var(--soft); border-top: 1px solid var(--line); padding-top: 0.75rem; }
.points { font-family: var(--mono); color: var(--gold); font-weight: 500; }
.diff { border-radius: 4px; padding: 0.05rem 0.45rem; font-weight: 600; font-size: 0.78rem; background: rgba(147, 166, 209, 0.14); color: var(--paper); }
.d-medium { color: var(--gold); }
.d-hard { color: var(--rose); }
.d-vault { color: #041029; background: var(--gold); }
a.cat { display: block; color: var(--paper); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
a.cat:hover { border-color: var(--h); transform: translateY(-3px); color: var(--paper); }
.cat .go { display: inline-block; margin-top: 1rem; color: var(--h); font-weight: 600; font-size: 0.95rem; }
.packsteps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.packsteps .form { margin: 0; padding: 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); gap: 0.8rem; align-content: start; }
.packsteps h3 { font-size: 1.05rem; }
.tick { position: absolute; top: 0.6rem; right: 0.6rem; font-size: 0.78rem; font-weight: 600; color: #041029; background: var(--mint); border-radius: 99px; padding: 0.15rem 0.6rem; box-shadow: 0 0 16px rgba(69, 224, 176, 0.7); }
.tile.solved { border-color: rgba(69, 224, 176, 0.6); }
.tile.solved .state { color: var(--mint); font-weight: 600; }
.tile.spent .state { color: var(--rose); }
.tile.locked .art { filter: grayscale(1) brightness(0.55); }
.veil { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(135deg, rgba(6, 11, 26, 0.35) 0 10px, rgba(6, 11, 26, 0.6) 10px 20px); color: var(--paper); }
.lock { width: 2.1rem; height: 2.1rem; filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.9)); }
.tile.locked { border-style: dashed; }
.tile.locked h3, .tile.locked .catname, .tile.locked .points { color: var(--soft); }
.tile.locked .state { color: var(--paper); font-weight: 600; }

/* ---- single challenge ---- */
.solve { max-width: 860px; padding-top: 2rem; }
.editor { max-width: 760px; padding-top: 2rem; }
.back { margin-bottom: 1.5rem; font-size: 0.95rem; }
.sheet { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet-art { height: 150px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: clamp(1.25rem, 4vw, 2.25rem); }
.sheet-body .first { padding-bottom: 1.5rem; }
.sheet h1 { margin-bottom: 0.6rem; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.editor h1 { margin-bottom: 1.5rem; }
.prose p { max-width: 68ch; }
.cipher {
  font: 500 1.15rem/1.6 var(--mono); background: #040917; border: 1px solid var(--line); border-left: 4px solid var(--h);
  padding: 1.1rem 1.3rem; border-radius: 8px; margin: 0 0 1.25rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--paper);
}
.result { font-size: 1.1rem; font-weight: 600; border-left: 4px solid; padding: 1rem 1.2rem; background: rgba(4, 9, 23, 0.6); border-radius: 8px; margin: 2rem 0 0; }

/* ---- forms ---- */
.narrow { width: min(520px, 100% - 2.5rem); margin-inline: auto; margin-top: clamp(2rem, 6vw, 4rem); padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.narrow h1 { margin-bottom: 1rem; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.form { display: grid; gap: 1.25rem; margin-top: 1.75rem; justify-items: start; }
.form.wide { max-width: 760px; }
.field { display: grid; gap: 0.4rem; width: 100%; }
.field > span, legend { font-weight: 600; font-size: 0.98rem; }
.field small { color: var(--soft); font-size: 0.88rem; line-height: 1.45; }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  width: 100%; font: 400 1.05rem/1.4 var(--body); color: var(--paper);
  background: #040917; border: 1.5px solid var(--line-2); border-radius: 8px; padding: 0.75rem 0.9rem; color-scheme: dark;
}
textarea { font-family: var(--mono); font-size: 0.95rem; resize: vertical; }
input.mono { font-family: var(--mono); }
input::placeholder { color: #5f73a3; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(95, 227, 255, 0.25); border-radius: 8px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; width: 100%; min-width: 0; }
legend { padding: 0; margin-bottom: 0.7rem; }
.choice { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.85rem 1rem; border: 1.5px solid var(--line-2); border-radius: 8px; cursor: pointer; background: rgba(4, 9, 23, 0.5); }
.choice:hover { border-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: rgba(77, 155, 255, 0.14); }
.choice input { accent-color: var(--blue); width: 1.15rem; height: 1.15rem; margin: 0.22rem 0 0; flex: none; }
.alt { margin: 1.75rem 0 0; color: var(--soft); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; width: 100%; }
.answer { margin-top: 2rem; }
.inline { display: inline; margin: 0; }
.rowform { grid-template-columns: minmax(0, 320px) auto; align-items: end; margin-top: 1rem; }
.danger { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.danger h2 { font-size: 1.3rem; }
.danger p { color: var(--soft); margin: 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.board { width: 100%; border-collapse: collapse; font-size: 1rem; }
.board th { text-align: left; font-weight: 500; font-size: 0.85rem; color: var(--soft); padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(33, 53, 96, 0.6); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.board th.num { font-family: var(--body); }
.board td.rank { width: 4.5rem; color: var(--soft); }
.board td.rank span { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 8px; padding: 0 0.3rem; }
.board .p1 .rank span { background: var(--gold); color: #041029; font-weight: 600; box-shadow: 0 0 16px rgba(255, 207, 92, 0.6); }
.board .p2 .rank span { background: #c9d6f2; color: #041029; font-weight: 600; }
.board .p3 .rank span { background: #e39a6b; color: #041029; font-weight: 600; }
.board .player { font-weight: 600; }
.board .player a { color: var(--paper); }
.board .player small { display: block; font-weight: 400; color: var(--soft); font-size: 0.82rem; }
.board .uni { color: var(--soft); font-family: var(--mono); font-size: 0.9rem; }
.board .pts { color: var(--gold); font-weight: 500; }
.board .when { color: var(--soft); font-size: 0.88rem; white-space: nowrap; }
.board .self td { background: rgba(77, 155, 255, 0.14); }
.board .self .plink::after { content: " (you)"; color: var(--cyan); font-weight: 400; }
.board .acts { text-align: right; white-space: nowrap; }
.board .acts > * { margin-left: 0.4rem; }
.pill { display: inline-block; font-size: 0.8rem; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--soft); white-space: nowrap; font-weight: 500; }
.pill.on { border-color: var(--mint); color: var(--mint); }
.admin h2 { margin: 3rem 0 1rem; }
.admin h2:first-of-type { margin-top: 1rem; }
.admin .sub { font: 400 1rem var(--mono); color: var(--soft); }
.domains { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.domains li { display: flex; align-items: center; gap: 0.75rem; }

/* ---- timed rounds ---- */
.roundbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; padding: 0.8rem 1.1rem; margin: 0 0 1.5rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--glass); }
.roundbar p { margin: 0; flex: 1 1 16rem; }
.roundbar.on { border-color: var(--mint); box-shadow: 0 0 28px -10px var(--mint); }
.clock { font-family: var(--mono); font-weight: 500; font-size: 1.1em; color: var(--gold); font-variant-numeric: tabular-nums; }
.roundbar.on .clock { color: var(--mint); }
.tick.timed { background: var(--gold); box-shadow: 0 0 16px rgba(255, 207, 92, 0.6); }
.roundform { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; margin: 1.25rem 0 0; }
.hero .roundbar { margin: 0 0 1.25rem; }

/* ---- podium ---- */
.podium-row { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: end; }
.podium-row li { position: relative; display: grid; justify-items: center; gap: 0.3rem; text-align: center; padding: 1.6rem 1rem 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); --m: #e39a6b; border-top: 3px solid var(--m); }
.podium-row .p1 { order: 2; padding-top: 2.4rem; padding-bottom: 2rem; --m: var(--gold); box-shadow: 0 20px 50px -24px var(--gold); }
.podium-row .p2 { order: 1; --m: #c9d6f2; }
.podium-row .p3 { order: 3; }
.podium-row .place { position: absolute; top: -1rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--m); color: #041029; font: 700 1rem var(--display); }
.podium-row .plink { font-size: 1.15rem; font-family: var(--display); }
.podium-row small { color: var(--soft); font-size: 0.84rem; overflow-wrap: anywhere; }
.podium-row b { font-family: var(--mono); color: var(--gold); font-weight: 500; }

/* ---- badges ---- */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.badges li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: center; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.badges b { display: block; font-family: var(--display); font-size: 1.05rem; }
.badges small { color: var(--soft); font-size: 0.86rem; line-height: 1.35; display: block; }
.medal { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; color: var(--soft); border: 1.5px dashed var(--line-2); }
.medal svg { width: 1.5rem; height: 1.5rem; }
.badges .got { border-color: rgba(255, 207, 92, 0.55); }
.badges .got .medal { color: #041029; border: 0; background: radial-gradient(circle at 35% 30%, #fff3c9, var(--gold) 60%, #c98f1a); box-shadow: 0 0 20px rgba(255, 207, 92, 0.55); }
.badges li:not(.got) b { color: var(--soft); }

/* ---- text pages ---- */
.prose-page { width: min(720px, 100% - 2.5rem); }
.prose-page h2 { margin: 2.5rem 0 0.75rem; font-size: 1.45rem; }
.prose-page ul { padding-left: 1.2rem; }
.prose-page li { margin-bottom: 0.6rem; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); color: var(--soft); font-size: 0.92rem; background: rgba(6, 11, 26, 0.6); }
.foot-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.5rem; }
.foot p { margin: 0; }

@media (max-width: 1000px) {
  .arena-grid, .two { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .wheel { width: min(70%, 300px); order: -1; justify-self: start; }
  .hero h1 { min-height: 0; }
  .cats { grid-template-columns: 1fr; }
  .statline { grid-template-columns: 1fr 1fr; }
  .statline div:nth-child(2) { border-right: 0; }
  .statline div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .wrap, .prose-page { width: calc(100% - 2rem); }
  .narrow { width: calc(100% - 2rem); }
  .top { position: static; }
  .links { order: 3; width: 100%; margin: 0; gap: 1.2rem; }
  .who { margin-left: auto; }
  .steps { grid-template-columns: 1fr; }
  .hud, .mine, .level { width: 100%; min-width: 0; }
  .mine div { flex: 1; padding: 0.7rem 0.8rem; }
  .rowform { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  .ranks .uni { display: none; }
  .board th, .board td { padding: 0.7rem 0.7rem; }
  .podium-row { grid-template-columns: 1fr; }
  .podium-row li, .podium-row .p1 { order: 0; padding: 1.5rem 1rem 1.1rem; }
  .badges li { grid-template-columns: auto 1fr; }
  .badges .pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wheel .inner, .tile { transition: none; }
  .live { animation: none; }
  a.tile:hover { transform: none; }
}
