:root {
  --bg: #120f0e;
  --bg-alt: #1d1816;
  --panel: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f7f4ef;
  --muted: rgba(247, 244, 239, 0.65);
  --accent: #f7a938;
  --accent-strong: #ff7b00;
  --badge-bg: rgba(247, 169, 56, 0.18);
  --badge-border: rgba(247, 169, 56, 0.4);
  --success: #2dd597;
  --state-live-border: #ffae52;
  --state-live-bg: rgba(255, 174, 82, 0.16);
  --state-next-border: rgba(123, 164, 255, 0.45);
  --state-next-bg: rgba(123, 164, 255, 0.15);
  --state-rest-border: rgba(255, 255, 255, 0.08);
  --state-rest-bg: rgba(255, 255, 255, 0.04);
  --role-chip-bg: rgba(255, 255, 255, 0.22);
  --role-chip-text: #fff8e4;
}

body.theme-sportco {
  --accent: #ff8c42;
  --accent-strong: #ff5b1f;
  --badge-bg: rgba(255, 140, 66, 0.18);
  --badge-border: rgba(255, 140, 66, 0.45);
}

body.theme-raquettes {
  --accent: #6eb7ff;
  --accent-strong: #3c8bff;
  --badge-bg: rgba(110, 183, 255, 0.22);
  --badge-border: rgba(110, 183, 255, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #24201f 0%, #120f0e 55%);
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  display: flex;
  justify-content: center;
}

body.ladder-mode[data-screen='ladder-pilot'] {
  display: block;
}

body[data-screen='swiss-pilot'] {
  display: block;
}

body[data-screen='pool-pilot'] {
  display: block;
}

body[data-screen='rotating-pilot'] {
  display: block;
}

.app-shell {
  width: min(1100px, 100%);
  padding: clamp(16px, 4vw, 32px);
}

body.ladder-mode .app-shell {
  max-width: 100%;
  width: 100%;
}

body.ladder-mode[data-screen='ladder-pilot'] .app-shell {
  padding: 0;
}

body.ladder-mode[data-screen='ladder-pilot'] .topbar,
body.ladder-mode[data-screen='ladder-pilot'] .stepper {
  display: none;
}

body[data-screen='swiss-pilot'] .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

body[data-screen='pool-pilot'] .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

body[data-screen='rotating-pilot'] .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

body[data-screen='swiss-pilot'] .topbar,
body[data-screen='swiss-pilot'] .stepper {
  display: none;
}

body[data-screen='pool-pilot'] .topbar,
body[data-screen='pool-pilot'] .stepper {
  display: none;
}

body[data-screen='rotating-pilot'] .topbar,
body[data-screen='rotating-pilot'] .stepper {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.mode-pill {
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--text);
  white-space: nowrap;
}

.mode-pill.subtle {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}

.tools-item {
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.tools-item:hover,
.tools-item:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.brand-name {
  margin: 0;
  font-weight: 600;
}

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

.stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.step.step-clickable {
  cursor: pointer;
}

.step.step-clickable:hover,
.step.step-clickable:focus-visible {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.35);
}

.step.step-disabled {
  cursor: default;
}

.step.done {
  opacity: 1;
  border-color: rgba(247, 169, 56, 0.5);
}

.step.current {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(247, 169, 56, 0.15);
}

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
}

.step-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.screen-stack {
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: clamp(20px, 6vw, 48px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  animation: fade 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card {
  text-align: center;
  padding: clamp(30px, 8vw, 80px);
}

.landing-card {
  text-align: center;
  padding: clamp(32px, 10vw, 120px);
  background: var(--panel);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-card.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 40px);
}

.landing-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.mega-card {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  gap: 12px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease;
}

.mega-card:hover,
.mega-card:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.35);
}

.mega-card.theme-sportco {
  background: linear-gradient(120deg, rgba(255, 128, 66, 0.2), rgba(255, 83, 31, 0.1));
}

.mega-card.theme-raquettes {
  background: linear-gradient(120deg, rgba(110, 183, 255, 0.2), rgba(60, 139, 255, 0.08));
}

.mega-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.mega-card span:last-child {
  font-size: 1.6rem;
  opacity: 0.65;
}

.mega-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.landing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.landing-sessions-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.landing-sessions-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.landing-sessions-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.landing-sessions-head h3 {
  margin: 6px 0 0;
}

.landing-sessions-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.landing-sessions-list {
  display: grid;
  gap: 12px;
}

.session-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.session-class-card {
  --session-class-color: rgba(96, 214, 140, 0.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--session-class-color) 45%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--session-class-color) 12%, rgba(255, 255, 255, 0.03)), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
}

.session-class-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.session-class-copy strong,
.session-class-copy span {
  overflow-wrap: anywhere;
}

.session-class-chip {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

.session-class-meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.session-class-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-class-actions .btn.primary {
  min-width: 150px;
}

.landing-session-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.landing-session-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.landing-session-copy strong,
.landing-session-copy span {
  overflow-wrap: anywhere;
}

.landing-session-meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.landing-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.landing-session-empty {
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
  text-align: center;
}

.landing-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.landing-card h1 {
  font-size: clamp(2.4rem, 12vw, 4.2rem);
  margin: 0;
}

.landing-subtitle {
  margin: 8px auto 24px;
  color: var(--muted);
  font-size: 1.1rem;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 520px;
  margin: 0 auto;
}

.landing-highlight {
  border-radius: 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.landing-highlight.alt {
  background: rgba(5, 4, 4, 0.75);
  border-style: dashed;
}

.landing-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.7rem;
  color: var(--muted);
}

.landing-desc {
  margin: 0;
  color: rgba(247, 244, 239, 0.8);
  font-size: 0.95rem;
}

.resume-btn {
  margin-top: 4px;
}

.landing-hint {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.class-manager-card {
  text-align: left;
  gap: 16px;
}

.class-manager-card h3 {
  margin: 0;
}

.landing-subcopy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.class-manager-field {
  max-width: 420px;
}

.class-manager-field select {
  width: 100%;
}

.class-manager-actions {
  justify-content: flex-start;
}

.eyebrow {
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-card h1 {
  font-size: clamp(2.2rem, 12vw, 4rem);
  margin: 0 0 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.quick-roles {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.quick-roles-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.quick-roles-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.quick-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-role-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.btn:focus-visible,
.mega-card:focus-visible,
.tools-item:focus-visible,
.tab:focus-visible,
.quick-role-option:focus-visible,
.collapsible-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.quick-role-option input {
  accent-color: var(--accent);
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.subtitle {
  margin: 0 auto 24px;
  max-width: 480px;
  color: var(--muted);
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.hero-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 24px;
}

.hero-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.hero-benefits article {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.hero-benefits h3 {
  margin: 0;
  font-size: 1rem;
}

.hero-benefits p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-size: 1rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #1c1205;
}

.btn.success {
  background: linear-gradient(120deg, #43c788, #2aa86c);
  color: #08150d;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn.reset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn.reset-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
}

.btn.small {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn.tiny {
  padding: 6px 14px;
  font-size: 0.75rem;
}

.btn.xl {
  padding: 18px 40px;
  font-size: 1.1rem;
}

.btn.hero {
  min-height: 56px;
  font-size: 1.05rem;
  box-shadow: 0 20px 45px rgba(247, 169, 56, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.screen-header h2 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.screen-header p {
  margin: 0;
  color: var(--muted);
}

.mode-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.mode-header-actions {
  display: flex;
  gap: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.mode-card {
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.mode-card.active {
  border-color: var(--accent);
  background: rgba(247, 169, 56, 0.05);
  transform: translateY(-2px);
}

.mode-card.disabled {
  opacity: 0.4;
}

.mode-card strong {
  font-size: 1.2rem;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
}

.mode-footnote {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
}

.pill.muted {
  background: rgba(255, 255, 255, 0.05);
}

.pill.accent {
  background: rgba(247, 169, 56, 0.2);
  color: var(--accent);
}

.pill.subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.group-pill,
.match-group-label,
.match-group-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.match-group-label {
  margin-left: 8px;
}

.match-group-inline {
  margin-left: 6px;
  font-size: 0.7rem;
}

.nav-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-actions.wrap {
  justify-content: flex-start;
}

.counter-card {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
}

.counter-value {
  font-size: clamp(3rem, 18vw, 6rem);
  font-weight: 600;
}

.slider-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
}

input[type='range'] {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.team-tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.bulk-import label {
  color: var(--muted);
  font-size: 0.9rem;
}

.bulk-import textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px;
  resize: vertical;
  min-height: 120px;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 6px;
}

.team-list input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-grid.compact {
  gap: 12px;
}

.ladder-settings {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.ladder-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ladder-legend .badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ladder-legend .badge.arbiter {
  background: rgba(110, 183, 255, 0.16);
  border-color: rgba(110, 183, 255, 0.4);
}

.ladder-legend .badge.free {
  background: rgba(255, 189, 120, 0.16);
  border-color: rgba(255, 189, 120, 0.35);
}

.field-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.field-badge.arbiter {
  border-color: rgba(110, 183, 255, 0.45);
  background: rgba(110, 183, 255, 0.15);
}

.field-badge.free {
  border-color: rgba(255, 189, 120, 0.35);
  background: rgba(255, 189, 120, 0.12);
}

.ladder-settings.hidden {
  display: none;
}

.ladder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

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

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input[type='number'],
.field input[type='time'] {
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
}

.field.switch input[type='checkbox'] {
  width: 46px;
  height: 26px;
  accent-color: var(--accent);
}

.mode-options-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mode-context-card {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(18px, 3vw, 32px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.35);
}

.mode-context-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-chip {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
}

.mode-primary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.mode-field {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-field.wide {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .mode-field.wide {
    grid-column: span 1;
  }
}

.mode-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.field-inline input {
  font-size: 1.1rem;
}

.inline-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.field.switch.emphasis {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.options-advanced {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 6, 6, 0.7);
  padding: 0 16px 16px;
}

.options-advanced summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  position: relative;
  padding-right: 32px;
  color: rgba(247, 244, 239, 0.9);
}

.options-advanced summary::-webkit-details-marker {
  display: none;
}

.options-advanced summary::after {
  content: '⌄';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--muted);
}

.options-advanced[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.options-advanced summary span {
  font-size: 1rem;
}

.options-advanced summary small {
  font-size: 0.85rem;
  color: var(--muted);
}

.options-advanced[open] {
  border-color: rgba(247, 169, 56, 0.35);
  box-shadow: inset 0 0 0 1px rgba(247, 169, 56, 0.08);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.scheduling-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.chip input {
  accent-color: var(--accent);
}

.defi-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-title-row,
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-title-row h4,
.section-title-row strong {
  margin: 0;
}

.defi-hint strong {
  font-size: 1rem;
}

.defi-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.micro-copy {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.info-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  padding: 2px 4px;
  vertical-align: middle;
}

.info-trigger:hover {
  opacity: 1;
}

.info-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.collapsible-body {
  display: block;
  margin-top: 8px;
}

.collapsible-body.collapsed {
  display: none;
}

.collapsible-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

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

.roles-field .switch.inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.roles-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-shortcuts {
  margin-top: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.view-shortcuts-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.view-shortcuts-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.roles-options.disabled {
  opacity: 0.4;
}

.role-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
}

.role-option input {
  accent-color: var(--accent);
}

.coach-mode {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.coach-mode.disabled {
  opacity: 0.4;
}

.coach-mode select {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 10px;
}

.simulation-tools {
  margin: 18px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulation-tools .btn {
  align-self: flex-start;
}

.reset-feedback {
  margin: 0;
  font-size: 0.9rem;
  color: var(--success);
}

.panel-card {
  border-radius: 20px;
  padding: 20px;
  font-size: 0.95rem;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  animation: panelFade 0.3s ease;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.panel-icon.cold {
  background: rgba(110, 150, 255, 0.15);
  color: #c5d6ff;
}

.panel-icon.warm {
  background: rgba(247, 169, 56, 0.2);
  color: var(--accent);
}

.simulation-result {
  border: 1px solid rgba(120, 150, 255, 0.18);
  border-left: 4px solid rgba(120, 150, 255, 0.45);
  background: linear-gradient(140deg, rgba(36, 40, 66, 0.65), rgba(20, 18, 26, 0.9));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

.simulation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.simulation-metric {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.simulation-metric span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.simulation-metric strong {
  font-size: 1.05rem;
  color: var(--text);
}

.simulation-analysis {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.simulation-analysis h5 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text);
}

.simulation-analysis .analysis-list {
  margin-bottom: 8px;
}

.recommendation-tools {
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommendation-result {
  border: 1px solid rgba(247, 169, 56, 0.25);
  border-left: 4px solid rgba(247, 169, 56, 0.7);
  background: linear-gradient(150deg, rgba(50, 36, 22, 0.85), rgba(18, 12, 8, 0.95));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.recommendation-grid .metric {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.recommendation-grid .metric span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.recommendation-grid .metric strong {
  color: var(--text);
  font-size: 1rem;
}

.recommendation-note {
  margin: 0 0 6px;
  color: var(--muted);
}

.recommendation-result .analysis-list {
  margin-top: 6px;
}

.recommendation-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recommendation-actions .btn {
  min-width: 220px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recommendation-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.recommendation-actions .btn:active {
  transform: scale(0.97);
}

.recommendation-feedback {
  font-size: 0.9rem;
  color: var(--success);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.recommendation-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.practice-stats {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.practice-stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 70px;
}

.practice-stats span {
  font-size: 0.8rem;
  color: var(--muted);
}

.practice-stats strong {
  font-size: 1rem;
  color: var(--text);
}

.recommendation-variants {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.variant-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.variant-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.variant-card h5 {
  margin: 0;
  font-size: 1rem;
}

.variant-card span {
  font-size: 0.8rem;
  color: var(--muted);
}

.variant-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.variant-card.variant-warning {
  border-color: rgba(255, 153, 128, 0.6);
}

.recommendation-feedback::before {
  content: '✓';
  margin-right: 6px;
}

.simulation-status {
  margin: 0;
  font-weight: 600;
}

.simulation-status.ok {
  color: var(--success);
}

.simulation-status.alert {
  color: var(--accent);
}

.simulation-suggestions {
  margin-top: 10px;
  font-size: 0.9rem;
}

.simulation-suggestions ul {
  margin: 6px 0 0 16px;
  padding: 0;
  color: var(--muted);
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.summary-primary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.summary-card.analysis-card {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analysis-tag {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
}

.analysis-tag.high {
  color: var(--success);
  background: rgba(45, 213, 151, 0.1);
}

.analysis-tag.medium {
  color: var(--accent);
  background: rgba(255, 123, 0, 0.15);
}

.analysis-tag.low {
  color: #ff6868;
  background: rgba(255, 104, 104, 0.15);
}

.summary-card-primary {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-card-primary strong {
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
}

.summary-details-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 16px 16px;
}

.summary-details-card summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--text);
}

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

.summary-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.summary-details-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-details-list li span {
  color: var(--muted);
}

.summary-details-list li strong {
  color: var(--text);
  text-align: right;
}

.analysis-tag.neutral {
  color: var(--muted);
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.time-indicator {
  margin: 4px 0 20px;
  font-size: 0.92rem;
  color: var(--muted);
}

.time-indicator.ok {
  color: var(--success);
}

.time-indicator.alert {
  color: var(--accent);
}

.match-insight {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--muted);
}

.results-mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.mode-toggle {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mode-toggle.active {
  background: var(--badge-bg);
  color: var(--text);
}

.results-mode-note {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-action-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

.results-primary-cta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.results-primary-cta .btn.hero {
  width: 100%;
  justify-content: center;
}

.action-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-secondary-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.session-save-feedback {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 28, 22, 0.96);
  border: 1px solid rgba(96, 214, 140, 0.45);
  color: #dff8e8;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
  font-weight: 600;
}

.session-save-feedback.hidden {
  display: none;
}

.session-save-panel {
  margin-top: 18px;
}

.session-save-panel-head h4 {
  margin: 6px 0 0;
}

.session-save-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-save-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.session-save-panel [data-session-name-hint]:not(.hidden) {
  color: var(--warning, #ffd27a);
}

.results-tertiary-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.results-more-panel {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-more-panel .btn {
  width: 100%;
  justify-content: center;
}

.muted-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
}

.summary-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
}

.summary-card span {
  font-size: 0.85rem;
  color: var(--muted);
}

.summary-card strong {
  font-size: 1.4rem;
}

.view-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.view-hub-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border 0.2s ease, background 0.2s ease;
}

.view-hub-card strong {
  color: var(--text);
  font-size: 1.1rem;
}

.view-hub-card small {
  font-size: 0.85rem;
  color: var(--muted);
}

.view-hub-card.active {
  border-color: var(--accent);
  background: rgba(247, 169, 56, 0.15);
  color: var(--text);
}

.view-toggle {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 6px;
}

.tab {
  flex: 1;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.view.hidden {
  display: none;
}

.screen[data-screen='results'][data-results-mode='read'] .view-toggle,
.screen[data-screen='results'][data-results-mode='read']:not(.results-challenge) .view {
  display: none;
}

.screen[data-screen='results'][data-results-mode='pilot'] .results-mode-note {
  display: none;
}

.screen[data-screen='results'].results-challenge .view-hub,
.screen[data-screen='results'].results-challenge .summary-grid,
.screen[data-screen='results'].results-challenge .match-insight,
.screen[data-screen='results'].results-challenge .time-indicator,
.screen[data-screen='results'].results-challenge .results-mode-switch,
.screen[data-screen='results'].results-challenge .results-mode-note,
.screen[data-screen='results'].results-challenge .results-tertiary-cta,
.screen[data-screen='results'].results-challenge .view-toggle,
.screen[data-screen='results'].results-challenge #teamView,
.screen[data-screen='results'].results-challenge #rankingView {
  display: none !important;
}

.screen[data-screen='results'].results-challenge #rotationView {
  margin-top: 0;
}

.screen[data-screen='results'].results-ladder-simplified .view-hub,
.screen[data-screen='results'].results-ladder-simplified .results-mode-switch,
.screen[data-screen='results'].results-ladder-simplified .results-mode-note,
.screen[data-screen='results'].results-ladder-simplified .view-toggle,
.screen[data-screen='results'].results-ladder-simplified #teamView,
.screen[data-screen='results'].results-ladder-simplified #rankingView {
  display: none !important;
}

.challenge-shell {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.challenge-shell-header h3 {
  margin: 0;
}

.challenge-shell-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.challenge-quick-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip-link {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  padding: 4px 12px;
  cursor: pointer;
}

.chip-link:hover,
.chip-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.challenge-shell-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.challenge-instructions {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.challenge-history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.challenge-history-card.is-empty {
  opacity: 0.7;
}

.challenge-history-card strong {
  color: var(--text);
}

.challenge-history-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.challenge-history-card .btn {
  white-space: nowrap;
}

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

.challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.challenge-row.inactive {
  opacity: 0.55;
}

.challenge-row.highlight {
  border-color: color-mix(in srgb, var(--accent) 50%, rgba(255,255,255,0.12));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.challenge-row.selected {
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 18px;
}

.challenge-row.challenge-out-of-range {
  opacity: 0.4;
  filter: grayscale(0.5);
  pointer-events: none;
  cursor: not-allowed;
}

.challenge-rank {
  width: 36px;
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  opacity: 0.75;
}

.challenge-name {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  flex: 1;
}

.challenge-action {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.85rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.challenge-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.challenge-action:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 50%, rgba(255,255,255,0.18));
  color: color-mix(in srgb, var(--accent) 80%, var(--text));
}

.challenge-action:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--text);
}

.challenge-name:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 6px;
}

.challenge-card {
  width: min(460px, 100%);
  gap: 12px;
}

.challenge-dialog-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.challenge-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.challenge-select select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
}

.challenge-score-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.score-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.score-field input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.score-field input:focus-visible,
.challenge-select select:focus-visible {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.challenge-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.challenge-ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-ranking-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 0;
  font-size: 0.95rem;
}

.rotation-card,
.team-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
}

.rotation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.rotation-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(247, 169, 56, 0.2);
}

.rotation-card h3,
.team-card h3 {
  margin: 0 0 8px;
}

.rotation-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.match-list,
.team-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.match-list li,
.team-match-list li {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.match-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.match-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.match-title .vs {
  opacity: 0.7;
  font-size: 0.85em;
}

.field-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.score-inputs span {
  color: var(--muted);
  font-weight: 600;
}

.score-inputs input {
  width: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 8px;
  color: var(--text);
}

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

.field-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.field-card h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.field-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-card li {
  font-size: 0.85rem;
  color: var(--muted);
}

.rest-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.rest-badge {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-match-list li.bye {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.15);
}

.ranking-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.ranking-card header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ranking-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ranking-card th,
.ranking-card td {
  padding: 8px;
  text-align: left;
}

.ranking-card th {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

.ranking-card tbody tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ranking-status {
  font-size: 0.8rem;
  color: var(--muted);
}

.ranking-card.finals-card {
  background: rgba(247, 169, 56, 0.04);
}

.finals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finals-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.final-score {
  font-weight: 600;
}

.live-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.live-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.live-header-block h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
}

.live-meta {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.live-header-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 120px;
}

.live-header-timer .label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-timer span {
  display: block;
}

#liveTimerDisplay {
  font-size: clamp(2rem, 10vw, 3.4rem);
  line-height: 1;
}

#liveTimerState {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
}

.live-header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  position: relative;
}

#liveCurrentRotationBtn {
  min-width: 220px;
}

.live-actions-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

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

.live-pilot-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-shell.ladder-live-mode .live-matches {
  order: 1;
}

.live-shell.ladder-live-mode .live-ranking {
  order: 2;
}

.live-shell.ladder-live-mode .live-pilot-stack {
  order: 3;
}

.live-current-rotation-card,
.ladder-focus-card {
  border-radius: 28px;
  border: 1px solid rgba(247, 169, 56, 0.35);
  background: linear-gradient(135deg, rgba(247, 169, 56, 0.16), rgba(255, 255, 255, 0.04));
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.live-current-rotation-card.hidden {
  display: none !important;
}

.live-ladder-secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-ladder-secondary-panel {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.live-ladder-movements {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ladder-focus-copy {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ladder-focus-copy h3 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.ladder-focus-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.ladder-focus-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ladder-focus-actions {
  flex: 0 1 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.ladder-focus-actions .btn {
  width: 100%;
}

@media (min-width: 1024px) {
  .live-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "pilot matches"
      "ranking score";
    align-items: start;
  }
  .live-pilot-stack {
    grid-area: pilot;
  }
  .live-matches {
    grid-area: matches;
  }
  .live-ranking {
    grid-area: ranking;
  }
  .live-score-panel {
    grid-area: score;
  }

  .live-shell.ladder-live-mode .live-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    grid-template-areas:
      "matches matches"
      "ranking ranking"
      "pilot pilot";
  }
}

.live-ranking {
  position: relative;
}

.live-timer-panel {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border 0.2s ease, background 0.2s ease;
}

.live-timer-panel.running {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(247, 169, 56, 0.15);
}

.live-timer-panel.ended {
  border-color: #ff6b6b;
}

.live-timer-panel.disabled {
  opacity: 0.6;
}

.timer-face .label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-timer-display {
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 700;
  line-height: 1;
}

.timer-state {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
}

.timer-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.timer-actions.stacked {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

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

.timer-actions .btn.primary {
  min-height: 54px;
}

.live-matches {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  scroll-margin-top: 24px;
}

.live-now-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.live-field-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.live-field-board article {
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.live-field-board h4 {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.live-field-board p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.field-match-line {
  padding: 8px 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.field-match-line:first-of-type {
  border-top: none;
  padding-top: 0;
}
.field-match-line p {
  margin: 0;
  font-weight: 500;
}
.field-match-line .role-lines {
  margin-top: 6px;
}

.live-board-empty {
  grid-column: 1 / -1;
  border-radius: 18px;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--muted);
  text-align: center;
}

.live-match-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.live-match-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.live-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.live-match-card .live-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.live-match-card .live-badge.info {
  background: rgba(247, 169, 56, 0.15);
  border-color: rgba(247, 169, 56, 0.4);
  color: var(--text);
}

.live-match-card .live-badge.success {
  background: rgba(45, 213, 151, 0.15);
  border-color: rgba(45, 213, 151, 0.5);
  color: var(--text);
}

.live-match-card .live-badge.neutral {
  background: rgba(158, 166, 180, 0.2);
  border-color: rgba(158, 166, 180, 0.5);
  color: #d4dae5;
}

.live-match-card.neutralized {
  opacity: 0.65;
  border-style: dashed;
}

.live-match-card.active {
  border-color: rgba(247, 169, 56, 0.6);
  background: rgba(247, 169, 56, 0.08);
  box-shadow: 0 0 0 1px rgba(247, 169, 56, 0.1);
}

.live-match-card.validated {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.15);
  opacity: 0.85;
}

.live-match-card .role-lines {
  margin-top: 4px;
}

.live-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  gap: 8px;
}

.live-match-card .teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.live-team {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-team strong {
  font-size: 1.2rem;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.live-score-pad {
  display: grid;
  grid-template-columns: 38px minmax(44px, 58px) 38px;
  gap: 6px;
  width: 100%;
  max-width: 148px;
}

.score-adjust {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.score-adjust:disabled {
  opacity: 0.4;
}

.live-score-pad input {
  width: 100%;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 1.3rem;
  color: var(--text);
  padding: 10px 6px;
}

.score-adjust:disabled,
.live-score-pad input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.live-score-pad span {
  font-size: 0.75rem;
  color: var(--muted);
}

.live-match-card.incomplete {
  border-color: rgba(255, 120, 85, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 85, 0.3);
}

.live-ranking {
  flex: 1;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
}

.live-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
}

.live-ranking header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.live-ranking-table {
  max-height: 420px;
  overflow: auto;
}

.live-ranking-table table {
  width: 100%;
  border-collapse: collapse;
}

.live-ranking-table th,
.live-ranking-table td {
  padding: 6px;
  text-align: left;
  font-size: 0.88rem;
}

.live-ranking-table th {
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
}

.live-ranking-table tbody tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.live-ranking-meta {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.live-ranking-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.live-score-panel {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  background: rgba(9, 9, 9, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-score-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-score-panel #liveRotationContent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-rest {
  border-radius: 18px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  margin-top: 16px;
}

.live-rest strong {
  display: block;
  margin-bottom: 6px;
}

.rest-role-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.rest-role-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.rest-waiting-line {
  display: block;
  margin-bottom: 6px;
}

.rest-role-line strong {
  color: #fff;
  font-weight: 600;
}

.rest-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted);
}

.rest-roles span {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 2px 10px;
}

.role-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
}

.role-line {
  font-size: 0.9rem;
  color: #fffdf6;
  display: flex;
  gap: 10px;
  align-items: center;
}

.role-chip {
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--role-chip-text);
  background: var(--role-chip-bg);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.live-next {
  margin-top: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-next-label {
  color: var(--muted);
}

.live-next-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.live-next-card {
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-next-card .meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.live-next-card strong {
  font-size: 1.05rem;
}

.live-next-card .vs {
  font-size: 0.8rem;
  color: var(--muted);
}

.live-next-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.live-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.live-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.chrono-screen {
  background: none;
  border: none;
  padding: 0;
}

.chrono-shell {
  min-height: calc(100vh - 80px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: clamp(20px, 6vw, 60px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.chrono-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chrono-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.chrono-display {
  font-size: clamp(3.8rem, 26vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
}

.chrono-state {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  color: var(--muted);
}

.chrono-meta {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.chrono-matches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  text-align: left;
}

.chrono-match-card {
  border-radius: 24px;
  border: 2px solid var(--state-live-border);
  background: var(--state-live-bg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.chrono-match-card .label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.85);
}

.chrono-match-card .teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chrono-match-card strong {
  font-size: 1.1rem;
}

.chrono-score {
  font-size: 1.4rem;
  font-weight: 600;
}

.chrono-match-card .vs {
  font-size: 0.8rem;
  color: var(--muted);
}

.chrono-rest {
  margin: 4px auto 0;
  padding: 14px 24px;
  border-radius: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.03);
  max-width: 680px;
}

.chrono-rest strong {
  color: #fff;
}

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

.chrono-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.chrono-screen.running .chrono-display {
  color: var(--accent);
}

.chrono-screen.ended .chrono-display {
  color: #ff6b6b;
  animation: pulse-alert 1s ease-in-out infinite;
}

.chrono-screen.ended .chrono-state {
  color: #ff6b6b;
}

.live-timer-panel.ended .live-timer-display {
  color: #ff6b6b;
  animation: pulse-alert 1s ease-in-out infinite;
}

.chrono-screen .btn {
  width: 100%;
}

.chrono-screen.chrono-disabled .chrono-display {
  opacity: 0.55;
}

.chrono-screen.chrono-disabled .chrono-controls .btn.secondary {
  opacity: 0.4;
  pointer-events: none;
}

.projection-screen {
  background: transparent;
}

.projection-shell {
  min-height: 80vh;
  border-radius: 40px;
  padding: clamp(20px, 6vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 5, 5, 0.88);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.projection-shell header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.projection-shell h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 6vw, 3rem);
}

.projection-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.projection-timer {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  text-align: center;
}

.projection-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.projection-field {
  border-radius: 28px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.projection-field.in-play {
  border-color: var(--state-live-border);
  background: var(--state-live-bg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

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

.projection-field h3 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.projection-field .state-pill {
  margin-top: 4px;
}

.state-pill {
  border-radius: 999px;
  padding: 3px 16px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.state-pill.live {
  border-color: var(--state-live-border);
  color: #fff4e4;
  background: rgba(255, 202, 125, 0.2);
}

.state-pill.next {
  border-color: var(--state-next-border);
  color: #e2ecff;
  background: rgba(128, 162, 255, 0.2);
}

.state-pill.rest {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.projection-match {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 0;
}

.projection-match:first-of-type {
  border-top: none;
  padding-top: 0;
}

.projection-match p {
  margin: 0;
  font-size: clamp(1.4rem, 5.5vw, 2.3rem);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.projection-match p span {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.projection-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 16px;
}

.projection-next,
.projection-rest {
  border-radius: 28px;
  padding: 20px;
}

.projection-next {
  border: 1px solid var(--state-next-border);
  background: var(--state-next-bg);
}

.projection-rest {
  border: 1px solid var(--state-rest-border);
  background: var(--state-rest-bg);
}

.projection-next header,
.projection-rest header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.projection-section-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projection-next h4,
.projection-rest h4 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.projection-next header span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.projection-rest header span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.projection-next-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.projection-next-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(6, 12, 28, 0.45);
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projection-next-card strong {
  font-size: 1.1rem;
}

.projection-next-card .meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.projection-next-card .role-lines {
  margin-top: 4px;
}

.projection-next-card .vs {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

.projection-rest p {
  margin: 0 0 8px;
  font-size: 1rem;
}

.projection-await-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.projection-await-list li {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.9rem;
}

.projection-rest .rest-role-summary {
  margin-top: 12px;
}

.control-group.primary {
  flex-direction: column;
}

.control-group.primary .btn {
  width: 100%;
}

.control-group.timer button {
  flex: 1;
}

.control-group.secondary {
  justify-content: flex-start;
}

.print-header {
  display: none;
}

.timer {
  position: fixed;
  right: clamp(12px, 4vw, 32px);
  bottom: clamp(12px, 4vw, 32px);
  width: 240px;
  background: rgba(14, 13, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.timer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
}

.timer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.timer-close:hover {
  color: var(--text);
}

.timer-display {
  font-size: 2.6rem;
  text-align: center;
  margin: 12px 0;
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.timer-controls button {
  border: none;
  border-radius: 14px;
  padding: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.timer-footer {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-footer button {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  cursor: pointer;
}

.timer-fab {
  position: fixed;
  right: clamp(12px, 4vw, 32px);
  bottom: clamp(12px, 4vw, 32px);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1c1205;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 10;
}

.timer-fab:active {
  transform: scale(0.96);
}

.help-fab {
  position: fixed;
  right: clamp(12px, 4vw, 32px);
  bottom: clamp(84px, 10vw, 120px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, rgba(247, 169, 56, 0.95), rgba(255, 123, 0, 0.9));
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 11;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.help-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
}

.help-fab:active {
  transform: scale(0.95);
}

.help-fab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

body.mode-projection .timer-fab,
body.mode-projection .help-fab,
body.mode-chrono .timer-fab,
body.mode-chrono .help-fab,
body.mode-projection #timerWidget,
body.mode-chrono #timerWidget {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  width: min(720px, 100%);
  background: #1c1614;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.session-save-modal-card {
  width: min(560px, calc(100vw - 32px));
}

.session-save-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-save-modal-copy,
.session-save-modal-mode {
  margin: 0;
}

.session-save-modal-mode {
  color: var(--muted);
  font-size: 0.95rem;
}

.config-edit-modal-card {
  width: min(520px, calc(100vw - 32px));
}

.config-edit-modal-copy {
  margin: 0;
  color: var(--muted);
}

.session-organization-card {
  width: min(620px, calc(100vw - 32px));
}

.session-organization-copy {
  margin: 0;
  font-size: 1rem;
}

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

.session-organization-item {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-organization-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.session-organization-item strong {
  font-size: 1.1rem;
}

.session-organization-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-organization-notes p,
.session-organization-copy {
  color: var(--muted);
}

#finalRankingModal .final-ranking-card {
  width: min(1040px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: hidden;
}

.ladder-pilot-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #15110f, #0f0d0c);
  border-radius: 0;
  padding: clamp(16px, 2.4vw, 28px);
}

.ladder-pilot-screen-shell {
  width: 100%;
  min-height: calc(100vh - clamp(32px, 4.8vw, 56px));
}

.ladder-pilot-modal-card {
  width: 100%;
  max-height: none;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.ladder-pilot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#ladderPilotCloseBtn {
  display: none;
}

.ladder-pilot-modal-body {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.ladder-pilot-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.ladder-pilot-modal .ladder-pilot-card {
  min-height: 100%;
}

.pool-pilot-screen {
  width: 100vw;
  min-height: 100vh;
  padding: clamp(16px, 2.4vw, 28px);
  background: linear-gradient(180deg, #15110f, #0f0d0c);
}

.rotating-pilot-screen {
  width: 100vw;
  min-height: 100vh;
  padding: clamp(16px, 2.4vw, 28px);
  background: linear-gradient(180deg, #15110f, #0f0d0c);
}

.pool-pilot-card {
  width: 100%;
  min-height: calc(100vh - clamp(32px, 4.8vw, 56px));
}

.pool-pilot-body {
  width: 100%;
}

.pool-pilot-toolbar {
  justify-content: flex-start;
  align-items: center;
}

#poolPilotCloseBtn {
  display: none;
}

#rotatingPilotCloseBtn {
  display: none;
}

.pool-pilot-summary-card {
  margin-bottom: 4px;
}

.pool-pilot-console {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pool-pilot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  width: 100%;
}

.pool-pilot-list .live-match-card {
  min-height: 100%;
  padding: 18px;
}

.pool-pilot-list .live-match-card header {
  align-items: flex-start;
  gap: 10px;
}

.pool-pilot-list .live-match-card .teams {
  gap: 16px;
}

.rotating-pool-preview-card {
  gap: 12px;
}

.rotating-pool-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.rotating-pool-preview-head p {
  margin: 4px 0 0;
  opacity: 0.7;
  font-size: 0.95rem;
}

.rotating-config-shell {
  display: grid;
  gap: 12px;
  margin: 10px 0 16px;
}

.rotating-config-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.rotating-config-row .field.compact {
  gap: 8px;
  min-width: 0;
}

.rotating-config-row-info {
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
}

.rotating-editor-grid {
  align-items: start;
}

.rotating-pool-editor-card.invalid {
  border-color: rgba(248, 113, 113, 0.35);
}

.rotating-pool-warning {
  margin: 0;
  color: #fca5a5;
  overflow-wrap: anywhere;
}

.rotating-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rotating-editor-students {
  display: grid;
  gap: 10px;
}

.rotating-editor-student {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.rotating-editor-student strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rotating-editor-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rotating-config-alert {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.18);
  color: #fecaca;
}

.rotating-config-alert strong {
  color: #fee2e2;
}

.rotating-config-alert p {
  margin: 0;
  color: #fecaca;
}

.rotating-match-card .teams.rotating-teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.rotating-team {
  gap: 10px;
}

.rotating-team-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rotating-player-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rotating-player-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  white-space: normal;
}

.rotating-player-pill.team-a {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.rotating-player-pill.team-b {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.28);
}

.rotating-team-head span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.68;
}

.rotating-team-head strong {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rotating-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.rotating-card-meta p {
  margin: 0;
  overflow-wrap: anywhere;
}

.rotating-ranking-wrap .ranking-card {
  margin-bottom: 0;
}

.rotating-recommendation-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

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

.rotating-recommendation-head p {
  margin: 6px 0 0;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

.rotating-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 14px;
}

.rotating-recommendation-grid span {
  overflow-wrap: anywhere;
}

.rotating-recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rotating-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rotating-history-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.rotating-match-card,
.rotating-match-card *,
.live-match-card,
.live-match-card * {
  min-width: 0;
  box-sizing: border-box;
}

.rotating-teams-grid,
.rotating-match-card .teams,
.live-match-card .teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.rotating-player-pill,
.live-team strong,
.live-team span,
.match-title,
.match-label {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.score-inputs {
  display: grid;
  grid-template-columns: 38px minmax(44px, 58px) 38px;
  gap: 6px;
  width: 100%;
  max-width: 148px;
}

.score-inputs input {
  width: 100%;
  min-width: 0;
  text-align: center;
}

@media (max-width: 900px) {
  .rotating-teams-grid,
  .rotating-match-card .teams,
  .live-match-card .teams {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .rotating-match-card .teams.rotating-teams-grid {
    grid-template-columns: 1fr;
  }
}

.pool-pilot-list .live-team strong {
  font-size: 1.3rem;
  overflow-wrap: anywhere;
}

.pool-pilot-list .score-adjust {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 16px;
}

.pool-pilot-list .live-score-pad input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  font-size: 1.45rem;
}

.pool-pilot-list .live-card-actions {
  justify-content: stretch;
  flex-wrap: wrap;
}

.pool-pilot-list .live-card-actions .btn {
  min-height: 44px;
}

.pool-pilot-next-cta {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 13, 12, 0), rgba(15, 13, 12, 0.96) 24%, rgba(15, 13, 12, 0.98));
}

.pool-pilot-next-cta .btn {
  min-width: min(420px, 100%);
}

.pool-pilot-next-hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .pool-pilot-screen {
    padding: 16px;
  }

  .pool-pilot-card {
    min-height: calc(100vh - 32px);
  }

  .pool-pilot-list {
    grid-template-columns: 1fr;
  }

  .pool-pilot-list .live-match-card .teams {
    grid-template-columns: 1fr;
  }

  .pool-pilot-next-cta {
    padding-inline: 0;
    background: linear-gradient(180deg, rgba(15, 13, 12, 0), rgba(15, 13, 12, 0.94) 20%, rgba(15, 13, 12, 0.98));
  }
}

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

.ranking-modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.ranking-modal-body table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-modal-body th,
.ranking-modal-body td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.status-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  gap: 12px;
}

.status-row.disabled {
  opacity: 0.55;
}

.status-name {
  font-weight: 600;
}

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

.status-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text);
  padding: 6px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

.status-chip.active {
  border-color: var(--accent);
  background: rgba(247, 169, 56, 0.18);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.unavailable {
  border-color: rgba(160, 170, 190, 0.6);
  color: #d4dae8;
}

.modal-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.final-ranking-table {
  max-height: 65vh;
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
}

.final-ranking-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  min-width: 760px;
}

.final-ranking-table th,
.final-ranking-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #1c1614;
}

.final-ranking-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  background: #241c19;
}

.final-ranking-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.final-ranking-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.final-ranking-table .note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 720px) {
  #finalRankingModal {
    padding: 16px;
  }

  #finalRankingModal .final-ranking-card {
    width: min(100vw - 32px, 1040px);
    padding: 18px;
    border-radius: 24px;
  }

  .final-ranking-table {
    max-height: 60vh;
  }
}

.help-card {
  max-height: 90vh;
  overflow: hidden;
}

.help-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
  max-height: 70vh;
}

.help-section {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.help-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.help-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(247, 169, 56, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.help-section-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.help-section h4 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.help-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.help-list.numbered {
  list-style: decimal;
}

.help-list li strong {
  color: var(--text);
  font-weight: 600;
}

.help-list li {
  margin-bottom: 6px;
}

body.modal-open {
  overflow: hidden;
}

.timer.running {
  border-color: var(--accent);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

.timer-ended .timer-display {
  color: #ff5f52;
}

.hidden {
  display: none !important;
}

@keyframes pulse-alert {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .cta-group {
    flex-direction: row;
    justify-content: center;
  }
  .timer {
    width: 260px;
  }
  .results-action-stack {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }
  .results-primary-cta {
    max-width: 320px;
  }
  .results-tertiary-cta {
    min-width: 220px;
  }
  .live-main {
    flex-direction: row;
    align-items: flex-start;
  }
  .control-group.primary {
    flex-direction: row;
  }
  .control-group.primary .btn {
    flex: 1;
  }
  .chrono-matches {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .chrono-controls {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-benefits {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .team-list {
    max-height: 40vh;
  }
}

.ladder-mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ladder-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  min-height: 112px;
}

.ladder-mode-btn strong {
  font-size: 1.05rem;
}

.ladder-mode-btn span {
  color: var(--muted);
  line-height: 1.4;
}

.ladder-mode-btn.active {
  border-color: rgba(247, 169, 56, 0.65);
  background: rgba(247, 169, 56, 0.12);
  box-shadow: 0 0 0 1px rgba(247, 169, 56, 0.15);
}

.ladder-mode-help {
  margin: 12px 0 0;
}

.ladder-court-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ladder-court-mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ladder-court-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.ladder-court-mode-btn strong {
  font-size: 0.98rem;
}

.ladder-court-mode-btn span,
.ladder-court-mode-help {
  color: var(--muted);
}

.ladder-court-mode-btn.active {
  border-color: rgba(247, 169, 56, 0.65);
  background: rgba(247, 169, 56, 0.1);
}

.ladder-settings {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ladder-summary-card {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ladder-summary-top,
.ladder-summary-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ladder-summary-top {
  justify-content: space-between;
  align-items: center;
}

.ladder-summary-grid p,
.ladder-summary-cta {
  margin: 0;
}

.ladder-summary-grid p {
  flex: 1 1 180px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.ladder-summary-tip {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.ladder-summary-cta {
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff0cf;
}

.ladder-summary-pill {
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.92rem;
}

.ladder-group-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.ladder-group-panel-head h4 {
  margin: 6px 0 0;
}

.ladder-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ladder-group-card {
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.ladder-group-card h5 {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--muted);
}

.ladder-group-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.ladder-group-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ladder-group-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ladder-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ladder-manual-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ladder-manual-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.ladder-manual-option input {
  accent-color: var(--accent);
}

.ladder-pilot-card {
  padding: 14px;
  gap: 12px;
  border-width: 2px;
  overflow: hidden;
}

.ladder-pilot-summary-card {
  margin-bottom: 4px;
}

.ladder-pilot-console {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ladder-pilot-head {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  align-items: stretch;
}

.ladder-pilot-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ladder-pilot-head h4 {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.2;
}

.ladder-pilot-head h4 .ladder-versus {
  color: var(--muted);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.ladder-player-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ladder-player-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
  white-space: normal;
}

.result-winner {
  border-color: rgba(85, 200, 130, 0.95);
  background: rgba(85, 200, 130, 0.12);
  box-shadow: 0 0 0 1px rgba(85, 200, 130, 0.16), 0 0 16px rgba(85, 200, 130, 0.14);
}

.result-loser {
  border-color: rgba(244, 96, 96, 0.95);
  background: rgba(244, 96, 96, 0.12);
  box-shadow: 0 0 0 1px rgba(244, 96, 96, 0.14), 0 0 16px rgba(244, 96, 96, 0.12);
}

.swiss-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: none;
}

.swiss-pilot-screen {
  width: 100vw;
  min-height: 100vh;
  padding: 24px;
  border: none;
  border-radius: 0;
  background: radial-gradient(circle at top, #24201f 0%, #120f0e 55%);
}

.swiss-pilot-card {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 48px);
  margin: 0;
  padding: 24px;
  border-radius: 28px;
}

.swiss-pilot-body {
  width: 100%;
  padding-bottom: 18px;
}

.swiss-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.swiss-board-header h3,
.swiss-ranking-panel h3 {
  margin: 0;
}

.swiss-board-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.swiss-board-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.swiss-board-layout {
  display: block;
}

.swiss-match-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  width: 100%;
}

.swiss-match-card,
.swiss-ranking-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  padding: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.swiss-match-card {
  min-height: 280px;
  width: 100%;
}

.swiss-match-card header,
.swiss-ranking-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.swiss-match-card-bye {
  border-style: dashed;
}

.swiss-match-card.validated {
  border-color: rgba(255, 255, 255, 0.16);
}

.swiss-bye-player {
  margin: 0;
  font-weight: 600;
}

.swiss-match-players {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.swiss-player-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 72px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  padding: 16px;
  text-align: left;
  font-size: 1.15rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, opacity 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.swiss-player-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.16);
}

.swiss-player-btn.winner {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.25);
}

.swiss-player-btn.loser {
  opacity: 0.4;
}

.swiss-player-name {
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.2;
}

.swiss-player-points {
  color: var(--muted);
  font-size: 0.95rem;
}

.swiss-player-btn.winner .swiss-player-points {
  color: rgba(255, 255, 255, 0.82);
}

.swiss-versus {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  align-self: center;
}

.swiss-ranking-panel {
  overflow: auto;
  position: static;
  width: 100%;
}

body[data-screen='swiss-pilot'] .swiss-ranking-panel {
  display: none;
}

.swiss-ranking-card table,
.swiss-ranking-panel table {
  min-width: 100%;
}

.swiss-ranking-card th,
.swiss-ranking-panel th {
  white-space: nowrap;
}

.swiss-pilot-layout {
  gap: 28px;
}

.swiss-pilot-cta {
  display: flex;
  justify-content: center;
}

.swiss-validation-cta {
  position: sticky;
  bottom: 16px;
  padding: 4px 0 0;
  z-index: 4;
}

.swiss-pilot-cta .btn {
  min-width: min(100%, 520px);
  min-height: 62px;
  font-size: 1rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

@media (max-width: 980px) {
  .swiss-pilot-card {
    width: 100%;
  }

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

@media (max-width: 640px) {
  .swiss-pilot-screen {
    padding: 16px;
  }

  .swiss-pilot-card {
    min-height: calc(100vh - 32px);
    padding: 16px;
    border-radius: 22px;
  }

  .swiss-board-header {
    padding: 16px;
    align-items: flex-start;
  }

  .swiss-board-actions {
    width: 100%;
    justify-content: stretch;
  }

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

  .swiss-match-players {
    grid-template-columns: 1fr;
  }

  .swiss-versus {
    justify-self: center;
  }

  .swiss-match-list {
    grid-template-columns: 1fr;
  }

  .swiss-match-card,
  .swiss-ranking-panel {
    padding: 18px;
  }
}

.ladder-pilot-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}

.ladder-pilot-tags .state-pill {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ladder-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ladder-quick-actions .btn {
  min-height: 46px;
  padding-inline: 10px;
}

.ladder-pilot-secondary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.ladder-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.ladder-status-actions .btn {
  min-height: 0;
  padding: 6px 10px;
}

.ladder-score-editor {
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 10px;
}

.ladder-score-editor.hidden {
  display: none;
}

.ladder-pilot-next-cta {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
  background: linear-gradient(180deg, rgba(15, 13, 12, 0), rgba(15, 13, 12, 0.92) 38%);
  z-index: 3;
}

.ladder-pilot-next-cta .btn {
  min-width: min(100%, 420px);
  min-height: 58px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.ladder-movement-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.ladder-movement-card p,
.ladder-movement-card strong {
  margin: 0;
}

.ladder-movement-card p {
  color: var(--muted);
  margin-top: 4px;
}

.ladder-movement-card.up {
  border-color: rgba(45, 213, 151, 0.4);
}

.ladder-movement-card.down {
  border-color: rgba(255, 120, 85, 0.45);
}

.ladder-movement-card.arbiter {
  border-color: rgba(255, 216, 95, 0.45);
}

.ladder-movement-card.play {
  border-color: rgba(128, 162, 255, 0.45);
}

.ladder-movement-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1rem;
  flex: 0 0 auto;
}

.ladder-bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ladder-bench-card {
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.ladder-bench-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ladder-bench-card h4 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.ladder-bench-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ladder-bench-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ladder-bench-empty {
  margin: 0;
  color: var(--muted);
}

.projection-ranking {
  border-radius: 28px;
  padding: 20px;
  border: 1px solid var(--state-rest-border);
  background: var(--state-rest-bg);
}

.projection-ranking header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.projection-ranking h4 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.projection-ranking header span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.projection-ranking-table {
  overflow: auto;
}

.projection-ranking table {
  width: 100%;
  border-collapse: collapse;
}

.projection-ranking th,
.projection-ranking td {
  padding: 8px 10px;
  text-align: left;
}

.projection-ranking th {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

.projection-ranking tbody tr + tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ladder-projection-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.ladder-projection-rest {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ladder-projection-rest p {
  margin: 0;
}

@media (max-width: 900px) {
  .live-current-rotation-card,
  .ladder-focus-card {
    padding: 18px;
  }

  .ladder-pilot-modal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ladder-pilot-head,
  .ladder-bench-item,
  .ladder-focus-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .ladder-pilot-tags {
    justify-content: flex-start;
  }

  .ladder-quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .session-save-feedback {
    width: calc(100vw - 24px);
    max-width: 520px;
    text-align: center;
    bottom: 12px;
  }

  .session-save-panel-actions .btn {
    flex: 1 1 100%;
  }

  .landing-sessions-head,
  .landing-session-card {
    flex-direction: column;
  }

  .landing-sessions-head-actions {
    width: 100%;
    align-items: flex-start;
  }

  .session-class-grid {
    grid-template-columns: 1fr;
  }

  .landing-session-actions {
    width: 100%;
    justify-content: stretch;
  }

  .landing-session-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .session-class-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .ladder-pilot-screen {
    padding: 12px;
  }

  .ladder-pilot-modal-list {
    grid-template-columns: 1fr;
  }

  .ladder-pilot-toolbar .btn {
    flex: 1 1 calc(50% - 5px);
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm 16mm;
  }
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    background-image: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .app-shell {
    width: 100%;
    padding: 0;
  }
  .topbar,
  .stepper,
  .cta-group,
  .hero-benefits,
  .view-toggle,
  .nav-actions,
  .results-action-stack,
  .results-tertiary-cta,
  .results-more-panel,
  .results-secondary-cta,
  .simulation-tools,
  .recommendation-tools,
  .simulation-result,
  .recommendation-result,
  .timer,
  .timer-fab,
  .help-fab,
  .timer-footer,
  .timer-controls,
  .timer header,
  .live-shell,
  .screen[data-screen='landing'],
  .screen[data-screen='quick'],
  .screen[data-screen='type'],
  .screen[data-screen='count'],
  .screen[data-screen='teams'],
  .screen[data-screen='options'],
  .screen[data-screen='live'],
  .screen[data-screen='projection'],
  .screen[data-screen='chrono'],
  .btn {
    display: none !important;
  }
  .screen[data-screen='results'] {
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .screen[data-screen='results'] .view {
    display: none !important;
  }
  .screen[data-screen='results'] .view:not(.hidden) {
    display: block !important;
  }
  .print-header {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
  }
  .print-header h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #000;
  }
  .print-header p {
    margin: 2px 0;
    color: #222;
    font-size: 0.9rem;
  }
  .summary-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .time-indicator {
    color: #000;
    margin-bottom: 16px;
  }
  .match-insight {
    color: #000;
    margin-bottom: 16px;
  }
  .summary-card {
    background: #fff;
    border: 1px solid #222;
    color: #000;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .summary-card span {
    color: #444;
  }
  .summary-card strong {
    color: #000;
  }
  .live-timer-panel,
  .rotation-card,
  .team-card,
  .ranking-card,
  .field-card,
  .match-list li,
  .team-match-list li {
    background: #fff;
    border: 1px solid #c2c2c2;
    color: #000;
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }
  .rotation-card,
  .team-card,
  .ranking-card {
    margin-bottom: 12px;
  }
  .match-list li,
  .team-match-list li {
    background: #f6f6f6;
  }
  .finals-list li {
    break-inside: avoid;
  }
  .fields-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .rotation-card {
    page-break-inside: avoid;
  }
  .rotation-header h3,
  .team-card h3,
  .ranking-card h3 {
    color: #000;
  }
  .match-list,
  .team-match-list {
    padding-left: 18px;
    break-inside: avoid;
  }
  .match-list li,
  .team-match-list li {
    background: #f6f6f6;
    border: 1px solid #d7d7d7;
  }
  .role-lines {
    margin-top: 4px;
    gap: 4px;
    border-left: 2px solid #000;
    padding-left: 6px;
  }
  .role-chip {
    background: #222;
    color: #fff;
  }
  .field-match-line,
  .projection-match {
    border-top: 1px solid #c2c2c2;
    padding: 6px 0;
  }
  .field-match-line:first-of-type,
  .projection-match:first-of-type {
    border-top: none;
    padding-top: 0;
  }
  .rest-role-hint {
    color: #555;
  }
  .field-card h4 {
    color: #000;
  }
  input,
  textarea,
  select {
    border: none;
    background: transparent;
    color: #000;
    padding: 0;
    width: auto;
    font-size: 0.95rem;
  }
  table {
    width: 100%;
    border-collapse: collapse;
    color: #000;
  }
  th,
  td {
    border: 1px solid #999;
  }
  th {
    background: #f2f2f2;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
}
