:root {
  --bg: #060505;
  --panel: #171717;
  --panel-2: #101010;
  --edge: #272727;
  --line: #f97316;
  --gold: #e9b949;
  --silver: #c8ccd4;
  --bronze: #c07a3e;
  --text: #ededed;
  --dim: #8f8f8f;
  --danger: #ef4444;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* our display rules would otherwise win */

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 15px; line-height: 1.5;
}
#stars { position: fixed; inset: 0; pointer-events: none; }
#stars i { position: absolute; background: #fff; border-radius: 50%; }
.wrap { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 24px;
        min-height: 100vh; display: flex; flex-direction: column; }
:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }

/* ---- header ---- */
header { display: flex; align-items: center; justify-content: space-between; gap: 14px;
         padding: 20px 0 14px; border-bottom: 2px solid var(--line); }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.logo img { height: 58px; border-radius: 12px; display: block; }
.wordmark { font-family: Oswald, sans-serif; font-size: 22px; letter-spacing: .1em; line-height: 1.15; }
nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* page tabs, their own line under the header */
.subnav { display: flex; gap: 6px; margin: 14px auto 0; padding: 5px; width: 100%; max-width: 760px;
          background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.subnav a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
            padding: 9px 6px; border-radius: 8px; color: var(--dim); text-decoration: none;
            font-size: 13px; white-space: nowrap; }
.subnav a:hover { background: #212121; color: var(--text); }
.subnav a.on { background: rgba(249,115,22,.14); color: var(--line); }

main { flex: 1; padding: 30px 0 44px; }

h1 { font-family: Oswald, "Arial Narrow", sans-serif; font-weight: 600; letter-spacing: .06em;
     font-size: 27px; margin: 0 0 6px; }
h2 { font-family: Oswald, sans-serif; letter-spacing: .04em; margin: 0 0 10px; }
h1 + .hint, .eyebrow + h1 { margin-bottom: 22px; }
h1 i { color: var(--line); font-size: .8em; }
a { color: var(--line); }
.eyebrow { color: var(--dim); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 4px; }

/* ---- cards ---- */
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px;
        padding: 28px 30px; max-width: 760px; margin: 0 auto 22px;
        box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.card.narrow { max-width: 460px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between;
             gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.card-head h1 { margin: 0; }

/* ---- podium ---- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-bottom: 30px; }
.place { position: relative; flex: 1 1 0; max-width: 33.33%; min-width: 0; display: flex; flex-direction: column;
         align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--edge);
         border-radius: 14px; padding: 16px 10px; text-align: center; }
.place .medal { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
                background: #1d1d1d; color: var(--text); border: 1px solid var(--edge);
                font-family: Oswald, sans-serif; font-size: 17px; line-height: 1; }
.place .pname { overflow-wrap: anywhere; }
.place .ppts { font-family: Oswald, sans-serif; font-size: 27px; line-height: 1; }
.p1 { order: 2; padding-top: 30px; border-color: var(--gold); overflow: hidden; }
.p1::before { content: ""; position: absolute; inset: 0; z-index: 0;
              background: radial-gradient(ellipse at 50% 0%, rgba(233,185,73,.20), transparent 65%); }
.p1 > * { position: relative; }
.p1 .medal { background: var(--gold); border-color: var(--gold); color: #17120a; }
.p1 .ppts { color: var(--gold); }
.p2 { order: 1; padding-top: 22px; }
.p2 .medal { background: var(--silver); border-color: var(--silver); color: #15161a; }
.p3 { order: 3; }
.p3 .medal { background: var(--bronze); border-color: var(--bronze); color: #1a1108; }

/* ---- tables ---- */
.board .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
              padding: 11px 10px; border-radius: 10px; }
.board .row + .row { box-shadow: inset 0 1px 0 var(--edge); }
.board .head { color: var(--dim); font-size: 12px; letter-spacing: .12em;
               text-transform: uppercase; box-shadow: none; }
#board .row { grid-template-columns: 58px 1fr auto 28px; }
.rank { color: var(--dim); }
.pts { text-align: right; font-weight: 700; }
.empty { color: var(--dim); text-align: center; padding: 22px 0; }
.row.pick { cursor: pointer; }
.row.pick:hover { background: #212121; }
.row.pick.selected { background: rgba(249,115,22,.12); box-shadow: inset 3px 0 0 var(--line); }

.info { padding: 0; border: 0; background: none; color: var(--line); font-size: 16px;
        line-height: 1; cursor: pointer; }
.info:hover { color: #ffa94d; }

.searchbox { position: relative; margin-bottom: 12px; }
.searchbox i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.searchbox input { padding-left: 40px; margin-top: 0; }

/* ---- forms ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--line); color: #100c07;
       border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 500;
       cursor: pointer; text-decoration: none; }
.btn:hover { background: #ff8b33; }
.btn.ghost { background: none; color: var(--text); border: 1px solid #3a3a3a; }
.btn.ghost:hover { background: #232323; border-color: #555; }
.btn.danger { background: none; color: var(--danger); border: 1px solid rgba(239,68,68,.5); }
.btn.danger:hover { background: rgba(239,68,68,.12); }
.btn.icon-only { padding: 10px 13px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; background: var(--line); }

form label { display: block; margin-bottom: 16px; color: var(--dim); font-size: 13px; }
input, select { width: 100%; margin-top: 6px; background: #0d0d0d; color: var(--text);
                border: 1px solid #333; border-radius: 10px; padding: 11px 12px; font: inherit; }
input::placeholder { color: #5c5c5c; }
input:focus, select:focus { border-color: var(--line); outline: none; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.inline input, .inline select { width: auto; margin-top: 0; }
.inline.grow { flex: 1; margin-bottom: 0; }
.inline.grow input { flex: 1; min-width: 130px; }
.board .row select { width: auto; margin-top: 0; padding: 7px 10px; }
.picked { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.picked form { margin: 0; }
.picked-name { font-family: Oswald, sans-serif; font-size: 22px; letter-spacing: .03em;
               color: var(--dim); margin: 0 0 16px; }
.picked-name.chosen { color: var(--text); }
.picked-name.chosen::before { content: "\f005"; font: 900 14px "Font Awesome 6 Free";
                              color: var(--line); margin-right: 10px; vertical-align: 2px; }
.hint { color: var(--dim); font-size: 13px; }
.flash { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto 20px;
         background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.45);
         border-radius: 10px; padding: 11px 15px; }
.flash i { color: var(--line); }

.stepper { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.stepper input { text-align: center; margin-top: 0; max-width: 150px;
                 font-family: Oswald, sans-serif; font-size: 22px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--edge);
         border-radius: 16px; padding: 26px; min-width: 320px; max-width: 92vw;
         box-shadow: 0 24px 60px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.72); }
dialog ul { list-style: none; padding: 0; margin: 0 0 18px; }
dialog li { display: flex; justify-content: space-between; gap: 24px; padding: 9px 0;
            border-bottom: 1px solid var(--edge); }
dialog li:last-child { border-bottom: 0; }
dialog form { display: flex; gap: 10px; }
pre { background: #0d0d0d; border: 1px solid var(--edge); padding: 14px; border-radius: 10px;
      overflow-x: auto; margin: 0 0 18px; }

footer { border-top: 2px solid var(--line); padding: 14px 0 24px; text-align: center;
         color: var(--dim); font-size: 12px; }
footer p { margin: 3px 0; }
footer i { color: var(--line); }
.readme { color: var(--gold); }

.card.center { text-align: center; }
.card.center .stepper, .card.center form > .btn { justify-content: center; }
.card.center .stepper { max-width: 300px; margin-inline: auto; }
.card.center .hint { max-width: 48ch; margin-inline: auto; }
.card.center form > .btn { display: flex; width: fit-content; margin: 0 auto; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { padding: 0 14px; }
  header { padding: 14px 0 10px; }
  .logo img { height: 44px; }
  .logo { gap: 10px; }
  .wordmark { font-size: 15px; letter-spacing: .05em; }
  .btn { padding: 9px 12px; gap: 6px; }
  main { padding: 26px 0; }
  h1 { font-size: 21px; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .podium { gap: 7px; }
  .place { padding: 12px 6px; font-size: 13px; gap: 6px; }
  .place .medal { width: 28px; height: 28px; font-size: 13px; }
  .p1 { padding-top: 20px; }
  .p2 { padding-top: 15px; }
  .place .ppts { font-size: 22px; }
  #board .row { grid-template-columns: 30px 1fr auto 24px; padding: 10px 6px; }
  .board .row { padding: 10px 6px; }
  .subnav { gap: 4px; padding: 4px; }
  .subnav a { font-size: 12px; gap: 6px; padding: 9px 4px; }
}
@media (max-width: 380px) { .wordmark { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
