/* Vòng Xoay Tình Bạn, look A "Đêm Đấu": a fight-night poster printed in two riso inks.
   Paper ground, blue corner vs red corner. Change colors and fonts in the tokens below, not in the components. */
:root {
  color-scheme: light;
  --paper: #F1F2EE;
  --paper-2: #E4E6E0;
  --card: #FAFAF7;
  --ink: #16171C;
  --ink-2: #2B2C34;
  --muted: #5D6068;
  --line: rgba(22, 23, 28, .14);
  --line-2: rgba(22, 23, 28, .30);
  --blue: #0E6FC0;
  --blue-ink: #0A5596;
  --blue-soft: #D5E4F2;
  --red: #E5412F;
  --red-ink: #B42E1F;
  --red-soft: #F7DAD3;
  --yellow: #FFD62E;
  --yellow-soft: #FFF0A6;
  --white: #FFFFFF;
  --f-display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 6px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --halftone: radial-gradient(rgba(0, 0, 0, .2) 1.1px, transparent 1.4px);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(22, 23, 28, .06) 1px, transparent 1.3px);
  background-size: 10px 10px;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue-ink); }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; font-weight: 600; }

/* ---------- App shell ---------- */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) 12px;
  background: var(--paper);
}
.wordmark {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(23px, 6.6vw, 30px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}
.mis { position: relative; display: inline-block; color: var(--blue); }
.mis::after {
  content: attr(data-t);
  position: absolute;
  inset: 0;
  color: var(--red);
  mix-blend-mode: multiply;
  transform: translate(.045em, -.03em);
  pointer-events: none;
}
.status-pill {
  margin-left: auto;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 9px 4px;
  border: 1.5px dashed var(--line-2);
  border-radius: 999px;
  color: var(--muted);
}

/* Tabs: a bar at the bottom on phones, inline in the header on wide screens. */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 4px;
  padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: var(--card);
  border-top: 1.5px solid var(--ink);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.tab-ic { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background .18s, color .18s; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab[aria-current="page"] .tab-ic { background: var(--ink); color: var(--paper); }
@media (min-width: 900px) {
  .app { padding-bottom: 48px; }
  .tabs {
    position: static;
    display: flex;
    padding: 3px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--card);
  }
  .tab { flex-direction: row; gap: 7px; min-height: 0; padding: 8px 14px 8px 10px; border-radius: 999px; font-size: 13.5px; }
  .tab-ic { width: auto; height: auto; background: none !important; color: inherit !important; }
  .tab:hover { background: var(--paper-2); }
  .tab[aria-current="page"] { background: var(--ink); color: var(--paper); }
}

/* ---------- Page parts ---------- */
.view:focus { outline: none; }
.page { display: grid; gap: 18px; padding-top: 6px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.h1 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(44px, 9vw, 72px);
  line-height: .84;
  text-transform: uppercase;
  letter-spacing: .005em;
  text-shadow: 3px 2px 0 rgba(229, 65, 47, .85);
  text-wrap: balance;
}
.h2 { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 30px; line-height: .9; text-transform: uppercase; }
.count {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 12.5px;
  padding: 5px 10px 4px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-variant-numeric: tabular-nums;
}
.count.full { background: var(--yellow); }
.hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.label {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.section { display: grid; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink-2); }
.btn.danger { border-color: var(--red-ink); color: var(--red-ink); }
.btn.danger.solid { background: var(--red); border-color: var(--ink); color: var(--white); }
.btn.big { min-height: 52px; padding: 12px 22px; font-size: 16px; font-weight: 700; }
.btn[aria-pressed="true"] { background: var(--yellow); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .38; cursor: default; transform: none; }
.btn.icon { padding: 0; width: 44px; }
.btn svg { flex: none; }

/* Tooltips: hover or keyboard focus only, after a short delay. */
@media (hover: hover) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translate(-50%, 4px);
    width: max-content;
    max-width: 230px;
    padding: 6px 9px;
    border-radius: 5px;
    background: var(--ink);
    color: var(--paper);
    font: 500 12px/1.35 var(--f-body);
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 40;
  }
  [data-tip][data-tip-end]::after { left: auto; right: 0; transform: translate(0, 4px); }
  [data-tip][data-tip-below]::after { bottom: auto; top: calc(100% + 9px); }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .45s; }
  [data-tip][data-tip-end]:hover::after, [data-tip][data-tip-end]:focus-visible::after { transform: none; }
}

/* ---------- Small shared pieces ---------- */
.av {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding-top: .06em;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--av, var(--paper-2));
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
}
.av.sm { width: 30px; height: 30px; font-size: 17px; }
.tag {
  display: inline-block;
  padding: 3px 5px 2px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.lanes { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .04em;
  line-height: 1;
  padding: 4px 6px 3px;
  border: 1.2px dashed var(--line-2);
  border-radius: 3px;
  color: var(--muted);
  transition: background .25s, color .25s, border-color .25s;
}
.lc.on { background: var(--c, var(--ink)); border: 1.2px solid var(--c, var(--ink)); color: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 28px 24px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--card);
}
.empty p { margin: 0; max-width: 46ch; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 4px 4px 0 rgba(22, 23, 28, .25);
  animation: toast-in .25s var(--ease-out);
}
@media (min-width: 900px) { .toast { bottom: 28px; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Chia đội (tonight) ---------- */
.pick-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 8px; }
.pick {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.pick:hover { border-color: var(--ink); }
.pick[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pick[aria-pressed="true"] .av { border-color: var(--paper); }
.pick[aria-pressed="true"] .lanes { color: rgba(241, 242, 238, .75); }
.pick[aria-disabled="true"] { opacity: .5; }
.pick .meta { display: grid; min-width: 0; line-height: 1.25; }
.pick .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.pick .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick[aria-pressed="true"] .tag { background: var(--yellow); color: var(--ink); }

.seg { display: inline-flex; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); }
.seg button {
  appearance: none;
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
}
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg button:disabled { color: var(--muted); cursor: not-allowed; }

.fx-pick { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-pick legend { padding: 0; margin-bottom: 10px; }
.fx-opt {
  position: relative;
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 12px 12px 13px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.fx-opt:hover { border-color: var(--ink); }
.fx-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fx-opt:has(input:checked) { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.fx-opt:has(input:focus-visible) { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.fx-name { display: flex; align-items: center; gap: 6px; font-family: var(--f-display); font-weight: 900; font-size: 22px; line-height: 1; text-transform: uppercase; }
.fx-desc { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
@media (max-width: 420px) { .fx-desc { display: none; } .fx-name { font-size: 19px; } }

.split-bar {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}
@media (min-width: 900px) { .split-bar { bottom: 18px; } }
.split-bar .msg { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.split-bar .msg.ok { color: var(--ink); }
.link-btn { appearance: none; border: 0; background: none; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Đội hình (roster) ---------- */
.rows { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--card); overflow: hidden; }
.row { border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; color: inherit; text-decoration: none; }
.row a:hover { background: var(--paper); }
.row .meta { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.row .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chev { color: var(--muted); flex: none; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn:has(.file-input:focus-visible) { outline: 2.5px solid var(--blue); outline-offset: 2px; }

/* Player form */
.form { display: grid; gap: 22px; max-width: 640px; }
.field { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { font-family: var(--f-mono); font-weight: 600; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; padding: 0; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  font-size: 16px;
}
.input::placeholder { color: rgba(93, 96, 104, .7); }
textarea.input { min-height: 104px; resize: vertical; line-height: 1.45; }
.lane-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.lane-btn {
  position: relative;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
}
.lane-btn[aria-pressed="true"] { background: var(--blue); color: var(--white); }
.lane-btn .rk {
  position: absolute;
  top: -9px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
}
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; min-height: 44px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 48px; height: 28px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-2); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--ink); transition: transform .18s var(--ease-out); }
.switch input:checked + .track { background: var(--yellow); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.ranges { display: grid; gap: 10px; }
.range-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.range-row input { width: 100%; accent-color: var(--ink); }
.range-row output { font-family: var(--f-mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.subhead { display: grid; gap: 4px; padding-top: 6px; border-top: 1.5px dashed var(--line-2); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions .danger-zone { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.err { margin: 0; color: var(--red-ink); font-weight: 600; font-size: 13.5px; }

/* ---------- Thẻ (cards) ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.mini {
  position: relative;
  display: grid;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.mini:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.mini-band { height: 58px; background-color: var(--blue); background-image: var(--halftone); background-size: 7px 7px; }
.mini .av { position: absolute; left: 12px; top: 26px; width: 58px; height: 58px; font-size: 32px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.mini-body { display: grid; gap: 2px; padding: 34px 12px 12px; min-width: 0; }
.mini-name { padding-top: .08em; font-family: var(--f-display); font-weight: 900; font-size: 26px; line-height: 1.08; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-title { font-family: var(--f-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .dad { position: absolute; right: 10px; top: 10px; background: var(--paper); color: var(--ink); }

.card-page { display: grid; gap: 14px; justify-items: center; }
.card-page .bar { width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard {
  position: relative;
  width: 100%;
  max-width: 420px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.pcard-band { position: relative; height: 128px; background-color: var(--blue); background-image: var(--halftone); background-size: 7px 7px; overflow: hidden; }
.pcard-wm { position: absolute; right: -4px; bottom: -36px; font-family: var(--f-display); font-weight: 900; font-size: 176px; line-height: .8; color: rgba(255, 255, 255, .14); pointer-events: none; }
.pcard-tags { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; }
.pcard-tags .tag { font-size: 11px; padding: 5px 7px 4px; background: var(--paper); color: var(--ink); }
.pcard-tags .tag.dad { background: var(--ink); color: var(--paper); }
.pcard-no { position: absolute; right: 14px; top: 16px; font-family: var(--f-mono); font-weight: 600; font-size: 11px; letter-spacing: .1em; color: var(--white); }
.pcard .av { position: absolute; left: 18px; top: 74px; width: 100px; height: 100px; font-size: 58px; border-width: 2.5px; box-shadow: 5px 5px 0 var(--ink); }
.pcard-id { padding: 22px 18px 0 136px; min-height: 64px; }
.pcard-name { font-family: var(--f-display); font-weight: 900; font-size: 64px; line-height: .82; text-transform: uppercase; text-shadow: 3px 2px 0 rgba(229, 65, 47, .85); overflow-wrap: anywhere; }
.pcard-title { margin-top: 8px; font-family: var(--f-mono); font-weight: 600; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats { list-style: none; margin: 0; padding: 18px 18px 4px; display: grid; gap: 9px; }
.stats li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.stats .bar { height: 8px; border-radius: 2px; background: rgba(22, 23, 28, .12); overflow: hidden; }
.stats .bar i { display: block; height: 100%; width: var(--v, 0%); background: var(--blue); }
.stats li.fun .bar i { background: var(--ink); }
.stats b { font-family: var(--f-mono); font-weight: 600; font-size: 12.5px; text-align: right; }
.stats li.na { color: var(--muted); }
.stats .sep { display: block; border-top: 1px dashed rgba(22, 23, 28, .28); margin: 1px 0; }
.skill { margin: 10px 18px 0; padding: 10px 12px 11px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--yellow); display: grid; gap: 3px; }
.skill .k { font-family: var(--f-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.skill .n { font-family: var(--f-display); font-weight: 900; font-size: 26px; line-height: .95; text-transform: uppercase; }
.skill .t { font-size: 13px; font-weight: 500; line-height: 1.35; }
.pcard-quote { margin: 0; padding: 14px 18px 16px; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.card-page .hint { max-width: 420px; }
@media (max-width: 380px) {
  .pcard-id { padding-left: 128px; }
  .pcard-name { font-size: 54px; }
}

/* ---------- Mở màn (reveal overlay) ---------- */
.reveal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(22, 23, 28, .06) 1px, transparent 1.3px);
  background-size: 10px 10px;
}
.rv-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.rv-top .wordmark { font-size: 24px; }
.rv-top .seg { margin-left: auto; }
.rv-top .seg button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { .rv-top .seg .lbl { display: none; } .rv-top .wordmark { font-size: 17px; white-space: normal; max-width: 6.5em; line-height: .95; } .rv-top .seg button { padding: 8px 10px; } }
.rv-gap { margin-left: auto; }
.reveal.watching .cta { display: none; } /* "tap to continue" is for the admin's phone only */
.rv-main {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
@media (max-width: 899px) { .rv-main { grid-template-columns: minmax(0, 1fr); } }
.rv-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1.5px solid var(--ink);
  background: var(--card);
}
.rv-controls .prog { margin-left: auto; font-family: var(--f-mono); font-weight: 600; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-controls .hint { flex-basis: 100%; font-size: 12.5px; }
.follow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
@media (max-width: 560px) { .rv-controls .btn .lbl-opt { display: none; } .rv-controls .btn.opt { width: 44px; padding: 0; } }

/* The box sets the stage size; the stage inside uses size containment for its cqw/cqh units. */
.stage-box { position: relative; width: min(100%, calc((100svh - 190px) * 16 / 9)); aspect-ratio: 16 / 9; margin-inline: auto; }
@media (max-width: 720px) { .stage-box { aspect-ratio: 4 / 5; width: min(100%, calc((100svh - 230px) * 4 / 5)); } }
.stage {
  position: absolute;
  inset: 0;
  container: stage / size;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--paper-2);
  background-image: radial-gradient(rgba(22, 23, 28, .08) 1px, transparent 1.3px);
  background-size: 10px 10px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
}
.stage.done { cursor: default; }
.stage:fullscreen { border: 0; border-radius: 0; }
.stage::backdrop { background: var(--paper); }
.scene { position: absolute; inset: 0; }
.flash { position: absolute; inset: 0; z-index: 13; background: var(--white); pointer-events: none; }
.fx { position: absolute; inset: 0; z-index: 14; width: 100%; height: 100%; pointer-events: none; }

/* Result board */
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--card); }
.bh { padding: 9px 12px 7px; background: var(--c); color: var(--white); font-family: var(--f-display); font-weight: 900; font-size: 20px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.bh.blue { --c: var(--blue); }
.bh.red { --c: var(--red); text-align: right; }
.bh.mid { display: grid; place-items: center; padding: 9px 10px; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-weight: 600; font-size: 11px; }
.bslot { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 50px; padding: 8px 12px; border-top: 1px solid var(--line); }
.bslot.red { flex-direction: row-reverse; text-align: right; }
.bwho { display: grid; min-width: 0; line-height: 1.25; }
.bname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bnum { display: grid; place-items: center; padding: 0 10px; border-top: 1px solid var(--line); background: var(--paper-2); font-family: var(--f-mono); font-weight: 600; font-size: 11.5px; color: var(--muted); }
.ph { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1.5px dashed var(--line-2); border-radius: 50%; font-family: var(--f-display); font-weight: 900; color: var(--line-2); }
.bcov { display: flex; flex-wrap: wrap; gap: 4px; padding: 9px 12px; border-top: 1.5px solid var(--ink); background: var(--paper); }
.bcov.blue { --c: var(--blue); }
.bcov.red { --c: var(--red); justify-content: flex-end; }
.bcov-mid { display: grid; place-items: center; padding: 0 8px; border-top: 1.5px solid var(--ink); background: var(--paper-2); font-family: var(--f-mono); font-weight: 600; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.summary { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.summary b { color: var(--ink); }
@media (max-width: 520px) {
  .bslot { padding: 7px 9px; gap: 7px; }
  .bslot .tag, .bslot .lanes { display: none; }
  .bnum { padding: 0 6px; }
  .bcov { padding: 8px 9px; gap: 3px; }
  .lc { font-size: 9px; padding: 3px 4px 2px; }
}

/* Word and letter reveals */
.w, .l { display: inline-block; opacity: 0; animation: rise .42s var(--ease-out) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(.45em); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Idle poster + final stamp */
.idle { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 1.8cqh; padding: 6cqw; text-align: center; }
.idle-k { font-family: var(--f-mono); font-weight: 600; font-size: clamp(11px, 1.4cqw, 18px); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.idle-big { position: relative; font-family: var(--f-display); font-weight: 900; font-size: clamp(60px, 15cqw, 230px); line-height: .8; text-transform: uppercase; color: var(--blue); }
.idle-big::after { content: attr(data-t); position: absolute; inset: 0; color: var(--red); mix-blend-mode: multiply; transform: translate(.035em, -.022em); }
.idle-sub { font-family: var(--f-mono); font-weight: 500; font-size: clamp(10px, 1.3cqw, 16px); letter-spacing: .14em; text-transform: uppercase; }
.cta { display: inline-flex; align-items: center; gap: .5em; margin-top: 1.4cqh; padding: .6em 1.1em; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 600; font-size: clamp(12px, 1.5cqw, 18px); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  display: grid;
  justify-items: center;
  gap: 1cqh;
  padding: 2cqh 3.4cqw 2.2cqh;
  border: max(2px, .45cqw) solid var(--ink);
  background: var(--paper);
  box-shadow: 1cqw 1cqw 0 var(--ink);
  transform: translate(-50%, -50%) rotate(-8deg);
  pointer-events: none;
}
.stamp-k { position: relative; font-family: var(--f-display); font-weight: 900; font-size: clamp(52px, 13cqw, 210px); line-height: .8; color: var(--blue); }
.stamp-k::after { content: attr(data-t); position: absolute; inset: 0; color: var(--red); mix-blend-mode: multiply; transform: translate(.035em, -.022em); }
.stamp-s { font-family: var(--f-mono); font-weight: 600; font-size: clamp(10px, 1.3cqw, 16px); letter-spacing: .16em; text-transform: uppercase; }

/* Effect 1: VS pairs */
.vs { position: absolute; inset: 0; }
.vs-side { position: absolute; inset: 0; display: flex; align-items: center; background-color: var(--c); background-image: radial-gradient(rgba(0, 0, 0, .18) 1.1px, transparent 1.4px); background-size: 7px 7px; }
.vs-side.blue { --c: var(--blue); clip-path: polygon(0 0, 57% 0, 41% 100%, 0 100%); justify-content: flex-start; }
.vs-side.red { --c: var(--red); clip-path: polygon(59% 0, 100% 0, 100% 100%, 43% 100%); justify-content: flex-end; }
.vs-wm { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--f-display); font-weight: 900; font-size: 46cqw; line-height: .8; color: rgba(255, 255, 255, .13); white-space: nowrap; pointer-events: none; }
.fighter { position: relative; display: grid; grid-template-areas: "av" "meta" "name" "title" "line"; justify-items: start; gap: 1.3cqh; max-width: 46cqw; padding-inline: 6cqw; color: var(--white); }
.red .fighter { justify-items: end; text-align: right; }
.f-av { grid-area: av; width: 13cqw; height: 13cqw; font-size: 7.4cqw; border-width: max(2px, .45cqw); box-shadow: .8cqw .8cqw 0 var(--ink); }
.f-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: .6cqw; }
.fighter .tag { font-size: clamp(10px, 1.15cqw, 16px); background: var(--paper); color: var(--ink); }
.fighter .tag.dad { background: var(--ink); color: var(--paper); }
.f-name { grid-area: name; max-width: 100%; padding-top: .14em; font-family: var(--f-display); font-weight: 900; font-size: 10cqw; line-height: .8; text-transform: uppercase; text-shadow: .45cqw .45cqw 0 var(--ink); overflow-wrap: anywhere; }
.f-title { grid-area: title; font-family: var(--f-mono); font-weight: 600; font-size: clamp(10px, 1.25cqw, 18px); letter-spacing: .14em; text-transform: uppercase; opacity: .92; }
.f-line { grid-area: line; margin: 0; max-width: 34cqw; min-height: 2.5em; font-weight: 600; font-size: clamp(13px, 1.85cqw, 28px); line-height: 1.25; }
.vs-mark { position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center; width: 19cqw; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-4deg); opacity: 0; pointer-events: none; }
.burst { position: absolute; inset: 0; }
.burst.k { background: var(--ink); }
.burst.p { inset: 6%; background: var(--yellow); }
.vs-mark b { position: relative; font-family: var(--f-display); font-weight: 900; font-size: 8.6cqw; line-height: 1; color: var(--ink); text-shadow: .3cqw .3cqw 0 var(--red); }
.vs-cap { position: absolute; top: 3.2cqh; left: 50%; z-index: 3; transform: translateX(-50%); padding: .45em .9em; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font-family: var(--f-mono); font-weight: 600; font-size: clamp(10px, 1.25cqw, 16px); letter-spacing: .14em; white-space: nowrap; }
.vs-cap:empty { display: none; }
@container stage (orientation: portrait) {
  .vs-side { align-items: flex-start; }
  .vs-side.blue { clip-path: polygon(0 0, 100% 0, 100% 40%, 0 56%); }
  .vs-side.red { clip-path: polygon(0 58%, 100% 42%, 100% 100%, 0 100%); align-items: flex-end; }
  .vs-wm { font-size: 60cqw; }
  .fighter { grid-template-areas: "av meta" "av name" "av title" "line line"; grid-template-columns: auto minmax(0, 1fr); column-gap: 4cqw; row-gap: 1cqh; align-items: center; width: 100%; max-width: none; padding: 6cqw; }
  .red .fighter { grid-template-areas: "meta av" "name av" "title av" "line line"; grid-template-columns: minmax(0, 1fr) auto; }
  .f-av { width: 19cqw; height: 19cqw; font-size: 10.5cqw; }
  .f-name { font-size: 12.5cqw; }
  .f-line { max-width: none; font-size: clamp(13px, 3.9cqw, 20px); }
  .vs-mark { width: 30cqw; }
  .vs-mark b { font-size: 13cqw; }
  .vs-cap { top: auto; bottom: 50%; left: 4cqw; transform: translateY(50%); }
}

/* Effect 2: Pack opening */
.pk { position: absolute; inset: 0; --cw: min(calc((100cqw - 16cqw - 4 * 1.6cqw) / 5), calc((100cqh - 18cqh) / 2 / 1.4)); }
.pk-packs { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9cqw; }
.pack { position: relative; width: min(20cqw, 46cqh); aspect-ratio: 5 / 8; --c: var(--blue); }
.pack.red { --c: var(--red); }
.pack-body { position: absolute; inset: 11% 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqh; padding: 6%; border: 2px solid var(--ink); border-top: 2px dashed rgba(255, 255, 255, .75); border-radius: 0 0 1.2cqw 1.2cqw; background-color: var(--c); background-image: var(--halftone); background-size: 6px 6px; box-shadow: 1cqw 1cqw 0 var(--ink); color: var(--white); text-align: center; }
.pack-top { position: absolute; inset: 0 0 auto; height: 13%; border: 2px solid var(--ink); border-bottom: 0; background: var(--c); }
.pack .emb { width: 7.5cqw; border-width: max(2px, .35cqw); font-size: 3.2cqw; }
.pack-t { font-family: var(--f-display); font-weight: 900; font-size: clamp(20px, 3.2cqw, 50px); line-height: .9; text-transform: uppercase; }
.pack-n { font-family: var(--f-mono); font-weight: 600; font-size: clamp(9px, 1.1cqw, 14px); letter-spacing: .14em; text-transform: uppercase; }
.pk .cta { position: absolute; left: 50%; bottom: 4cqh; margin: 0; transform: translateX(-50%); animation: none; }
.pk-rows { position: absolute; inset: 0; display: grid; align-content: center; justify-content: center; gap: 4cqh; transition: opacity .3s; }
.pk.focus .pk-rows { opacity: .16; }
.pk-row { display: flex; align-items: center; gap: 1.6cqw; --c: var(--blue); }
.pk-row.red { --c: var(--red); }
.pk-tag { width: 2.4cqw; writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--f-mono); font-weight: 600; font-size: clamp(9px, 1.1cqw, 14px); letter-spacing: .18em; color: var(--c); }
.pk-cards { display: flex; gap: 1.6cqw; }
.pk .card { width: var(--cw); }
.pk-feat { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 3.4cqw; padding: 4cqw; }
.pk .feat-card { width: min(30cqw, 62cqh); }
.bubble { display: grid; justify-items: start; gap: 1.6cqh; max-width: min(34cqw, 440px); --c: var(--blue); }
.bubble.red { --c: var(--red); }
.b-team { padding: .12em .4em .06em; border-radius: 4px; background: var(--c); color: var(--white); font-family: var(--f-display); font-weight: 900; font-size: clamp(18px, 2.6cqw, 40px); line-height: 1; text-transform: uppercase; }
.b-line { margin: 0; min-height: 2.5em; font-weight: 600; font-size: clamp(15px, 2.3cqw, 32px); line-height: 1.25; }
.b-skill { margin: 0; color: var(--muted); font-size: clamp(12px, 1.35cqw, 18px); }
.b-skill span { margin-right: .4em; color: var(--ink); font-family: var(--f-mono); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
@container stage (orientation: portrait) {
  .pk { --cw: min(calc((100cqw - 14cqw - 4 * 1.6cqw) / 5), calc((100cqh - 20cqh) / 2 / 1.4)); }
  .pk-packs { gap: 6cqw; }
  .pack { width: min(38cqw, 46cqh); }
  .pack .emb { width: 13cqw; font-size: 5.6cqw; }
  .pack-t { font-size: clamp(18px, 6.4cqw, 40px); }
  .pk-tag { width: 3.5cqw; font-size: 9px; }
  .pk-feat { flex-direction: column; gap: 2.4cqh; }
  .pk .feat-card { width: min(66cqw, 52cqh); }
  .bubble { justify-items: center; max-width: 88cqw; text-align: center; }
  .b-line { min-height: 0; font-size: clamp(14px, 4.2cqw, 22px); }
  .b-skill { display: none; }
}

/* Flip cards used by the pack effect */
.card { position: relative; aspect-ratio: 5 / 7; container-type: inline-size; perspective: 1000px; --c: var(--blue); }
.card.red { --c: var(--red); }
.card-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.2, .8, .2, 1); }
.card.up .card-in { transform: rotateY(180deg); }
.card.instant .card-in { transition: none; }
.face { position: absolute; inset: 0; overflow: hidden; border: max(1.5px, .9cqi) solid var(--ink); border-radius: 4.5cqi; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back { display: grid; place-items: center; background-color: var(--c); background-image: var(--halftone); background-size: 6px 6px; }
.emb { display: grid; place-items: center; width: 44cqi; aspect-ratio: 1; padding-top: .06em; border: 1.2cqi solid var(--paper); border-radius: 50%; color: var(--paper); font-family: var(--f-display); font-weight: 900; font-size: 18cqi; line-height: 1; }
.front { display: flex; flex-direction: column; align-items: center; gap: 2.2cqi; padding: 5cqi; background: var(--card); text-align: center; transform: rotateY(180deg); }
.c-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 2cqi; font-family: var(--f-mono); font-weight: 600; font-size: 5.8cqi; letter-spacing: .06em; line-height: 1; }
.c-lane { padding: .35em .55em .3em; border-radius: 1.6cqi; background: var(--c); color: var(--white); }
.c-dad { padding: .35em .55em .3em; border-radius: 1.6cqi; background: var(--ink); color: var(--paper); }
.c-av { width: 31cqi; height: 31cqi; font-size: 17cqi; border-width: max(1.5px, .9cqi); }
.c-name { max-width: 100%; font-family: var(--f-display); font-weight: 900; font-size: 14cqi; line-height: .88; text-transform: uppercase; overflow-wrap: anywhere; }
.c-title { color: var(--muted); font-size: 5.4cqi; font-weight: 600; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
.c-stats { list-style: none; align-self: stretch; display: grid; gap: 1.7cqi; margin: auto 0 0; padding: 0; }
.c-stats li { display: grid; grid-template-columns: 36cqi minmax(0, 1fr) 8cqi; align-items: center; gap: 2cqi; font-size: 5.1cqi; line-height: 1.1; text-align: left; }
.c-stats i { position: relative; height: 2.4cqi; overflow: hidden; border-radius: 1cqi; background: var(--line); }
.c-stats i::after { content: ""; position: absolute; inset: 0; width: var(--v); background: var(--ink); }
.c-stats b { font-family: var(--f-mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
@container (max-width: 219.98px) {
  .c-stats { display: none; }
  .front { justify-content: center; gap: 3cqi; }
}
@container (max-width: 109.98px) {
  .c-top, .c-title { display: none; }
  .front { gap: 5cqi; padding: 4cqi; }
  .c-av { width: 56cqi; height: 56cqi; font-size: 30cqi; }
  .c-name { font-size: 20cqi; }
  .emb { width: 56cqi; font-size: 22cqi; }
}

/* Effect 3: Wheel */
.wh { position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5cqw; padding: 5cqh 6cqw; }
.wh-wheel { position: relative; width: 86cqh; aspect-ratio: 1; }
.wh-wheel canvas { display: block; width: 100%; height: 100%; }
.wh-ptr { position: absolute; left: 50%; top: -3%; z-index: 2; width: 8%; aspect-ratio: 3 / 4; background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); transform: translateX(-50%); transform-origin: 50% 15%; }
.wh-hub { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 17%; aspect-ratio: 1; padding-top: .06em; border: max(2px, .5cqh) solid var(--ink); border-radius: 50%; background: var(--paper); transform: translate(-50%, -50%); font-family: var(--f-display); font-weight: 900; font-size: 4.4cqh; line-height: 1; }
.wh-info { display: grid; justify-items: start; gap: 2.2cqh; min-width: 0; }
.wh-turn { font-family: var(--f-mono); font-weight: 600; font-size: clamp(10px, 1.3cqw, 16px); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wh-slot { display: flex; flex-wrap: wrap; align-items: center; gap: .8cqw; }
.pill { padding: .12em .4em .06em; border-radius: 4px; background: var(--c); color: var(--white); font-family: var(--f-display); font-weight: 900; font-size: clamp(18px, 3.1cqw, 46px); line-height: 1; text-transform: uppercase; }
.pill.blue { --c: var(--blue); }
.pill.red { --c: var(--red); }
.wh-count { font-family: var(--f-mono); font-weight: 600; font-size: clamp(12px, 1.6cqw, 22px); letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.wh-name { max-width: 100%; font-family: var(--f-display); font-weight: 900; font-size: clamp(46px, 9cqw, 150px); line-height: .82; text-transform: uppercase; overflow-wrap: anywhere; }
.wh-name.q { color: var(--line-2); }
.wh-line { margin: 0; min-height: 2.6em; font-weight: 600; font-size: clamp(13px, 1.8cqw, 26px); line-height: 1.3; }
@container stage (orientation: portrait) {
  .wh { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; justify-items: center; align-content: center; gap: 3cqh; padding: 6cqw; text-align: center; }
  .wh-wheel { width: min(80cqw, 54cqh); }
  .wh-info { justify-items: center; gap: 1.6cqh; }
  .wh-slot { justify-content: center; }
  .wh-hub { font-size: 4.6cqw; }
  .wh-name { font-size: clamp(40px, 14cqw, 90px); }
  .wh-line { min-height: 0; font-size: clamp(13px, 3.9cqw, 20px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .w, .l { animation: fade .2s linear forwards; }
  .cta, .toast { animation: none; }
  .card-in { transition: none; }
  .mini, .switch .track::after { transition: none; }
}

/* ---------- Phase 2: accounts, tonight's room, approvals, guide ---------- */
.loading { padding: 40px 0; color: var(--muted); font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; }

/* Discord picture over the first letter (the letter shows if the picture can't load). */
.av { position: relative; overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.xs { width: 26px; height: 26px; font-size: 15px; border-width: 1.2px; }
.av.lg { width: 64px; height: 64px; font-size: 34px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.tab .av.xs { border-color: currentColor; }
.tab[aria-current="page"] .tab-ic:has(.av) { background: none; }
.tab[aria-current="page"] .av.xs { outline: 2px solid var(--ink); outline-offset: 1px; }

.btn.discord { background: #5865F2; border-color: var(--ink); color: var(--white); }
.btn.discord:hover { background: #4752C4; }

/* A boxed line about me: sign in, waiting, join, or already in. */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}
.notice p { margin: 0; flex: 1 1 260px; }
.notice .hint { flex-basis: 100%; }
.notice.in { box-shadow: none; background: var(--yellow-soft); }
.in-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-right: auto; }

.badge {
  display: inline-block;
  padding: 3px 7px 2px;
  border: 1.2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--card);
}
.badge.owner, .badge.admin { background: var(--ink); color: var(--paper); }
.badge.pending { background: var(--yellow); }
.badge.rejected { border-color: var(--red-ink); color: var(--red-ink); }

/* Members of tonight's room. Admins tap a name to move it between Chơi and Chờ. */
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.member { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 12px 7px 7px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); }
.member.me { background: var(--yellow-soft); }
.member .meta, .add-item .meta { display: grid; min-width: 0; line-height: 1.25; }
.member .nm, .add-item .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.member .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.admin { padding: 0; }
.m-main { appearance: none; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 4px 7px 7px; border: 0; border-radius: 999px 0 0 999px; background: none; text-align: left; cursor: pointer; }
.m-main:hover { background: var(--paper-2); }
.m-x { appearance: none; flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-right: 5px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.m-x:hover { background: var(--red-soft); color: var(--red-ink); }
.members.waiting .member { border-style: dashed; border-color: var(--line-2); background: transparent; }

/* The latest split: both teams in plain lists, with a button to watch the show. */
.latest { display: grid; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--card); }
.latest.live { box-shadow: 4px 4px 0 var(--red); }
.latest-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.latest-head .label { display: inline-flex; align-items: center; gap: 8px; }
.teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.team { display: grid; gap: 6px; align-content: start; }
.team.blue .label { color: var(--blue-ink); }
.team.red .label { color: var(--red-ink); }
.team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.team li { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.team li > span:not(.av):not(.tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.blue .av { box-shadow: 0 0 0 2px var(--blue); }
.team.red .av { box-shadow: 0 0 0 2px var(--red); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: dot-pulse 1.4s ease-in-out infinite; }
@keyframes dot-pulse { 50% { opacity: .35; } }

/* Admin: add people to the room. */
.section > .btn { justify-self: start; }
.add-panel { display: grid; gap: 10px; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--card); }
.add-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; }
.add-item { appearance: none; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--paper); text-align: left; cursor: pointer; }
.add-item:hover { border-color: var(--ink); }
.add-item .meta { flex: 1; }
.add-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.quick-new { display: grid; gap: 10px; justify-items: start; padding-top: 12px; border-top: 1.5px dashed var(--line-2); }
.quick-new .input { max-width: 360px; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.guide-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13.5px; font-weight: 600; }

/* Tôi */
.profile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile .meta { display: grid; gap: 2px; min-width: 0; }
.profile .nm { font-family: var(--f-display); font-weight: 900; font-size: 30px; line-height: .95; text-transform: uppercase; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-weight: 600; }
#meForm .form { max-width: 640px; }

/* Người chơi: rows that aren't links, waiting sign-ups, the fun switch. */
.row-in { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; min-width: 0; flex: 1; }
.row .nm .badge { margin-left: 2px; }
.row.pend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding-right: 12px; }
.pend-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 10px 14px; }
@media (min-width: 640px) { .pend-actions { padding: 0; margin-left: auto; } }
.input.sm { min-height: 44px; padding: 8px 10px; font-size: 14px; width: auto; max-width: 220px; }
.pending { padding: 14px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--yellow-soft); }
.fun-box { padding-top: 16px; border-top: 1.5px dashed var(--line-2); }
.fun-box .h2 { display: inline-flex; align-items: center; gap: 8px; }
.switch.off { color: var(--muted); cursor: not-allowed; }
.switch input:disabled + .track { opacity: .5; }
.switch svg { flex: none; }

/* Bắt đầu (welcome): design A. Three lines drop in, the teams slide together, the steps pop in. */
.welcome { padding-top: 2px; }
.wl-grid { display: grid; gap: 18px; grid-template-areas: "hero" "vs" "steps" "soon" "cta"; }
.wl-hero { grid-area: hero; display: grid; gap: 14px; align-content: start; }
.wl-kicker { margin: 0; font-family: var(--f-mono); font-weight: 600; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); animation: wl-rise .5s ease-out both; }
.wl-title { margin: 0; display: grid; font-family: var(--f-display); font-weight: 900; font-size: clamp(60px, 17vw, 112px); line-height: .88; text-transform: uppercase; letter-spacing: .005em; }
.wl-line { display: block; padding-top: .05em; animation: wl-drop .7s cubic-bezier(.2, .8, .2, 1) both; }
.wl-line.l0 { color: var(--ink); text-shadow: 3px 2px 0 rgba(229, 65, 47, .85); animation-delay: .12s; }
.wl-line.l1 { color: var(--blue); text-shadow: 3px 2px 0 rgba(229, 65, 47, .6); animation-delay: .4s; }
.wl-line.l2 { color: var(--red); text-shadow: 3px 2px 0 rgba(14, 111, 192, .55); animation-delay: .68s; }
.wl-lead { margin: 0; max-width: 34ch; font-size: 16px; font-weight: 500; animation: wl-rise .5s ease-out 1s both; }

.wl-vs { grid-area: vs; position: relative; height: 108px; border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--card); box-shadow: 4px 4px 0 var(--ink); }
.wl-side { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.wl-side b { font-family: var(--f-display); font-weight: 900; font-size: 26px; line-height: 1; color: var(--white); text-transform: uppercase; }
.wl-side.blue { left: 0; right: 50%; padding-left: 16px; background: var(--blue); animation: wl-left 4.2s cubic-bezier(.2, .8, .2, 1) 1.1s infinite both; }
.wl-side.red { left: 50%; right: 0; padding-right: 16px; align-items: flex-end; background: var(--red); animation: wl-right 4.2s cubic-bezier(.2, .8, .2, 1) 1.1s infinite both; }
.wl-dots { display: flex; gap: 6px; }
.wl-dots i { width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 50%; animation: wl-dot 4.2s calc(1.1s + var(--i) * .1s) infinite both; }
.wl-side.blue .wl-dots i { background: var(--blue-soft); }
.wl-side.red .wl-dots i { background: var(--red-soft); }
.wl-badge { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 76px; height: 76px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-family: var(--f-display); font-weight: 900; font-size: 34px; line-height: 1; animation: wl-slam 4.2s cubic-bezier(.5, 0, .75, 0) 1.1s infinite both; }

.wl-steps { grid-area: steps; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wl-steps li { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 8px 10px; padding: 12px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--card); animation: wl-pop .5s cubic-bezier(.2, .8, .2, 1) calc(1.4s + var(--i) * .18s) both; }
.wl-steps li:last-child { background: var(--yellow-soft); }
.wl-steps b { grid-column: 1 / -1; font-size: 14.5px; line-height: 1.2; }
.wl-n { font-family: var(--f-display); font-weight: 900; font-size: 28px; line-height: .8; color: var(--red); }
.wl-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); }
.wl-ic.discord { background: #5865F2; color: var(--white); }
.wl-ic.play { background: var(--ink); color: var(--yellow); }

.wl-soon { grid-area: soon; margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px dashed var(--line-2); border-radius: var(--r); font-size: 13.5px; font-weight: 600; animation: wl-rise .5s ease-out 2.2s both; }
.wl-soon .tag { background: var(--yellow); color: var(--ink); }
.wl-soon svg { flex: none; color: var(--blue); }

.wl-cta { grid-area: cta; display: flex; flex-direction: column; align-items: stretch; gap: 10px; animation: wl-rise .5s ease-out 2.3s both; }
.wl-cta .btn.big { box-shadow: 3px 3px 0 var(--ink); }
.wl-cta .hint { text-align: center; }
.wl-watch { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.wl-watch svg { animation: wl-nudge 1.4s ease-in-out infinite; }

.wl-admin { padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--card); }
.wl-admin summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--f-display); font-weight: 900; font-size: 22px; text-transform: uppercase; list-style: none; }
.wl-admin summary::-webkit-details-marker { display: none; }
.wl-admin ol { margin: 12px 0 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 64ch; }

@media (min-width: 560px) and (max-width: 899px) { .wl-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .wl-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "hero vs" "hero steps" "cta soon"; column-gap: 56px; row-gap: 16px; padding-top: 28px; align-items: start; }
  .wl-lead { font-size: 18px; }
  .wl-vs { height: 200px; box-shadow: 5px 5px 0 var(--ink); }
  .wl-side b { font-size: 38px; }
  .wl-dots { gap: 8px; }
  .wl-dots i { width: 22px; height: 22px; }
  .wl-side.blue { padding-left: 24px; }
  .wl-side.red { padding-right: 24px; }
  .wl-badge { width: 104px; height: 104px; font-size: 48px; border-width: 2.5px; }
  .wl-cta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
  .wl-cta .hint { flex-basis: 100%; text-align: left; }
}

@keyframes wl-drop { 0% { opacity: 0; transform: translateY(-46px) rotate(-5deg); } 62% { opacity: 1; transform: translateY(5px) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes wl-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wl-pop { 0% { opacity: 0; transform: translateY(14px) scale(.88); } 70% { opacity: 1; transform: translateY(-2px) scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes wl-left { 0%, 6% { transform: translateX(-102%); } 22%, 84% { transform: none; } 96%, 100% { transform: translateX(-102%); } }
@keyframes wl-right { 0%, 10% { transform: translateX(102%); } 26%, 84% { transform: none; } 96%, 100% { transform: translateX(102%); } }
@keyframes wl-slam { 0%, 24% { opacity: 0; transform: translate(-50%, -50%) scale(2.6) rotate(-16deg); } 32% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-5deg); } 36% { transform: translate(-50%, -50%) scale(1.08) rotate(-5deg); } 40%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-5deg); } 92%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-5deg); } }
@keyframes wl-dot { 0%, 30% { opacity: 0; transform: scale(.3); } 38%, 84% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: scale(.3); } }
@keyframes wl-nudge { 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) {
  .welcome *, .welcome *::before { animation: none !important; }
}

/* Chọn role */
.roles-page .lead { margin: 0; max-width: 40ch; font-size: 17px; font-weight: 500; }
.lane-picks.big { gap: 10px; }
.lane-picks.big .lane-btn { min-height: 52px; padding: 12px 20px; font-size: 15px; }
.lane-btn.fill { border-style: dashed; }
.lane-btn.fill[aria-pressed="true"] { border-style: solid; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
