/* ==========================================================================
   /play: a loud, sticker-sheet look that is deliberately separate from the
   rest of ianwurst.com. Chunky ink outlines, hard shadows, candy colours.
   ========================================================================== */

:root {
  --ink: #2a1458;
  --ink-soft: #5b4a86;
  --paper: #f2ecff;
  --card: #ffffff;
  --pink: #ff5da2;
  --sun: #ffc62e;
  --mint: #2edba5;
  --sky: #4cc0ff;
  --orange: #ff8a3d;
  --grape: #7a4dff;

  --accent: var(--pink);          /* swapped by .tint-* */
  --line: 3px;
  --radius: 18px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-small: 3px 3px 0 var(--ink);

  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tint-pink   { --accent: var(--pink); }
.tint-sun    { --accent: var(--sun); }
.tint-mint   { --accent: var(--mint); }
.tint-sky    { --accent: var(--sky); }
.tint-orange { --accent: var(--orange); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(42, 20, 88, .09) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

main { flex: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.block { padding-block: 28px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1120px, 100% - 32px); margin: 0 auto; padding: 18px 0 6px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-dots { display: grid; grid-template-columns: repeat(2, 13px); gap: 3px; }
.brand-dots i { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--ink); }
.brand-dots i:nth-child(1) { background: var(--pink); }
.brand-dots i:nth-child(2) { background: var(--sun); }
.brand-dots i:nth-child(3) { background: var(--mint); }
.brand-dots i:nth-child(4) { background: var(--sky); }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 2rem; letter-spacing: -.02em; line-height: 1; }

.top-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav a {
  text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  border: var(--line) solid transparent;
}
.top-nav a:hover { border-color: var(--ink); background: #fff; }
.top-nav a[aria-current="page"] { background: var(--sun); border-color: var(--ink); }
.top-nav .top-exit { color: var(--ink-soft); font-weight: 500; }

@media (max-width: 560px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .top-nav { gap: 2px; }
  .top-nav a { padding: 6px 10px; }
  .brand-word { font-size: 1.7rem; }
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 44px;
  background: #fff; color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-small);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-small); }
.btn-primary { background: var(--accent); }
.btn-big { min-height: 56px; padding: 14px 26px; font-size: 1.15rem; font-family: var(--font-display); border-radius: 16px; }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: .95rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-danger { background: #ffd9e6; }
.btn[aria-pressed="true"] { background: var(--sun); }

/* -------------------------------------------------------------------- home */
.hero { padding: 34px 0 10px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.hero-title { font-size: clamp(2.3rem, 6vw, 4.2rem); max-width: 18ch; text-wrap: balance; }
.hero-sub { margin-top: 16px; max-width: 52ch; font-size: 1.15rem; color: var(--ink-soft); }

.live-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 999px;
  box-shadow: var(--shadow-small); font-weight: 700;
}
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); flex: none; }

.hero-live { justify-self: start; }

.game-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.game-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-height: 230px; padding: 22px 22px 20px;
  background: var(--accent); color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 24px; box-shadow: 7px 7px 0 var(--ink);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.game-card:hover { transform: translate(-2px, -3px) rotate(-1deg); box-shadow: 10px 10px 0 var(--ink); }
a.game-card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.game-emoji { font-size: 3.6rem; line-height: 1; margin-bottom: 8px; }
.game-title { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.05; }
.game-tag { font-size: 1.05rem; max-width: 26ch; }
.game-meta { margin-top: auto; padding-top: 14px; }
.game-live {
  display: inline-block; padding: 4px 12px; background: #fff; border: 2.5px solid var(--ink);
  border-radius: 999px; font-weight: 700; font-size: .9rem;
}
.game-card-soon {
  background: transparent; box-shadow: none; border-style: dashed; color: var(--ink-soft);
}
.game-card-soon .game-title { font-size: 1.5rem; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--ink-soft); }

/* ---------------------------------------------------------------- lobby list */
.lobby-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lobby-link {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px 16px; align-items: center;
  padding: 14px 16px; background: #fff; text-decoration: none;
  border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-small);
  transition: transform .08s ease, box-shadow .08s ease;
}
.lobby-link:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: #fffbe9; }
.lobby-main { display: flex; flex-direction: column; min-width: 0; }
.lobby-name { font-weight: 700; }
.lobby-status { color: var(--ink-soft); font-size: .92rem; }
.lobby-people { font-size: .95rem; white-space: nowrap; }
.chip {
  padding: 4px 12px; border: 2.5px solid var(--ink); border-radius: 999px;
  font-weight: 700; font-size: .9rem; background: var(--paper); white-space: nowrap;
}
.chip-open { background: var(--mint); }
.empty { color: var(--ink-soft); padding: 6px 2px; }

@media (max-width: 560px) {
  .lobby-link { grid-template-columns: 1fr auto; }
  .lobby-people { grid-column: 1; }
  .lobby-link .chip { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------------------------------------------------------------- game page */
.crumbs { font-size: .95rem; color: var(--ink-soft); margin-bottom: 10px; }
.crumbs a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

.game-head { padding-top: 26px; }
.game-head-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.game-h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.lede { margin-top: 14px; font-size: 1.2rem; max-width: 48ch; }

.start-card {
  padding: 22px; background: var(--accent); border: var(--line) solid var(--ink);
  border-radius: 24px; box-shadow: 7px 7px 0 var(--ink); display: grid; gap: 16px;
}
.start-card h2 { font-size: 1.6rem; }
.choice-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-set legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.choices { display: grid; gap: 10px; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body {
  display: flex; flex-direction: column; padding: 10px 14px; background: #fff;
  border: var(--line) solid var(--ink); border-radius: 14px;
}
.choice-body small { color: var(--ink-soft); font-size: .9rem; }
.choice input:checked + .choice-body { background: var(--ink); color: #fff; }
.choice input:checked + .choice-body small { color: #d9ccff; }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.choice:hover .choice-body { transform: translate(-1px, -1px); box-shadow: var(--shadow-small); }

.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.fine { font-size: .9rem; }
.form-error {
  background: #fff; border: var(--line) solid var(--ink); border-radius: 12px;
  padding: 10px 14px; font-weight: 700;
}

.code-form { margin-top: 26px; max-width: 520px; }
.code-form label { font-weight: 700; display: block; margin-bottom: 8px; }
.code-row { display: flex; gap: 10px; flex-wrap: wrap; }
.code-row input {
  flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 8px 14px; background: #fff;
  border: var(--line) solid var(--ink); border-radius: 14px;
}
.code-form .form-error { margin-top: 10px; }

.how { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.how h2 { font-size: 1.7rem; margin-bottom: 14px; }
.how-list { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; max-width: 56ch; }
.how-list li::marker { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.controls { margin: 0; display: grid; gap: 10px; }
.controls div { display: grid; gap: 2px; padding: 10px 14px; background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; }
.controls dt { font-weight: 700; }
.controls dd { margin: 0; color: var(--ink-soft); }

@media (min-width: 900px) {
  .game-head-grid { grid-template-columns: 1.1fr 1fr; gap: 48px; }
  .how { grid-template-columns: 1.2fr 1fr; gap: 48px; }
}

/* ------------------------------------------------------------- closed lobby */
.closed { text-align: center; padding: 70px 0; display: grid; gap: 16px; justify-items: center; }
.closed-emoji { font-size: 4rem; filter: grayscale(.4); }
.closed h1 { font-size: clamp(2rem, 5vw, 3rem); }
.closed .lede { margin-top: 0; }

/* -------------------------------------------------------------------- lobby */
.lobby-wrap { padding-block: 22px 40px; }
.lobby-bar { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.lobby-title { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.lobby-title small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 1rem; color: var(--ink-soft); letter-spacing: 0; margin-top: 4px; }
.lobby-bar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.conn {
  padding: 6px 14px; background: #fff; border: var(--line) solid var(--ink); border-radius: 999px;
  font-weight: 700; font-size: .92rem;
}
.conn-ok { background: var(--mint); }
.conn-bad { background: #ffd9e6; }

.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 980px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

.stage-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

.seatbar {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-small);
}
.seatbar p { font-weight: 700; }
.seat-actions { display: flex; gap: 10px; }

.stage {
  position: relative; padding: 18px; background: var(--accent);
  border: var(--line) solid var(--ink); border-radius: 24px; box-shadow: 7px 7px 0 var(--ink);
  overflow: hidden; min-width: 0;
}

.banner {
  position: relative; z-index: 5; margin: 16px auto 0;
  width: min(100%, 440px); padding: 16px 20px 18px; text-align: center; cursor: pointer;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink);
  display: grid; gap: 6px; justify-items: center;
  animation: pop .35s cubic-bezier(.2, 1.6, .4, 1);
}
.banner-win { background: #fff4c2; }
.banner-lose { background: #ffe0ec; }
.banner-emoji { font-size: 2.2rem; line-height: 1; }
.banner-title { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.banner-detail { color: var(--ink-soft); }
.banner .btn { margin-top: 8px; }

@keyframes pop {
  from { transform: scale(.7) rotate(-3deg); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.float {
  position: absolute; bottom: -10px; font-size: 2.4rem; line-height: 1;
  display: flex; flex-direction: column; align-items: center;
  animation: float-up 2.5s ease-out forwards;
}
.float-name {
  font-family: var(--font-body); font-size: .72rem; font-weight: 700; margin-top: 2px;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; white-space: nowrap;
}
@keyframes float-up {
  0% { transform: translateY(0) scale(.7); opacity: 0; }
  12% { opacity: 1; transform: translateY(-30px) scale(1.1); }
  100% { transform: translateY(-340px) scale(1); opacity: 0; }
}

.setup {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; padding: 14px 16px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-small);
}
.setup h2 { font-size: 1.25rem; flex-basis: 100%; }
.select { display: grid; gap: 4px; font-weight: 700; flex: 1 1 240px; }
.select select {
  min-height: 44px; padding: 8px 12px; background: var(--paper); font-weight: 500;
  border: var(--line) solid var(--ink); border-radius: 12px;
}

.cheer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cheer-label { font-weight: 700; margin-right: 4px; }
.cheer-btn {
  width: 48px; height: 48px; font-size: 1.5rem; line-height: 1; cursor: pointer; background: #fff;
  border: var(--line) solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink);
  transition: transform .08s ease;
}
.cheer-btn:hover { transform: translateY(-3px) rotate(-6deg); }
.cheer-btn:active { transform: translateY(1px); box-shadow: 0 0 0 var(--ink); }

.side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.panel {
  padding: 16px; background: #fff; border: var(--line) solid var(--ink); border-radius: 20px; box-shadow: var(--shadow-small);
}
.panel h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px;
  background: var(--sun); border: 2.5px solid var(--ink); border-radius: 999px; font-family: var(--font-body); font-size: .9rem;
}
.people { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.person-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .75rem; font-weight: 700; padding: 1px 9px; border: 2px solid var(--ink); border-radius: 999px; white-space: nowrap; }
.tag-you { background: var(--sky); }
.tag-play { background: var(--pink); }

.name-edit { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.name-edit input, .chat-form input {
  min-height: 42px; padding: 8px 12px; background: var(--paper); min-width: 0;
  border: var(--line) solid var(--ink); border-radius: 12px; font-weight: 500;
}

.chat-log {
  list-style: none; margin: 0 0 12px; padding: 0; height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.msg { padding: 6px 12px; background: var(--paper); border-radius: 14px; overflow-wrap: anywhere; align-self: flex-start; max-width: 100%; }
.msg-name { margin-right: 8px; }
.msg-mine { background: #ffe7a3; align-self: flex-end; }
.msg-system { background: transparent; color: var(--ink-soft); font-size: .9rem; padding: 2px 4px; align-self: center; text-align: center; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700;
  transition: transform .2s ease, opacity .2s ease; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* -------------------------------------------------------------- minesweeper */
.ms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: center; }
.ms-hud {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 440px;
  padding: 10px 12px; background: #fff; border: var(--line) solid var(--ink); border-radius: 18px;
}
.ms-counter { display: flex; align-items: center; gap: 6px; min-width: 96px; }
.ms-counter:last-child { justify-content: flex-end; }
.ms-counter output {
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1;
  min-width: 3ch; text-align: center; padding: 4px 8px; background: var(--ink); color: var(--sun);
  border-radius: 10px; font-variant-numeric: tabular-nums;
}
.ms-face {
  width: 56px; height: 56px; font-size: 2rem; line-height: 1; cursor: pointer; background: var(--sun);
  border: var(--line) solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s ease;
}
.ms-face:hover:not([disabled]) { transform: rotate(-8deg) scale(1.05); }
.ms-face:active:not([disabled]) { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.ms-face[disabled] { cursor: default; }

.ms-scroll { width: 100%; overflow-x: auto; padding: 6px 4px 10px; display: flex; }
.ms-board {
  --cell: 36px;
  display: inline-flex; flex-direction: column; margin: 0 auto; padding: 8px; background: var(--ink);
  border-radius: 18px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.ms-row { display: flex; }

.ms-cell {
  width: var(--cell); height: var(--cell); padding: 0; margin: 1px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: calc(var(--cell) * .6); line-height: 1;
  border: 0; border-radius: calc(var(--cell) * .25); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ms-cell.is-hidden {
  background: var(--accent);
  box-shadow: inset 0 calc(var(--cell) * -.12) 0 rgba(42, 20, 88, .28), inset 0 calc(var(--cell) * .08) 0 rgba(255, 255, 255, .55);
  transition: transform .06s ease;
}
.ms-board:not(.is-watching) .ms-cell.is-hidden:hover { transform: translateY(-1px); filter: brightness(1.08); }
.ms-board:not(.is-watching) .ms-cell.is-hidden:active { transform: translateY(2px); }
.ms-cell.is-open { background: #f7f2ff; cursor: default; box-shadow: inset 0 2px 0 rgba(42, 20, 88, .12); }
.ms-board:not(.is-watching) .ms-cell.is-open[class*=" n"] { cursor: pointer; }
.ms-cell.is-flag { font-size: calc(var(--cell) * .55); }
.ms-cell.is-mine { background: #ffe0ec; font-size: calc(var(--cell) * .55); }
.ms-cell.is-boom { background: var(--pink); font-size: calc(var(--cell) * .6); }
.ms-cell.is-wrong { background: #ffe0ec; }
.ms-cell.is-ghost { outline: 3px solid #fff; outline-offset: -3px; box-shadow: 0 0 0 3px var(--ink), 0 0 14px 4px rgba(255, 255, 255, .9); z-index: 1; position: relative; }

.ms-board.is-watching .ms-cell { cursor: default; }
.ms-board.flag-mode .ms-cell.is-hidden { cursor: cell; }

.ms-cell.n1 { color: #1c6dff; }
.ms-cell.n2 { color: #0c9a62; }
.ms-cell.n3 { color: #e4264f; }
.ms-cell.n4 { color: #6a2bff; }
.ms-cell.n5 { color: #d95f00; }
.ms-cell.n6 { color: #008f9e; }
.ms-cell.n7 { color: var(--ink); }
.ms-cell.n8 { color: #7b7399; }

.ms-board.shake { animation: shake .5s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.ms-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; }
.ms-hint { font-size: .9rem; max-width: 40ch; }

/* ------------------------------------------------------------------ profile */
.profile-head { display: flex; align-items: center; gap: 18px; padding-top: 30px; }
.avatar {
  width: 92px; height: 92px; font-size: 3rem; line-height: 1; cursor: pointer; flex: none;
  background: var(--sun); border: var(--line) solid var(--ink); border-radius: 50%; box-shadow: var(--shadow);
  transition: transform .1s ease;
}
.avatar:hover { transform: rotate(-8deg); }
.profile-id { min-width: 0; }
.profile-name {
  display: block; width: min(420px, 100%); font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.1; padding: 2px 8px; margin-left: -8px; background: transparent; color: var(--ink);
  border: var(--line) dashed transparent; border-radius: 12px;
}
.profile-name:hover, .profile-name:focus { border-color: var(--ink); background: #fff; }
.rank {
  display: inline-block; margin-top: 4px; padding: 2px 14px; background: var(--pink);
  border: var(--line) solid var(--ink); border-radius: 999px; font-weight: 700;
}

.empty-card {
  display: grid; gap: 14px; justify-items: start; max-width: 520px; padding: 24px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 24px; box-shadow: 7px 7px 0 var(--ink);
}
.empty-card h2 { font-size: 1.8rem; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat {
  padding: 16px 18px; background: var(--accent); border: var(--line) solid var(--ink);
  border-radius: 20px; box-shadow: var(--shadow-small);
}
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.stat-label { font-weight: 700; margin-top: 6px; }
.stat-note { font-size: .92rem; margin-top: 2px; }

.cal {
  width: fit-content; max-width: 100%;
  display: flex; gap: 5px; overflow-x: auto; padding: 16px; background: #fff;
  border: var(--line) solid var(--ink); border-radius: 20px; box-shadow: var(--shadow-small);
}
.cal-col { display: grid; gap: 5px; grid-template-rows: repeat(7, 18px); }
.cal-cell { width: 18px; height: 18px; border-radius: 6px; background: var(--paper); border: 2px solid rgba(42, 20, 88, .2); }
.cal-cell.cal-future { visibility: hidden; }
.cal-cell.lvl-1 { background: #ffe58a; border-color: var(--ink); }
.cal-cell.lvl-2 { background: var(--sun); border-color: var(--ink); }
.cal-cell.lvl-3 { background: var(--orange); border-color: var(--ink); }
.cal-cell.lvl-4 { background: var(--pink); border-color: var(--ink); }

.variant-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.variant {
  padding: 16px 18px; background: #fff; border: var(--line) solid var(--ink); border-radius: 20px; box-shadow: var(--shadow-small);
}
.variant-name { font-size: 1.1rem; }
.variant-best { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; line-height: 1.1; margin-top: 8px; }
.variant-sub { color: var(--ink-soft); font-size: .92rem; }
.variant-facts { margin: 12px 0 0; display: grid; gap: 4px; }
.variant-facts div { display: flex; justify-content: space-between; gap: 12px; border-top: 2px dotted rgba(42, 20, 88, .25); padding-top: 4px; }
.variant-facts dt { color: var(--ink-soft); }
.variant-facts dd { margin: 0; font-weight: 700; }
.totals { margin-top: 14px; max-width: 64ch; }

.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.recent-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 14px; align-items: center;
  padding: 10px 16px; background: #fff; border: var(--line) solid var(--ink); border-radius: 14px;
}
.recent-row.is-win { border-left-width: 10px; border-left-color: var(--mint); }
.recent-row.is-loss { border-left-width: 10px; border-left-color: var(--pink); }
.recent-what { font-weight: 700; }
.recent-ago { color: var(--ink-soft); font-size: .92rem; }
@media (max-width: 560px) {
  .recent-row { grid-template-columns: auto 1fr auto; }
  .recent-ago { grid-column: 2 / -1; }
}

.data-tools { display: grid; gap: 10px; padding-bottom: 40px; }
.data-tools h2 { font-size: 1.5rem; }
.data-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* ------------------------------------------------------------------- footer */
.foot { width: min(1120px, 100% - 32px); margin: 30px auto 0; padding: 18px 0 28px; color: var(--ink-soft); font-size: .95rem; border-top: 2px dotted rgba(42, 20, 88, .3); }

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .float { animation: none; opacity: 0; }
}
