.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.app-shell-scoreboard {
  width: min(1180px, calc(100% - 20px));
  padding-top: 16px;
}

.app-shell-scoreboard-fit {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.topbar-compact {
  align-items: center;
  margin-bottom: 14px;
}

.branding {
  max-width: 760px;
}

.eyebrow,
.panel-kicker,
.team-index {
  display: inline-flex;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.eyebrow {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #effce4;
  background: rgba(8, 47, 73, 0.84);
}

.intro-copy {
  max-width: 60ch;
  margin-top: 10px;
}

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

.nav-pill,
.inline-link {
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--panel-strong);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(10, 51, 45, 0.1);
  transition: transform 0.18s ease;
}

.nav-pill:hover,
.inline-link:hover {
  transform: translateY(-1px);
}

.nav-pill-active {
  color: #f7fff7;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.96), rgba(10, 96, 84, 0.92));
}

.pwa-update-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, calc(100vw - 24px));
  padding: 14px 16px;
  border: 1px solid rgba(10, 51, 45, 0.16);
  border-radius: 20px;
  background: rgba(255, 249, 236, 0.96);
  box-shadow:
    0 22px 46px rgba(10, 51, 45, 0.22),
    0 8px 18px rgba(10, 51, 45, 0.12);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.pwa-update-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pwa-update-copy strong {
  font-size: 1rem;
  color: var(--panel-strong);
}

.pwa-update-copy span {
  font-size: 0.88rem;
  color: var(--panel-soft);
}

.pwa-update-button {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d5d53, #123f49);
  color: #f8fff8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pwa-update-button:hover {
  filter: brightness(1.06);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.full-span {
  grid-column: 1 / -1;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 196, 0, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(8, 47, 73, 0.95), rgba(10, 96, 84, 0.92));
  color: #f5fff8;
}

.panel-hero h2,
.panel-hero p,
.panel-hero .panel-kicker {
  color: inherit;
}

.panel-copy {
  margin-top: 12px;
  max-width: 34rem;
  color: rgba(245, 255, 248, 0.78);
}

.panel-heading,
.group-head,
.history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.group-head-compact {
  align-items: center;
}

.group-head-compact > div:first-child {
  min-width: 0;
}

.group-head-compact h3 {
  margin: 4px 0 0;
}

.summary-grid,
.double-grid,
.history-list,
.history-meta {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.mini-stat {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mini-stat span {
  display: block;
  color: rgba(245, 255, 248, 0.76);
}

.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
}

.status-banner {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 700;
}

.status-banner-loading {
  background: rgba(255, 255, 255, 0.16);
}

.status-banner-loaded {
  color: #103b34;
  background: rgba(201, 255, 215, 0.9);
}

.status-banner-empty {
  color: #5f3c0a;
  background: rgba(255, 239, 190, 0.94);
}

.status-banner-error {
  color: #5b1020;
  background: rgba(255, 214, 224, 0.94);
}

.floating-status-bubble {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%);
  min-width: min(78vw, 320px);
  max-width: min(84vw, 420px);
  padding: 14px 20px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  color: #f8fff9;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.96), rgba(10, 96, 84, 0.92));
  box-shadow: 0 18px 40px rgba(8, 47, 73, 0.28);
  pointer-events: none;
  animation: status-bubble-in 0.18s ease-out;
}

@keyframes status-bubble-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.selection-shell,
.selection-form,
.group-board {
  display: grid;
  gap: 18px;
}

.selection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.selection-toolbar > .field {
  width: min(100%, 220px);
}

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

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span {
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(10, 51, 45, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--panel-strong);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 200px;
}

.field input[type='date'] {
  min-width: 0;
}

.button-stack {
  display: grid;
  gap: 12px;
  align-content: end;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  padding: 14px 18px;
}

.primary-button {
  color: #f8fff8;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.96), rgba(10, 96, 84, 0.92));
}

.secondary-button {
  color: var(--panel-strong);
  background: rgba(11, 88, 73, 0.1);
}

.selection-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(10, 51, 45, 0.05);
  color: var(--panel-soft);
}

.group-card,
.history-card,
.empty-state {
  padding: 22px;
  border-radius: 22px;
  background: rgba(246, 249, 244, 0.95);
  border: 1px solid rgba(10, 51, 45, 0.08);
}

.group-card-stage {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 242, 0.94));
}

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

.team-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.team-stage-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(10, 51, 45, 0.08);
}

.team-index {
  color: var(--panel-soft);
}

.team-name {
  margin-top: 10px;
  font-size: 1.08rem;
  color: var(--panel-strong);
}

.winner-badge {
  align-self: start;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--panel-strong);
  background: rgba(11, 88, 73, 0.1);
}

.history-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.history-meta span {
  color: var(--panel-soft);
}

.history-card-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.history-card-button:hover {
  box-shadow: 0 12px 28px rgba(8, 47, 73, 0.08);
}

.history-card-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.history-card-content {
  padding: 0;
  background: transparent;
}

.history-delete-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  font: inherit;
  color: #fff;
  background: linear-gradient(180deg, #e57a63, #c44c3d);
  box-shadow:
    inset 0 0 0 1px rgba(161, 54, 37, 0.22),
    0 10px 18px rgba(8, 47, 73, 0.12);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
}

.history-delete-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(161, 54, 37, 0.28),
    0 14px 22px rgba(8, 47, 73, 0.16);
}

.history-delete-button:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.history-delete-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.history-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pagination-button {
  min-width: 44px;
  padding: 10px 14px;
  border-radius: 12px;
}

.pagination-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.pagination-button-active {
  color: #f8fff8;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.96), rgba(10, 96, 84, 0.92));
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--panel-soft);
}

.pagination-summary {
  color: var(--panel-soft);
  font-size: 0.92rem;
}

.scoreboard-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 14px;
  align-items: start;
  min-height: 0;
  height: 100%;
}

.streak-banner {
  position: fixed;
  left: 50%;
  top: 18%;
  z-index: 85;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: min(88vw, 420px);
  padding: 18px 28px;
  border-radius: 28px;
  color: #fff8e8;
  background:
    radial-gradient(circle at top, rgba(255, 219, 112, 0.38), transparent 46%),
    linear-gradient(135deg, rgba(143, 25, 26, 0.96), rgba(248, 128, 45, 0.92));
  box-shadow:
    0 24px 48px rgba(8, 47, 73, 0.32),
    inset 0 0 0 1px rgba(255, 238, 194, 0.24);
  transform: translate(-50%, 0);
  pointer-events: none;
  animation: streak-banner-burst 1.8s ease forwards;
}

.streak-banner-count {
  font-size: 0.96rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 244, 214, 0.86);
}

.streak-banner strong {
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(101, 14, 10, 0.28),
    0 0 22px rgba(255, 226, 154, 0.24);
}

.streak-banner small {
  font-size: 1rem;
  color: rgba(255, 248, 232, 0.92);
}

.victory-banner {
  position: fixed;
  left: 50%;
  top: 22%;
  z-index: 86;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: min(90vw, 460px);
  padding: 22px 30px;
  border-radius: 30px;
  color: #4a2e1d;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.34), transparent 40%),
    linear-gradient(135deg, rgba(255, 243, 196, 0.98), rgba(255, 199, 92, 0.94));
  box-shadow:
    0 30px 56px rgba(8, 47, 73, 0.28),
    0 0 0 6px rgba(255, 243, 211, 0.16),
    inset 0 0 0 1px rgba(196, 134, 32, 0.34);
  transform: translate(-50%, 0);
  pointer-events: none;
  animation: victory-banner-burst 2.2s ease forwards;
}

.victory-banner-kicker {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(101, 67, 22, 0.82);
}

.victory-banner strong {
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.4),
    0 0 22px rgba(255, 242, 176, 0.34);
}

.victory-banner small,
.victory-banner em {
  font-size: 1rem;
  font-style: normal;
  color: rgba(74, 46, 29, 0.9);
}

@keyframes streak-banner-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.88);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04);
  }

  70% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.96);
  }
}

@keyframes victory-banner-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.84);
  }

  14% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.06);
  }

  68% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.96);
  }
}

.scoreboard-court {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 12px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 205, 96, 0.22), transparent 26%),
    linear-gradient(145deg, rgba(8, 47, 73, 0.97), rgba(10, 96, 84, 0.93));
  box-shadow: 0 30px 60px rgba(8, 47, 73, 0.24);
}

.scoreboard-team-section {
  display: grid;
  gap: 8px;
}

.scoreboard-team-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 8px;
  align-items: center;
}

.team-head-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 64px;
  padding: 8px;
  border-radius: 4px;
  background: rgba(255, 248, 232, 0.92);
  box-shadow: inset 0 0 0 1px rgba(195, 154, 88, 0.2);
}

.scoreboard-name-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 8px;
  border-radius: 4px;
  color: #16342f;
  background: rgba(255, 255, 255, 0.7);
}

.scoreboard-name-chip strong {
  font-size: clamp(1rem, 2.4vw, 1.9rem);
  line-height: 1;
  font-weight: 500;
}

.scoreboard-name-chip-serving {
  background: linear-gradient(180deg, #ebf8a4, #d6e164);
  box-shadow: inset 0 0 0 2px rgba(111, 128, 27, 0.24);
}

.team-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-family: var(--mono);
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.96), rgba(10, 96, 84, 0.92));
  border-radius: 4px;
}

.team-head-buttons {
  display: grid;
  gap: 10px;
}

.team-icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  color: #5b2f13;
  background: linear-gradient(180deg, #fff8e8, #f2d9a3);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.35),
    0 6px 14px rgba(8, 47, 73, 0.14);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.team-icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.45),
    0 10px 18px rgba(8, 47, 73, 0.18);
}

.team-icon-button:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.team-icon-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.serve-lane {
  position: relative;
  display: grid;
  grid-template-columns: 32px auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  width: min(100%, 440px);
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  color: #f8f4ea;
  background: rgba(255, 248, 232, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 202, 0.12);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.serve-lane:disabled {
  cursor: default;
}

.serve-lane:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 248, 232, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 202, 0.22),
    0 10px 18px rgba(8, 47, 73, 0.12);
}

.serve-lane-prompt {
  background: rgba(255, 248, 232, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 202, 0.12);
}

.serve-lane-arrow {
  display: none;
}

.serve-lane small {
  justify-self: end;
  color: rgba(248, 244, 234, 0.72);
}

.serve-lane-prompt > span:nth-of-type(2) {
  color: #f7ffbe;
  font-weight: 800;
  text-shadow:
    0 0 12px rgba(235, 248, 164, 0.5),
    0 0 22px rgba(235, 248, 164, 0.24);
  animation: serve-label-pulse 0.9s ease-in-out infinite;
}

.serve-lane-locked {
  box-shadow: inset 0 0 0 1px rgba(214, 225, 100, 0.42);
}

.serve-lane-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff8e8, #f0dfbd);
  box-shadow: inset 0 0 0 1px rgba(195, 154, 88, 0.22);
}

.serve-lane-box-checked {
  position: relative;
  background: linear-gradient(180deg, #ebf8a4, #d6e164);
  box-shadow:
    inset 0 0 0 1px rgba(111, 128, 27, 0.26),
    0 0 0 1px rgba(214, 225, 100, 0.14);
}

.serve-lane-box-checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  color: #38501f;
}

@keyframes serve-label-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.82;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.score-panel-surface {
  display: grid;
  place-items: center;
  min-height: 172px;
  border: 0;
  width: 100%;
  padding: 0;
  border-radius: 4px;
  cursor: default;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
  background:
    linear-gradient(transparent 0 40%, rgba(11, 39, 34, 0.18) 40% 60%, transparent 60% 100%),
    linear-gradient(90deg, transparent 0 40%, rgba(11, 39, 34, 0.18) 40% 60%, transparent 60% 100%),
    linear-gradient(180deg, rgba(255, 248, 232, 0.2), rgba(255, 248, 232, 0.08)),
    rgba(245, 237, 221, 0.96);
}

.score-panel-surface-live {
  cursor: pointer;
}

.score-panel-surface-live:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 2px rgba(236, 193, 112, 0.44),
    0 10px 20px rgba(8, 47, 73, 0.12);
}

.score-panel-value {
  font-family: var(--mono);
  font-size: clamp(4.4rem, 11vw, 7.2rem);
  line-height: 1;
  color: #0d544a;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.42);
}

.scoreboard-center-banner {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 2px 0;
}

.scoreboard-center-banner p {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  color: #fff7e9;
  text-align: center;
}

.scoreboard-center-banner small {
  font-size: 0.92rem;
  color: rgba(255, 247, 233, 0.76);
}

.scoreboard-rail {
  display: grid;
  gap: 10px;
  align-content: start;
}

.rail-icon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.rail-square-button {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: #5b2f13;
  background: linear-gradient(180deg, #fff8e8, #f2d9a3);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.35),
    0 8px 18px rgba(8, 47, 73, 0.14);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.rail-square-button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.45),
    0 12px 20px rgba(8, 47, 73, 0.18);
}

.rail-square-button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.rail-clock {
  display: grid;
  place-items: center;
  min-height: 68px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 1.7rem;
  color: #fff7e9;
  background:
    radial-gradient(circle at top right, rgba(255, 205, 96, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(8, 47, 73, 0.97), rgba(10, 96, 84, 0.93));
}

.rail-room-id {
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  color: #f7fff8;
  background: rgba(8, 47, 73, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rail-pill {
  border: 0;
  border-radius: 999px;
  padding: 14px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  font: inherit;
  font-size: 1rem;
  color: #4a2e1d;
  background: linear-gradient(180deg, #fff0c7, #f8c870);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.28),
    0 10px 18px rgba(8, 47, 73, 0.14);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.rail-pill-hold-wrap {
  display: grid;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.rail-pill-hold-wrap-active {
  filter: drop-shadow(0 12px 20px rgba(217, 90, 68, 0.2));
}

.rail-pill:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.34),
    0 14px 22px rgba(8, 47, 73, 0.18);
}

.rail-pill:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.rail-pill-danger {
  color: #fff;
  background: linear-gradient(180deg, #d95a44, #b53a28);
}

.rail-pill-active-hold {
  transform: translateY(1px) scale(0.99);
  filter: brightness(1.08) saturate(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 227, 214, 0.5),
    inset 0 12px 18px rgba(255, 255, 255, 0.1),
    0 0 0 4px rgba(255, 224, 194, 0.2),
    0 14px 26px rgba(181, 58, 40, 0.28);
}

.rail-pill-muted {
  color: #4d3a29;
  background: linear-gradient(180deg, #f7f2e8, #e0d6c5);
}

.rail-hold-progress {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 240, 199, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 208, 0.12);
}

.rail-hold-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffe9a8, #fff7d0, #ffffff);
  box-shadow: 0 0 12px rgba(255, 246, 203, 0.5);
}

.voice-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}

.voice-settings-panel {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px 20px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff8e8, #ffe5ad);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px rgba(200, 140, 46, 0.45);
}

.voice-settings-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  color: #b34e3a;
  background: linear-gradient(180deg, #ffe5bf, #f0bd7c);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.34),
    0 10px 18px rgba(8, 47, 73, 0.16);
}

.voice-setting-row,
.voice-setting-slider {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 249, 238, 0.94);
  box-shadow: inset 0 0 0 1px rgba(199, 155, 83, 0.12);
}

.voice-setting-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.voice-setting-row input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: #0f6a5d;
}

.voice-setting-slider strong {
  justify-self: end;
  color: #5b2f13;
}

.voice-setting-slider input[type='range'] {
  width: 100%;
  accent-color: #0f6a5d;
}

.team-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
}

.team-picker-shell {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100dvh - 24px);
}

.team-picker-close {
  position: absolute;
  top: -12px;
  right: 8px;
  z-index: 2;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 2.4rem;
  color: #b34e3a;
  background: linear-gradient(180deg, #ffe5bf, #f0bd7c);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.34),
    0 14px 26px rgba(8, 47, 73, 0.2);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.team-picker-close:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.42),
    0 18px 30px rgba(8, 47, 73, 0.24);
}

.team-picker-close:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.team-picker-ribbon {
  position: absolute;
  top: -24px;
  left: 34px;
  z-index: 2;
  padding: 16px 24px;
  border-radius: 24px;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
}

.team-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 22px 16px 16px;
  border-radius: 28px;
  background: rgba(20, 10, 6, 0.18);
  max-height: calc(100dvh - 52px);
}

.team-picker-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff8e8, #ffe5ad);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px rgba(200, 140, 46, 0.45);
  min-height: 0;
}

.team-picker-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-picker-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 1.25rem;
  color: #4a2e1d;
  background: linear-gradient(180deg, #f5d89f, #ecc170);
}

.team-picker-title p {
  margin-top: 2px;
  font-size: 0.84rem;
}

.team-picker-config-row {
  display: flex;
  justify-content: flex-start;
}

.team-picker-config {
  display: grid;
  gap: 6px;
  color: #4a2e1d;
}

.team-picker-config span {
  font-weight: 700;
}

.team-picker-config-compact {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
}

.team-picker-config-compact span {
  font-size: 0.92rem;
}

.team-picker-score-input {
  width: 100%;
  max-width: 140px;
  padding: 12px 14px;
  border: 1px solid rgba(124, 98, 61, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #2e231b;
  font: inherit;
}

.team-picker-score-input-compact {
  width: 72px;
  max-width: 72px;
  padding: 8px 10px;
  text-align: center;
}

.team-picker-list {
  display: grid;
  gap: 10px;
  max-height: min(48dvh, 430px);
  overflow: auto;
  padding-right: 4px;
}

.team-picker-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border: 1px solid rgba(124, 98, 61, 0.18);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: #2e231b;
  background: rgba(255, 249, 238, 0.92);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.team-picker-option:hover {
  transform: translateY(-1px);
  border-color: rgba(199, 155, 83, 0.34);
  box-shadow: 0 12px 22px rgba(8, 47, 73, 0.08);
}

.team-picker-option-active {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 20px rgba(147, 104, 35, 0.12);
}

.team-picker-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(100, 83, 61, 0.28);
  background: rgba(255, 255, 255, 0.88);
}

.team-picker-option-active .team-picker-checkbox {
  color: #fff;
  background: linear-gradient(180deg, #ffbf3b, #f0a21a);
}

.team-picker-option strong,
.preset-team-card strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.team-picker-option small,
.preset-team-card small,
.picker-side-hint {
  display: block;
  margin-top: 4px;
  color: #7b6148;
  font-size: 0.82rem;
}

.team-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-picker-ghost,
.team-picker-confirm,
.team-picker-clear {
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.24),
    0 10px 18px rgba(8, 47, 73, 0.12);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.team-picker-ghost:hover,
.team-picker-confirm:hover:not(:disabled),
.team-picker-clear:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 155, 83, 0.34),
    0 14px 22px rgba(8, 47, 73, 0.16);
}

.team-picker-ghost:active,
.team-picker-confirm:active:not(:disabled),
.team-picker-clear:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.team-picker-ghost {
  color: #4d3a29;
  background: linear-gradient(180deg, #f7f2e8, #e0d6c5);
}

.team-picker-confirm {
  color: #4a2e1d;
  background: linear-gradient(180deg, #ebf8a4, #d6e164);
}

.team-picker-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.preset-team-block {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.preset-team-head {
  display: grid;
  gap: 2px;
  color: #4a2e1d;
}

.preset-team-head small {
  color: #7b6148;
  font-size: 0.8rem;
}

.preset-team-list {
  display: grid;
  gap: 8px;
  max-height: min(44dvh, 360px);
  overflow: auto;
}

.preset-team-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(124, 98, 61, 0.16);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  background: rgba(255, 249, 238, 0.92);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.preset-team-card:hover {
  transform: translateY(-1px);
  border-color: rgba(199, 155, 83, 0.34);
  box-shadow: 0 12px 22px rgba(8, 47, 73, 0.08);
}

.preset-team-card-active {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 20px rgba(147, 104, 35, 0.12);
}

.preset-team-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.1rem;
  color: #5b2f13;
  background: linear-gradient(180deg, #ffc84d, #f2a316);
}

.team-picker-clear {
  color: #fff;
  background: linear-gradient(180deg, #f7a17e, #ed774d);
}

.finish-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(6px);
}

.finish-dialog {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px 20px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff8e8, #ffe5ad);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px rgba(200, 140, 46, 0.45);
}

.finish-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 1.8rem;
  color: #b34e3a;
  background: linear-gradient(180deg, #ffe5bf, #f0bd7c);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.34),
    0 10px 18px rgba(8, 47, 73, 0.16);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.finish-dialog-close:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.42),
    0 14px 22px rgba(8, 47, 73, 0.2);
}

.finish-dialog-close:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.finish-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 249, 238, 0.94);
}

.finish-score div {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.finish-score strong {
  font-family: var(--mono);
  font-size: 2.6rem;
  line-height: 1;
  color: #16342f;
}

.finish-score span {
  color: #5f4a35;
}

.finish-score-divider {
  font-family: var(--mono);
  font-size: 2rem;
  color: #70543c;
}

.finish-dialog-copy {
  color: #5f4a35;
  text-align: center;
}

.finish-dialog-error {
  padding: 12px 14px;
  border-radius: 14px;
  color: #7a1d2a;
  background: rgba(255, 224, 230, 0.95);
}

.finish-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.history-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(6px);
}

.history-modal {
  position: relative;
  width: min(680px, 100%);
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff8e8, #ffe5ad);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 0 0 2px rgba(200, 140, 46, 0.45);
}

.history-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  color: #b34e3a;
  background: linear-gradient(180deg, #ffe5bf, #f0bd7c);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.34),
    0 10px 18px rgba(8, 47, 73, 0.16);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.history-modal-close:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(199, 125, 63, 0.42),
    0 14px 22px rgba(8, 47, 73, 0.2);
}

.history-modal-close:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.history-modal-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 249, 238, 0.94);
}

.history-modal-score div {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.history-modal-score strong {
  font-family: var(--mono);
  font-size: 1.9rem;
  line-height: 1;
  color: #16342f;
}

.history-modal-score span {
  font-size: 0.88rem;
  color: #5f4a35;
}

.history-modal-score-divider {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: #70543c;
}

.history-modal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: #5f4a35;
}

.history-replay-list {
  display: grid;
  gap: 10px;
  max-height: min(50vh, 480px);
  overflow: auto;
}

.history-replay-row {
  display: grid;
  grid-template-columns: 108px 92px 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 249, 238, 0.92);
}

.history-replay-empty {
  padding: 12px 14px;
  border-radius: 14px;
  color: #5f4a35;
  background: rgba(255, 249, 238, 0.92);
}

.inline-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .topbar,
  .page-grid,
  .summary-grid,
  .double-grid,
  .history-meta,
  .selection-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .panel-heading,
  .group-head,
  .history-head {
    flex-direction: column;
  }

  .group-head-compact {
    flex-direction: row;
    align-items: center;
  }

  .group-head-compact .group-actions {
    flex-shrink: 0;
  }

  .scoreboard-team-head {
    grid-template-columns: minmax(0, 1fr) 62px;
  }

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

  .team-picker-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .pwa-update-toast {
    gap: 10px;
    bottom: 12px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
  }

  .pwa-update-copy strong {
    font-size: 0.92rem;
  }

  .pwa-update-copy span {
    font-size: 0.78rem;
  }

  .pwa-update-button {
    min-width: 84px;
    padding: 9px 12px;
    font-size: 0.84rem;
  }

  .app-shell {
    width: min(100% - 14px, 1240px);
    padding: 14px 0 24px;
  }

  .app-shell-scoreboard {
    width: min(100% - 10px, 1240px);
    padding-top: 10px;
  }

  .app-shell-scoreboard-fit {
    min-height: 100dvh;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .branding h1 {
    font-size: 1.35rem;
  }

  .intro-copy {
    display: none;
  }

  .nav-pill,
  .inline-link {
    padding: 9px 12px;
  }

  .selection-toolbar {
    gap: 12px;
  }

  .selection-toolbar > .field {
    width: 100%;
  }

  .button-stack {
    grid-template-columns: 1fr;
  }

  .field input[type='date'] {
    max-width: 100%;
    font-size: 16px;
    overflow: hidden;
  }

  .floating-status-bubble {
    bottom: 12px;
    min-width: min(88vw, 320px);
    max-width: 92vw;
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .group-head-compact {
    gap: 10px;
  }

  .group-head-compact h3 {
    font-size: 1rem;
  }

  .group-head-compact .inline-link {
    padding: 8px 12px;
    white-space: nowrap;
  }

  .scoreboard-court {
    gap: 10px;
    padding: 8px;
    border-radius: 16px;
  }

  .app-shell-scoreboard-fit .topbar-compact {
    gap: 6px;
    margin-bottom: 6px;
  }

  .app-shell-scoreboard-fit .eyebrow {
    margin-bottom: 6px;
    padding: 6px 10px;
    font-size: 0.66rem;
  }

  .app-shell-scoreboard-fit .branding h1 {
    margin: 8px 0 6px;
    font-size: 1.12rem;
  }

  .app-shell-scoreboard-fit .topnav {
    gap: 6px;
  }

  .app-shell-scoreboard-fit .nav-pill {
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .streak-banner {
    top: 12%;
    min-width: min(92vw, 360px);
    padding: 14px 18px;
    border-radius: 22px;
  }

  .streak-banner strong {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .streak-banner small {
    font-size: 0.88rem;
  }

  .victory-banner {
    top: 14%;
    min-width: min(92vw, 360px);
    padding: 16px 18px;
    border-radius: 22px;
  }

  .victory-banner strong {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
  }

  .victory-banner small,
  .victory-banner em {
    font-size: 0.88rem;
  }

  .voice-settings-panel {
    padding: 20px 14px 14px;
    border-radius: 18px;
  }

  .scoreboard-team-head {
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 5px;
  }

  .team-head-main {
    gap: 5px;
    min-height: 46px;
    padding: 5px;
  }

  .scoreboard-name-chip {
    gap: 5px;
    min-height: 34px;
    padding: 3px 5px;
  }

  .serve-lane-arrow {
    left: 52px;
  }

  .team-number {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 0.82rem;
  }

  .scoreboard-name-chip strong {
    font-size: clamp(0.76rem, 3.6vw, 1rem);
  }

  .team-icon-button {
    min-height: 30px;
    font-size: 0.94rem;
  }

  .serve-lane {
    grid-template-columns: 28px auto;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.86rem;
  }

  .serve-lane small {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.72rem;
  }

  .score-panel-surface {
    min-height: clamp(90px, 15.5dvh, 104px);
  }

  .score-panel-value {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .scoreboard-center-banner {
    gap: 2px;
  }

  .scoreboard-center-banner p {
    font-size: 1.02rem;
  }

  .scoreboard-center-banner small {
    font-size: 0.7rem;
    text-align: center;
  }

  .scoreboard-screen {
    grid-template-columns: 1fr;
  }

  .scoreboard-rail {
    grid-template-columns: minmax(0, 1fr) 94px 106px;
    gap: 6px;
    align-items: stretch;
  }

  .rail-pill-hold-wrap {
    grid-column: 1 / -1;
  }

  .rail-square-button {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .rail-clock {
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.96rem;
  }

  .rail-room-id {
    padding: 7px 8px;
    font-size: 0.76rem;
  }

  .rail-pill {
    padding: 8px 7px;
    font-size: 0.82rem;
  }

  .rail-pill-hold-wrap {
    gap: 4px;
  }

  .rail-hold-progress {
    height: 5px;
  }

  .finish-dialog {
    padding: 20px 14px 14px;
    border-radius: 18px;
  }

  .history-modal {
    gap: 8px;
    padding: 14px 12px;
    border-radius: 18px;
  }

  .finish-dialog-close {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .finish-score {
    padding: 12px 10px;
  }

  .finish-score strong {
    font-size: 2rem;
  }

  .finish-dialog-actions {
    grid-template-columns: 1fr;
  }

  .history-modal-score {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px;
  }

  .history-modal-score-divider {
    display: block;
  }

  .history-replay-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .history-card-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-delete-button {
    width: 100%;
  }

  .room-card {
    padding: 14px;
    border-radius: 16px;
  }

  .room-card-score strong,
  .room-watch-team strong {
    font-size: clamp(1.7rem, 12vw, 2.6rem);
  }

  .team-picker-ribbon {
    left: 18px;
    right: 90px;
    top: -18px;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 0.88rem;
  }

  .team-picker-shell {
    max-height: calc(100dvh - 12px);
  }

  .team-picker-layout {
    grid-template-columns: minmax(0, 1fr) 156px;
    gap: 8px;
    padding: 18px 10px 10px;
    border-radius: 20px;
    max-height: calc(100dvh - 24px);
  }

  .team-picker-panel {
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .team-picker-title {
    gap: 8px;
  }

  .team-picker-count {
    min-width: 56px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 1rem;
  }

  .team-picker-title strong {
    font-size: 0.96rem;
  }

  .team-picker-title p {
    font-size: 0.72rem;
  }

  .team-picker-config-compact span {
    font-size: 0.8rem;
  }

  .team-picker-score-input-compact {
    width: 58px;
    max-width: 58px;
    padding: 6px 8px;
    font-size: 0.88rem;
  }

  .team-picker-list {
    gap: 6px;
    max-height: min(46dvh, 330px);
  }

  .team-picker-option {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 8px;
    border-radius: 12px;
  }

  .team-picker-checkbox {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .team-picker-option strong,
  .preset-team-card strong {
    font-size: 0.9rem;
  }

  .team-picker-option small,
  .preset-team-card small,
  .picker-side-hint,
  .preset-team-head small {
    font-size: 0.72rem;
  }

  .team-picker-actions {
    gap: 8px;
  }

  .team-picker-ghost,
  .team-picker-confirm,
  .team-picker-clear {
    padding: 10px 10px;
    font-size: 0.86rem;
  }

  .preset-team-list {
    gap: 6px;
    max-height: min(42dvh, 300px);
  }

  .preset-team-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }

  .preset-team-index {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
  }
}

@media (max-width: 720px) and (max-height: 840px) {
  .app-shell-scoreboard-fit .scoreboard-screen {
    gap: 5px;
  }

  .app-shell-scoreboard-fit .scoreboard-court {
    gap: 8px;
    padding: 6px;
  }

  .app-shell-scoreboard-fit .scoreboard-team-section {
    gap: 5px;
  }

  .app-shell-scoreboard-fit .score-panel-surface {
    min-height: clamp(82px, 14.2dvh, 96px);
  }

  .app-shell-scoreboard-fit .score-panel-value {
    font-size: clamp(2.7rem, 13.5vw, 4.1rem);
  }

  .app-shell-scoreboard-fit .scoreboard-center-banner p {
    font-size: 0.96rem;
  }
}

.room-list-grid {
  display: grid;
  gap: 16px;
}

.room-list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.room-refresh-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.room-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 28px rgba(8, 47, 73, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(8, 47, 73, 0.12);
}

.room-card-head,
.room-watch-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.room-card-head span,
.room-watch-meta span,
.room-card-updated {
  color: var(--panel-soft);
  font-size: 0.9rem;
}

.room-card-score,
.room-watch-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.room-card-matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.room-card-score div,
.room-watch-team {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: 18px;
  background: rgba(244, 236, 216, 0.8);
}

.room-card-matchup strong {
  display: block;
  min-width: 0;
  padding: 16px 12px;
  border-radius: 18px;
  text-align: center;
  background: rgba(244, 236, 216, 0.8);
  color: var(--panel-strong);
}

.room-card-matchup span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--panel-soft);
}

.room-card-score small,
.room-watch-team small {
  color: var(--panel-soft);
}

.room-card-score strong,
.room-watch-team strong {
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
}

.room-card-score span,
.room-watch-divider {
  font-size: 2rem;
  font-weight: 700;
  color: var(--panel-strong);
}

.room-watch-panel {
  display: grid;
  gap: 18px;
}

.changelog-list {
  display: grid;
  gap: 16px;
}

.changelog-card {
  position: relative;
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(246, 249, 244, 0.95);
  border: 1px solid rgba(10, 51, 45, 0.08);
}

.changelog-card-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.changelog-date {
  font-size: 0.85rem;
  color: var(--panel-soft);
}

.changelog-hash {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--panel-strong);
  background: rgba(11, 88, 73, 0.1);
}

.changelog-subject {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--panel-strong);
}

.changelog-notes {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.changelog-notes p {
  margin: 0;
  color: var(--panel-soft);
}

.changelog-section {
  margin-top: 12px;
}

.changelog-section-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--panel-strong);
}

.changelog-section-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.changelog-section-list li {
  color: var(--panel-soft);
  line-height: 1.55;
}
