:root {
  color-scheme: dark;
  --bg: #0b0a09;
  --panel: rgba(22, 19, 16, 0.94);
  --panel-soft: rgba(37, 31, 25, 0.82);
  --line: rgba(232, 201, 139, 0.22);
  --line-strong: rgba(232, 201, 139, 0.42);
  --gold: #e8c98b;
  --gold-deep: #a97732;
  --ivory: #f7efe1;
  --muted: #bcb1a1;
  --red: #8f2424;
  --red-hot: #d72c18;
  --red-soft: rgba(143, 36, 36, 0.26);
  --jade: #4ca88c;
  --ink: #16120f;
  --wash-top: rgba(232, 201, 139, 0.22);
  --wash-left: rgba(215, 44, 24, 0.2);
  --wash-right: rgba(76, 168, 140, 0.14);
  --grid-gold: rgba(232, 201, 139, 0.05);
  --grid-red: rgba(143, 36, 36, 0.04);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  --radius: 8px;
}

html[data-theme="ocean"] {
  --bg: #071018;
  --panel: rgba(12, 24, 34, 0.94);
  --panel-soft: rgba(16, 40, 56, 0.82);
  --line: rgba(132, 206, 232, 0.24);
  --line-strong: rgba(132, 206, 232, 0.44);
  --gold: #9fdcff;
  --gold-deep: #2d7b9a;
  --ivory: #edf8ff;
  --muted: #a8bdc8;
  --red: #1d5d8f;
  --red-hot: #33a3d8;
  --red-soft: rgba(45, 123, 154, 0.28);
  --jade: #66d1c0;
  --wash-top: rgba(132, 206, 232, 0.24);
  --wash-left: rgba(20, 82, 123, 0.24);
  --wash-right: rgba(102, 209, 192, 0.16);
  --grid-gold: rgba(159, 220, 255, 0.05);
  --grid-red: rgba(20, 82, 123, 0.05);
}

html[data-theme="emerald"] {
  --bg: #07130e;
  --panel: rgba(13, 29, 22, 0.94);
  --panel-soft: rgba(18, 48, 36, 0.82);
  --line: rgba(139, 224, 171, 0.24);
  --line-strong: rgba(139, 224, 171, 0.44);
  --gold: #bfe99a;
  --gold-deep: #5d8b35;
  --ivory: #f1f8e9;
  --muted: #b7c7ad;
  --red: #276d4f;
  --red-hot: #55bd76;
  --red-soft: rgba(39, 109, 79, 0.3);
  --jade: #66d1a1;
  --wash-top: rgba(191, 233, 154, 0.2);
  --wash-left: rgba(39, 109, 79, 0.25);
  --wash-right: rgba(102, 209, 161, 0.16);
  --grid-gold: rgba(191, 233, 154, 0.05);
  --grid-red: rgba(39, 109, 79, 0.05);
}

html[data-theme="violet"] {
  --bg: #100916;
  --panel: rgba(25, 15, 33, 0.94);
  --panel-soft: rgba(43, 28, 56, 0.82);
  --line: rgba(220, 176, 255, 0.22);
  --line-strong: rgba(220, 176, 255, 0.42);
  --gold: #dcb0ff;
  --gold-deep: #8d58c6;
  --ivory: #fbf1ff;
  --muted: #c5b0ca;
  --red: #6b2b77;
  --red-hot: #b64bd8;
  --red-soft: rgba(107, 43, 119, 0.3);
  --jade: #e083c4;
  --wash-top: rgba(220, 176, 255, 0.2);
  --wash-left: rgba(107, 43, 119, 0.27);
  --wash-right: rgba(224, 131, 196, 0.15);
  --grid-gold: rgba(220, 176, 255, 0.05);
  --grid-red: rgba(107, 43, 119, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -20%, var(--wash-top), transparent 34%),
    linear-gradient(135deg, var(--wash-left), transparent 28%),
    linear-gradient(315deg, var(--wash-right), transparent 30%),
    repeating-linear-gradient(90deg, var(--grid-gold) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, var(--grid-red) 0 1px, transparent 1px 54px),
    var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ivory);
  font-family:
    Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui,
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 1280px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 8px;
}

.control-panel,
.output-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(232, 201, 139, 0.08), transparent 28%),
    linear-gradient(25deg, rgba(143, 36, 36, 0.16), transparent 36%),
    var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 7px;
  max-height: none;
  padding: 8px;
  overflow: visible;
}

.settings-panel {
  position: fixed;
  inset: 12px;
  z-index: 50;
  align-content: start;
  max-height: calc(100svh - 24px);
  overflow: auto;
}

.settings-panel:not(.is-open) {
  display: none;
}

.close-settings {
  grid-column: -2 / -1;
  justify-self: end;
  align-self: center;
}

.output-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.brand-lockup,
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  justify-content: flex-start;
  align-self: center;
  grid-column: span 2;
  min-width: 0;
  padding-bottom: 0;
}

.crest {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(232, 201, 139, 0.14), rgba(143, 36, 36, 0.12)),
    #120f0c;
}

.crest svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  font-size: clamp(0.98rem, 2vw, 1.28rem);
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.brand-lockup h1,
.output-header h2 {
  color: var(--gold);
  text-shadow:
    0 2px 0 rgba(85, 30, 14, 0.95),
    0 0 18px rgba(232, 201, 139, 0.34);
}

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

.field-grid {
  display: contents;
}

.field-grid .field-group {
  min-width: 0;
}

.control-panel > .field-group {
  min-width: 0;
}

.control-panel > .players-field {
  min-width: 0;
  grid-column: 1 / -2;
}

.event-title-field {
  grid-column: span 4;
}

.format-field,
.seed-field,
.theme-field {
  grid-column: span 2;
}

.location-field {
  grid-column: span 4;
}

.date-field,
.time-field {
  grid-column: span 2;
}

.compact-field {
  grid-column: span 1;
}

.control-panel label {
  font-size: 0.72rem;
}

.control-panel input,
.control-panel select {
  height: 34px;
  padding: 0 8px;
  font-size: 0.86rem;
}

.control-panel textarea {
  padding: 7px 8px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.control-panel .primary-action {
  grid-column: span 1;
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.player-list {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.player-entry {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(232, 201, 139, 0.22);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(8, 7, 6, 0.74);
}

.player-entry b {
  display: grid;
  place-items: center;
  width: 28px;
  align-self: stretch;
  flex: 0 0 28px;
  background: #b7d800;
  color: #15180a;
  font-size: 0.66rem;
  font-weight: 950;
}

.player-entry input {
  height: 28px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 6px;
  font-size: 0.78rem;
}

.compact-note {
  display: none;
}

.field-grid {
  gap: 11px;
}

.compact-note {
  align-content: end;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

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

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(232, 201, 139, 0.28);
  border-radius: 5px;
  background: rgba(232, 201, 139, 0.08);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
}

.mini-action.apply {
  border-color: rgba(76, 168, 140, 0.5);
  background: rgba(76, 168, 140, 0.18);
  color: var(--ivory);
}

.bulk-paste-panel {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 6px;
  background: rgba(8, 7, 6, 0.52);
}

.bulk-paste-panel.is-open {
  display: grid;
}

.bulk-paste-panel textarea {
  min-height: 76px;
  resize: vertical;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(232, 201, 139, 0.24);
  border-radius: 6px;
  background: rgba(8, 7, 6, 0.74);
  color: var(--ivory);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 170px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 201, 139, 0.13);
  background: rgba(12, 10, 8, 0.92);
}

.option-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 6px;
  background: rgba(232, 201, 139, 0.06);
  color: var(--ivory);
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-deep);
}

.primary-action,
.icon-button,
.text-button,
.view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--ivory);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.primary-action {
  gap: 9px;
  min-height: 48px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(232, 201, 139, 0.97), rgba(169, 119, 50, 0.94) 58%, rgba(143, 36, 36, 0.88)),
    var(--gold-deep);
  color: #120f0c;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.primary-action svg,
.icon-button svg,
.text-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-action:hover,
.icon-button:hover,
.text-button:hover,
.view-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(232, 201, 139, 0.08);
}

.icon-button.ghost {
  width: 30px;
  height: 30px;
  border-color: rgba(232, 201, 139, 0.2);
}

.output-header {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 88px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(143, 36, 36, 0.3), transparent 48%),
    linear-gradient(180deg, rgba(232, 201, 139, 0.12), transparent);
}

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

.toolbar-left {
  justify-self: start;
}

.toolbar-right {
  justify-self: end;
}

.poster-sigil {
  justify-self: center;
  width: min(100%, 760px);
  min-width: 0;
  height: clamp(62px, 7vw, 92px);
  border: 1px solid rgba(232, 201, 139, 0.4);
  border-radius: 6px;
  overflow: hidden;
  background: #130f0d;
  box-shadow: 0 0 22px rgba(232, 201, 139, 0.12);
}

.poster-sigil img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(1.18) contrast(1.05);
  opacity: 0.96;
}

.schedule-banner {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background:
    radial-gradient(circle at 50% 20%, rgba(232, 201, 139, 0.24), transparent 34%),
    linear-gradient(100deg, rgba(143, 36, 36, 0.42), rgba(12, 10, 8, 0.72) 48%, rgba(232, 201, 139, 0.12)),
    #120f0c;
}

.schedule-banner strong {
  color: var(--gold);
  font-size: clamp(1.45rem, 4vw, 3rem);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(85, 30, 14, 0.95),
    0 0 30px rgba(232, 201, 139, 0.34);
}

.schedule-banner span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(116px, 1fr));
  gap: 8px;
  padding: 8px 12px 6px;
}

.metric-card {
  animation: riseIn 0.42s ease both;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(232, 201, 139, 0.11), transparent),
    rgba(10, 8, 7, 0.56);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ivory);
  font-size: 1.15rem;
  line-height: 1;
}

.metric-card em {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 0.78rem;
  font-style: normal;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 7px;
}

.view-toggle,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-button,
.text-button {
  min-height: 38px;
  border-radius: 6px;
  background: rgba(232, 201, 139, 0.07);
  font-weight: 900;
}

.view-button {
  min-width: 86px;
  padding: 0 13px;
  color: var(--muted);
}

.view-button.active {
  border-color: var(--gold);
  background:
    linear-gradient(100deg, transparent 0 8%, rgba(215, 44, 24, 0.72) 8% 92%, transparent 92%),
    rgba(232, 201, 139, 0.12);
  color: var(--ivory);
  box-shadow: 0 0 18px rgba(215, 44, 24, 0.18);
}

.text-button {
  gap: 8px;
  padding: 0 13px;
}

.text-button.save {
  border-color: rgba(76, 168, 140, 0.55);
  background: rgba(10, 138, 117, 0.75);
}

.text-button.danger {
  border-color: rgba(215, 44, 24, 0.58);
  background: rgba(143, 36, 36, 0.62);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0 14px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(232, 201, 139, 0.2);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(215, 44, 24, 0.16), transparent),
    rgba(255, 255, 255, 0.045);
}

.status-strip span,
.status-strip em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 800;
}

.status-strip strong {
  color: var(--gold);
  font-size: 0.92rem;
}

.match-log {
  display: none;
  align-items: center;
  gap: 9px;
  margin: -2px 14px 8px;
  padding: 7px 10px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.match-log.is-visible {
  display: flex;
}

.match-log b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 0.78rem;
}

.match-log div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.match-log span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(232, 201, 139, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.match-log em {
  color: var(--gold);
  font-style: normal;
}

.period-tabs {
  display: flex;
  gap: 8px;
  padding: 0 22px 14px;
  overflow: auto;
}

.period-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 36px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 6px;
  background: rgba(232, 201, 139, 0.05);
  color: var(--muted);
  font-weight: 800;
}

.period-tab.active {
  border-color: var(--gold);
  background:
    linear-gradient(100deg, transparent 0 6%, rgba(215, 44, 24, 0.86) 6% 92%, transparent 92%),
    var(--red-soft);
  color: var(--ivory);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.period-tab.done {
  border-color: rgba(76, 168, 140, 0.45);
  color: var(--jade);
}

.schedule-board {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0 10px 10px;
  overflow: auto;
}

.table-wrap {
  animation: fadeSlide 0.34s ease both;
  overflow: auto;
  border: 1px solid rgba(232, 201, 139, 0.2);
  border-radius: var(--radius);
  background: rgba(9, 7, 6, 0.72);
}

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

th,
td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(232, 201, 139, 0.12);
  line-height: 1.35;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #18130f;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  color: #f1e6d3;
  font-size: 0.94rem;
}

tbody tr {
  animation: rowReveal 0.32s ease both;
}

tbody tr:nth-child(2) {
  animation-delay: 0.025s;
}

tbody tr:nth-child(3) {
  animation-delay: 0.05s;
}

tbody tr:nth-child(4) {
  animation-delay: 0.075s;
}

tbody tr:nth-child(5) {
  animation-delay: 0.1s;
}

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

.match-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(232, 201, 139, 0.24);
  border-radius: 999px;
  color: #16100a;
  background: linear-gradient(135deg, #fff0a8, #e7b94d 48%, #9d4c13);
  font-size: 0.78rem;
  font-weight: 900;
}

.duel {
  display: grid;
  gap: 4px;
}

.duel strong {
  color: var(--ivory);
  font-size: 1rem;
}

.duel span {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ivory);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.king {
  background: linear-gradient(100deg, rgba(215, 44, 24, 0.92), rgba(90, 12, 8, 0.92));
  border: 1px solid rgba(232, 201, 139, 0.34);
}

.badge.normal {
  background: rgba(76, 168, 140, 0.24);
  border: 1px solid rgba(76, 168, 140, 0.45);
}

.empty-state {
  display: none;
  place-items: center;
  gap: 8px;
  min-height: 320px;
  border: 1px dashed rgba(232, 201, 139, 0.24);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ivory);
  font-size: 1.1rem;
}

.empty-state.is-visible {
  display: grid;
}

.bracket-wrap {
  position: relative;
  display: none;
  overflow: hidden;
  min-height: min(66svh, 620px);
  border: 1px solid rgba(232, 201, 139, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(232, 201, 139, 0.06), transparent 32%, rgba(143, 36, 36, 0.1)),
    rgba(8, 7, 6, 0.78);
}

.bracket-wrap::before,
.bracket-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.bracket-wrap::before {
  inset: auto -8% -24% -8%;
  height: 42%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 90%, rgba(255, 196, 73, 0.28), transparent 34%),
    radial-gradient(ellipse at 48% 95%, rgba(215, 44, 24, 0.32), transparent 38%),
    radial-gradient(ellipse at 82% 90%, rgba(255, 125, 30, 0.24), transparent 34%);
  filter: blur(10px);
}

.bracket-wrap::after {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(0deg, rgba(215, 44, 24, 0.22), transparent 34%),
    radial-gradient(circle at 50% 78%, rgba(232, 201, 139, 0.16), transparent 28%);
}

.bracket-wrap.final-four-mode::before {
  opacity: 1;
  animation: fireRise 0.9s ease-in-out infinite alternate;
}

.bracket-wrap.final-four-mode::after {
  opacity: 1;
  animation: emberPulse 0.85s ease-in-out infinite alternate;
}

.bracket-wrap > * {
  position: relative;
  z-index: 1;
}

.bracket-wrap.is-visible {
  display: block;
  animation: fadeSlide 0.34s ease both;
}

.bracket-stagebar {
  display: none;
  gap: 8px;
  padding: 10px 12px 0;
  overflow: auto;
}

.bracket-brand {
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 7px 10px 1px;
  text-align: center;
}

.bracket-brand strong {
  color: var(--ivory);
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
  line-height: 1;
  letter-spacing: 0.08em;
}

.bracket-brand span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.stage-pill {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.stage-pill.done {
  border-color: rgba(76, 168, 140, 0.48);
  color: var(--jade);
}

.stage-pill.active {
  border-color: var(--gold);
  background: rgba(215, 44, 24, 0.36);
  color: var(--ivory);
}

.champion-panel {
  position: relative;
  z-index: 3;
  width: min(760px, calc(100% - 24px));
  overflow: hidden;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 170px;
  margin: 8px auto 4px;
  padding: 14px;
  border: 1px solid rgba(232, 201, 139, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(143, 36, 36, 0.35), transparent 38%, rgba(232, 201, 139, 0.16)),
    rgba(13, 10, 8, 0.88);
  text-align: center;
  animation: crownReveal 0.58s ease both;
}

.gold-sweep {
  position: absolute;
  inset: -30%;
  background: linear-gradient(
    110deg,
    transparent 36%,
    rgba(255, 240, 168, 0.36) 46%,
    rgba(232, 201, 139, 0.16) 54%,
    transparent 64%
  );
  transform: translateX(-60%);
  pointer-events: none;
  animation: goldSweep 0.86s ease both;
}

.crown-burst {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  filter: drop-shadow(0 0 18px rgba(232, 201, 139, 0.34));
  animation: crownDrop 0.72s cubic-bezier(0.2, 1.3, 0.35, 1) both;
}

.champion-panel span,
.champion-panel em {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.champion-panel strong {
  position: relative;
  z-index: 1;
  color: var(--ivory);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(85, 30, 14, 0.95),
    0 0 30px rgba(232, 201, 139, 0.4);
}

.champion-name {
  animation: championZoom 0.78s ease both;
}

.champion-panel .podium-grid {
  display: none;
}

.medal-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  width: min(100%, 560px);
}

.medal-card {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 10px;
  border-radius: 6px;
  align-content: center;
}

.medal-card span {
  letter-spacing: 0.08em;
}

.medal-card strong {
  font-size: 1.2rem;
  text-shadow: none;
}

.medal-card.silver {
  border: 1px solid rgba(225, 229, 232, 0.62);
  background:
    linear-gradient(145deg, rgba(225, 229, 232, 0.24), rgba(110, 120, 130, 0.12)),
    rgba(255, 255, 255, 0.05);
}

.medal-card.silver span,
.medal-card.silver strong {
  color: #e5e8eb;
}

.medal-card.bronze {
  border: 1px solid rgba(198, 122, 65, 0.64);
  background:
    linear-gradient(145deg, rgba(198, 122, 65, 0.28), rgba(80, 42, 24, 0.16)),
    rgba(255, 255, 255, 0.045);
}

.medal-card.bronze span,
.medal-card.bronze strong {
  color: #d79a63;
}

.podium-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.12fr 1fr 1fr;
  gap: 10px;
  width: min(100%, 820px);
  margin-top: 8px;
}

.podium-card {
  display: grid;
  gap: 5px;
  min-height: 100px;
  padding: 13px;
  border: 1px solid rgba(232, 201, 139, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  align-content: center;
}

.podium-card.first {
  border-color: rgba(232, 201, 139, 0.68);
  background:
    linear-gradient(160deg, rgba(232, 201, 139, 0.22), transparent),
    rgba(255, 255, 255, 0.06);
}

.podium-card.second {
  animation: runnerExit 0.74s ease both;
}

.podium-card.third {
  border-color: rgba(76, 168, 140, 0.42);
}

.podium-card.pending {
  border-style: dashed;
}

.podium-card span,
.podium-card em {
  color: var(--muted);
  letter-spacing: 0;
}

.podium-card strong {
  color: var(--ivory);
  font-size: 1.1rem;
  line-height: 1.18;
  text-shadow: none;
}

.podium-card.first strong {
  color: var(--gold);
  font-size: 1.35rem;
}

.third-place-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.third-place-actions button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(76, 168, 140, 0.5);
  border-radius: 999px;
  background: rgba(76, 168, 140, 0.14);
  color: var(--ivory);
  font-weight: 900;
}

.third-place-actions button:hover {
  border-color: var(--gold);
  background: rgba(232, 201, 139, 0.12);
}

.bracket-grid {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 5px 8px 4px;
}

.bracket-grid.mirrored-tree {
  grid-template-columns:
    repeat(var(--side-rounds, 4), minmax(0, 1fr))
    minmax(0, 0.78fr)
    repeat(var(--side-rounds, 4), minmax(0, 1fr));
  align-items: start;
  width: calc(100% / var(--tree-zoom, 1));
  transform: scale(var(--tree-zoom, 1));
  transform-origin: top left;
  margin: 0 auto;
}

.bracket-grid.stage-32 {
  gap: 2px;
  padding: 3px 3px 2px;
}

.bracket-grid.stage-32 .bracket-column.match-count-8 {
  --match-gap: 2px;
}

.bracket-grid.stage-32 .bracket-column.match-count-4 {
  --match-gap: 16px;
  --column-pad-top: 10px;
}

.bracket-grid.stage-32 .bracket-column.match-count-2 {
  --match-gap: 50px;
  --column-pad-top: 32px;
}

.bracket-grid.stage-32 .bracket-column.match-count-1 {
  --column-pad-top: 82px;
}

.bracket-grid.stage-32 .bracket-column.center-side.match-count-2 {
  --match-gap: 20px;
}

.bracket-grid.stage-32 .round-title {
  min-height: 17px;
  padding: 2px 3px;
  font-size: 0.54rem;
}

.bracket-grid.stage-32 .bracket-match {
  gap: 1px;
  padding: 2px;
  border-radius: 4px;
}

.bracket-grid.stage-32 .bracket-player {
  min-height: 15px;
  padding: 0 15px 0 13px;
  font-size: 0.54rem;
}

.bracket-grid.stage-32 .seed-tag {
  min-width: 11px;
  font-size: 0.44rem;
}

.bracket-grid.stage-32 .result-mark {
  display: none;
}

.bracket-grid.final-only {
  grid-template-columns: minmax(180px, 360px);
  justify-content: center;
  width: min(100%, 420px);
}

.bracket-column {
  display: grid;
  align-content: start;
  gap: var(--match-gap, 4px);
  min-height: 0;
  min-width: 0;
  padding-top: var(--column-pad-top, 0);
}

.bracket-column.match-count-8 {
  --match-gap: 4px;
  --column-pad-top: 0;
}

.bracket-column.match-count-4 {
  --match-gap: 26px;
  --column-pad-top: 18px;
}

.bracket-column.match-count-2 {
  --match-gap: 86px;
  --column-pad-top: 58px;
}

.bracket-column.match-count-1 {
  --match-gap: 0;
  --column-pad-top: 144px;
}

.bracket-column.center-side.match-count-2 {
  --match-gap: 34px;
  --column-pad-top: 0;
}

.bracket-column.center-side {
  align-self: center;
  padding-top: 0;
}

.round-title {
  min-height: 20px;
  padding: 3px 5px;
  border: 1px solid rgba(232, 201, 139, 0.28);
  border-radius: 6px;
  background: #17110d;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.round-title.gold-title {
  color: var(--gold);
  border-color: rgba(232, 201, 139, 0.48);
}

.round-title.bronze-title {
  color: #d79a63;
  border-color: rgba(198, 122, 65, 0.48);
}

.bracket-match {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 3px;
  border: 1px solid rgba(232, 201, 139, 0.18);
  border-radius: 5px;
  background:
    linear-gradient(145deg, rgba(232, 201, 139, 0.1), transparent),
    rgba(22, 18, 15, 0.95);
  box-shadow: 0 0 0 rgba(232, 201, 139, 0);
  animation: bracketPop 0.38s ease both;
  touch-action: manipulation;
}

.bracket-column.left-side .bracket-match::after,
.bracket-column.right-side .bracket-match::before,
.bracket-column.center-side .bracket-match::before,
.bracket-column.center-side .bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 2px;
  background: rgba(232, 201, 139, 0.28);
  transform: translateY(-50%);
}

.bracket-column.left-side .bracket-match::after,
.bracket-column.center-side .bracket-match::after {
  right: -7px;
}

.bracket-column.right-side .bracket-match::before,
.bracket-column.center-side .bracket-match::before {
  left: -7px;
}

.bracket-match.final-match {
  border-color: rgba(232, 201, 139, 0.5);
  box-shadow: 0 0 26px rgba(232, 201, 139, 0.14);
}

.bracket-match:hover {
  border-color: rgba(232, 201, 139, 0.64);
  box-shadow: 0 0 22px rgba(232, 201, 139, 0.12);
}

.match-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 14px;
}

.bracket-code {
  width: fit-content;
  padding: 1px 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff0a8, #e7b94d 48%, #9d4c13);
  color: #16100a;
  font-size: 0.54rem;
  font-weight: 900;
}

.bracket-player {
  position: relative;
  display: grid;
  align-items: center;
  justify-content: stretch;
  place-items: center;
  gap: 0;
  width: 100%;
  min-height: 18px;
  padding: 1px 25px 1px 17px;
  border: 1px solid rgba(232, 201, 139, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ivory);
  font-size: 0.62rem;
  text-align: center;
}

.bracket-player span {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.seed-tag {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 1px;
  display: grid;
  place-items: center;
  min-width: 14px;
  margin: 0;
  border-radius: 3px 0 0 3px;
  background: #b7d800;
  color: #15180a;
  font-size: 0.52rem;
  font-weight: 950;
}

.right-side .seed-tag {
  left: 1px;
  margin: 0;
  border-radius: 3px 0 0 3px;
}

.seed-tag.empty {
  background: rgba(232, 201, 139, 0.1);
  color: transparent;
}

.player-button {
  cursor: pointer;
}

.player-button:hover:not(:disabled) {
  border-color: rgba(232, 201, 139, 0.62);
  background: rgba(232, 201, 139, 0.12);
  transform: translateX(2px);
}

.player-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.player-button.winner {
  border-color: rgba(232, 201, 139, 0.75);
  background:
    linear-gradient(135deg, rgba(232, 201, 139, 0.22), rgba(169, 119, 50, 0.14)),
    rgba(255, 255, 255, 0.06);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(232, 201, 139, 0.14);
}

.player-button.defeated {
  border-color: rgba(215, 44, 24, 0.44);
  background: rgba(95, 14, 10, 0.44);
  color: rgba(247, 239, 225, 0.66);
  text-decoration: line-through;
}

.player-button.defeat-pulse {
  animation: defeatBurst 0.62s ease both;
}

.player-button.advance-pulse {
  animation: advanceGlow 0.62s ease both;
}

.result-mark {
  position: absolute;
  top: 50%;
  right: 2px;
  margin: 0;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(232, 201, 139, 0.16);
  color: var(--gold);
  font-size: 0.5rem;
  line-height: 1;
  transform: translateY(-50%);
}

.result-mark.ko {
  background: rgba(215, 44, 24, 0.24);
  color: #ff9d7a;
}

.right-side .result-mark {
  right: 2px;
  margin: 0;
}

.bracket-note {
  color: var(--muted);
  font-size: 0.52rem;
  white-space: nowrap;
}

.bracket-podium-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 2px 6px 10px;
}

.bracket-podium-strip.medal-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.podium-line {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 24px;
  overflow: hidden;
  border: 1px solid rgba(232, 201, 139, 0.24);
  background: rgba(255, 255, 255, 0.045);
}

.podium-line b {
  display: grid;
  place-items: center;
  width: 38px;
  flex: 0 0 38px;
  background: #0d0b09;
  color: var(--ivory);
  font-size: 0.58rem;
  font-style: italic;
}

.podium-line.gold {
  border-color: rgba(232, 201, 139, 0.58);
  background: rgba(232, 201, 139, 0.1);
}

.podium-line.gold b {
  color: #17100a;
  background: linear-gradient(135deg, #fff0a8, #e7b94d 48%, #9d4c13);
}

.podium-line.silver {
  border-color: rgba(225, 229, 232, 0.52);
  background: rgba(225, 229, 232, 0.08);
}

.podium-line.silver b {
  color: #17191b;
  background: linear-gradient(135deg, #f7f9fb, #b9c0c8 55%, #6f7882);
}

.podium-line.bronze {
  border-color: rgba(198, 122, 65, 0.56);
  background: rgba(198, 122, 65, 0.09);
}

.podium-line.bronze b {
  color: #1b1009;
  background: linear-gradient(135deg, #f0be83, #c67a41 55%, #74401f);
}

.podium-line span {
  min-width: 0;
  flex: 1;
  padding: 4px 5px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-line.pending-glow::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -45%;
  width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255, 244, 188, 0.34), transparent);
  transform: skewX(-18deg);
  animation: emptyShine 1.35s ease-in-out infinite;
}

.third-place-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
}

.third-place-inline span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.third-place-inline button {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(76, 168, 140, 0.5);
  border-radius: 999px;
  background: rgba(76, 168, 140, 0.14);
  color: var(--ivory);
  font-size: 0.68rem;
  font-weight: 900;
}

.poster-board {
  display: grid;
  gap: 18px;
  min-height: 640px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(215, 44, 24, 0.18), transparent 40%),
    linear-gradient(315deg, rgba(232, 201, 139, 0.16), transparent 34%),
    rgba(10, 8, 7, 0.92);
}

.poster-heading {
  display: grid;
  place-items: center;
  gap: 7px;
  text-align: center;
}

.poster-heading p,
.poster-heading span {
  margin: 0;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.poster-heading h3 {
  margin: 0;
  color: var(--ivory);
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(85, 30, 14, 0.95),
    0 0 30px rgba(232, 201, 139, 0.34);
}

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

.poster-match-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.poster-match-list div,
.poster-podium {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(232, 201, 139, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.poster-match-list b {
  color: var(--gold);
}

.poster-match-list span,
.poster-podium span {
  color: var(--ivory);
}

.poster-match-list em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.poster-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.poster-qr {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  width: min(100%, 220px);
  aspect-ratio: 1;
  padding: 10px;
  justify-self: center;
  border: 1px solid rgba(232, 201, 139, 0.34);
  border-radius: 6px;
  background: #f7efe1;
}

.poster-qr i {
  border-radius: 1px;
  background: rgba(22, 18, 15, 0.12);
}

.poster-qr i.dark {
  background: #16120f;
}

.poster-podium strong {
  color: var(--gold);
  font-size: 1.2rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 42px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #17120e;
  color: var(--ivory);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.version-badge {
  position: fixed;
  right: 12px;
  bottom: 8px;
  z-index: 20;
  padding: 3px 6px;
  border: 1px solid rgba(232, 201, 139, 0.14);
  border-radius: 999px;
  background: rgba(8, 7, 6, 0.42);
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 800;
  opacity: 0.58;
  pointer-events: none;
}

.live-mode .output-header,
.live-mode .summary-grid,
.live-mode .view-toggle,
.live-mode .period-tabs,
.live-mode .match-log {
  display: none !important;
}

.live-mode .action-bar {
  justify-content: center;
  padding: 7px 12px;
}

.live-mode .quick-actions {
  justify-content: center;
}

.live-mode .quick-actions .text-button:not(#liveModeButton):not(#undoButton):not(#resetButton) {
  display: none;
}

.live-mode .status-strip {
  margin: 0 12px 6px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.live-mode .schedule-board {
  padding-top: 0;
}

.live-mode .bracket-wrap {
  min-height: calc(100svh - 116px);
}

.live-mode .bracket-grid.mirrored-tree {
  --tree-zoom: 0.86;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .control-panel {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-height: none;
  }

  .brand-lockup,
  .event-title-field,
  .location-field {
    grid-column: span 3;
  }

  .date-field,
  .time-field,
  .format-field,
  .seed-field,
  .theme-field,
  .control-panel .primary-action {
    grid-column: span 2;
  }

  .settings-panel .players-field {
    grid-column: 1 / -1;
  }

  .settings-panel .close-settings {
    grid-column: -2 / -1;
  }

  .player-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(82px, 1fr));
    gap: 6px;
  }

  .action-bar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }

  .output-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0;
    padding: 10px 14px;
  }

  .poster-sigil {
    order: 0;
    width: min(100%, 620px);
    min-width: 0;
    height: clamp(76px, 13vw, 108px);
  }

  .metric-card {
    min-height: 52px;
    padding: 8px;
  }

  .metric-card strong {
    font-size: 1rem;
  }

  .metric-card em {
    display: none;
  }

  .bracket-grid.mirrored-tree {
    --tree-zoom: 0.78;
  }

  .bracket-wrap {
    min-height: calc(100svh - 230px);
  }
}

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

  .control-panel,
  .output-panel {
    border-radius: 0;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    overflow: visible;
  }

  .brand-lockup,
  .output-header {
    align-items: flex-start;
  }

  .output-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 8px 10px;
  }

  .poster-sigil {
    order: 0;
    width: 100%;
    min-width: 0;
    height: 76px;
  }

  .summary-grid,
  .action-bar,
  .status-strip,
  .match-log,
  .period-tabs,
  .schedule-board {
    padding-left: 17px;
    padding-right: 17px;
  }

  .status-strip,
  .match-log {
    margin-left: 17px;
    margin-right: 17px;
  }

  .quick-actions,
  .view-toggle {
    width: 100%;
  }

  .text-button,
  .view-button {
    flex: 1 1 auto;
  }

  .control-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px;
  }

  .brand-lockup,
  .event-title-field,
  .location-field {
    grid-column: span 4;
  }

  .date-field,
  .time-field,
  .format-field,
  .seed-field,
  .theme-field,
  .control-panel .primary-action {
    grid-column: span 2;
  }

  .settings-panel .players-field {
    grid-column: 1 / -1;
  }

  .compact-field {
    grid-column: span 1;
  }

  .control-panel > .players-field {
    min-width: 0;
  }

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

  .bulk-paste-panel {
    grid-template-columns: 1fr;
  }

  .bracket-grid.mirrored-tree {
    --tree-zoom: 0.68;
  }

  .bracket-wrap {
    min-height: calc(100svh - 230px);
  }

  .live-mode .bracket-wrap {
    min-height: calc(100svh - 112px);
  }

  .live-mode .bracket-grid.mirrored-tree {
    --tree-zoom: 0.74;
  }

  .stage-pill,
  .status-strip span,
  .status-strip strong {
    font-size: 0.72rem;
  }

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

  .poster-content,
  .poster-match-list {
    grid-template-columns: 1fr;
  }

  .poster-board {
    padding: 16px;
  }
}

@media (max-height: 560px) {
  .summary-grid {
    display: none;
  }

  .output-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 7px 10px;
  }

  .output-header .eyebrow,
  .metric-card em {
    display: none;
  }

  .status-strip {
    margin-bottom: 6px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .bracket-wrap {
    min-height: calc(100svh - 154px);
  }

  .bracket-grid.mirrored-tree {
    --tree-zoom: 0.62;
  }

  .bracket-brand {
    padding-top: 3px;
  }

  .bracket-brand strong {
    font-size: 1.05rem;
  }

  .bracket-brand span {
    display: none;
  }

  .bracket-column.match-count-4 {
    --match-gap: 18px;
    --column-pad-top: 13px;
  }

  .bracket-column.match-count-2 {
    --match-gap: 64px;
    --column-pad-top: 44px;
  }

  .bracket-column.match-count-1 {
    --column-pad-top: 108px;
  }

  .round-title {
    min-height: 17px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .bracket-player {
    min-height: 17px;
  }

  .bracket-podium-strip {
    padding-bottom: 6px;
  }
}

@media print {
  html,
  body {
    background: #fff;
    color: #111;
  }

  .app-shell {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .control-panel,
  .toolbar,
  .action-bar,
  .period-tabs,
  .match-log,
  .toast,
  .version-badge {
    display: none;
  }

  .output-panel {
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .output-header,
  .metric-card,
  .table-wrap,
  th {
    background: #fff;
    color: #111;
  }

  .schedule-board {
    padding: 0;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    border-color: #bbb;
    color: #111;
  }
}

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

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

@keyframes rowReveal {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bracketPop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes lineGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes defeatBurst {
  0% {
    transform: translateX(0) scale(1);
    box-shadow: 0 0 0 rgba(215, 44, 24, 0);
  }
  30% {
    transform: translateX(-3px) scale(1.015);
    box-shadow: 0 0 28px rgba(215, 44, 24, 0.42);
  }
  58% {
    transform: translateX(3px) scale(0.995);
  }
  100% {
    transform: translateX(0) scale(1);
    box-shadow: 0 0 0 rgba(215, 44, 24, 0);
  }
}

@keyframes advanceGlow {
  0% {
    box-shadow: 0 0 0 rgba(232, 201, 139, 0);
  }
  45% {
    box-shadow: 0 0 34px rgba(232, 201, 139, 0.34);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(232, 201, 139, 0.14);
  }
}

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

@keyframes goldSweep {
  from {
    opacity: 0;
    transform: translateX(-60%) rotate(0deg);
  }
  35% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(60%) rotate(0deg);
  }
}

@keyframes crownDrop {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.72);
  }
  72% {
    opacity: 1;
    transform: translateY(2px) scale(1.08);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes championZoom {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  64% {
    opacity: 1;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes runnerExit {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes emptyShine {
  from {
    left: -46%;
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  to {
    left: 118%;
    opacity: 0;
  }
}

@keyframes fireRise {
  from {
    transform: translateY(12px) scaleX(0.96);
    filter: blur(12px) saturate(1);
  }
  to {
    transform: translateY(-6px) scaleX(1.04);
    filter: blur(8px) saturate(1.35);
  }
}

@keyframes emberPulse {
  from {
    opacity: 0.38;
  }
  to {
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
