/* The player portal (me/index.php, js/me.js): phone-first, one column of cards. Same colours as the remote and the game. */
:root {
  color-scheme: dark;
  --bg: #0b0d1c; --panel: #14173a; --panel2: #1b1f4a; --line: #2c3168; --ink: #eef0ff; --muted: #a3a9d6;
  --cyan: #5eeaff; --pink: #ff5cbe; --yellow: #ffd64a; --green: #5af096; --red: #ff6b7a; --gold: #f5c542;
  --display: Bungee, "Arial Black", Impact, sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(620px 420px at 0% -10%, #2c1640 0, transparent 70%), var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-tap-highlight-color: transparent; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
code { font-family: var(--mono); color: var(--yellow); font-size: .92em; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }

.top { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding-block: calc(env(safe-area-inset-top, 0px) + 14px) 6px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { font-family: var(--display); font-size: 16px; text-decoration: none; background: linear-gradient(90deg, var(--cyan), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ghost { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.ghost:hover { color: var(--ink); border-color: #4a52a0; }

.wrap { max-width: 760px; margin: 0 auto; padding-block: 8px 48px; display: flex; flex-direction: column; gap: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 6px; font: 400 18px var(--display); letter-spacing: .02em; }
.card h2 + .small { margin-top: 0; }
.quiet { background: transparent; }

/* signed out */
.signin .hero { text-align: center; padding: 28px 18px; }
.signin h1 { font: 400 clamp(26px, 6vw, 36px) var(--display); margin: 6px 0; }
.signin .lede { color: var(--muted); max-width: 46ch; margin: 0 auto 18px; }
.sampleBall { width: 120px; height: 120px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 12px 20px; font-weight: 800; text-decoration: none; border: 0; cursor: pointer; }
.btn.primary { background: #9146ff; color: #fff; }
.btn.primary:hover { background: #a970ff; }

/* the ball */
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ballBox { width: 150px; height: 150px; flex: none; }
.ballBox svg { width: 100%; height: 100%; }
.who { flex: 1 1 220px; min-width: 0; }
.who h1 { font: 400 clamp(24px, 5vw, 32px) var(--display); margin: 0; overflow-wrap: anywhere; }
.who p { margin: 4px 0 0; }
.who .note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: -5px; margin-right: 6px; }

/* colours */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff 0 9%, var(--c) 32%, var(--c) 72%, #000 140%); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.sw.chat { background: conic-gradient(#ff5cbe, #ffd64a, #5af096, #5eeaff, #b48cff, #ff5cbe); }
.sw[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--cyan); }

/* hats */
.hats { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.hats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; background: var(--panel2); border: 2px solid transparent; border-radius: 14px; cursor: pointer; min-width: 0; }
.hat svg { width: 100%; max-width: 72px; aspect-ratio: 1; }
.hat span { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.hat small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.hat[aria-checked="true"] { border-color: var(--cyan); background: #1f2a5a; }
.hat:hover:not(:disabled) { border-color: #4a52a0; }
.hat.locked { cursor: default; opacity: .9; }
.hat.locked span { color: var(--muted); }
.hat.mastery { background: linear-gradient(180deg, #2a2412, var(--panel2)); }
.hat.mastery:not(.locked) span { color: var(--gold); }
.coll + .coll { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ch h3 { margin: 0; font-size: 16px; }
.ch .count { font-weight: 800; color: var(--cyan); }
.coll .small { margin: 2px 0 8px; }
.prog { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; font-size: 13px; color: var(--ink); }
.prog .bar { height: 8px; border-radius: 99px; background: #0f1230; overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 99px; }
.prog.done { color: var(--gold); font-weight: 800; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.stat { background: var(--panel2); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font: 400 22px var(--display); color: var(--ink); }
.stat span { font-size: 12px; color: var(--muted); }

/* streams */
.channels { list-style: none; margin: 0; padding: 0; }
.channels li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.channels li:first-child { border-top: 0; }
.channels a { font-weight: 700; text-decoration: none; }

/* forget me */
.forget { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }
.danger { background: var(--red); color: #2a0509; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #10132e; border: 1px solid var(--green); color: var(--ink); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 14px; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--red); }

@media (max-width: 560px) {
  .hats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { justify-content: center; text-align: center; }
  .ballBox { width: 130px; height: 130px; }
}
/* race awards (newest first) */
.awardlist .awname { font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--pink); }
.awardlist a { font-weight: 700; color: var(--ink); text-decoration: none; }
