@font-face {
  font-family: "Bungee";
  src: url("/static/fonts/Bungee-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #172033;
  --muted: #647083;
  --border: #d9e1ea;
  --line: #e8edf3;
  --primary: #176b87;
  --primary-strong: #0f5268;
  --accent: #c9792b;
  --success: #247a4d;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .45rem;
  background: var(--text);
  color: white;
  font-weight: 800;
  font-size: .8rem;
}

.brand strong { display: block; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: .75rem; margin-top: .1rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.main {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-title { margin: 0; font-size: 2rem; line-height: 1.08; }
.page-subtitle { margin: .35rem 0 0; color: var(--muted); }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 1rem;
  align-items: start;
}

.tournament-live-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .55fr);
}

.page-head-compact {
  align-items: center;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(99, 216, 242, .16);
}

.layout-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.league-workspace {
  display: grid;
  grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .5rem;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.panel-title { margin: 0; font-size: 1rem; font-weight: 700; }
.panel-body { padding: 1rem; }

.stack {
  display: grid;
  gap: .85rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: .45rem .75rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: .4rem .4rem 0 0;
  color: var(--muted);
  font-weight: 800;
}

.tab-active {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--border);
}

.tournament-tabs {
  margin-bottom: 1rem;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .85rem;
}

.metric small { color: var(--muted); display: block; font-size: .72rem; text-transform: uppercase; }
.metric strong { display: block; margin-top: .15rem; font-size: 1.35rem; }

.form-row { display: flex; gap: .55rem; align-items: center; }
.form-row input, .form-row select { min-width: 0; flex: 1; }

.input,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: .4rem;
  padding: .55rem .65rem;
  outline: none;
}

.input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, .12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  padding: .55rem .75rem;
  font-weight: 700;
  line-height: 1.15;
  min-height: 2.35rem;
  white-space: nowrap;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-compact {
  min-height: 2rem;
  padding: .38rem .55rem;
  font-size: .78rem;
}

.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.btn-secondary:hover { background: #e3ebf3; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-ghost { color: var(--primary); background: transparent; border-color: transparent; }
.btn:disabled { opacity: .48; cursor: not-allowed; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .74rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.badge-success { color: var(--success); background: #e6f4ed; }
.badge-warning { color: var(--warning); background: #fff4d6; }
.badge-danger { color: var(--danger); background: #fde8e7; }
.badge-primary { color: var(--primary); background: #e6f4f8; }

.table-wrap { overflow-x: auto; }
.league-ranking-wrap {
  margin-top: .85rem;
}

.league-player-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: center;
}

.league-player-actions .form-row {
  min-width: 0;
}

.data-table th,
.data-table td {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfcfe;
}
.data-table tbody tr:hover { background: #fbfcfe; }

.list {
  display: grid;
  gap: .55rem;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  background: #fff;
}

.player-row {
  padding: 0;
}

.player-row.is-inactive {
  opacity: .68;
}

.player-menu-button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 3rem;
  padding: .65rem .7rem;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.player-menu-button:hover,
.player-menu-button:focus {
  background: rgba(99, 216, 242, .08);
}

.player-name-wrap {
  display: grid;
  min-width: 0;
}

.player-name-wrap small,
.winner-line {
  color: var(--muted);
  font-size: .74rem;
}

.player-note {
  color: #ffd5aa;
}

.player-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: .75rem;
}

.player-card-button,
.picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  color: inherit;
  background: linear-gradient(180deg, rgba(8, 45, 57, .96), rgba(5, 31, 42, .96));
  text-align: left;
}

.player-card-button:hover,
.player-card-button:focus,
.picker-row:hover,
.picker-row:focus {
  border-color: var(--primary);
  background: rgba(99, 216, 242, .11);
}

.player-card-button strong,
.player-card-button small,
.picker-row strong,
.picker-row small {
  display: block;
}

.player-card-button small,
.picker-row small {
  color: var(--muted);
  font-size: .74rem;
}

.player-card-stats {
  display: grid;
  gap: .25rem;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.row-main {
  display: block;
  flex: 1 1 auto;
}

.field-label {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.seed-row { cursor: grab; }
.seed-row.dragging { opacity: .45; }
.seed-index {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  font-weight: 800;
  color: var(--muted);
  flex: 0 0 auto;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.match {
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #fff;
  overflow: visible;
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.match-body { padding: .75rem; display: grid; gap: .55rem; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .55rem; }
.player-pill {
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: #fff;
  min-width: 0;
}

.player-pill-win {
  border-color: rgba(177, 217, 91, .64);
  background: rgba(177, 217, 91, .16);
  box-shadow: inset 0 0 0 1px rgba(177, 217, 91, .18);
}

.player-pill-draw {
  border-color: rgba(242, 209, 41, .7);
  background: rgba(242, 209, 41, .16);
  box-shadow: inset 0 0 0 1px rgba(242, 209, 41, .18);
}

.player-pill-loss {
  border-color: rgba(242, 80, 93, .66);
  background: rgba(242, 80, 93, .16);
  box-shadow: inset 0 0 0 1px rgba(242, 80, 93, .16);
}

.vs { color: var(--muted); font-size: .75rem; font-weight: 800; }
.result-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.result-actions .btn { min-height: 2rem; padding: .4rem .55rem; font-size: .78rem; }

.round-block + .round-block { margin-top: 1rem; }
.round-completed { opacity: .86; }

details.round-completed {
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: rgba(3, 20, 27, .36);
}

.round-block summary {
  list-style: none;
  cursor: pointer;
}

.round-block summary::-webkit-details-marker { display: none; }

.round-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

.round-summary small {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-size: .74rem;
}

.round-completed .round-summary {
  margin-bottom: 0;
}

.round-completed[open] .round-summary {
  margin-bottom: .7rem;
}

.round-content {
  padding-top: .05rem;
}

.match-head-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  min-width: 0;
}

.result-menu {
  position: relative;
}

.result-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-height: 1.72rem;
  padding: .25rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(99, 216, 242, .08);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.result-menu summary::-webkit-details-marker { display: none; }

.result-menu svg {
  width: .9rem;
  height: .9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-menu-panel {
  position: absolute;
  top: calc(100% + .35rem);
  right: 0;
  z-index: 30;
  display: grid;
  gap: .35rem;
  min-width: 12rem;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.result-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2rem;
  padding: .42rem .55rem;
  border: 1px solid transparent;
  border-radius: .38rem;
  color: var(--text);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  text-align: left;
}

.result-option:hover,
.result-option:focus {
  border-color: var(--border);
  background: var(--surface-2);
}

.match-result-line {
  min-height: 1.55rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(99, 216, 242, .1);
  font-size: .78rem;
  font-weight: 900;
}

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

.empty {
  padding: 1.1rem;
  border: 1px dashed var(--border);
  border-radius: .5rem;
  color: var(--muted);
  background: #fbfcfe;
}

.callout {
  border-left: .24rem solid var(--accent);
  background: #fff7ed;
  padding: .8rem .9rem;
  border-radius: .35rem;
  color: #6f3f12;
}

.round-image-body {
  display: grid;
  grid-template-columns: minmax(18rem, .86fr) minmax(18rem, 1.14fr);
  gap: 1rem;
  align-items: start;
}

.round-image-controls {
  display: grid;
  gap: .25rem;
}

.round-image-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

.image-config {
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .28);
  overflow: hidden;
}

.image-config summary {
  cursor: pointer;
  padding: .72rem .8rem;
  color: var(--primary);
  font-weight: 900;
}

.image-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  padding: 0 .8rem .8rem;
}

.round-image-preview-wrap {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .75rem;
  background: rgba(3, 20, 27, .38);
}

.round-image-preview-wrap canvas {
  display: block;
  width: min(100%, 24rem);
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: .45rem;
  box-shadow: var(--shadow);
}

.manual-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1fr);
  gap: .55rem;
  align-items: center;
}

details.manual {
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .75rem;
  background: #fbfcfe;
}

details.manual summary {
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(460px, calc(100vw - 2rem));
  padding: .8rem 1rem;
  background: #101828;
  color: #fff;
  border-radius: .5rem;
  box-shadow: var(--shadow);
  z-index: 100;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(1, 8, 12, .72);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: #041923;
  box-shadow: var(--shadow);
}

.modal-card-sm {
  width: min(460px, 100%);
}

.modal-card-edit {
  width: min(640px, 100%);
}

.modal-backdrop-nested {
  z-index: 140;
  background: rgba(1, 8, 12, .52);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 20, 27, .96);
}

.modal-head h2 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.modal-body {
  display: grid;
  gap: .9rem;
  padding: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.textarea {
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.4rem;
  padding-top: 1.45rem;
  color: var(--muted);
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  color: var(--text);
  background: rgba(99, 216, 242, .08);
  font-weight: 900;
}

.player-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.history-row {
  display: grid;
  gap: .1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}

.history-row small {
  color: var(--muted);
  font-size: .74rem;
}

@media (max-width: 980px) {
  .layout-2,
  .layout-3,
  .league-workspace,
  .metric-strip,
  .match-grid,
  .round-image-body {
    grid-template-columns: 1fr;
  }
  .page-head { display: block; }
}

@media (max-width: 640px) {
  .main { padding: .85rem; }
  .page-title { font-size: 1.55rem; }
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .form-row { display: grid; }
  .league-player-actions { grid-template-columns: 1fr; }
  .deck-edit-form { grid-template-columns: 1fr; }
  .image-config-grid { grid-template-columns: 1fr; }
  .deck-editor-summary,
  .deck-modal-toolbar,
  .deck-modal-row,
  .deck-modal-row-form,
  .standing-card,
  .standing-core {
    grid-template-columns: 1fr;
  }
  .deck-editor-summary {
    display: grid;
  }
  .standing-core {
    justify-content: stretch;
    text-align: left;
  }
  .list-row { align-items: stretch; flex-direction: column; }
  .manual-row { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; }
  .vs { display: none; }
  .btn { width: 100%; white-space: normal; }
  .form-grid-2,
  .player-history {
    grid-template-columns: 1fr;
  }
}

/* Rotom League Dex theme */
:root {
  --bg: #03141b;
  --surface: #06222d;
  --surface-2: #082d39;
  --surface-3: #0b3542;
  --text: #ecfbff;
  --muted: #8fb4bf;
  --border: rgba(99, 216, 242, .22);
  --line: rgba(99, 216, 242, .14);
  --primary: #63d8f2;
  --primary-strong: #19a9c7;
  --accent: #f28d35;
  --success: #b1d95b;
  --danger: #f2505d;
  --warning: #f2d129;
  --shadow: 0 18px 46px rgba(0, 0, 0, .28);
}

body {
  background: linear-gradient(135deg, #020c12 0%, #031823 52%, #041118 100%);
  color: var(--text);
}

.shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.1rem;
  padding: 1rem;
  background: rgba(2, 19, 27, .92);
  border-right: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .03);
}

.brand {
  padding: .5rem .45rem .85rem;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: .7rem;
  border: 1px solid rgba(99, 216, 242, .35);
}

.brand strong {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.brand small { color: var(--primary); }

.side-nav {
  display: grid;
  gap: .45rem;
}

.side-nav-secondary {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 2.65rem;
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  color: #cdeef5;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.side-link:hover,
.side-link:focus {
  border-color: rgba(99, 216, 242, .28);
  background: rgba(99, 216, 242, .11);
  color: #fff;
}

.side-button {
  margin-top: .65rem;
  color: #ffc7c7;
}

.topbar-actions {
  margin-top: 1.75rem;
  display: grid;
  width: 100%;
  gap: .45rem;
}

.topbar-actions .btn { width: 100%; }

.main {
  width: min(1480px, 100%);
  padding: 1rem 1.25rem 5rem;
}

.page-head {
  min-height: 4.8rem;
  align-items: center;
  padding: .3rem 0 .65rem;
}

.page-title {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 900;
}

.deck-editor {
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}

.deck-editor-compact {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .28);
}

.deck-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

.deck-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.deck-editor-summary p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.live-tools {
  display: grid;
  gap: .7rem;
  padding: .75rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .3);
}

.live-tools-copy {
  display: grid;
  gap: .15rem;
}

.live-tools-copy strong {
  font-size: .9rem;
}

.live-tools-copy small {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
}

.live-tools-actions {
  display: grid;
  gap: .45rem;
}

.live-tools-actions .btn {
  width: 100%;
}

.user-list {
  display: grid;
  gap: .75rem;
}

.user-card {
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .28);
  overflow: hidden;
}

.user-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem;
  cursor: pointer;
}

.user-card summary span:first-child {
  display: grid;
  gap: .15rem;
}

.user-card summary small,
.check-row small {
  color: var(--muted);
  font-size: .74rem;
}

.user-card .settings-form {
  padding: .85rem;
  border-top: 1px solid var(--line);
}

.assignment-list {
  display: grid;
  gap: .4rem;
  max-height: 15rem;
  overflow: auto;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: rgba(0, 0, 0, .12);
}

.assignment-panel {
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(99, 216, 242, .05);
}

.assignment-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  cursor: pointer;
  color: var(--text);
  font-size: .86rem;
  font-weight: 900;
}

.assignment-panel .assignment-list {
  margin: 0 .7rem .7rem;
}

.assignment-panel .page-subtitle {
  margin: 0 .8rem .8rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--text);
  font-size: .84rem;
  font-weight: 800;
}

.check-row span {
  display: grid;
  gap: .08rem;
}

.deck-editor-head small,
.field-label small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.deck-editor-list {
  display: grid;
  gap: .55rem;
}

.deck-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: end;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  background: rgba(3, 20, 27, .38);
}

.deck-edit-form label {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.deck-edit-form label span {
  color: var(--text);
  font-size: .82rem;
  font-weight: 900;
}

.modal-card-decks {
  width: min(860px, 100%);
}

.deck-modal-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
}

.deck-modal-list {
  display: grid;
  gap: .55rem;
}

.deck-modal-row {
  display: grid;
  grid-template-columns: minmax(11rem, .7fr) minmax(16rem, 1.3fr);
  gap: .75rem;
  align-items: center;
  padding: .72rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .36);
}

.deck-modal-row.is-dropped {
  opacity: .72;
  background: rgba(64, 1, 1, .22);
}

.tdf-panel .settings-form {
  gap: .9rem;
}

.deck-modal-player {
  min-width: 0;
}

.deck-modal-player strong {
  display: block;
  color: var(--text);
  line-height: 1.2;
}

.deck-modal-player small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .74rem;
}

.deck-modal-row-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
}

.deck-input-wrap {
  position: relative;
  min-width: 0;
}

.deck-suggestions {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  z-index: 4;
  display: grid;
  gap: .25rem;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #041923;
  box-shadow: var(--shadow);
}

.deck-autocomplete-suggestion {
  display: grid;
  gap: .1rem;
  width: 100%;
  padding: .45rem .55rem;
  border-radius: .38rem;
  color: var(--text);
  text-align: left;
  background: rgba(99, 216, 242, .08);
}

.deck-autocomplete-suggestion:hover,
.deck-autocomplete-suggestion:focus {
  background: rgba(99, 216, 242, .16);
}

.deck-autocomplete-suggestion strong {
  font-size: .82rem;
}

.deck-autocomplete-suggestion small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.standings-compact {
  display: grid;
  gap: .55rem;
}

.tournament-live-layout .panel {
  min-width: 0;
}

.tournament-live-layout .panel-body {
  padding: .85rem;
}

.tournament-live-layout .standings-compact {
  max-height: calc(100vh - 18rem);
  overflow: auto;
  padding-right: .15rem;
}

.standing-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: start;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .34);
}

.standing-card:nth-child(2n) {
  background: rgba(99, 216, 242, .07);
}

.standing-rank {
  min-width: 2.2rem;
  padding-top: .15rem;
}

.standing-main {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.standing-name-line {
  display: grid;
  gap: .08rem;
  min-width: 0;
}

.standing-name-line strong {
  overflow: hidden;
  color: var(--text);
  font-size: .96rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-name-line small {
  color: var(--muted);
  font-size: .72rem;
}

.standing-deck-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 1.55rem;
  padding: .18rem .48rem;
  border: 1px solid rgba(99, 216, 242, .26);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(99, 216, 242, .1);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.2;
}

.standing-breakers summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
}

.standing-breaker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  margin-top: .45rem;
}

.standing-breaker-grid span,
.standing-core div {
  display: grid;
  gap: .08rem;
}

.standing-breaker-grid small,
.standing-core small {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.standing-breaker-grid strong {
  color: var(--text);
  font-size: .82rem;
}

.standing-core {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: .55rem;
  justify-content: end;
  min-width: 5.6rem;
  text-align: right;
}

.standing-core strong {
  color: #fff;
  font-size: 1.08rem;
}

.raffle-layout {
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(0, 1.22fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.raffle-control-panel {
  position: sticky;
  top: 1rem;
}

.raffle-form {
  display: grid;
  gap: .8rem;
}

.raffle-stage {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .7rem;
  background: radial-gradient(circle at center, rgba(99, 216, 242, .13), rgba(3, 20, 27, .58) 62%);
}

.raffle-wheel {
  position: relative;
  display: grid;
  place-items: center;
  gap: .3rem;
  min-height: 14rem;
  padding: 1rem;
  overflow: hidden;
  text-align: center;
}

.raffle-wheel-ring {
  position: absolute;
  inset: 1rem;
  border: .45rem solid rgba(99, 216, 242, .18);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
}

.raffle-wheel-spinning .raffle-wheel-ring {
  animation: raffleSpin .42s linear infinite;
}

.raffle-wheel-winner .raffle-wheel-ring {
  border-color: var(--success);
  box-shadow: 0 0 1.4rem rgba(177, 217, 91, .28);
}

.raffle-wheel strong {
  position: relative;
  z-index: 1;
  max-width: 90%;
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 2.35rem);
  line-height: 1.02;
}

.raffle-wheel small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 850;
}

.raffle-participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: .65rem;
}

.raffle-participant {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  min-width: 0;
  padding: .65rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .58rem;
  background: rgba(3, 20, 27, .36);
}

.raffle-participant strong,
.raffle-participant small {
  display: block;
  min-width: 0;
}

.raffle-participant small {
  color: var(--muted);
  font-size: .74rem;
}

.raffle-participant-won {
  opacity: .64;
  background: rgba(177, 217, 91, .08);
}

.raffle-history-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

@keyframes raffleSpin {
  to { transform: rotate(360deg); }
}

.detailed-ranking-wrap {
  border: 1px solid var(--border);
  border-radius: .55rem;
}

.detailed-ranking-table {
  min-width: 1040px;
}

.detailed-ranking-table th,
.detailed-ranking-table td {
  vertical-align: middle;
}

.deck-table-chip {
  display: inline-flex;
  max-width: 17rem;
  padding: .22rem .5rem;
  border: 1px solid rgba(99, 216, 242, .24);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(99, 216, 242, .1);
  font-size: .74rem;
  font-weight: 900;
  line-height: 1.2;
}

.standing-deck {
  color: var(--primary);
  font-weight: 800;
}

.standing-deck-empty {
  color: var(--muted);
  font-weight: 700;
}

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

.panel,
.metric,
.match,
.list-row,
.player-pill,
details.manual {
  background: linear-gradient(180deg, rgba(8, 45, 57, .96), rgba(5, 31, 42, .96));
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.panel { border-radius: .55rem; }

.panel-header,
.match-head {
  background: rgba(3, 20, 27, .66);
  border-bottom-color: var(--line);
}

.panel-title { color: #fff; }

.metric small,
.data-table th,
.field-label {
  color: var(--muted);
}

.metric strong { color: #fff; }

.tabs {
  margin-bottom: .85rem;
  border-bottom-color: var(--border);
}

.tab {
  color: var(--muted);
  background: rgba(8, 45, 57, .45);
  border-color: rgba(99, 216, 242, .1);
}

.tab-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(3, 140, 140, .32), rgba(8, 45, 57, .96));
  border-color: var(--primary);
}

.input,
select {
  background: #041923;
  border-color: var(--border);
  color: var(--text);
}

.input::placeholder { color: #5f8791; }

.input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 216, 242, .13);
}

.btn {
  border-radius: .45rem;
  font-weight: 900;
}

.btn-primary {
  background: linear-gradient(135deg, #038c8c, #63d8f2);
  color: #021014;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #63d8f2, #b1d95b);
}

.btn-secondary {
  color: #dff8ff;
  background: rgba(99, 216, 242, .08);
  border-color: var(--border);
}

.btn-secondary:hover { background: rgba(99, 216, 242, .16); }

.btn-danger {
  background: rgba(242, 80, 93, .17);
  border-color: rgba(242, 80, 93, .38);
  color: #ffc6cc;
}

.btn-ghost { color: var(--primary); }

.badge { background: rgba(99, 216, 242, .1); color: #bfeff7; }
.badge-success { background: rgba(177, 217, 91, .13); color: #d8ff86; }
.badge-warning { background: rgba(242, 209, 41, .13); color: #ffe86d; }
.badge-danger { background: rgba(242, 80, 93, .13); color: #ff9aa4; }
.badge-primary { background: rgba(99, 216, 242, .13); color: #8ff0ff; }

.data-table th { background: rgba(3, 20, 27, .72); }
.data-table td { border-bottom-color: var(--line); }
.data-table tbody tr:hover { background: rgba(99, 216, 242, .06); }

.seed-index {
  background: rgba(99, 216, 242, .12);
  color: var(--primary);
}

.empty {
  background: rgba(3, 20, 27, .48);
  color: var(--muted);
  border-color: var(--border);
}

.callout {
  background: rgba(242, 141, 53, .11);
  border-left-color: var(--accent);
  color: #ffd5aa;
}

.result-menu-panel {
  background: #041923;
  border-color: var(--border);
}

.result-option {
  color: var(--text);
}

.result-option:hover,
.result-option:focus {
  background: rgba(99, 216, 242, .1);
}

.match-result-line {
  color: var(--primary);
  background: rgba(99, 216, 242, .12);
}

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

.player-pill-win {
  border-color: rgba(177, 217, 91, .64);
  background: linear-gradient(180deg, rgba(177, 217, 91, .18), rgba(22, 71, 48, .55));
}

.player-pill-draw {
  border-color: rgba(242, 209, 41, .7);
  background: linear-gradient(180deg, rgba(242, 209, 41, .18), rgba(86, 73, 13, .45));
}

.player-pill-loss {
  border-color: rgba(242, 80, 93, .66);
  background: linear-gradient(180deg, rgba(242, 80, 93, .18), rgba(93, 20, 31, .45));
}

.tournament-floating-action {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.floating-action-btn,
.floating-action-wait {
  pointer-events: auto;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
}

.floating-action-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  background: #03141b;
  color: #fff;
  border: 1px solid var(--border);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(3, 140, 140, .16), transparent 34%),
    linear-gradient(315deg, rgba(242, 141, 53, .14), transparent 38%),
    #02080c;
}

.login-card {
  width: min(28rem, 100%);
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: rgba(3, 20, 27, .9);
  box-shadow: var(--shadow);
}

.login-logo {
  display: block;
  width: min(20rem, 100%);
  margin: 0 auto 1rem;
  border-radius: .65rem;
}

.login-form {
  display: grid;
  gap: .55rem;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .topbar-actions {
    margin-top: 0;
    display: flex;
  }
  .topbar-actions .btn { width: auto; }
}

@media (max-width: 640px) {
  .main { padding: .85rem; }
  .side-nav { grid-template-columns: 1fr 1fr; }
  .side-link { justify-content: center; text-align: center; }
  .topbar-actions { display: grid; }
  .topbar-actions .btn { width: 100%; }
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  color: var(--muted);
  background: rgba(99, 216, 242, .06);
  cursor: pointer;
}

.sidebar-toggle svg,
.side-icon svg,
.action-icon svg,
.rank-medal svg {
  width: 1.05rem;
  height: 1.05rem;
}

.sidebar-toggle svg,
.side-icon svg,
.action-icon svg,
.rank-medal svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-link {
  min-height: 2.75rem;
  align-items: center;
  gap: .7rem;
}

.side-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  min-width: 1.35rem;
  color: var(--primary);
}

.side-icon-badged {
  overflow: visible;
}

.nav-badge {
  position: absolute;
  top: -.52rem;
  right: -.62rem;
  display: inline-grid;
  place-items: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .22rem;
  border: 2px solid #02131b;
  border-radius: 999px;
  color: #02131b;
  background: var(--warning);
  font-size: .62rem;
  font-weight: 950;
  line-height: 1;
}

.side-link-active {
  color: #fff;
  background: rgba(99, 216, 242, .13);
  border-color: var(--primary);
}

.side-button { text-align: left; }

.action-btn {
  width: 100%;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  min-width: 1.15rem;
}

.shell.sidebar-collapsed {
  grid-template-columns: 5.25rem minmax(0, 1fr);
}

.sidebar-collapsed .topbar {
  align-items: center;
  padding-inline: .72rem;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .side-label,
.sidebar-collapsed .action-label {
  display: none;
}

.sidebar-collapsed .side-link,
.sidebar-collapsed .action-btn {
  justify-content: center;
  padding-inline: .65rem;
}

.sidebar-collapsed .topbar-actions {
  margin-top: 1.4rem;
}

.sidebar-collapsed .action-btn {
  width: 2.75rem;
  min-height: 2.75rem;
  padding: .55rem;
}

.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.rank-medal {
  display: inline-grid;
  grid-template-columns: 1rem auto;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 2.45rem;
  padding: .22rem .38rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 900;
}

.rank-1 {
  color: #ffe66d;
  background: rgba(242, 209, 41, .14);
}

.rank-2 {
  color: #d9e4ea;
  background: rgba(136, 137, 140, .16);
}

.rank-3 {
  color: #ffad6d;
  background: rgba(242, 100, 48, .14);
}

.rank-plain {
  color: var(--muted);
  font-weight: 800;
}

.hof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: .85rem;
}

.hof-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hof-card {
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: linear-gradient(180deg, rgba(8, 45, 57, .96), rgba(5, 31, 42, .98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hof-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem .85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 20, 27, .58);
}

.hof-card-head small {
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
}

.hof-podium {
  display: grid;
  gap: .55rem;
  padding: .75rem;
}

.hof-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem;
  border: 1px solid rgba(99, 216, 242, .1);
  border-radius: .45rem;
  background: rgba(3, 20, 27, .48);
}

.hof-rank-1 {
  border-color: rgba(242, 209, 41, .36);
  background: rgba(242, 209, 41, .08);
}

.hof-player {
  min-width: 0;
}

.hof-player strong,
.hof-player small {
  display: block;
}

.hof-player strong {
  color: #fff;
}

.hof-player small,
.version-summary,
.copyright {
  color: var(--muted);
  font-size: .8rem;
}

.hof-admin-panel .panel-body {
  background:
    linear-gradient(90deg, rgba(99, 216, 242, .04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(99, 216, 242, .035) 1px, transparent 1px);
  background-size: 22px 22px;
}

.hof-public-panel .panel-body {
  padding: .9rem;
}

.hof-public-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(99, 216, 242, .2);
}

.hof-public-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, #3d7dff, #50c878, #f2505d, #f28d35);
  opacity: .85;
}

.hof-arcade-stage {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.hof-arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .95rem;
}

.hof-arcade-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.hof-arcade-card {
  --hof-main: #3d7dff;
  --hof-accent: #63d8f2;
  --hof-deep: #071e5b;
  position: relative;
  overflow: hidden;
  min-height: 22rem;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: .35rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(135deg, var(--hof-deep), rgba(3, 20, 27, .98) 68%);
  background-size: 14px 14px, 14px 14px, auto;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

.hof-arcade-card::before,
.hof-arcade-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hof-arcade-card::before {
  inset: .5rem;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18);
}

.hof-arcade-card::after {
  right: -2.4rem;
  bottom: -2.8rem;
  width: 10rem;
  height: 10rem;
  border: 1.4rem solid color-mix(in srgb, var(--hof-main) 45%, transparent);
  opacity: .26;
  transform: rotate(45deg);
}

.hof-arcade-blue {
  --hof-main: #3d7dff;
  --hof-accent: #63d8f2;
  --hof-deep: #071e5b;
}

.hof-arcade-green {
  --hof-main: #50c878;
  --hof-accent: #b1d95b;
  --hof-deep: #06361f;
}

.hof-arcade-red {
  --hof-main: #f2505d;
  --hof-accent: #f28d35;
  --hof-deep: #4b0711;
}

.hof-pixel-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1rem 1rem 1rem 1fr;
  gap: .32rem;
  align-items: center;
  padding: .65rem .8rem;
  color: #fff;
  background: rgba(2, 12, 18, .72);
  border-bottom: 2px solid color-mix(in srgb, var(--hof-main) 64%, transparent);
  font-family: "Bungee", Inter, sans-serif;
  font-size: .72rem;
  letter-spacing: 0;
}

.hof-pixel-bar span {
  width: .72rem;
  height: .72rem;
  background: var(--hof-main);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .22);
}

.hof-pixel-bar span:nth-child(2) {
  background: var(--hof-accent);
}

.hof-pixel-bar span:nth-child(3) {
  background: #fff;
}

.hof-pixel-bar strong {
  justify-self: end;
}

.hof-arcade-screen {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .75rem;
  padding: .95rem;
}

.hof-arcade-title {
  display: grid;
  gap: .18rem;
  padding-bottom: .65rem;
  border-bottom: 2px dashed rgba(255, 255, 255, .14);
}

.hof-arcade-title small,
.hof-champion-slot small,
.hof-party-slot small,
.hof-save-line {
  color: color-mix(in srgb, var(--hof-accent) 72%, #fff);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hof-arcade-title strong {
  color: #fff;
  font-family: "Bungee", Inter, sans-serif;
  font-size: clamp(1.18rem, 4vw, 2rem);
  line-height: 1;
}

.hof-arcade-title em {
  color: rgba(255, 255, 255, .7);
  font-style: normal;
  font-size: .78rem;
}

.hof-champion-slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
  padding: .85rem;
  border: 2px solid color-mix(in srgb, var(--hof-main) 55%, #fff);
  border-radius: .25rem;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--hof-main) 20%, transparent), rgba(0, 0, 0, .24)),
    rgba(3, 20, 27, .74);
}

.hof-pixel-trophy .rank-medal {
  width: 3rem;
  height: 3rem;
  border-radius: .25rem;
  background: var(--hof-main);
  color: #fff;
  box-shadow: .28rem .28rem 0 rgba(0, 0, 0, .34);
}

.hof-champion-slot strong,
.hof-party-slot strong {
  display: block;
  min-width: 0;
  color: #fff;
  font-family: "Bungee", Inter, sans-serif;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.hof-champion-slot strong {
  font-size: clamp(1.4rem, 5vw, 2.35rem);
}

.hof-champion-slot em {
  display: block;
  margin-top: .2rem;
  color: rgba(255, 255, 255, .74);
  font-style: normal;
  font-size: .82rem;
}

.hof-party-slots {
  display: grid;
  gap: .5rem;
}

.hof-party-slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
  padding: .62rem .7rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: .25rem;
  background: rgba(0, 0, 0, .26);
}

.hof-party-slot .rank-medal {
  border-radius: .2rem;
  min-width: 2.3rem;
  color: #fff;
  background: color-mix(in srgb, var(--hof-main) 78%, #111);
}

.hof-party-rank-2 .rank-medal {
  background: #88898c;
}

.hof-party-rank-3 .rank-medal {
  background: #f26430;
}

.hof-save-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .1rem;
  padding-top: .65rem;
  border-top: 2px dashed rgba(255, 255, 255, .14);
}

.hof-save-line b {
  color: #fff;
  font-family: "Bungee", Inter, sans-serif;
  font-size: .78rem;
  font-weight: 400;
}

.public-active-league,
.operation-spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(99, 216, 242, .22);
  border-radius: .5rem;
  background:
    linear-gradient(135deg, rgba(99, 216, 242, .14), rgba(3, 20, 27, .92) 52%),
    rgba(3, 20, 27, .9);
  box-shadow: var(--shadow);
}

.public-active-league h2,
.operation-spotlight h2 {
  margin: .15rem 0;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
}

.public-active-league p,
.operation-spotlight p {
  margin: 0;
  color: var(--muted);
}

.operation-spotlight small {
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
}

.operation-list {
  gap: .6rem;
}

.operation-row {
  border-color: rgba(99, 216, 242, .16);
  background: rgba(99, 216, 242, .06);
}

.operation-registration-stack {
  gap: .75rem;
}

.operation-registration-row {
  align-items: flex-start;
  border: 1px solid rgba(242, 209, 41, .2);
  border-radius: .45rem;
  background: rgba(242, 209, 41, .045);
}

.audit-list {
  display: grid;
  gap: .55rem;
}

.audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  border: 1px solid rgba(99, 216, 242, .12);
  border-radius: .45rem;
  background: rgba(3, 20, 27, .36);
}

.audit-row strong,
.audit-row small {
  display: block;
}

.audit-row small {
  color: var(--muted);
  font-size: .76rem;
}

.backup-import-box {
  padding: .75rem;
  border: 1px dashed rgba(242, 100, 48, .45);
  border-radius: .45rem;
  background: rgba(242, 100, 48, .055);
}

.public-mode .shell {
  display: block;
}

.public-mode .topbar {
  display: none;
}

.public-mode .main {
  width: min(1180px, 100%);
  padding-top: 1.25rem;
}

.public-nav {
  position: sticky;
  top: .7rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: .7rem;
  background: rgba(3, 20, 27, .88);
  backdrop-filter: blur(14px);
}

.public-nav-brand img {
  display: block;
  width: 6.5rem;
  max-height: 2.6rem;
  object-fit: contain;
  object-position: left center;
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.public-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.25rem;
  padding: .4rem .65rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  color: #cdeef5;
  font-weight: 850;
}

.public-nav-link:hover,
.public-nav-link:focus,
.public-nav-link-active {
  color: #fff;
  border-color: rgba(99, 216, 242, .28);
  background: rgba(99, 216, 242, .11);
}

.public-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(99, 216, 242, .12);
  border-radius: .45rem;
  color: rgba(205, 238, 245, .5);
  background: rgba(99, 216, 242, .035);
}

.public-admin-link:hover,
.public-admin-link:focus {
  color: var(--primary);
  border-color: rgba(99, 216, 242, .26);
  background: rgba(99, 216, 242, .08);
}

.public-admin-link svg {
  width: .95rem;
  height: .95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}

.public-home-hero {
  min-height: 13rem;
}

.public-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-section {
  margin-top: 1rem;
}

.public-logo {
  width: min(14rem, 60vw);
  max-height: 5.5rem;
  object-fit: contain;
  object-position: left center;
  display: block;
  margin-bottom: .65rem;
}

.winner-stack {
  display: grid;
  gap: .75rem;
}

.winner-card {
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .42);
  overflow: hidden;
}

.winner-card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
}

.winner-card-head small {
  color: var(--muted);
  font-size: .7rem;
}

.winner-podium {
  display: grid;
  gap: .45rem;
  padding: .65rem;
}

.winner-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem;
  border-radius: .45rem;
  background: rgba(99, 216, 242, .07);
}

.winner-row span {
  display: grid;
  min-width: 0;
}

.winner-row small {
  color: var(--muted);
  font-size: .72rem;
}

.public-home-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 4rem;
  padding: .75rem;
}

.public-home-card strong,
.public-home-card small {
  display: block;
}

.public-home-card small {
  margin-top: .12rem;
  color: var(--muted);
  font-size: .74rem;
}

.event-stack {
  display: grid;
  gap: .65rem;
}

.event-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  padding: .75rem;
  border: 1px solid rgba(99, 216, 242, .16);
  border-radius: .55rem;
  background: linear-gradient(180deg, rgba(8, 45, 57, .88), rgba(3, 20, 27, .66));
}

.event-date-pill {
  display: grid;
  place-items: center;
  width: 3.15rem;
  min-height: 3.15rem;
  border: 1px solid rgba(242, 141, 53, .55);
  border-radius: .55rem;
  color: #ffd19f;
  background: rgba(242, 141, 53, .12);
}

.event-date-pill strong {
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
}

.event-date-pill small {
  margin-top: .12rem;
  font-size: .65rem;
  font-weight: 900;
}

.event-card-body {
  display: grid;
  gap: .2rem;
  min-width: 0;
}

.event-card-body strong,
.event-card-body small {
  display: block;
}

.event-card-body small,
.event-card-body p {
  color: var(--muted);
  font-size: .74rem;
}

.event-card-body p {
  margin: .15rem 0 0;
}

.public-event-link:hover,
.public-event-link:focus {
  border-color: rgba(99, 216, 242, .36);
  background: linear-gradient(180deg, rgba(8, 56, 70, .95), rgba(3, 20, 27, .78));
}

.event-chip-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .15rem;
}

.event-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .55rem;
}

.event-detail-item {
  display: grid;
  gap: .12rem;
  min-width: 0;
  padding: .62rem .7rem;
  border: 1px solid rgba(99, 216, 242, .14);
  border-radius: .48rem;
  background: rgba(8, 45, 57, .54);
}

.event-detail-item span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}

.event-detail-item strong {
  color: #fff;
  font-size: .98rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.admin-event-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.check-row-compact {
  min-height: auto;
  padding-top: .1rem;
}

.event-registrations {
  margin-top: .5rem;
  padding: .55rem;
  border: 1px solid rgba(99, 216, 242, .14);
  border-radius: .5rem;
  background: rgba(3, 20, 27, .42);
}

.event-registrations summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 900;
}

.registration-stack {
  display: grid;
  gap: .45rem;
  margin-top: .55rem;
}

.registration-row {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
  align-items: center;
  padding: .55rem;
  border: 1px solid rgba(99, 216, 242, .12);
  border-radius: .45rem;
  background: rgba(8, 45, 57, .72);
}

.registration-row strong,
.registration-row small {
  display: block;
}

.registration-row small {
  color: var(--muted);
  font-size: .72rem;
}

.registration-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: wrap;
}

.registration-main {
  display: grid;
  gap: .45rem;
  min-width: 0;
}

.registration-review {
  display: grid;
  gap: .45rem;
  margin-top: .4rem;
  padding: .5rem;
  border: 1px solid rgba(99, 216, 242, .12);
  border-radius: .45rem;
  background: rgba(3, 20, 27, .38);
}

.suggestion-block {
  display: grid;
  gap: .35rem;
}

.suggestion-block > small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.suggestion-list {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.suggestion-chip,
.player-suggestion {
  border: 1px solid rgba(99, 216, 242, .18);
  color: #dff8ff;
  background: rgba(99, 216, 242, .08);
  cursor: pointer;
}

.suggestion-chip {
  min-height: 1.85rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
}

.player-suggestion-stack {
  display: grid;
  gap: .35rem;
}

.player-suggestion {
  width: 100%;
  display: grid;
  gap: .12rem;
  padding: .45rem .55rem;
  border-radius: .45rem;
  text-align: left;
}

.player-suggestion:hover,
.player-suggestion:focus,
.suggestion-chip:hover,
.suggestion-chip:focus {
  border-color: rgba(99, 216, 242, .38);
  background: rgba(99, 216, 242, .14);
}

.player-suggestion em {
  color: var(--primary);
  font-size: .68rem;
  font-style: normal;
  font-weight: 850;
}

.suggestion-action {
  justify-self: start;
  margin-top: .1rem;
  padding: .18rem .42rem;
  border-radius: 999px;
  color: #02131b;
  background: var(--primary);
  font-size: .66rem;
  font-weight: 950;
}

.exact-match-block {
  padding: .45rem;
  border: 1px solid rgba(177, 217, 91, .24);
  border-radius: .45rem;
  background: rgba(177, 217, 91, .08);
}

.player-suggestion-exact {
  border-color: rgba(177, 217, 91, .5);
  background: linear-gradient(180deg, rgba(177, 217, 91, .16), rgba(8, 45, 57, .74));
}

.soft-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}

.featured-grid,
.public-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .65rem;
}

.featured-player-card,
.public-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-height: 4.7rem;
  padding: .75rem;
  border: 1px solid rgba(99, 216, 242, .16);
  border-radius: .55rem;
  background: linear-gradient(180deg, rgba(8, 45, 57, .88), rgba(3, 20, 27, .66));
}

.featured-player-card strong,
.featured-player-card small,
.public-player-card strong,
.public-player-card small {
  display: block;
}

.featured-player-card small,
.public-player-card small {
  margin-top: .12rem;
  color: var(--muted);
  font-size: .72rem;
}

.featured-medal {
  flex: 0 0 auto;
}

.featured-stats {
  display: grid;
  justify-items: end;
  color: var(--primary);
}

.featured-stats b {
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
}

.featured-stats small {
  font-size: .68rem;
}

.public-search-box {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .7rem;
}

.public-search-box .input {
  flex: 1;
}

.public-player-more {
  justify-content: center;
  text-align: center;
  border-style: dashed;
}

.top-deck-highlight-grid {
  display: grid;
  gap: .7rem;
}

.top-deck-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .8rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .6rem;
  background: linear-gradient(90deg, rgba(8, 45, 57, .95), rgba(3, 20, 27, .68));
}

.top-deck-rank-1,
.top-deck-rank-2,
.top-deck-rank-3 {
  border-color: rgba(242, 209, 41, .42);
  background: linear-gradient(90deg, rgba(21, 80, 95, .98), rgba(3, 20, 27, .72));
}

.top-deck-rank {
  width: 2.4rem;
  display: flex;
  justify-content: center;
}

.top-deck-main {
  min-width: 0;
}

.top-deck-main strong,
.top-deck-main small,
.top-deck-rate b,
.top-deck-rate small {
  display: block;
}

.top-deck-main small,
.top-deck-rate small {
  color: var(--muted);
  font-size: .72rem;
}

.top-deck-rate {
  text-align: right;
}

.top-deck-rate b {
  color: #fff;
  font-size: 1.1rem;
}

.public-deckdex-cta {
  display: flex;
  justify-content: center;
  margin-top: .9rem;
}

.public-deck-tools {
  flex-wrap: wrap;
}

.public-deck-tools .public-deck-search {
  min-width: min(22rem, 100%);
}

.public-deck-tools .public-deck-sort {
  flex: 0 0 10rem;
}

.top-decks-table {
  min-width: 620px;
}

.trainer-profile {
  display: grid;
  gap: .9rem;
}

.trainer-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  min-height: 9.5rem;
  padding: 1rem;
  border: 1px solid rgba(99, 216, 242, .34);
  border-radius: .7rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(99, 216, 242, .18), transparent 34%),
    linear-gradient(315deg, rgba(242, 141, 53, .22), transparent 34%),
    linear-gradient(180deg, rgba(8, 45, 57, .96), rgba(3, 20, 27, .98));
}

.trainer-hero::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5.5rem auto;
  width: 15rem;
  height: 15rem;
  border: 1.7rem solid rgba(99, 216, 242, .08);
  border-radius: 50%;
}

.trainer-hero h2 {
  position: relative;
  z-index: 1;
  margin: .2rem 0 .35rem;
  color: #fff;
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 1;
  font-weight: 950;
}

.trainer-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #c8edf4;
}

.trainer-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  color: var(--warning);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.trainer-emblem {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  min-width: 4.2rem;
  justify-content: flex-end;
}

.trainer-emblem .rank-medal {
  transform: scale(1.2);
  transform-origin: top right;
}

.stat-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
}

.profile-stat {
  min-height: 5rem;
  padding: .75rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .55rem;
  background: linear-gradient(180deg, rgba(8, 45, 57, .92), rgba(3, 20, 27, .82));
}

.profile-stat small {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}

.profile-stat strong {
  display: block;
  margin-top: .2rem;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.05;
}

.profile-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: .9rem;
  align-items: start;
}

.profile-block {
  min-width: 0;
  padding: .9rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .6rem;
  background: rgba(3, 20, 27, .42);
}

.profile-block .panel-title {
  margin-bottom: .7rem;
}

.profile-rank-block {
  background:
    linear-gradient(90deg, rgba(99, 216, 242, .09), transparent),
    rgba(3, 20, 27, .42);
}

.league-rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .65rem;
}

.league-rank-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  min-width: 0;
  padding: .65rem;
  border: 1px solid rgba(99, 216, 242, .18);
  border-radius: .58rem;
  background: rgba(8, 45, 57, .48);
}

.league-rank-card strong,
.league-rank-card small {
  display: block;
  min-width: 0;
}

.league-rank-card small {
  color: var(--muted);
  font-size: .76rem;
}

.profile-table-wrap {
  border: 1px solid rgba(99, 216, 242, .12);
  border-radius: .5rem;
}

.profile-table {
  width: 100%;
  min-width: 560px;
}

.profile-table td strong,
.profile-table td small {
  display: block;
}

.profile-table td small {
  color: var(--muted);
  font-size: .72rem;
}

.profile-table th,
.profile-table td {
  padding: .55rem .6rem;
}

.history-stack {
  display: grid;
  gap: .55rem;
}

.history-stack-compact {
  gap: .45rem;
}

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 0;
  padding: .65rem .7rem;
  border: 1px solid rgba(99, 216, 242, .14);
  border-radius: .5rem;
  background: rgba(8, 45, 57, .62);
}

.history-card strong,
.history-card small {
  display: block;
}

.history-card strong {
  color: #fff;
}

.history-card small {
  color: var(--muted);
  font-size: .72rem;
}

.history-metric {
  display: grid;
  justify-items: end;
  gap: .2rem;
  flex: 0 0 auto;
  text-align: right;
}

.history-win {
  border-color: rgba(177, 217, 91, .34);
  background: linear-gradient(180deg, rgba(177, 217, 91, .13), rgba(8, 45, 57, .55));
}

.history-draw {
  border-color: rgba(242, 209, 41, .34);
  background: linear-gradient(180deg, rgba(242, 209, 41, .12), rgba(8, 45, 57, .55));
}

.history-loss {
  border-color: rgba(242, 80, 93, .34);
  background: linear-gradient(180deg, rgba(242, 80, 93, .12), rgba(8, 45, 57, .55));
}

.settings-form {
  display: grid;
  gap: .55rem;
}

.deck-icon {
  --deck-color: #63D8F2;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--deck-color), white 18%);
  border-radius: .45rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--deck-color), #001018 35%), rgba(3, 20, 27, .92));
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
  color: white;
  font-family: var(--display-font);
  font-size: .72rem;
}

.deck-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-icon-xs {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: .35rem;
  font-size: .55rem;
}

.deck-icon-lg {
  width: 3rem;
  height: 3rem;
  border-radius: .65rem;
}

.deck-name-visual,
.standing-player-name,
.standing-name-line {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}

.profile-deck-line {
  display: inline-flex;
  margin-top: .35rem;
}

.deck-catalog-form,
.deck-catalog-edit {
  display: grid;
  gap: .65rem;
}

.deck-catalog-form {
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .52);
}

.deck-catalog-grid {
  display: grid;
  gap: .8rem;
}

.deck-catalog-card {
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .85rem;
  background: linear-gradient(180deg, rgba(8, 45, 57, .78), rgba(3, 20, 27, .66));
}

.avatar-studio-section {
  display: grid;
  gap: .65rem;
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(99, 216, 242, .14);
}

.section-kicker {
  margin: 0;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.avatar-sprite-form-grid,
.avatar-palette-grid {
  display: grid;
  gap: .6rem;
}

.avatar-sprite-form,
.avatar-palette-form,
.avatar-palette-create {
  display: grid;
  gap: .55rem;
  padding: .65rem;
  border: 1px solid rgba(99, 216, 242, .16);
  border-radius: .55rem;
  background: rgba(3, 20, 27, .46);
}

.avatar-sprite-form-head,
.avatar-palette-form {
  align-items: center;
}

.avatar-sprite-form-head {
  display: flex;
  gap: .6rem;
}

.avatar-sprite-form-head span,
.avatar-sprite-form-head small {
  display: block;
}

.avatar-sprite-form-head small {
  color: var(--muted);
}

.avatar-palette-create,
.avatar-palette-form {
  grid-template-columns: minmax(0, 1fr) 4rem auto;
}

.avatar-palette-form {
  grid-template-columns: auto minmax(0, 1fr) 4rem auto auto auto;
}

.avatar-palette-form.is-inactive {
  opacity: .58;
}

.avatar-color-swatch {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: .45rem;
}

.deck-catalog-card.is-inactive {
  opacity: .62;
}

.deck-catalog-card-head,
.deck-catalog-tools {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.deck-catalog-card-head span {
  min-width: 0;
}

.deck-catalog-card-head small {
  display: block;
  color: var(--muted);
}

.deck-catalog-tools input[type="color"] {
  width: 4rem;
  padding: .2rem;
}

.deck-autocomplete-suggestion {
  align-items: center;
}

.promotion-preview-list {
  display: grid;
  gap: .45rem;
}

.promotion-mini-row,
.promotion-public-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: rgba(3, 20, 27, .46);
}

.promotion-mini-row strong,
.promotion-public-card strong {
  display: block;
  color: var(--text);
}

.promotion-mini-row small,
.promotion-public-card small {
  color: var(--muted);
}

.promotion-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .75rem;
}

.rank-promotion-public {
  margin-bottom: 1rem;
}

.avatar-sprite {
  --avatar-main: #28cde1;
  --avatar-dark: #075d70;
  --avatar-light: #bff8ff;
  --avatar-line: #06131b;
  --avatar-skin: #f4c590;
  --avatar-boot: #16313d;
  --avatar-white: #f4fbff;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-block;
  flex: 0 0 auto;
  image-rendering: pixelated;
  isolation: isolate;
  overflow: visible;
}

.avatar-xs { width: 1.45rem; height: 1.45rem; }
.avatar-sm { width: 2rem; height: 2rem; }
.avatar-md { width: 2.7rem; height: 2.7rem; }
.avatar-lg { width: 4rem; height: 4rem; }
.avatar-xl { width: 5.2rem; height: 5.2rem; }
.avatar-profile { width: 7rem; height: 7rem; }

.avatar-cyan { --avatar-main: #63D8F2; --avatar-dark: #038C8C; --avatar-light: #c9fbff; }
.avatar-amber { --avatar-main: #F28D35; --avatar-dark: #8a470b; --avatar-light: #ffd49d; }
.avatar-lime { --avatar-main: #B1D95B; --avatar-dark: #4f7720; --avatar-light: #e5ff9d; }
.avatar-rose { --avatar-main: #F279B2; --avatar-dark: #8b315b; --avatar-light: #ffc3df; }
.avatar-violet { --avatar-main: #9f8cff; --avatar-dark: #4d3b9a; --avatar-light: #ddd7ff; }
.avatar-slate { --avatar-main: #88989C; --avatar-dark: #344247; --avatar-light: #d5dee0; }

.avatar-sprite i {
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.avatar-uploaded {
  background: transparent;
}

.avatar-uploaded-bg {
  left: 6%;
  top: 6%;
  width: 88%;
  height: 88%;
  border: .08rem solid rgba(255,255,255,.34);
  border-radius: .35rem;
  background: var(--avatar-bg, var(--avatar-main));
  box-shadow: inset 0 0 0 .08rem rgba(3, 20, 27, .55), 0 .18rem .45rem rgba(0,0,0,.22);
  z-index: 0;
}

.avatar-custom-sprite {
  position: absolute;
  z-index: 30;
  left: 2%;
  top: 0;
  width: 96%;
  height: 98%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 .08rem 0 rgba(3, 20, 27, .82)) drop-shadow(.08rem 0 0 rgba(3, 20, 27, .5));
  pointer-events: none;
}

.avatar-shadow {
  left: 14%;
  right: 12%;
  bottom: 0;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .34);
  z-index: 0;
}

.avatar-leg {
  top: 70%;
  width: 14%;
  height: 19%;
  background: var(--avatar-boot);
  border: .08rem solid var(--avatar-line);
  z-index: 2;
}

.avatar-leg-left {
  left: 33%;
  box-shadow: -.08rem .12rem 0 var(--avatar-line);
}

.avatar-leg-right {
  right: 33%;
  box-shadow: .08rem .12rem 0 var(--avatar-line);
}

.avatar-body {
  left: 30%;
  top: 43%;
  width: 40%;
  height: 31%;
  border: .08rem solid var(--avatar-line);
  border-radius: .05rem;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,.35) 18% 27%, transparent 27% 100%),
    linear-gradient(180deg, var(--avatar-light) 0 18%, var(--avatar-main) 18% 68%, var(--avatar-dark) 68% 100%);
  box-shadow: 0 .12rem 0 rgba(0, 0, 0, .38);
  z-index: 4;
}

.avatar-body::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 48%;
  height: 13%;
  background: var(--avatar-line);
}

.avatar-arm {
  top: 47%;
  width: 13%;
  height: 27%;
  background: linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
  border: .08rem solid var(--avatar-line);
  z-index: 3;
}

.avatar-arm-left {
  left: 19%;
  transform: rotate(8deg);
}

.avatar-arm-right {
  right: 19%;
  transform: rotate(-8deg);
}

.avatar-head {
  left: 29%;
  top: 17%;
  width: 42%;
  height: 31%;
  border: .08rem solid var(--avatar-line);
  border-radius: .05rem .05rem .12rem .12rem;
  background: var(--avatar-skin);
  z-index: 6;
}

.avatar-hair {
  left: 27%;
  top: 13%;
  width: 46%;
  height: 17%;
  border: .08rem solid var(--avatar-line);
  border-bottom: 0;
  border-radius: .05rem .05rem 0 0;
  background: #24343d;
  z-index: 7;
}

.avatar-cap {
  left: 20%;
  top: 7%;
  width: 60%;
  height: 18%;
  border: .08rem solid var(--avatar-line);
  background:
    linear-gradient(90deg, var(--avatar-white) 0 23%, var(--avatar-main) 23% 78%, var(--avatar-dark) 78% 100%);
  z-index: 8;
}

.avatar-cap::after {
  content: "";
  position: absolute;
  right: -24%;
  bottom: -42%;
  width: 34%;
  height: 45%;
  border: .08rem solid var(--avatar-line);
  background: var(--avatar-main);
}

.avatar-face {
  left: 39%;
  top: 31%;
  width: 7%;
  height: 7%;
  background: #03141b;
  box-shadow: .42rem 0 0 #03141b;
  z-index: 9;
}

.avatar-pack,
.avatar-badge,
.avatar-cape {
  display: none;
}

.avatar-pack {
  left: 12%;
  top: 43%;
  width: 18%;
  height: 33%;
  border: .08rem solid var(--avatar-line);
  background: linear-gradient(180deg, #eef8ff, var(--avatar-main));
  z-index: 2;
}

.avatar-badge {
  left: 58%;
  top: 49%;
  width: 13%;
  height: 13%;
  border: .06rem solid var(--avatar-line);
  background: #f2d129;
  z-index: 7;
}

.avatar-cape {
  left: 18%;
  top: 40%;
  width: 64%;
  height: 51%;
  border: .08rem solid var(--avatar-line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 30% 70%, rgba(0,0,0,.22)),
    linear-gradient(180deg, #f2505d, #400101);
  z-index: 1;
}

.avatar-crown,
.avatar-trophy {
  display: none;
}

.avatar-crown {
  left: 24%;
  top: -4%;
  width: 52%;
  height: 20%;
  border: .08rem solid var(--avatar-line);
  background: #F2D129;
  clip-path: polygon(0 100%, 0 45%, 18% 45%, 18% 10%, 39% 52%, 50% 0, 61% 52%, 82% 10%, 82% 45%, 100% 45%, 100% 100%);
  z-index: 10;
}

.avatar-trophy {
  right: 2%;
  top: 40%;
  width: 16%;
  height: 26%;
  border: .07rem solid var(--avatar-line);
  background: #F2D129;
  z-index: 7;
}

.avatar-trophy::before {
  content: "";
  position: absolute;
  left: -42%;
  right: -42%;
  top: 18%;
  height: 38%;
  border: .06rem solid var(--avatar-line);
  border-bottom: 0;
}

.avatar-rank-challenger .avatar-pack,
.avatar-rank-ace .avatar-pack,
.avatar-rank-leader .avatar-pack {
  display: block;
}

.avatar-rank-ace .avatar-body,
.avatar-rank-leader .avatar-body,
.avatar-rank-champion .avatar-body {
  left: 27%;
  width: 46%;
  height: 33%;
  background:
    linear-gradient(90deg, rgba(255,255,255,.45) 0 14%, transparent 14% 72%, rgba(0,0,0,.18) 72% 100%),
    linear-gradient(180deg, var(--avatar-light) 0 15%, var(--avatar-main) 15% 62%, var(--avatar-dark) 62% 100%);
}

.avatar-rank-ace .avatar-badge,
.avatar-rank-leader .avatar-badge,
.avatar-rank-champion .avatar-badge {
  display: block;
}

.avatar-rank-leader .avatar-cape,
.avatar-rank-champion .avatar-cape {
  display: block;
}

.avatar-rank-leader .avatar-arm-right,
.avatar-rank-champion .avatar-arm-right {
  top: 43%;
  transform: rotate(-38deg);
}

.avatar-rank-leader .avatar-cap {
  top: 5%;
  height: 16%;
  background:
    linear-gradient(90deg, var(--avatar-main) 0 25%, var(--avatar-white) 25% 45%, var(--avatar-main) 45% 100%);
}

.avatar-rank-champion .avatar-cap {
  display: none;
}

.avatar-rank-champion .avatar-crown,
.avatar-rank-champion .avatar-trophy {
  display: block;
}

.avatar-rank-champion .avatar-body {
  top: 41%;
  height: 36%;
  box-shadow: 0 0 0 .12rem rgba(242, 209, 41, .35), 0 .12rem 0 rgba(0, 0, 0, .38);
}

.avatar-rank-champion .avatar-head {
  top: 15%;
}

.avatar-rank-champion .avatar-hair {
  top: 11%;
}

.trainer-rank-label {
  display: inline-block;
  margin-top: .3rem;
  color: var(--accent);
}

.avatar-preview-grid {
  display: grid;
  gap: .8rem;
}

.avatar-preview-family {
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .8rem;
  background: rgba(3, 20, 27, .48);
}

.avatar-preview-title,
.avatar-rank-row,
.avatar-rank-chip {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.avatar-rank-row {
  flex-wrap: wrap;
  margin-top: .65rem;
}

.avatar-rank-chip {
  border: 1px solid var(--line);
  border-radius: .55rem;
  padding: .45rem;
  background: rgba(7, 47, 59, .6);
}

.avatar-rank-chip small {
  color: var(--muted);
}

body {
  background: linear-gradient(135deg, #020c12 0%, #031823 52%, #041118 100%);
}

@media (max-width: 980px) {
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .layout-2,
  .league-workspace,
  .raffle-layout,
  .tournament-live-layout {
    grid-template-columns: 1fr;
  }
  .raffle-control-panel {
    position: static;
  }
  .side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .profile-sections {
    grid-template-columns: 1fr;
  }
  .stat-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .side-nav {
    grid-template-columns: 1fr 1fr;
  }
  .public-hero {
    display: grid;
  }
  .public-nav {
    align-items: stretch;
    flex-direction: column;
  }
  .public-nav-brand img {
    margin-inline: auto;
  }
  .public-actions,
  .public-search-box {
    display: grid;
    justify-content: stretch;
  }
  .public-active-league,
  .operation-spotlight,
  .audit-row {
    align-items: stretch;
    flex-direction: column;
  }
  .trainer-hero {
    display: grid;
  }
  .trainer-emblem {
    justify-content: flex-start;
  }
  .stat-ribbon {
    grid-template-columns: 1fr;
  }
  .history-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-event-card,
  .event-card {
    grid-template-columns: 1fr;
  }
  .event-date-pill {
    width: 100%;
    min-height: 2.8rem;
  }
  .event-actions {
    justify-content: stretch;
  }
  .registration-row,
  .registration-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .history-metric {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  body:not(.public-mode) .shell,
  body:not(.public-mode) .shell.sidebar-collapsed {
    display: block;
    grid-template-columns: 1fr;
  }

  body:not(.public-mode) .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .45rem;
    padding: .55rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  body:not(.public-mode) .brand {
    padding: 0;
    border-bottom: 0;
  }

  body:not(.public-mode) .brand-logo {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .55rem;
  }

  body:not(.public-mode) .brand-copy {
    display: none;
  }

  body:not(.public-mode) .sidebar-toggle {
    justify-self: end;
  }

  body:not(.public-mode) .side-nav,
  body:not(.public-mode) .topbar-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: .08rem;
  }

  body:not(.public-mode) .side-nav-secondary {
    margin-top: 0;
    padding-top: .4rem;
    border-top: 1px solid var(--line);
  }

  body:not(.public-mode) .side-link,
  body:not(.public-mode) .action-btn {
    flex: 0 0 auto;
    min-height: 2.35rem;
    padding: .45rem .6rem;
    border-radius: .45rem;
    white-space: nowrap;
  }

  body:not(.public-mode) .topbar-actions .btn {
    width: auto;
  }

  body:not(.public-mode) .sidebar-collapsed .side-label,
  body:not(.public-mode) .sidebar-collapsed .action-label {
    display: none;
  }

  body:not(.public-mode) .sidebar-collapsed .side-link,
  body:not(.public-mode) .sidebar-collapsed .action-btn {
    width: 2.55rem;
    justify-content: center;
    padding-inline: .55rem;
  }

  body:not(.public-mode) .main {
    padding: .85rem;
  }

  .public-nav {
    top: .35rem;
    align-items: center;
    flex-direction: row;
    overflow: hidden;
  }

  .public-nav-brand img {
    width: 3rem;
    margin-inline: 0;
  }

  .public-nav-links {
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .public-nav-link {
    flex: 0 0 auto;
    min-height: 2.1rem;
    padding-inline: .55rem;
    white-space: nowrap;
  }

  .public-admin-link {
    flex: 0 0 auto;
    width: 1.9rem;
    height: 1.9rem;
  }
}
