/* ==========================================================================
   Ringer FC — mobile-first design system
   Deep-pitch dark theme, lime accents, generous touch targets.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #080d09;
  --surface: #121c15;
  --surface-2: #17251b;
  --surface-3: #1e3023;
  --surface-4: #263d2c;
  --border: #263a2c;
  --border-strong: #38523c;
  --text: #f1f7ee;
  --muted: #a0b5a5;
  --faint: #728a78;
  --accent: #c9f75a;
  --accent-strong: #a8e63a;
  --accent-ink: #0d1507;
  --accent-2: #5eead4;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius-xl: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-h: 62px;
}

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

* {
  min-width: 0;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(680px 420px at 8% -10%, rgba(94, 234, 212, 0.13), transparent 68%),
    radial-gradient(620px 420px at 100% 0%, rgba(201, 247, 90, 0.1), transparent 66%),
    linear-gradient(180deg, #0b120d 0%, var(--bg) 48%);
}

@supports (overflow-x: clip) {
  body {
    overflow-x: clip;
  }
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- utilities ---------- */
.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.mt {
  margin-top: 14px;
}

.mb {
  margin-bottom: 14px;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.row > * {
  min-width: 0;
}

.empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.sig {
  color: var(--faint);
  font-size: 11px;
}

/* ---------- shell ---------- */
.view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 14px calc(56px + var(--safe-bottom));
}

.page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 25px;
  font-weight: 800;
}

.page-head .sub {
  max-width: 62ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.page-head .row {
  width: 100%;
}

.page-head .row > .btn {
  flex: 1 1 auto;
}

.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(24, 38, 28, 0.95), rgba(18, 28, 21, 0.97));
  box-shadow: var(--shadow-soft);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, filter 0.15s;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(201, 247, 90, 0.18);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--bad);
}

.btn.sm {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

@media (hover: hover) {
  .btn:hover:not(:disabled) {
    border-color: var(--border-strong);
  }

  .btn.primary:hover:not(:disabled) {
    filter: brightness(1.06);
    border-color: transparent;
  }

  .btn.ghost:hover:not(:disabled) {
    background: var(--surface-2);
  }

  .btn.danger:hover:not(:disabled) {
    background: rgba(251, 113, 133, 0.08);
  }
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b130d;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 247, 90, 0.13);
}

.input::placeholder {
  color: var(--faint);
}

select.input {
  min-height: 46px;
}

textarea.input {
  resize: vertical;
}

.bulk-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

input[type="range"] {
  width: 100%;
  height: 30px;
  accent-color: var(--accent);
  cursor: pointer;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13.5px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- top bar / navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-top));
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 9, 0.84);
  backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), #78b81f);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(201, 247, 90, 0.2);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

#league-switcher {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.18s, opacity 0.18s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.topbar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  max-height: calc(100dvh - var(--topbar-h) - 24px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: menu-in 0.16s ease-out;
}

.topbar-menu.open {
  display: block;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.nav-btn {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (hover: hover) {
  .nav-btn:hover:not(.active) {
    background: var(--surface-2);
    color: var(--text);
  }
}

.user-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.user-area .who {
  max-width: 16ch;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-area .role {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pool-status {
  display: none;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.pool-status strong {
  color: var(--text);
}

body.logged-out .hide-logged-out {
  display: none !important;
}

@media (min-width: 1200px) {
  .topbar {
    gap: 16px;
    padding: 12px 22px;
  }

  .brand-name {
    font-size: 18px;
  }

  #league-switcher {
    flex: 0 0 auto;
    width: auto;
    min-width: 170px;
    max-width: 240px;
  }

  .menu-toggle {
    display: none;
  }

  .topbar-menu {
    display: flex;
    position: static;
    flex: 1;
    align-items: center;
    gap: 16px;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    animation: none;
  }

  .nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
  }

  .nav-btn {
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 13px;
    text-align: center;
  }

  .user-area {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

}

@media (min-width: 1400px) {
  .pool-status {
    display: block;
    margin-left: auto;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }
}

/* ---------- players ---------- */
.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.player-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  transition: border-color 0.15s, transform 0.15s;
}

@media (hover: hover) {
  .player-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
  }
}

.player-card .name {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name actions"
    "badges badges";
  align-items: center;
  gap: 6px 8px;
  font-size: 16px;
  font-weight: 800;
}

.player-card .name > span:first-child {
  grid-area: name;
  overflow-wrap: anywhere;
}

.player-card .badges {
  grid-area: badges;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.player-card .actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.player-card .actions .btn {
  min-height: 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.badge.gk,
.badge.willing {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.rating-cell {
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0b130d;
  text-align: center;
}

.rating-cell .pos {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.rating-cell .val {
  font-size: 15px;
  font-weight: 800;
}

.rating-cell .sig {
  font-size: 10px;
}

.mu-bar,
.r-bar,
.lb-bar,
.line-bar,
.meter {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0b130d;
}

.mu-bar {
  height: 5px;
  margin: 5px 0 3px;
}

.mu-bar > span,
.lb-bar > span,
.line-bar > span,
.meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

@media (min-width: 560px) {
  .player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .player-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- rank ---------- */
.rank-page .page-head {
  margin-bottom: 12px;
}

.segmented {
  display: flex;
  width: 100%;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.seg-btn {
  flex: 1;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.seg-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.pos-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pos-tabs::-webkit-scrollbar {
  display: none;
}

.pos-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pos-tab.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.duel .vs {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 14px;
  font-weight: 800;
}

.duel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  text-align: center;
}

.duel-card .pname {
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.duel-card .pmeta {
  display: none;
  color: var(--muted);
  font-size: 11px;
}

.duel-names .duel-card {
  padding: 12px 10px;
}

.verdict {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verdict-head {
  display: none;
}

.verdict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "skill a b"
    "btns btns btns";
  gap: 6px 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.vr-skill {
  grid-area: skill;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.vr-skill strong {
  font-size: 13px;
}

.vr-skill .small {
  margin: 0;
  font-size: 10px;
}

.vr-mu {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.vr-mu.a {
  grid-area: a;
  text-align: right;
}

.vr-mu.b {
  grid-area: b;
  text-align: right;
}

.vr-mu .small {
  font-size: 10px;
  font-weight: 400;
}

.vr-tag {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
}

.vr-btns {
  grid-area: btns;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.choice-btn {
  min-height: 40px;
  padding: 7px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0b130d;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.choice-btn.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.focus-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
}

.focus-banner #clear-focus {
  margin-left: auto;
}

.rank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rank-actions #progress {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 11.5px;
}

.rank-actions #skip,
.rank-actions #save {
  flex: 1 1 0;
}

.meter {
  height: 8px;
}

.confidence-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.confidence-meter {
  display: block;
  width: 100%;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .segmented {
    display: inline-flex;
    width: auto;
    margin-bottom: 16px;
  }

  .seg-btn {
    flex: 0 0 auto;
    padding: 8px 18px;
  }

  .duel {
    gap: 14px;
  }

  .duel-card {
    padding: 22px 16px;
  }

  .duel-card .pname {
    font-size: 20px;
  }

  .duel-card .pmeta {
    display: block;
  }

  .verdict {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .verdict-head {
    display: grid;
    grid-template-columns: minmax(90px, 1.4fr) 96px minmax(180px, auto) 96px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .verdict-head span {
    text-align: center;
  }

  .verdict-head span:first-child {
    text-align: left;
  }

  .verdict-row {
    grid-template-columns: minmax(90px, 1.4fr) 96px minmax(180px, auto) 96px;
    grid-template-areas: none;
    gap: 8px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }

  .verdict-row:last-child {
    border-bottom: 0;
  }

  .vr-skill,
  .vr-mu.a,
  .vr-mu.b,
  .vr-btns {
    grid-area: auto;
  }

  .vr-mu,
  .vr-mu.a,
  .vr-mu.b {
    text-align: center;
  }

  .vr-tag {
    display: none;
  }

  .vr-btns {
    display: flex;
    gap: 6px;
  }

  .choice-btn {
    flex: 1;
    min-height: 34px;
    padding: 6px 10px;
  }

  .rank-actions {
    flex-wrap: nowrap;
  }

  .rank-actions #progress {
    flex: 1 1 auto;
    margin-right: auto;
  }

  .rank-actions #skip,
  .rank-actions #save {
    flex: 0 0 auto;
  }
}

@media (max-width: 380px) {
  .rank-page .vr-skill .small {
    display: none;
  }

  .rank-page .vr-mu {
    font-size: 11px;
  }

  .rank-page .vr-mu .small {
    font-size: 9px;
  }

  .rank-actions #skip,
  .rank-actions #save {
    flex: 1 1 100%;
  }
}

/* ---------- teams ---------- */
.attendee-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 48dvh;
  margin-top: 10px;
  padding-right: 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.attendee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b130d;
  font-size: 13.5px;
  cursor: pointer;
}

.attendee.selected {
  border-color: var(--accent);
  background: rgba(201, 247, 90, 0.08);
}

.attendee input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.attendee .aname {
  flex: 1 1 90px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.attendee .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.constraint-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.constraint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0b130d;
  font-size: 13px;
}

.constraint .kind {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.constraint .kind.together {
  color: var(--good);
}

.constraint .kind.apart {
  color: var(--bad);
}

.constraint .cname {
  flex: 1 1 120px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.teams-result {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.team-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.team-panel.a {
  border-top: 3px solid var(--accent);
}

.team-panel.b {
  border-top: 3px solid var(--accent-2);
}

.team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.team-head h3 {
  font-size: 17px;
}

.team-total {
  font-size: 22px;
  font-weight: 800;
}

.line-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.line-row .lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 78px;
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 700;
}

.line-bar {
  flex: 1;
  height: 7px;
}

.line-weight {
  flex-shrink: 0;
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(201, 247, 90, 0.1);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.roster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.roster li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  grid-template-areas: "lock name move";
  gap: 3px 6px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(56, 82, 60, 0.55);
  font-size: 13px;
}

.roster li:last-child {
  border-bottom: 0;
}

.roster .lock {
  grid-area: lock;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  opacity: 0.65;
}

.roster .lock svg {
  width: 15px;
  height: 15px;
}

@media (hover: hover) {
  .roster .lock:hover {
    background: var(--surface-3);
    opacity: 1;
  }
}

.roster li.locked {
  border-radius: 6px;
  background: rgba(201, 247, 90, 0.06);
}

.roster li.locked .lock {
  color: var(--accent);
  opacity: 1;
}

.roster .rname {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.roster .move {
  grid-area: move;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0.65;
  cursor: pointer;
}

@media (hover: hover) {
  .roster .move:hover {
    background: var(--surface-3);
    color: var(--accent);
    opacity: 1;
  }
}

.roster .move:disabled {
  opacity: 0.25;
  cursor: default;
}


.winprob {
  margin-top: 14px;
}

.winprob .meter > span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.menu-wrap {
  position: relative;
}

.menu-pop {
  position: fixed;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  left: 12px;
  z-index: 120;
  max-height: 72dvh;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 100vmax rgba(4, 8, 5, 0.5);
}

.menu-pop.hidden {
  display: none;
}

@media (min-width: 560px) {
  .attendee-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .teams-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    bottom: auto;
    left: auto;
    width: min(340px, 80vw);
    box-shadow: var(--shadow);
  }
}

@media (min-width: 980px) {
  .attendee-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- results ---------- */
.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-meta .field {
  margin-bottom: 0;
}

.result-meta .date-field {
  grid-column: 1 / -1;
}

.score-input {
  text-align: center;
  font-weight: 800;
}

.builder-head {
  display: none;
}

.session-builder {
  max-height: 48dvh;
  margin-top: 10px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.builder-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.builder-row:last-child {
  border-bottom: 0;
}

.builder-row.team-a {
  background: rgba(201, 247, 90, 0.06);
}

.builder-row.team-b {
  background: rgba(94, 234, 212, 0.06);
}

.side-toggle {
  display: flex;
  gap: 5px;
}

.side-toggle .choice-btn {
  flex: 1;
  min-height: 42px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 800;
}

.builder-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.builder-row .bname {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 13px;
}

.builder-row .badge {
  margin-left: 2px;
}

.standout-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.standout-chip .star {
  width: 13px;
  height: 13px;
  flex: none;
}

@media (hover: hover) {
  .standout-chip:hover {
    color: var(--text);
    border-color: var(--border-strong);
  }
}

.standout-chip:focus-within {
  border-color: var(--accent-strong);
}

.standout-chip.active {
  color: var(--accent);
  border-color: var(--accent-strong);
  background: rgba(201, 247, 90, 0.12);
}

.standout-chip.active .star {
  fill: currentColor;
}

.standout-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  margin: 0;
  min-height: 0;
  height: auto;
  max-width: 150px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.standout-select:focus {
  outline: none;
}

.save-row {
  flex-wrap: wrap;
}

.save-row .check {
  flex: 1 1 100%;
}

.save-row .btn {
  flex: 1 1 100%;
}

.session-item {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.session-item:hover {
  border-color: var(--border-strong);
}

.session-item .score {
  font-size: 16px;
  font-weight: 800;
}

.session-item .row {
  gap: 6px 10px;
}

.split-bar {
  display: flex;
  height: 34px;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.split-bar > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

@media (min-width: 560px) {
  .result-meta {
    grid-template-columns: 1.5fr 0.8fr 0.8fr;
  }

  .result-meta .date-field {
    grid-column: auto;
  }

  .save-row .check,
  .save-row .btn {
    flex: 0 1 auto;
  }

  .save-row .btn {
    margin-left: auto;
  }
}

@media (min-width: 640px) {
  .builder-main {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .builder-row .bname {
    flex: 1;
  }

  .standout-chip {
    align-self: center;
  }
}

@media (min-width: 640px) {
  .builder-head {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    margin-top: 14px;
    padding: 0 10px 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .session-builder {
    max-height: 380px;
    margin-top: 0;
  }
}

/* ---------- stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
}

.stats-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 15px;
}

.lb {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank name val"
    "rank bar bar";
  gap: 3px 8px;
  align-items: center;
  font-size: 13px;
}

.lb-rank {
  grid-area: rank;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.lb-name {
  grid-area: name;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-bar {
  grid-area: bar;
  height: 5px;
}

.lb-val {
  grid-area: val;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.streak-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.streak {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.streak.win {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.06);
}

.streak.loss {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.05);
}

.streak-val {
  font-weight: 800;
  white-space: nowrap;
}

.pos-best-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pos-best {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b130d;
}

.pos-best-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pos-badge {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pos-best-name {
  margin: 6px 0 8px;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (min-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-value {
    font-size: 26px;
  }
}

@media (min-width: 700px) {
  .lb-row {
    grid-template-columns: 22px minmax(70px, 1fr) minmax(80px, 2fr) auto;
    grid-template-areas: "rank name bar val";
    gap: 8px;
  }

  .pos-best-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (min-width: 860px) {
  .stats-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* ---------- settings ---------- */
#view > .panel h2 {
  font-size: 16px;
}

/* ---------- admin ---------- */
.admin-section {
  margin-bottom: 14px;
}

.admin-section .row {
  margin-bottom: 10px;
}

.admin-section h2 {
  font-size: 17px;
}

.admin-scroll {
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table thead {
  display: none;
}

.admin-table,
.admin-table tbody,
.admin-table tr,
.admin-table td {
  display: block;
}

.admin-table tr {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-table tr:last-child {
  margin-bottom: 0;
}

.admin-table td {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border: 0;
  text-align: left;
}

.admin-table td::before {
  content: attr(data-label);
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-table td.admin-actions-cell {
  display: block;
  padding-top: 10px;
}

.admin-table td.admin-actions-cell::before {
  display: none;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-actions .btn {
  flex: 1 1 auto;
  min-height: 36px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px 2px 0;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
}

.chip button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--bad);
  font-weight: 800;
}

.member-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.member-picker .input {
  flex: 1 1 160px;
}

/* admin settings rows (mobile cards first) */
.skill-list,
.attribute-list,
.tuning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.skill-row,
.attribute-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.skill-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "key remove"
    "label label";
}

.skill-row .skill-key,
.attribute-row .skill-key {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.skill-row .skill-key {
  grid-area: key;
}

.skill-row [data-label] {
  grid-area: label;
}

.skill-row [data-remove] {
  grid-area: remove;
}

.attribute-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "key remove"
    "label label"
    "balance rotate";
}

.attribute-row .skill-key {
  grid-area: key;
}

.attribute-row [data-attr-label] {
  grid-area: label;
}

.attribute-row .attr-balance {
  grid-area: balance;
}

.attribute-row .attr-rotate {
  grid-area: rotate;
}

.attribute-row [data-attr-remove] {
  grid-area: remove;
}

.skill-add,
.attribute-add {
  padding: 10px;
}

.skill-add-grid,
.attribute-add-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.attribute-add-grid {
  grid-template-columns: 1fr 1fr;
}

.attribute-add-grid #new-attr-key,
.attribute-add-grid #new-attr-label,
.attribute-add-grid #add-attribute {
  grid-column: 1 / -1;
}

.attribute-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.tuning-heading {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tuning-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-areas:
    "label label"
    "slider value";
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.tuning-label {
  grid-area: label;
}

.tuning-label strong {
  font-size: 13px;
}

.tuning-row input[type="range"] {
  grid-area: slider;
}

.tuning-value {
  grid-area: value;
  text-align: right;
}

.panel .tuning-heading:first-child {
  margin-top: 0;
}

.tuning-footnote {
  margin: 0 2px 12px;
}

.page-head .tuning-manage > .btn {
  flex: 0 0 auto;
}

.sticky-actions {
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 28, 21, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.sticky-actions .grow {
  flex: 1 1 100%;
}

.sticky-actions .btn {
  flex: 1 1 100%;
}

@media (min-width: 480px) {
  .sticky-actions .grow {
    flex: 1 1 auto;
  }

  .sticky-actions .btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 560px) {
  .skill-add-grid {
    grid-template-columns: 90px 1fr auto;
  }

  .attribute-add-grid {
    grid-template-columns: 90px 1fr auto auto auto;
  }

  .attribute-add-grid #new-attr-key,
  .attribute-add-grid #new-attr-label,
  .attribute-add-grid #add-attribute {
    grid-column: auto;
  }
}

@media (min-width: 640px) {
  .skill-row {
    grid-template-columns: 78px minmax(120px, 1fr) auto;
    grid-template-areas: "key label remove";
  }

  .attribute-row {
    grid-template-columns: 78px minmax(120px, 1fr) auto auto auto;
    grid-template-areas: "key label balance rotate remove";
  }

  .tuning-row {
    grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) 42px;
    grid-template-areas: "label slider value";
  }
}

@media (min-width: 760px) {
  .admin-table {
    display: table;
    border-collapse: collapse;
  }

  .admin-table thead {
    display: table-header-group;
  }

  .admin-table tbody {
    display: table-row-group;
  }

  .admin-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .admin-table th,
  .admin-table td {
    display: table-cell;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
  }

  .admin-table th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .admin-table tr:hover td {
    background: rgba(201, 247, 90, 0.03);
  }

  .admin-table td::before {
    display: none;
  }

  .admin-table td.admin-actions-cell {
    display: table-cell;
    padding-top: 9px;
  }

  .admin-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
  }

  .admin-actions .btn {
    flex: 0 0 auto;
    min-height: 34px;
  }
}

/* ---------- login ---------- */
.login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 150px);
  padding: 8px 0;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 22px;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 800;
}

/* ---------- modal + toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(3, 6, 4, 0.72);
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px;
  padding-bottom: calc(18px + var(--safe-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: sheet-in 0.2s ease-out;
}

.modal::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  margin: -4px auto 14px;
  border-radius: 999px;
  background: var(--border-strong);
}

.modal h2 {
  font-size: 20px;
  font-weight: 800;
}

.modal h3 {
  font-size: 15px;
}

.modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin: 18px -18px calc(-18px - var(--safe-bottom));
  padding: 12px 18px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(18, 28, 21, 0.05), rgba(18, 28, 21, 0.98) 35%);
}

.modal .modal-actions .btn {
  flex: 1;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.seed-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.seed-row:last-child {
  border-bottom: 0;
}

.seed-btns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.seed-btn {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0b130d;
  color: var(--muted);
  font-weight: 800;
}

.seed-btn.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.toast-root {
  position: fixed;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  left: 12px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast.error {
  border-left-color: var(--bad);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 18px;
  }

  .modal {
    max-width: 560px;
    max-height: 88vh;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    animation: modal-in 0.18s ease-out;
  }

  .modal::before {
    display: none;
  }

  .modal .modal-actions {
    position: static;
    justify-content: flex-end;
    margin: 18px 0 0;
    padding: 0;
    background: none;
  }

  .modal .modal-actions .btn {
    flex: 0 0 auto;
  }

  .toast-root {
    right: 20px;
    left: auto;
    width: min(360px, calc(100vw - 40px));
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- larger layout ---------- */
@media (min-width: 640px) {
  .view {
    padding: 26px 22px calc(64px + var(--safe-bottom));
  }

  .page-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .page-head h1 {
    font-size: 29px;
  }

  .page-head .row {
    width: auto;
  }

  .panel {
    padding: 20px;
  }
}

@media (min-width: 980px) {
  .view {
    padding: 30px 24px calc(72px + var(--safe-bottom));
  }
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- overflow safety for long names/labels ---------- */
.chip,
.vr-skill strong,
.tuning-label strong {
  overflow-wrap: anywhere;
}

.admin-table td {
  overflow-wrap: anywhere;
  text-align: right;
}

.streak > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .admin-table td {
    text-align: left;
  }
}

/* ---------------------------------------------------------------------------
   Admin event log
   --------------------------------------------------------------------------- */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
}

.filters .field {
  margin-bottom: 0;
}

.event-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.event-row:first-child {
  border-top: 0;
}

.event-time {
  color: var(--muted);
  font-size: 0.76rem;
  min-width: 96px;
}

.event-text {
  flex: 1 1 190px;
  color: var(--text);
}

.event-user {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.event-decision {
  color: var(--accent);
  font-weight: 600;
}

.event-head {
  display: none;
}

.player-card.archived {
  opacity: 0.72;
}

@media (min-width: 760px) {
  .event-row {
    flex-wrap: nowrap;
  }
  .event-text {
    flex: 1 1 auto;
  }
  .event-head {
    display: flex;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .event-head .event-user {
    text-align: right;
  }
}
