:root {
  color-scheme: dark;
  --felt: #0f1f1b;
  --felt-2: #17342d;
  --rail: #271917;
  --ink: #f5f1e8;
  --muted: #beb5a6;
  --line: rgba(245, 241, 232, 0.16);
  --gold: #d6a84a;
  --silver: #aeb5bd;
  --bronze: #b87333;
  --red: #b94b42;
  --green: #35a36f;
  --panel: rgba(13, 22, 20, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, var(--felt), #07110f 58%, var(--rail));
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.page:not(.is-active):not(.clock-band) {
  display: none;
}

.clock-band:not(.is-active) {
  width: max-content;
  min-height: auto;
  grid-template-columns: 54px;
  grid-template-areas: "actions";
  margin-bottom: 20px;
}

.clock-band:not(.is-active) .title-block,
.clock-band:not(.is-active) .clock-main {
  display: none;
}

.page.panel,
.page.content-grid {
  margin-top: 20px;
}

.clock-band {
  min-height: 62vh;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(280px, 360px);
  grid-template-areas:
    "actions title table"
    "actions clock table";
  align-content: start;
  gap: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(15, 31, 27, 0.84), rgba(15, 31, 27, 0.88)),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255, 255, 255, 0.025) 19px);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 40px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.topbar,
.panel-header,
.controls,
.blind-panels,
.data-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header {
  justify-content: space-between;
  flex-wrap: wrap;
}

.topbar {
  display: contents;
}

.title-block {
  grid-area: title;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 5.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.05rem;
}

.top-actions {
  grid-area: actions;
  width: 54px;
  display: grid;
  grid-template-columns: 1fr;
  align-self: start;
  justify-items: center;
  align-items: start;
  align-content: start;
  gap: 8px;
}

.nav-expanded .clock-band {
  grid-template-columns: 178px minmax(0, 1fr) minmax(280px, 360px);
}

.nav-expanded .clock-band:not(.is-active) {
  grid-template-columns: 178px;
}

.icon-button,
.menu-button,
.menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.menu-toggle,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-weight: 800;
  text-decoration: none;
}

.menu-button.is-active {
  border-color: rgba(214, 168, 74, 0.62);
  background: rgba(214, 168, 74, 0.16);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
}

.menu-label {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-expanded .top-actions {
  width: 178px;
  justify-items: stretch;
}

.nav-expanded .menu-button,
.nav-expanded .icon-button,
.nav-expanded .menu-toggle,
.nav-expanded .volume-control {
  width: 100%;
  justify-content: flex-start;
}

.nav-expanded .menu-label {
  display: inline;
}

.volume-control {
  width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.volume-control input {
  display: none;
  width: 88px;
  accent-color: var(--gold);
}

.nav-expanded .volume-control input {
  display: block;
}

.clock-grid {
  grid-area: clock;
  display: grid;
  gap: clamp(18px, 3vw, 34px);
  justify-items: center;
  padding-top: 10px;
}

.clock-main {
  display: contents;
}

.clock-side-panel {
  grid-area: table;
  align-self: start;
  display: grid;
  gap: 14px;
}

.clock-player-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.18);
}

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

.board-header span {
  border: 1px solid rgba(214, 168, 74, 0.42);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--gold);
  font-weight: 900;
}

.clock-player-list {
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.clock-player-list.is-scrollable {
  max-height: 720px;
  overflow-y: auto;
}

.clock-player-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.clock-player-info {
  min-width: 0;
}

.clock-player-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}

.clock-player-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-player-title span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.clock-player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.clock-player-stats span {
  border: 1px solid rgba(245, 241, 232, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.74rem;
  font-weight: 800;
}

.clock-player-row.is-out {
  opacity: 0.5;
}

.clock-player-row.is-out strong {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
}

.clock-player-photo {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(214, 168, 74, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(rgba(214, 168, 74, 0.14), rgba(53, 163, 111, 0.12)),
    rgba(0, 0, 0, 0.22);
  background-position: center;
  background-size: cover;
}

.last-winner-card {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(214, 168, 74, 0.35);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.title-block .last-winner-card {
  margin-top: 14px;
}

.last-winner-card span,
.last-winner-card small,
.ranking-rule {
  color: var(--muted);
}

.last-winner-card strong {
  display: block;
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.1rem;
}

.winner-photo {
  width: 72px;
  height: 72px;
  border: 2px solid rgba(214, 168, 74, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(rgba(214, 168, 74, 0.2), rgba(53, 163, 111, 0.18)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.2));
  background-position: center;
  background-size: cover;
}

.level-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  border: 1px solid rgba(214, 168, 74, 0.36);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.18);
}

.level-pill {
  min-width: 116px;
  border: 1px solid rgba(214, 168, 74, 0.5);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 900;
}

.level-count {
  font-size: clamp(1.15rem, 2.2vw, 1.8rem);
  font-weight: 900;
  color: var(--ink);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: clamp(5rem, 18vw, 15rem);
  font-weight: 900;
  line-height: 0.88;
  text-shadow: 0 12px 38px rgba(0, 0, 0, 0.46);
}

.blind-panels {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.metric span,
.metric small,
label {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.4rem, 4vw, 3rem);
  line-height: 1;
}

.controls {
  flex-wrap: wrap;
  justify-content: center;
}

.tournament-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.control-button,
.text-button,
.danger-button,
.import-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.control-button {
  min-width: 128px;
  min-height: 48px;
  font-weight: 800;
}

.control-button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c130c;
}

.control-button.secondary {
  background: rgba(53, 163, 111, 0.22);
}

.control-button.subtle,
.danger-button {
  background: rgba(185, 75, 66, 0.2);
}

.control-button.accent {
  background: rgba(214, 168, 74, 0.18);
  border-color: rgba(214, 168, 74, 0.52);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
  gap: 20px;
  margin-top: 20px;
}

.table-form,
.player-form,
.structure-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 16px;
}

.structure-config {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.table-form input,
.table-form select,
.player-form select,
.structure-config input,
.structure-config select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

.structure-config label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.content-grid > *,
.side-stack {
  min-width: 0;
}

.side-stack {
  display: grid;
  gap: 20px;
  align-content: start;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr.is-current td {
  background: rgba(214, 168, 74, 0.08);
}

td input,
td select,
.money-grid input,
.player-form select,
.registered-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

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

.money-grid label {
  display: grid;
  gap: 6px;
}

.prize-box {
  grid-column: 1 / -1;
  border: 1px solid rgba(214, 168, 74, 0.42);
  border-radius: 8px;
  padding: 14px;
}

.table-prize-box {
  text-align: right;
  background: rgba(0, 0, 0, 0.18);
}

.prize-box span {
  display: block;
  color: var(--muted);
}

.prize-box strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
}

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

.payout-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.payout-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.payout-rank .trophy-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.payout-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.payout-item strong {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.registered-players-panel {
  margin-top: 20px;
}

.table-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

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

.table-row button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(185, 75, 66, 0.2);
  color: var(--ink);
}

.registered-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

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

.registered-form label {
  display: grid;
  gap: 6px;
}

.registered-form .photo-input,
.registered-form-actions {
  grid-column: 1 / -1;
}

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

.registered-player-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.registered-player-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.registered-player-row strong,
.registered-player-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registered-player-row small {
  color: var(--muted);
}

.registered-photo {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(214, 168, 74, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(rgba(214, 168, 74, 0.16), rgba(53, 163, 111, 0.14)),
    rgba(0, 0, 0, 0.2);
  background-position: center;
  background-size: cover;
}

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

.registered-player-row button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.registered-player-row [data-action="remove-registered"] {
  background: rgba(185, 75, 66, 0.18);
}

.player-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.player-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.player-photo {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(214, 168, 74, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(rgba(214, 168, 74, 0.14), rgba(53, 163, 111, 0.12)),
    rgba(0, 0, 0, 0.22);
  background-position: center;
  background-size: cover;
}

.player-row.is-out {
  opacity: 0.5;
}

.player-row.is-out strong {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
}

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

.player-actions button,
.delete-level {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.player-actions [data-action="eliminate"] {
  border-color: rgba(185, 75, 66, 0.55);
  background: rgba(185, 75, 66, 0.2);
  color: var(--ink);
  font-weight: 900;
}

.player-row.is-out .player-actions [data-action="eliminate"] {
  border-color: rgba(53, 163, 111, 0.55);
  background: rgba(53, 163, 111, 0.2);
}

.ranking-panel {
  margin-top: 20px;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.ranking-results {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.ranking-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.ranking-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.ranking-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

.ranking-date-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.ranking-date-controls label {
  display: grid;
  gap: 6px;
}

.ranking-date-controls input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

.ranking-date-controls small {
  color: var(--muted);
  line-height: 1.35;
}

.ranking-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ranking-stats-table {
  min-width: 420px;
}

.ranking-stats-table td:not(:first-child),
.ranking-stats-table th:not(:first-child) {
  text-align: center;
}

.ranking-history {
  display: grid;
  gap: 10px;
}

.ranking-history h3 {
  margin: 0;
  font-size: 0.95rem;
}

.ranking-history-list {
  display: grid;
  gap: 8px;
}

.ranking-history-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) repeat(4, auto);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.ranking-history-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-history-row span:not(.rank-number) {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.podium-form {
  display: grid;
  gap: 12px;
}

.ranking-points-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(214, 168, 74, 0.36);
  border-radius: 8px;
  padding: 12px;
}

.ranking-points-config legend {
  padding: 0 6px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.podium-form label {
  display: grid;
  gap: 6px;
}

.podium-form select,
.ranking-points-config input,
.photo-input input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

.ranking-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.ranking-row {
  display: grid;
  grid-template-columns: 36px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.ranking-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-weight: 900;
}

.trophy-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  background: currentColor;
  color: var(--muted);
  clip-path: polygon(
    18% 8%,
    82% 8%,
    82% 22%,
    96% 22%,
    88% 50%,
    72% 50%,
    64% 66%,
    56% 66%,
    56% 82%,
    72% 82%,
    72% 92%,
    28% 92%,
    28% 82%,
    44% 82%,
    44% 66%,
    36% 66%,
    28% 50%,
    12% 50%,
    4% 22%,
    18% 22%
  );
}

.trophy-icon.gold {
  color: var(--gold);
}

.trophy-icon.silver {
  color: var(--silver);
}

.trophy-icon.bronze {
  color: var(--bronze);
}

.trophy-icon.muted {
  color: rgba(245, 241, 232, 0.32);
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #111c19;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.modal-card p:not(.eyebrow) {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .clock-band {
    min-height: auto;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas:
      "actions table"
      "actions title"
      "actions clock";
  }

  .nav-expanded .clock-band {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .nav-expanded .clock-band:not(.is-active) {
    grid-template-columns: 54px;
  }

  .nav-expanded .top-actions {
    z-index: 3;
    width: min(178px, calc(100vw - 36px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 18, 16, 0.96);
  }

  .clock-main,
  .blind-panels,
  .content-grid,
  .registered-layout,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .timer {
    font-size: clamp(4.2rem, 24vw, 8rem);
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 44px;
    align-items: stretch;
  }

  .menu-button {
    justify-content: center;
  }

  .icon-button {
    width: 44px;
  }

  .volume-control {
    width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .volume-control input {
    width: min(120px, 100%);
  }

  .clock-player-list.is-scrollable {
    max-height: 320px;
  }
}

@media (max-width: 520px) {
  .clock-band {
    gap: 12px;
    padding: 18px 12px;
  }

  .controls,
  .data-actions,
  .player-form,
  .registered-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .control-button,
  .text-button,
  .danger-button,
  .import-button {
    width: 100%;
  }

  .structure-config {
    grid-template-columns: 1fr;
  }

  .structure-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ranking-toolbar {
    display: grid;
  }

  .ranking-date-controls {
    grid-template-columns: 1fr;
  }

  .ranking-points-config {
    grid-template-columns: 1fr;
  }

  .ranking-history-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .ranking-history-row span:not(.rank-number) {
    white-space: normal;
  }

  .tournament-actions {
    width: 100%;
  }

  .tournament-actions .control-button {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 8px;
  }

  .payout-grid {
    grid-template-columns: 1fr;
  }
}
