:root {
  --bg: #000;
  --bg-soft: #080808;
  --panel: #101010;
  --panel-2: #141414;
  --panel-3: #191919;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-soft-2: rgba(255, 255, 255, 0.05);
  --surface-soft-3: rgba(255, 255, 255, 0.065);
  --surface-divider: rgba(255, 255, 255, 0.09);
  --surface-dash: rgba(255, 255, 255, 0.14);
  --surface-glow: rgba(212, 176, 103, 0.18);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f1e8;
  --text-soft: rgba(245, 241, 232, 0.76);
  --text-dim: rgba(245, 241, 232, 0.48);
  --accent: #d4b067;
  --accent-strong: #efc97f;
  --accent-soft: rgba(212, 176, 103, 0.14);
  --brand-block: #42ddb5;
  --brand-block-strong: #8bf4d7;
  --brand-ink: #091117;
  --brand-shadow: rgba(66, 221, 181, 0.26);
  --green: #89ad73;
  --green-strong: #a9ca8d;
  --green-soft: rgba(137, 173, 115, 0.15);
  --amber: #d49b53;
  --amber-soft: rgba(212, 155, 83, 0.15);
  --danger: #d36a61;
  --danger-soft: rgba(211, 106, 97, 0.15);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 4px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-soft: #ece4d6;
  --panel: #f7f1e6;
  --panel-2: #fbf7f0;
  --panel-3: #efe7d9;
  --surface-soft: rgba(38, 28, 12, 0.04);
  --surface-soft-2: rgba(38, 28, 12, 0.06);
  --surface-soft-3: rgba(38, 28, 12, 0.08);
  --surface-divider: rgba(38, 28, 12, 0.11);
  --surface-dash: rgba(38, 28, 12, 0.16);
  --surface-glow: rgba(187, 144, 66, 0.16);
  --line: rgba(38, 28, 12, 0.12);
  --line-strong: rgba(38, 28, 12, 0.18);
  --text: #1f1a12;
  --text-soft: rgba(31, 26, 18, 0.76);
  --text-dim: rgba(31, 26, 18, 0.5);
  --accent: #bb9042;
  --accent-strong: #9d742a;
  --accent-soft: rgba(187, 144, 66, 0.14);
  --brand-block: #1fb78f;
  --brand-block-strong: #5dd6b5;
  --brand-ink: #071015;
  --brand-shadow: rgba(31, 183, 143, 0.2);
  --green: #6f8e5f;
  --green-strong: #597549;
  --green-soft: rgba(111, 142, 95, 0.15);
  --amber: #b97b34;
  --amber-soft: rgba(185, 123, 52, 0.15);
  --danger: #b35c57;
  --danger-soft: rgba(179, 92, 87, 0.14);
  --shadow: 0 18px 40px rgba(42, 29, 9, 0.08);
}

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

html {
  color-scheme: dark;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font: 14px/1.5 "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
}

body::before {
  display: none;
}

body.booting {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(212, 176, 103, 0.28);
  color: #fff8ef;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none !important;
}

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

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

code {
  padding: 0 0.32em;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.94em;
}

.hidden {
  display: none !important;
}

.auth-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 8, 0.8);
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

html[data-theme="light"] .auth-loading-screen {
  background: rgba(244, 239, 229, 0.82);
}

html[data-theme="light"] .user-menu-item.danger,
html[data-theme="light"] .form-hint.error,
html[data-theme="light"] .record-chip.loss,
html[data-theme="light"] .record-total.loss,
html[data-theme="light"] .person-badge.loser,
html[data-theme="light"] .person-badge.loser:hover,
html[data-theme="light"] .person-badge.loser.is-active {
  color: #9b443d;
}

html[data-theme="light"] .form-hint.success,
html[data-theme="light"] .winner-picker .result-btn.win.is-active {
  color: #4f6941;
}

html[data-theme="light"] .winner-picker .result-btn.draw.is-active,
html[data-theme="light"] .result-pill.draw,
html[data-theme="light"] .status-overdue,
html[data-theme="light"] .status-draw {
  color: #8a5f25;
}

html[data-theme="light"] .avatar-chip {
  border-color: rgba(38, 28, 12, 0.14);
  box-shadow: 0 2px 6px rgba(42, 29, 9, 0.14);
}

.auth-loading-screen.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-loading-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: min(420px, 100%);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  transform: translateY(0) scale(1);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.auth-loading-screen.hidden .auth-loading-mark {
  opacity: 0.9;
  transform: translateY(10px) scale(0.985);
}

.loading-rings {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.loading-rings span {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 999px;
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
}

.loading-rings span:nth-child(2) {
  inset: 7px;
  border-top-color: var(--green);
  animation-duration: 1.36s;
  animation-direction: reverse;
}

.loading-rings span:nth-child(3) {
  inset: 16px;
  border-top-color: rgba(255, 255, 255, 0.7);
  animation-duration: 1.54s;
}

.auth-loading-copy {
  display: grid;
  gap: 4px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.02em;
  padding: 0.08em 0.16em 0.12em;
  border-radius: 0.18em;
  background: #0b0e12;
  font-family: "Bebas Neue", "Space Grotesk", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.82;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-wordmark-base {
  color: #f8f5ee;
}

.brand-wordmark-block {
  display: inline-block;
  min-width: auto;
  padding: 0;
  background: none;
  color: #d4b067;
  box-shadow: none;
}

.auth-loading-brand {
  font-size: 34px;
}

.auth-loading-subline,
.auth-subtitle,
.form-note,
.form-hint,
.sidebar-copy,
.page-copy,
.section-copy,
.debate-subline,
.detail-row,
.mini-copy,
.muted-note,
.summary-note,
.top-stat-label,
.empty-state p {
  color: var(--text-soft);
}

.auth-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(560px, 100%);
}

.auth-intro,
.auth-card,
.topbar,
.sidebar,
.section-panel,
.side-section,
.profile-card,
.empty-state,
.unauthorized-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-intro,
.auth-card {
  padding: 24px;
}

.auth-intro {
  position: relative;
  overflow: hidden;
  background: var(--panel);
}

.auth-intro::after {
  display: none;
}

.auth-kicker,
.page-kicker,
.panel-label,
.brand-kicker,
.summary-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.auth-intro h1 {
  position: relative;
  z-index: 1;
  margin: 16px 0 14px;
  max-width: 600px;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.93;
}

.auth-intro p {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0;
  color: var(--text-soft);
}

.auth-points {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.auth-points div {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.auth-card {
  align-content: start;
  min-width: 0;
}

.auth-hero {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.auth-brand {
  display: inline-flex;
  font-size: 50px;
}

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

.tab-btn,
.nav-btn,
.secondary-btn,
.ghost-btn,
.result-btn {
  border-radius: var(--radius-sm);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.tab-btn,
.nav-btn {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-weight: 600;
}

.tab-btn.is-active,
.nav-btn.is-active {
  border-color: rgba(212, 176, 103, 0.32);
  background: rgba(212, 176, 103, 0.12);
  color: var(--text);
}

.auth-form,
.schedule-form {
  display: grid;
  gap: 12px;
}

.field,
.field-row {
  display: grid;
  gap: 8px;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-tabs {
  margin-top: 4px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:hover,
.custom-select-trigger:focus-visible {
  border-color: rgba(212, 176, 103, 0.44);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(212, 176, 103, 0.1);
}

.custom-select-value.is-placeholder {
  color: rgba(245, 241, 232, 0.42);
}

.custom-select-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
}

.custom-select.is-open .custom-select-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 18;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.custom-select-search-shell {
  padding: 2px;
}

.custom-select-search {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.custom-select-options {
  display: grid;
  gap: 2px;
  max-height: 224px;
  overflow: auto;
  padding-right: 2px;
}

.custom-select-option {
  width: 100%;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option:focus-visible,
.custom-select-option.is-selected {
  background: rgba(212, 176, 103, 0.12);
}

.custom-select-create {
  color: var(--accent-strong);
}

.custom-select-empty {
  padding: 10px 11px;
  color: var(--text-dim);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(245, 241, 232, 0.42);
}

.password-input-shell {
  position: relative;
}

.password-input-shell input {
  padding-right: 48px;
}

.password-visibility-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  transition: color 0.16s ease, background 0.16s ease;
}

.password-visibility-btn:hover,
.password-visibility-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.password-eye {
  width: 18px;
  height: 18px;
}

.password-eye-off {
  display: none;
}

.password-visibility-btn.is-visible .password-eye-open {
  display: none;
}

.password-visibility-btn.is-visible .password-eye-off {
  display: block;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(212, 176, 103, 0.44);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(212, 176, 103, 0.1);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-btn {
  color: #1d1509;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(212, 176, 103, 0.16);
}

.secondary-btn {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-soft-2);
}

.ghost-btn {
  color: var(--text-soft);
  border-color: var(--line);
  background: transparent;
}

.result-btn {
  min-height: 38px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
}

.result-btn.win {
  border-color: rgba(137, 173, 115, 0.28);
  background: var(--green-soft);
}

.result-btn.draw {
  border-color: rgba(212, 155, 83, 0.28);
  background: var(--amber-soft);
}

.result-btn.reopen {
  border-color: rgba(255, 255, 255, 0.14);
}

.winner-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.winner-picker .result-btn {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 0 14px;
}

.winner-picker .result-btn.is-active {
  box-shadow: 0 0 0 1px rgba(245, 241, 232, 0.08), 0 0 0 4px rgba(212, 176, 103, 0.08);
}

.winner-picker .result-btn.win.is-active {
  border-color: rgba(137, 173, 115, 0.42);
  background: rgba(137, 173, 115, 0.18);
  color: #d9ebc4;
}

.winner-picker .result-btn.draw.is-active {
  border-color: rgba(212, 155, 83, 0.42);
  background: rgba(212, 155, 83, 0.18);
  color: #ffd595;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.result-btn:hover,
.tab-btn:hover,
.nav-btn:hover,
.summary-tile:hover,
.debate-card:hover,
.side-section:hover {
  transform: translateY(-1px);
}

.form-hint {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
}

.form-hint.error {
  color: #f3a69f;
}

.form-hint.success {
  color: #b9d6a5;
}

.form-note {
  margin: -6px 0 0;
  font-size: 12px;
}

.hub-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: var(--bg-soft);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: none;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-row h1 {
  margin: 0;
  font-size: 38px;
  line-height: 0.95;
}

.brand-row p {
  margin: 0;
  color: var(--text-dim);
  white-space: nowrap;
}

.brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
}

.search-shell {
  position: relative;
  min-width: 0;
}

.search-field {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.search-field:focus-within,
.search-shell.is-open .search-field {
  border-color: rgba(212, 176, 103, 0.3);
  background: var(--panel-3);
}

.search-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.search-field input {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-field input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-results-button,
.search-field input[type="search"]::-webkit-search-results-decoration {
  appearance: none;
}

.search-clear {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
}

.search-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 24;
  display: grid;
  gap: 4px;
  max-height: 340px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.search-results-panel {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  max-height: none;
  box-shadow: none;
}

.search-results-shell {
  min-height: 240px;
}

.search-suggestion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.search-suggestion:hover,
.search-suggestion.is-active {
  border-color: rgba(212, 176, 103, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.search-suggestion-kind,
.detail-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.search-suggestion-copy {
  display: grid;
  min-width: 0;
}

.search-suggestion-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-meta,
.search-suggestion-note {
  color: var(--text-soft);
  font-size: 12px;
}

.search-suggestion-note {
  text-align: right;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-stat {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 74px;
}

.top-stat-value {
  font-size: 17px;
  font-weight: 700;
}

.user-menu {
  position: relative;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft-3);
}

.user-pill[aria-expanded="true"] {
  border-color: rgba(212, 176, 103, 0.32);
  background: rgba(212, 176, 103, 0.12);
}

.avatar-chip,
.rank-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-weight: 700;
}

.avatar-chip {
  --avatar-bg: #3b82f6;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 42%, rgba(0, 0, 0, 0.18) 84%),
    var(--avatar-bg);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.avatar-chip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-chip-initials {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.user-pill-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.user-pill-copy span {
  color: var(--text-dim);
  font-size: 11px;
}

.role-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(212, 176, 103, 0.14);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.user-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  min-width: 208px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  z-index: 15;
}

.account-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.account-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.account-modal-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.account-modal-title {
  margin: 0;
  font-size: 1.9rem;
  line-height: 0.96;
}

.account-modal-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 24px;
  line-height: 1;
}

.account-modal-close:hover {
  background: var(--surface-soft-2);
  color: var(--text);
}

.account-modal-form,
.account-modal-fields {
  display: grid;
  gap: 12px;
}

.account-modal-actions {
  justify-content: flex-end;
}

.user-menu-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.user-menu-item:hover {
  background: var(--surface-soft-2);
}

.user-menu-item.danger {
  color: #f2a39c;
}

.workspace {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
}

.sidebar {
  position: sticky;
  top: 80px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-btn {
  display: block;
  padding: 9px 10px;
  font-size: 12px;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.main-content,
.side-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.page-shell {
  display: grid;
  gap: 16px;
  animation: fadeUp 0.28s ease;
}

.page-hero,
.section-panel,
.side-section,
.profile-card,
.empty-state,
.unauthorized-panel {
  padding: 20px;
}

.page-hero {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-hero::after {
  display: none;
}

.page-hero-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.page-hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.page-avatar {
  width: 58px;
  height: 58px;
}

.page-avatar .avatar-chip-initials {
  font-size: 22px;
}

.page-title {
  position: relative;
  z-index: 1;
  margin: 10px 0 6px;
  max-width: 820px;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  line-height: 0.92;
}

.profile-hero .page-hero-identity {
  align-items: flex-start;
}

.profile-hero .page-avatar {
  margin-top: 14px;
}

.profile-hero .page-title {
  margin: 0;
}

.page-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0;
}

.hero-actions,
.section-actions,
.form-actions,
.admin-actions,
.meta-row,
.detail-grid,
.people-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-grid,
.section-grid {
  display: grid;
  gap: 14px;
}

.summary-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-rating-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.schedule-form-grid {
  align-items: stretch;
}

.schedule-form-grid > .section-panel {
  min-height: clamp(560px, calc(100vh - 240px), 780px);
  display: flex;
  flex-direction: column;
}

.schedule-form-grid > .section-panel > .panel-scroll.is-feed {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.archive-feed-panel {
  height: clamp(860px, calc(100vh - 120px), 1180px);
  max-height: clamp(860px, calc(100vh - 120px), 1180px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.archive-feed-panel > .panel-scroll.is-feed {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.rankings-table-panel {
  height: min(89vh, 1120px);
  max-height: min(89vh, 1120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rankings-table-panel > .panel-scroll.is-table {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.summary-tile {
  padding: 16px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--panel-2);
}

.summary-value {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.summary-value-compact {
  font-size: 22px;
}

.category-rating-card,
.mobile-category-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--panel-2);
}

.category-rating-card.is-featured,
.mobile-category-card.is-featured {
  border-color: rgba(212, 176, 103, 0.36);
  background: linear-gradient(180deg, rgba(212, 176, 103, 0.14), rgba(255, 255, 255, 0.03));
}

.category-rating-value {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
}

.category-rating-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.record-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.record-strip.is-compact {
  gap: 6px;
  margin-top: 4px;
}

.record-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.record-strip.is-compact .record-chip {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.record-chip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.record-chip strong {
  font-size: 1em;
}

.record-chip.win,
.record-total.win {
  border-color: rgba(137, 173, 115, 0.28);
  background: rgba(137, 173, 115, 0.12);
  color: var(--green-strong);
}

.record-chip.loss,
.record-total.loss {
  border-color: rgba(211, 106, 97, 0.28);
  background: rgba(211, 106, 97, 0.1);
  color: #f1a39d;
}

.record-chip.draw,
.record-total.draw {
  border-color: rgba(212, 155, 83, 0.28);
  background: rgba(212, 155, 83, 0.1);
  color: #f1c27d;
}

.admin-control-stack,
.mobile-admin-stack {
  display: grid;
  gap: 10px;
  width: 100%;
}

.admin-video-field {
  width: min(420px, 100%);
}

.admin-video-field input {
  min-height: 40px;
}

.admin-user-list {
  display: grid;
  gap: 12px;
}

.admin-user-manager,
.admin-user-search-results {
  display: grid;
  gap: 12px;
}

.admin-user-search-field {
  min-height: 44px;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--panel-2);
}

.admin-user-head,
.admin-user-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-identity {
  justify-content: flex-start;
}

.admin-user-meta {
  color: var(--text-dim);
  font-size: 12px;
  word-break: break-all;
}

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

.record-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 28px;
}

.summary-note {
  margin-top: 5px;
  font-size: 12px;
}

.section-panel,
.side-section,
.profile-card,
.unauthorized-panel {
  background: var(--panel);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 1.18rem;
}

.section-copy {
  margin: 0;
}

.debate-list,
.mini-list,
.ranking-list {
  display: grid;
  gap: 12px;
}

.panel-scroll {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.panel-scroll.is-feed {
  max-height: min(68vh, 860px);
}

.panel-scroll.is-results {
  max-height: min(56vh, 540px);
}

.panel-scroll.is-table {
  max-height: min(72vh, 760px);
  padding-right: 0;
}

.panel-scroll.is-comments {
  max-height: min(38vh, 420px);
}

.panel-scroll.is-side {
  max-height: min(28vh, 260px);
}

.panel-scroll.is-queue {
  max-height: min(44vh, 420px);
}

.queue-groups {
  display: grid;
  gap: 16px;
}

.queue-group {
  display: grid;
  gap: 10px;
}

.queue-group + .queue-group {
  padding-top: 16px;
  border-top: 1px solid var(--surface-divider);
}

.queue-group h3 {
  margin: 0;
}

.panel-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.panel-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.debate-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: var(--panel-2);
}

.schedule-page .page-hero,
.schedule-page .section-panel,
.schedule-page .debate-card,
.schedule-page .detail-row,
.schedule-page .custom-select-trigger,
.schedule-page .custom-select-menu,
.schedule-page .custom-select-option,
.schedule-page input,
.schedule-page textarea,
.schedule-page .primary-btn,
.schedule-page .secondary-btn,
.schedule-page .ghost-btn,
.schedule-page .person-badge,
.schedule-page .mini-tag,
.schedule-page .status-chip,
.schedule-page .result-pill {
  border-radius: 2px;
}

.debate-card-link {
  cursor: pointer;
}

.debate-card-link:focus-visible {
  outline: 1px solid rgba(212, 176, 103, 0.4);
  outline-offset: 3px;
}

.debate-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.debate-topic {
  margin: 10px 0 6px;
  font-size: 1.24rem;
  line-height: 1.2;
}

.status-chip,
.person-badge,
.result-pill,
.mini-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
}

.status-chip {
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-scheduled {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-resolved {
  background: var(--green-soft);
  color: var(--green-strong);
}

.status-overdue,
.status-draw {
  background: var(--amber-soft);
  color: #f1c27d;
}

.status-admin {
  background: rgba(212, 176, 103, 0.18);
  color: var(--accent-strong);
}

.category-tag {
  border: 1px solid rgba(212, 176, 103, 0.24);
  background: rgba(212, 176, 103, 0.12);
  color: var(--accent-strong);
}

.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.profile-link-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.profile-link-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.profile-avatar-sm {
  width: 24px;
  height: 24px;
}

.profile-avatar-lg {
  width: 32px;
  height: 32px;
}

.profile-link:hover,
.profile-link.is-active {
  color: var(--accent-strong);
}

.profile-link:focus-visible {
  outline: 1px solid rgba(212, 176, 103, 0.4);
  outline-offset: 2px;
}

.profile-link-strong {
  font-weight: 700;
}

.person-badge {
  min-width: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.person-badge.me {
  border-color: rgba(212, 176, 103, 0.28);
  background: rgba(212, 176, 103, 0.11);
}

.person-badge.winner {
  border-color: rgba(137, 173, 115, 0.28);
  background: rgba(137, 173, 115, 0.12);
  color: var(--green-strong);
}

.person-badge.winner:hover,
.person-badge.winner.is-active {
  color: var(--green-strong);
}

.person-badge.loser {
  border-color: rgba(211, 106, 97, 0.3);
  background: rgba(211, 106, 97, 0.12);
  color: #f1a39d;
}

.person-badge.loser:hover,
.person-badge.loser.is-active {
  color: #f1a39d;
}

.mini-tag {
  min-width: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
}

.people-row .person-badge {
  min-width: 82px;
  min-height: 36px;
  padding: 0 20px;
}

.people-row .mini-tag {
  min-width: 56px;
  min-height: 36px;
  padding: 0 18px;
}

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

.detail-grid.is-single {
  grid-template-columns: 1fr;
}

.debate-page-grid {
  align-items: start;
}

.debate-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.detail-row strong {
  color: var(--text);
  font-size: 14px;
}

.detail-row.is-winner {
  border-color: rgba(137, 173, 115, 0.28);
  background: rgba(137, 173, 115, 0.12);
}

.detail-row.is-winner .detail-label,
.detail-row.is-winner strong {
  color: var(--green-strong);
}

.detail-row .profile-link {
  justify-self: start;
  font-size: 14px;
}

.muted-note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--surface-divider);
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.video-frame-shell {
  overflow: hidden;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.video-frame-shell iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

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

.comment-head .profile-link {
  min-width: 0;
}

.comment-card p {
  margin: 0;
  color: var(--text-soft);
}

.result-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.result-pill.positive {
  border-color: rgba(137, 173, 115, 0.28);
  background: rgba(137, 173, 115, 0.12);
  color: var(--green-strong);
}

.result-pill.draw {
  border-color: rgba(212, 155, 83, 0.28);
  background: rgba(212, 155, 83, 0.12);
  color: #f1c27d;
}

.ranking-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--surface-divider);
  text-align: left;
}

.ranking-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ranking-table tr:last-child td {
  border-bottom: 0;
}

.ranking-table tbody tr:hover,
.ranking-table tbody tr.ranking-row-link:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.ranking-table tbody tr.ranking-row-link {
  cursor: pointer;
}

.ranking-table tbody tr.ranking-row-link:focus-visible td {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(212, 176, 103, 0.42);
}

.rank-badge {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.rating-cell {
  font-weight: 700;
}

.ranking-player-cell {
  min-width: 220px;
}

.side-section h3,
.profile-card h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
}

.mini-row,
.rail-ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-divider);
}

.mini-row:first-child,
.rail-ranking-item:first-child {
  padding-top: 0;
}

.mini-row:last-child,
.rail-ranking-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mini-row-copy,
.rail-ranking-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mini-stat {
  font-weight: 700;
}

.record-meta-row {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.profile-record {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profile-record div {
  padding: 12px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.profile-record strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.profile-record .record-strip {
  margin-top: 6px;
}

.snapshot-section {
  display: grid;
  gap: 12px;
}

.snapshot-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.snapshot-avatar {
  width: 42px;
  height: 42px;
}

.snapshot-avatar .avatar-chip-initials {
  font-size: 16px;
}

.snapshot-identity h3 {
  margin: 0;
  font-size: 1.08rem;
}

.snapshot-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.snapshot-stat,
.snapshot-record {
  padding: 14px;
  border: 1px solid var(--surface-divider);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.snapshot-stat {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 92px;
}

.snapshot-stat strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.snapshot-record {
  display: grid;
  gap: 10px;
}

.snapshot-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.snapshot-record .record-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.snapshot-record .record-chip {
  width: 100%;
  min-height: 40px;
  justify-content: space-between;
  padding: 0 12px;
}

.snapshot-record .record-chip-label {
  font-size: 11px;
}

.empty-state,
.unauthorized-panel {
  display: grid;
  gap: 10px;
}

.empty-state {
  min-height: 180px;
  place-items: center;
  text-align: center;
  border-style: dashed;
  border-color: var(--surface-dash);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--surface-soft);
}

.empty-state h3,
.unauthorized-panel h3 {
  margin: 0;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
  color: var(--text);
}

.toast.error {
  border-color: rgba(211, 106, 97, 0.28);
}

.toast.success {
  border-color: rgba(137, 173, 115, 0.28);
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .board {
    grid-template-columns: 1fr;
  }

  .side-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-rating-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .auth-screen {
    min-height: 100svh;
    place-items: center;
  }

  .auth-shell {
    width: min(560px, 100%);
  }

  .auth-shell,
  .workspace,
  .board,
  .topbar,
  .section-grid,
  .field-row,
  .side-content {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-top: 12px;
  }

  .sidebar {
    position: static;
  }

  .schedule-form-grid > .section-panel {
    min-height: 0;
    display: grid;
  }

  .schedule-form-grid > .section-panel > .panel-scroll.is-feed {
    flex: initial;
    max-height: min(68vh, 860px);
  }

  .archive-feed-panel {
    min-height: 0;
    display: grid;
  }

  .archive-feed-panel > .panel-scroll.is-feed {
    flex: initial;
    max-height: min(68vh, 860px);
  }

  .rankings-table-panel {
    height: auto;
    max-height: none;
    display: grid;
  }

  .rankings-table-panel > .panel-scroll.is-table {
    flex: initial;
    max-height: min(72vh, 760px);
  }

  .topbar-meta {
    justify-content: space-between;
  }

  .winner-picker {
    grid-template-columns: 1fr;
  }

  .search-suggestion {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-suggestion-note {
    display: none;
  }
}

@media (max-width: 720px) {
  .auth-screen,
  .workspace {
    padding: 12px;
  }

  .topbar {
    padding: 12px;
  }

  .auth-intro,
  .auth-card,
  .sidebar,
  .page-hero,
  .section-panel,
  .side-section,
  .profile-card,
  .unauthorized-panel,
  .empty-state {
    padding: 16px;
  }

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

  .brand-row h1,
  .auth-brand {
    font-size: 34px;
  }

  .brand-row p {
    display: none;
  }

  .category-rating-grid,
  .summary-grid,
  .profile-record,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    min-height: 44px;
  }

  .topbar-meta {
    flex-wrap: wrap;
  }

  .top-stat {
    min-width: 0;
    flex: 1 1 0;
    justify-items: start;
  }

  .user-pill {
    width: 100%;
    justify-content: space-between;
  }

  .ranking-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    max-width: none;
  }
}

body.is-mobile-app {
  overscroll-behavior-y: none;
  --mobile-tab-safe-pad: max(calc(env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px)) * 0.22), 0.22rem);
  --mobile-tabbar-height: 66px;
}

.is-mobile-app .hub-shell {
  min-height: 100svh;
  padding-bottom: calc(var(--mobile-tabbar-height) + var(--mobile-tab-safe-pad));
}

.is-mobile-app .topbar {
  display: none;
}

.is-mobile-app .search-shell,
.is-mobile-app .top-stat,
.is-mobile-app .side-content {
  display: none !important;
}

.is-mobile-app .brand-mark {
  gap: 10px;
}

.is-mobile-app .brand-logo {
  width: 28px;
  height: 28px;
}

.is-mobile-app .brand-row h1 {
  font-size: 26px;
}

.is-mobile-app .topbar-meta {
  justify-content: flex-end;
}

.is-mobile-app .user-pill {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
}

.is-mobile-app .user-pill-copy {
  display: none;
}

.is-mobile-app .workspace {
  display: block;
  padding: 0 12px calc(var(--mobile-tabbar-height) + var(--mobile-tab-safe-pad) + 10px);
}

.is-mobile-app .board {
  grid-template-columns: 1fr;
  gap: 0;
}

.is-mobile-app .main-content {
  gap: 20px;
}

.is-mobile-app .sidebar {
  position: fixed;
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.34rem 0.46rem var(--mobile-tab-safe-pad);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #000;
  box-shadow: 0 -18px 36px rgba(0, 0, 0, 0.44);
}

.is-mobile-app .sidebar-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.18rem;
  align-items: end;
}

.is-mobile-app .nav-btn {
  min-width: 0;
  min-height: 50px;
  padding: 0.38rem 0.14rem 0.42rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(245, 241, 232, 0.48);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.2rem;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  box-shadow: none;
}

.is-mobile-app .nav-btn::before {
  content: "";
  width: 19px;
  height: 19px;
  background: currentColor;
  opacity: 0.94;
  -webkit-mask: var(--mobile-nav-icon) center / contain no-repeat;
  mask: var(--mobile-nav-icon) center / contain no-repeat;
}

.is-mobile-app .nav-btn[data-page-link="search"] {
  --mobile-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='5.8' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M16 16l4 4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.is-mobile-app .nav-btn[data-page-link="schedule"] {
  --mobile-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='3' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M7.5 3.8v3.4M16.5 3.8v3.4M3.8 9.3h16.4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.is-mobile-app .nav-btn[data-page-link="archive"] {
  --mobile-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5.2A6.8 6.8 0 1 1 5.2 12' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M12 8.5V12l2.9 1.9' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 7V4.5H7.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.is-mobile-app .nav-btn[data-page-link="rankings"] {
  --mobile-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 18.5h14' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M7.5 16V11.5M12 16V7.5M16.5 16V9.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.is-mobile-app .nav-btn[data-page-link="settings"] {
  --mobile-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.2 7.2h11.6M6.2 12h11.6M6.2 16.8h7.6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M4.5 4.5h15v15h-15z' fill='none' stroke='%23000' stroke-width='1.6' opacity='0.45'/%3E%3C/svg%3E");
}

.is-mobile-app .nav-btn.is-active {
  border-color: transparent;
  background: rgba(212, 176, 103, 0.08);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(212, 176, 103, 0.12);
}

.is-mobile-app .nav-btn:hover,
.is-mobile-app .nav-btn:active {
  transform: none;
}

.is-mobile-app .mobile-page {
  gap: 18px;
  padding-top: 0;
}

.is-mobile-app .page-shell {
  animation: none;
}

.is-mobile-app .mobile-search-field {
  min-height: 48px;
}

.is-mobile-app .mobile-search-results {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  max-height: none;
  margin-top: 0;
}

.is-mobile-app .mobile-block {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--surface-divider);
}

.is-mobile-app .mobile-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.is-mobile-app .mobile-settings-title,
.is-mobile-app .mobile-settings-stack {
  display: grid;
  gap: 10px;
}

.is-mobile-app .mobile-settings-title {
  gap: 6px;
}

.is-mobile-app .mobile-settings-tab {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.is-mobile-app .mobile-settings-tab strong {
  font-size: 15px;
}

.is-mobile-app .mobile-settings-tab span {
  color: var(--text-soft);
  font-size: 12px;
}

.is-mobile-app .mobile-settings-tab.is-danger {
  border-color: rgba(211, 106, 97, 0.28);
}

.is-mobile-app .mobile-settings-tab.is-danger strong {
  color: #f1a39d;
}

.is-mobile-app .compact-mobile-change {
  gap: 2px;
  padding: 11px 13px;
}

.is-mobile-app .compact-mobile-change strong {
  font-size: 13px;
}

.is-mobile-app .compact-mobile-change span {
  font-size: 11px;
}

.is-mobile-app .admin-user-action-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.is-mobile-app .mobile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.is-mobile-app .mobile-identity-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.is-mobile-app .mobile-profile-block .mobile-identity-copy {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.is-mobile-app .page-avatar {
  width: 52px;
  height: 52px;
}

.is-mobile-app .mobile-page-title {
  margin: 0;
  font-size: clamp(1.8rem, 10vw, 2.5rem);
  line-height: 0.92;
}

.is-mobile-app .mobile-inline-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.is-mobile-app .mobile-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.is-mobile-app .mobile-stat {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-divider);
}

.is-mobile-app .mobile-stat strong {
  font-size: 24px;
  line-height: 1;
}

.is-mobile-app .mobile-category-card {
  padding: 12px 10px;
}

.is-mobile-app .mobile-category-card .summary-label {
  font-size: 9px;
  letter-spacing: 0.12em;
}

.is-mobile-app .mobile-category-card .category-rating-value {
  font-size: 22px;
}

.is-mobile-app .mobile-category-card .category-rating-meta {
  font-size: 11px;
}

.is-mobile-app .mobile-stat.is-winner strong {
  color: var(--green-strong);
}

.is-mobile-app .mobile-record-line .record-strip {
  margin-top: 0;
}

.is-mobile-app .mobile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.is-mobile-app .mobile-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.is-mobile-app .mobile-list {
  display: grid;
  gap: 0;
}

.is-mobile-app .mobile-entry {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--surface-divider);
}

.is-mobile-app .mobile-list .mobile-entry:first-child,
.is-mobile-app .mobile-ranking-list .mobile-ranking-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.is-mobile-app .mobile-list-row,
.is-mobile-app .mobile-ranking-row {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.is-mobile-app .mobile-list-row {
  display: grid;
  gap: 6px;
}

.is-mobile-app .mobile-row-title {
  font-size: 16px;
  line-height: 1.25;
}

.is-mobile-app .mobile-row-meta,
.is-mobile-app .mobile-row-matchup {
  color: var(--text-soft);
  font-size: 12px;
}

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

.is-mobile-app .mobile-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.is-mobile-app .mobile-ranking-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--surface-divider);
}

.is-mobile-app .mobile-ranking-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.is-mobile-app .mobile-ranking-copy .profile-link-inner {
  width: 100%;
}

.is-mobile-app .mobile-ranking-copy .profile-link-label {
  font-size: 15px;
}

.is-mobile-app .mobile-ranking-side {
  font-weight: 700;
}

.is-mobile-app .mobile-debate-people {
  gap: 8px;
}

.is-mobile-app .mobile-debate-people .person-badge {
  min-width: 70px;
  padding: 0 14px;
}

.is-mobile-app .mobile-debate-people .mini-tag {
  min-width: 44px;
}

.is-mobile-app .custom-select-menu {
  z-index: 42;
}

.is-mobile-app .empty-state {
  padding: 14px 0 0;
  border: 0;
  background: transparent;
}
