@font-face {
  font-family: "TencentScoreboard";
  src:
    local("腾讯体 W3"),
    local("TencentSansW3"),
    url("./assets/fonts/TencentSans-W3.ttf") format("truetype");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

/* 2026-07-17 多项目赛程工作台：导入赛程直接列表化，锁定生成赛程后自动收拢规划树 */
.tournament-planner-panel.is-planner-collapsed {
  padding-bottom: 10px;
}

.tournament-planner-panel.is-planner-collapsed > .schedule-source-bar,
.tournament-planner-panel.is-planner-collapsed > .import-schedule-panel,
.tournament-planner-panel.is-planner-collapsed > .generated-schedule-builder {
  display: none !important;
}

.multi-project-schedule-panel {
  display: grid;
  min-width: 0;
  gap: 12px;
  container-type: inline-size;
}

.multi-project-schedule-panel.is-hidden,
#singleProjectSchedulePanel.is-hidden {
  display: none !important;
}

.multi-project-schedule-heading span {
  color: #747474;
  font-size: 11px;
  font-weight: 850;
}

.multi-project-schedule-tabs-panel {
  position: relative;
  z-index: 4;
  grid-area: project-tabs;
}

#multiProjectSchedulePanel {
  grid-area: schedule;
}

.multi-project-tabs-scroll {
  padding-bottom: 2px;
}

.tournament-layout.has-multi-project-schedule {
  grid-template-areas:
    "project-tabs"
    "planner"
    "schedule"
    "snapshots";
}

.multi-project-schedule-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scrollbar-gutter: stable;
}

.multi-project-schedule-workspace {
  display: grid;
  gap: 10px;
}

.multi-project-schedule-tabs,
.multi-project-schedule-columns {
  display: grid;
  align-items: stretch;
  gap: 12px;
}

.multi-project-schedule-tab {
  display: grid;
  min-width: 0;
  min-height: 66px;
  grid-template-columns: 24px minmax(90px, auto) minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  border: 1px solid #DFDFDF;
  border-left-width: 5px;
  border-radius: 12px;
  padding: 9px 11px;
  color: #263249;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
  font: inherit;
  cursor: pointer;
}

.multi-project-schedule-tab > span {
  display: grid;
  width: 24px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  color: #6E6E6E;
  background: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  font-weight: 950;
}

.multi-project-schedule-tab strong {
  overflow: hidden;
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-project-schedule-tab em {
  overflow: hidden;
  color: #707070;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-project-schedule-tab.is-expanded {
  box-shadow: 0 0 0 3px rgba(49, 90, 217, 0.14), 0 7px 18px rgba(15, 23, 42, 0.08);
}

.multi-project-schedule-tab.is-type-a,
.multi-project-schedule-column.is-type-a {
  border-color: #efc56f;
  border-left-color: #d99a20;
  background: linear-gradient(145deg, #FDFDFD, #F7F7F7);
}

.multi-project-schedule-tab.is-type-b,
.multi-project-schedule-column.is-type-b {
  border-color: #c9b9ef;
  border-left-color: #7653ce;
  background: linear-gradient(145deg, #FBFBFB, #F3F3F3);
}

.multi-project-schedule-tab.is-type-c,
.multi-project-schedule-column.is-type-c {
  border-color: #C9C9C9;
  border-left-color: #238b78;
  background: linear-gradient(145deg, #FDFDFD, #F6F6F6);
}

.planning-assignment-toolbar {
  position: sticky;
  z-index: 3;
  left: 0;
  display: flex;
  width: min(100%, calc(100vw - 58px));
  min-height: 58px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #DFDFDF;
  border-radius: 11px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
}

.planning-assignment-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-assignment-toolbar > span {
  color: #707070;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.planning-assignment-confirm {
  position: sticky;
  z-index: 3;
  left: 0;
  display: flex;
  width: min(100%, calc(100vw - 58px));
  min-height: 50px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e4bd62;
  border-radius: 10px;
  padding: 8px 10px;
  color: #6d4b08;
  background: #F8F8F8;
}

.planning-assignment-confirm.is-hidden,
.planning-assignment-toolbar .is-hidden {
  display: none !important;
}

.planning-assignment-confirm > div {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.planning-assignment-confirm strong {
  font-size: 12px;
  font-weight: 900;
}

.multi-project-schedule-column {
  min-width: 0;
  max-height: 690px;
  overflow: hidden;
  border: 1px solid #E2E2E2;
  border-left-width: 5px;
  border-radius: 12px;
}

.multi-project-column-summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(116, 132, 164, 0.2);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.68);
}

.multi-project-column-summary strong {
  color: #263249;
  font-size: 14px;
  font-weight: 950;
}

.multi-project-column-summary span {
  color: #747474;
  font-size: 10px;
  font-weight: 850;
}

.multi-project-match-list {
  display: grid;
  max-height: 640px;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding: 9px;
}

.multi-project-match-row {
  display: grid;
  min-width: 0;
  min-height: 50px;
  grid-template-columns: 64px minmax(74px, 0.8fr) minmax(98px, 1fr) 22px minmax(98px, 1fr) auto;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(116, 132, 164, 0.24);
  border-radius: 9px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 140ms ease, box-shadow 140ms ease, grid-template-columns 160ms ease;
}

.multi-project-schedule-panel.is-selection-mode .multi-project-match-row {
  grid-template-columns: 28px 64px minmax(74px, 0.8fr) minmax(98px, 1fr) 22px minmax(98px, 1fr) auto;
}

.multi-project-match-row.is-selected {
  border-color: #315ad9;
  box-shadow: 0 0 0 2px rgba(49, 90, 217, 0.13);
}

.planning-match-selector {
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.multi-project-schedule-panel.is-selection-mode .planning-match-selector {
  display: grid;
}

.planning-match-selector input {
  position: absolute;
  opacity: 0;
}

.planning-match-selector span {
  display: block;
  width: 17px;
  height: 17px;
  box-sizing: border-box;
  border: 2px solid #B1B1B1;
  border-radius: 5px;
  background: #fff;
}

.planning-match-selector input:checked + span {
  border-color: #315ad9;
  background: #315ad9;
  box-shadow: inset 0 0 0 3px #fff;
}

.planning-match-selector input:disabled + span {
  opacity: 0.35;
  cursor: not-allowed;
}

.multi-project-match-number {
  color: #5F5F5F;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.multi-project-match-stage {
  overflow: hidden;
  color: #696969;
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-project-team {
  overflow: hidden;
  border-radius: 7px;
  padding: 7px 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-project-team.is-red {
  background: linear-gradient(135deg, #b53e38, #da554b);
}

.multi-project-team.is-blue {
  background: linear-gradient(135deg, #3158bd, #4775df);
}

.multi-project-match-row > b {
  color: #747474;
  font-size: 10px;
  text-align: center;
}

.multi-project-match-row > em {
  border: 1px solid #DFDFDF;
  border-radius: 7px;
  padding: 5px 7px;
  color: #707070;
  background: #FAFAFA;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.multi-project-match-row > em[data-status="比赛中"] {
  color: #505050;
  border-color: #D3D3D3;
  background: #F7F7F7;
}

.multi-project-match-row > em[data-status="比赛结束"] {
  color: #6F6F6F;
  background: #F1F1F1;
}

@media (max-width: 980px) {
  .planning-assignment-toolbar,
  .planning-assignment-confirm {
    width: calc(100vw - 34px);
    align-items: stretch;
    flex-direction: column;
  }

  .planning-assignment-toolbar > span {
    text-align: left;
  }
}

@font-face {
  font-family: "TencentScoreboard";
  src:
    local("腾讯体 W7"),
    local("TencentSansW7"),
    url("./assets/fonts/TencentSans-W7.otf") format("opentype");
  font-weight: 600 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-main: "TencentScoreboard", "腾讯体", "TencentSans", "Tencent Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --bg: #F6F6F6;
  --panel: #ffffff;
  --panel-strong: #FAFAFA;
  --ink: #121827;
  --muted: #727272;
  --line: #E1E1E1;
  --red: #df3f32;
  --red-soft: #F4F4F4;
  --blue: #2362df;
  --blue-soft: #F4F4F4;
  --green: #249a58;
  --amber: #d98b1e;
  --danger: #e22d2d;
  --stage: #10141d;
  --stage-2: #171e2b;
  --stage-line: rgba(255, 255, 255, 0.12);
  --radius: 8px;
  font-family: var(--font-main);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body:not(.display-mode) {
  overflow: hidden;
}

body:not(.display-mode) .app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

button,
input,
textarea,
select,
option {
  font-family: var(--font-main);
}

button {
  cursor: pointer;
}

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

.topbar {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 24px 8px;
}

.topbar h1,
.panel-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 20px;
  white-space: nowrap;
}

.topbar-brand-cluster {
  display: flex;
  min-width: 0;
  flex: 1 1 500px;
  align-items: center;
  gap: 14px;
}

.topbar .button {
  min-height: 34px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.timer-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-actions {
  align-items: center;
  justify-content: flex-end;
}

.project-switcher {
  display: flex;
  min-width: 310px;
  max-width: 430px;
  flex: 1 1 380px;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #DFDFDF;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.project-switcher span {
  flex: 0 0 auto;
  padding: 0 4px 0 6px;
  color: #6F6F6F;
  font-size: 12px;
  font-weight: 900;
}

.project-switcher select {
  min-width: 170px;
  flex: 1 1 140px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
}

.tournament-file-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions .tournament-mode-toggle {
  display: none;
  width: 190px;
}

.topbar-actions .tournament-mode-toggle.is-visible {
  display: grid;
}

.view-tabs {
  position: absolute;
  left: 50%;
  z-index: 5;
  display: inline-grid;
  width: 470px;
  box-sizing: border-box;
  flex: 0 0 470px;
  grid-template-columns: repeat(5, 88px);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
  transform: translateX(-50%);
}

.view-tabs button {
  border: 0;
  border-radius: 7px;
  width: 88px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  transform: none;
}

.view-tabs button.is-active {
  color: #fff;
  background: #1d4ed8;
}

.topbar-history-menu {
  position: relative;
  flex: 0 0 auto;
}

.topbar-history-menu > summary {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #6F6F6F;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.topbar-history-menu > summary::-webkit-details-marker {
  display: none;
}

.topbar-history-menu[open] > summary {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.34);
  background: #F4F4F4;
}

.history-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 80;
  width: min(520px, 82vw);
  max-height: min(72vh, 680px);
  display: grid;
  gap: 12px;
  overflow: auto;
  border: 1px solid #DFDFDF;
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.history-menu-popover > section {
  display: grid;
  gap: 8px;
}

.history-menu-popover > section + section {
  border-top: 1px solid #EAEAEA;
  padding-top: 12px;
}

.history-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-section-title strong {
  color: #111827;
  font-size: 14px;
}

.history-section-title small {
  color: #6F6F6F;
  font-size: 11px;
  font-weight: 850;
}

.history-action-list {
  display: grid;
  gap: 6px;
}

.history-action-item,
.history-action-empty {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #E6E6E6;
  border-radius: 8px;
  padding: 7px 9px;
  color: #3F3F3F;
  background: #FAFAFA;
  font-size: 12px;
}

.history-action-item.is-latest {
  border-color: rgba(29, 78, 216, 0.28);
  background: #F6F6F6;
}

.history-action-item span,
.history-action-empty {
  color: #6F6F6F;
  font-size: 11px;
}

.app-view.is-hidden {
  display: none !important;
}

.panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.ghost-button,
.file-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.button.primary {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

button:disabled,
textarea:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button.secondary.is-active {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.button.secondary {
  background: #FAFAFA;
}

.button.is-feedback:disabled {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
  opacity: 1;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.button.start {
  flex: 1 1 200px;
  min-height: 58px;
  color: #fff;
  border-color: #16784a;
  background: var(--green);
  font-size: 18px;
}

.button.start.is-running {
  color: #171207;
  border-color: #e0a223;
  background: #f2b33b;
}

.button.start span {
  opacity: 0.75;
  font-size: 13px;
}

.button.warning {
  min-width: 104px;
  color: #38210a;
  border-color: #f1c98f;
  background: #fff6e8;
}

.button.is-active,
#toggleScheduleLockBtn.is-active {
  color: #fff;
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.schedule-boundary-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid #DDDDDD;
  border-radius: 6px;
  color: #727272;
  background: #FAFAFA;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.schedule-boundary-status[data-status="confirmed"],
.schedule-boundary-status[data-status="running"] {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #F5F5F5;
}

.schedule-boundary-status[data-status="warning"],
.schedule-boundary-status[data-status="revision"] {
  color: #9a5a07;
  border-color: #f2cc8c;
  background: #fff8e8;
}

.hold-reset-button {
  --hold-progress: 0deg;
  --hold-bar-progress: 0%;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.hold-reset-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--hold-bar-progress);
  background: rgba(217, 139, 30, 0.18);
  pointer-events: none;
}

.hold-reset-button.is-holding {
  border-color: #d98b1e;
  box-shadow: 0 0 0 3px rgba(217, 139, 30, 0.14);
}

.hold-ring {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: conic-gradient(currentColor var(--hold-progress), rgba(56, 33, 10, 0.16) 0deg);
}

.hold-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #F7F7F7;
}

.compact-button .hold-ring {
  width: 18px;
  height: 18px;
}

.compact-button .hold-ring::after {
  inset: 4px;
}

.button.secondary .hold-ring::after {
  background: #fff;
}

.hold-label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.ghost-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

.operator-layout {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(600px, 1.28fr) minmax(410px, 0.72fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 0 24px 16px;
}

.preview-panel,
.control-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

.preview-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  align-self: start;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

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

.preview-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #D4D4D4;
}

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

.panel-header h2 {
  font-size: 17px;
  white-space: nowrap;
}

.scoreboard-frame {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  position: relative;
  justify-self: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b0f17;
}

.scoreboard-frame.is-preview-scaled {
  width: min(100%, max(320px, var(--preview-frame-width)));
  height: max(180px, var(--preview-frame-height));
}

.scoreboard-frame.is-preview-scaled .scoreboard-stage {
  position: relative;
  width: 100%;
  transform: none;
}

.scoreboard-frame:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  place-items: center;
  border-radius: 0;
  background: #020617;
}

.scoreboard-frame:fullscreen .scoreboard-stage {
  position: relative;
  top: auto;
  left: auto;
  width: min(100vw, calc(100vh * 16 / 9));
  transform: none;
}

.pinned-controls {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 12px;
  min-height: 0;
}

.match-nav-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #FCFCFC;
}

.scoredesk-source-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.scoredesk-source-control > span {
  max-width: 164px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control strong {
  color: #243047;
  font-size: 13px;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border: 1px solid #D4D4D4;
  border-radius: 999px;
  background: #EDEDED;
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 160ms ease;
}

.switch-control input:checked + .switch-track {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-control input:checked + .switch-track span {
  transform: translateX(16px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid rgba(49, 83, 216, 0.18);
  outline-offset: 2px;
}

.match-nav-panel.is-temporary-match .current-match-pill {
  border-color: #C4C4C4;
  background: #F8F8F8;
}

.match-nav-panel.is-schedule-active {
  border-color: #6f8cf0;
  background: linear-gradient(90deg, #F2F2F2, #FAFAFA);
  box-shadow: 0 0 0 3px rgba(49, 83, 216, 0.11);
}

.match-nav-panel.is-schedule-active .scoredesk-source-control {
  border-right-color: #b7c5ef;
}

.match-nav-panel.is-schedule-active .switch-control strong {
  color: #1d4ed8;
}

.match-nav-panel.is-schedule-active #scoredeskSourceHint {
  color: #3153d8;
  font-weight: 950;
}

.match-nav-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.current-match-pill {
  overflow: hidden;
  border: 1px solid #E2E2E2;
  border-radius: 7px;
  min-height: 34px;
  padding: 8px 10px;
  color: #1f2937;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-stage-button {
  min-width: 126px;
}

.pinned-controls .control-panel {
  padding: 12px;
}

.pinned-controls .panel-header {
  margin-bottom: 7px;
}

.pinned-controls .panel-header h2 {
  font-size: 16px;
}

.pinned-controls .eyebrow {
  margin-bottom: 3px;
  font-size: 11px;
}

.pinned-controls .panel-actions {
  gap: 6px;
}

.pinned-controls .compact-button,
.pinned-controls .timer-controls .button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.pinned-controls .score-controls {
  gap: 8px;
}

.pinned-controls .score-control {
  padding: 8px;
}

.pinned-controls .score-control-title {
  margin-bottom: 6px;
  font-size: 15px;
}

.pinned-controls .score-control-grid {
  grid-template-columns: 36px 1fr 36px;
  gap: 6px;
}

.pinned-controls .score-button {
  height: 36px;
  font-size: 24px;
}

.pinned-controls .score-edit-input {
  font-size: 38px;
}

.pinned-controls .hotkey-row {
  gap: 6px;
  margin-top: 8px;
}

.pinned-controls .hotkey-row label {
  gap: 4px;
  font-size: 11px;
}

.pinned-controls .hotkey-input {
  min-height: 28px;
  font-size: 12px;
}

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

.timer-type-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.timer-type-toggle button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: #3F3F3F;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.timer-type-toggle button span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-type-toggle button b {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.timer-type-toggle button.is-active {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.timer-type-toggle button.is-active b {
  color: rgba(255, 255, 255, 0.8);
}

.hold-switch-button {
  --hold-progress: 0%;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.hold-switch-button > * {
  position: relative;
  z-index: 1;
}

.hold-switch-button::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--hold-fraction, 0));
  transform-origin: left;
  background: rgba(245, 158, 11, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.hold-switch-button.is-holding {
  border-color: #d98b1e;
  box-shadow: 0 0 0 3px rgba(217, 139, 30, 0.14);
}

.hold-switch-button.is-holding::after {
  opacity: 1;
}

.hold-switch-button.is-switched {
  outline: 2px solid #d98b1e;
}

.pinned-controls .button.start {
  flex: initial;
  min-height: 42px;
  font-size: 16px;
}

.pinned-controls .button.start span {
  font-size: 12px;
}

.pinned-controls .sound-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.pinned-controls .sound-card {
  grid-template-columns: auto 1fr;
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.pinned-controls .sound-card .sound-icon {
  display: none;
}

.pinned-controls .sound-setting-wrap {
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  gap: 6px;
}

.pinned-controls .sound-setting-toggle,
.pinned-controls .sound-preview-button {
  width: 32px;
  height: 38px;
}

.pinned-controls .unified-sound-grid {
  margin-top: 0;
}

.scoreboard-stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  --design-width: 3840px;
  --design-height: 2160px;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  color: #FAFAFA;
  background:
    radial-gradient(circle at 50% 0%, rgba(74, 103, 148, 0.24), transparent 34%),
    linear-gradient(135deg, var(--stage), var(--stage-2));
  isolation: isolate;
}

.stage-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  container-type: inline-size;
  overflow: visible;
}

.scoreboard-stage.fit-safe .stage-content {
  inset: var(--safe-top, 6%) var(--safe-right, 6%) var(--safe-bottom, 6%) var(--safe-left, 6%);
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.stage-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.76;
  filter: saturate(1.05) contrast(1.04);
}

.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: clamp(54px, 4.2cqw, 162px) clamp(54px, 4.2cqw, 162px);
  mask-image: radial-gradient(circle at 50% 42%, black, transparent 72%);
}

.scoreboard-stage::before,
.scoreboard-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: 34%;
  opacity: 0.62;
  pointer-events: none;
}

.scoreboard-stage::before {
  left: 0;
  background: linear-gradient(90deg, rgba(223, 63, 50, 0.62) 0%, rgba(223, 63, 50, 0.24) 48%, transparent 100%);
}

.scoreboard-stage::after {
  right: 0;
  background: linear-gradient(270deg, rgba(35, 98, 223, 0.62) 0%, rgba(35, 98, 223, 0.24) 48%, transparent 100%);
}

.match-header {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
  text-align: center;
}

.match-title {
  position: absolute;
  left: var(--text-x, 50%);
  top: calc(var(--text-y, 12%) - 2%);
  overflow: visible;
  width: max-content;
  max-width: 100%;
  padding-bottom: 0.12em;
  color: #FAFAFA;
  font-size: clamp(18px, calc(var(--text-size, 150) * 0.0260417cqw), 240px);
  font-weight: 900;
  line-height: 1.18;
  transform: translate(-50%, -50%);
}

.round-title {
  position: absolute;
  left: var(--text-x, 50%);
  top: calc(var(--text-y, 38%) - 2%);
  overflow: visible;
  width: max-content;
  max-width: 100%;
  padding-bottom: 0.12em;
  color: rgba(250,250,250,0.78);
  font-size: clamp(11px, calc(var(--text-size, 80) * 0.0260417cqw), 150px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.18;
  transform: translate(-50%, -50%);
}

.match-header.is-round-promoted .round-title {
  color: #FAFAFA;
  font-weight: 900;
  letter-spacing: 0;
}

.timer-zone {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  justify-items: center;
  align-self: center;
  align-content: center;
  text-align: center;
}

.timer-label {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.42cqw 1cqw;
  color: rgba(250,250,250,0.66);
  background: rgba(8, 13, 22, 0.42);
  font-size: clamp(9px, 0.9cqw, 15px);
  font-weight: 800;
}

.timer-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.045em;
  margin-top: 0;
  color: #FAFAFA;
  font-family: var(--font-main);
  max-width: 100%;
  font-size: clamp(78px, 13.2cqw, 620px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-variant-numeric: tabular-nums;
  transform: translate(-0.1em, -0.03em);
}

.timer-digits,
.timer-colon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.timer-colon {
  position: relative;
  align-self: center;
  overflow: hidden;
  flex: 0 0 0.16em;
  width: 0.16em;
  height: 1em;
  color: inherit;
  font-size: 1em;
  text-indent: -9999px;
  transform: translateY(0.015em);
}

.timer-colon::before,
.timer-colon::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0.075em;
  height: 0.075em;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.timer-colon::before {
  top: 34%;
}

.timer-colon::after {
  bottom: 34%;
}

.timer-value.is-warning {
  color: var(--danger);
  text-shadow: 0 0 24px rgba(226, 45, 45, 0.28);
}

.timer-value.is-prestart {
  color: #FAFAFA;
  transform: translate(-0.04em, -0.03em);
}

.prestart-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.72em;
  color: inherit;
  font-size: 1.08em;
  line-height: 0.92;
}

.custom-message {
  position: absolute;
  z-index: 1;
  left: var(--text-x, 50%);
  top: calc(var(--text-y, 88%) - 2%);
  display: grid;
  min-width: clamp(180px, 24cqw, 920px);
  max-width: 62%;
  min-height: clamp(36px, 3.7cqw, 142px);
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.5cqw 1.25cqw;
  color: rgba(250,250,250,0.92);
  background: rgba(10, 15, 24, 0.46);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.custom-message.is-empty {
  display: none;
}

.custom-message span {
  display: block;
  overflow: hidden;
  width: 100%;
  padding-bottom: 0.1em;
  font-size: clamp(12px, calc(var(--text-size, 42) * 0.0260417cqw), 64px);
  font-weight: 850;
  line-height: 1.28;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard-stage.has-upcoming .custom-message {
  top: min(var(--text-y, 88%), 77%);
}

.screen-upcoming-matches {
  position: absolute;
  z-index: 2;
  left: var(--text-x, 50%);
  top: calc(var(--text-y, 86%) - 2%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  width: min(84%, 2700px);
  min-height: clamp(56px, 7.2cqw, 278px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 15, 24, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.screen-upcoming-matches.is-hidden,
.screen-upcoming-matches.is-empty,
.screen-upcoming-matches:empty {
  display: none;
}

.screen-upcoming-matches > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14em;
  overflow: hidden;
  padding: 0.45cqw 1.2cqw;
  color: rgba(250,250,250,0.92);
  font-size: clamp(10px, calc(var(--text-size, 34) * 0.0260417cqw), 56px);
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-definition,
.carousel-matchup {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.48em;
}

.carousel-definition {
  color: rgba(250,250,250,0.75);
  font-size: 0.7em;
  letter-spacing: 0.035em;
}

.carousel-matchup {
  font-size: 1em;
}

.carousel-prefix,
.carousel-sequence,
.carousel-separator,
.carousel-vs {
  flex: 0 0 auto;
}

.carousel-vs {
  color: rgba(250,250,250,0.86);
  font-size: 0.9em;
}

.carousel-team {
  display: inline-block;
  min-width: 0;
  max-width: 36%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-side-label {
  margin-right: 0.15em;
}

.carousel-team-red {
  color: #e14a3b;
}

.carousel-team-blue {
  color: #356bff;
}

.screen-upcoming-matches > div.is-empty {
  visibility: hidden;
}

.announcement-message {
  position: absolute;
  z-index: 8;
  left: var(--text-x, 50%);
  top: var(--text-y, 50%);
  display: none;
  width: min(88%, 3100px);
  color: rgba(250,250,250,0.96);
  font-size: clamp(28px, calc(var(--text-size, 170) * 0.0260417cqw), 220px);
  font-weight: 1000;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 16px 48px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.scoreboard-stage.is-announcement-mode .announcement-message {
  display: block;
}

.scoreboard-stage.is-announcement-mode .match-header,
.scoreboard-stage.is-announcement-mode .score-zone,
.scoreboard-stage.is-announcement-mode .custom-message,
.scoreboard-stage.is-announcement-mode .screen-upcoming-matches {
  display: none;
}

.screen-carousel-line.is-rolling {
  position: relative;
  animation: carouselSlideUp 420ms cubic-bezier(0.18, 0.78, 0.18, 1);
}

.screen-carousel-line.is-rolling::before {
  content: attr(data-prev);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: inherit;
  animation: carouselOldSlideUp 420ms cubic-bezier(0.18, 0.78, 0.18, 1) forwards;
  pointer-events: none;
}

.preview-panel .scoreboard-stage.is-editing-matchName .match-header,
.preview-panel .scoreboard-stage.is-editing-roundName .match-header {
  pointer-events: auto;
}

.preview-panel .scoreboard-stage.is-text-direct-editing .text-direct-edit-target {
  outline: 2px solid rgba(37, 99, 235, 0.96);
  outline-offset: 6px;
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.preview-panel .scoreboard-stage.is-text-direct-editing .text-direct-edit-target::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 8;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: #1d4ed8;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.28);
  cursor: nwse-resize;
}

.preview-panel .match-title.text-direct-edit-target::after,
.preview-panel .round-title.text-direct-edit-target::after {
  right: -16px;
  bottom: -12px;
}

.preview-panel .scoreboard-stage.is-text-direct-editing .text-direct-edit-target.is-direct-dragging {
  outline-color: #38bdf8;
  outline-offset: 8px;
}

body.is-text-direct-dragging {
  cursor: grabbing;
  user-select: none;
}

.score-zone {
  position: absolute;
  z-index: 1;
  top: 50.5%;
  left: 2.2%;
  right: 2.2%;
  bottom: auto;
  display: grid;
  grid-template-columns: clamp(150px, 21cqw, 840px) clamp(220px, 34cqw, 1360px) clamp(150px, 21cqw, 840px);
  align-items: stretch;
  justify-content: center;
  gap: clamp(30px, 3.4cqw, 136px);
  min-height: clamp(128px, 18.6cqw, 720px);
  padding: 0;
  transform: translateY(-50%);
}

.scoreboard-stage.is-header-empty .score-zone {
  top: 50%;
  left: 1.6%;
  right: 1.6%;
  grid-template-columns: clamp(150px, 22cqw, 900px) clamp(220px, 34cqw, 1460px) clamp(150px, 22cqw, 900px);
  gap: clamp(30px, 3.5cqw, 142px);
  min-height: clamp(146px, 20.6cqw, 790px);
}

.scoreboard-stage.is-header-empty .timer-value {
  font-size: clamp(86px, 13.7cqw, 650px);
}

@container (max-width: 900px) {
  .timer-value {
    transform: translate(-0.1em, -0.03em);
  }
}

.team-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  min-width: 0;
  min-height: 100%;
  border: 1px solid var(--stage-line);
  border-radius: 8px;
  padding: clamp(14px, 1.55cqw, 72px);
  background: rgba(10, 15, 24, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.game-win-slots {
  position: absolute;
  top: calc(clamp(18px, 1.8cqw, 70px) * -1);
  display: flex;
  gap: clamp(7px, 0.7cqw, 26px);
  height: clamp(10px, 0.9cqw, 34px);
}

.red-card .game-win-slots {
  left: 0;
  right: 0;
}

.blue-card .game-win-slots {
  left: 0;
  right: 0;
}

.game-win-slots span {
  display: block;
  flex: 1 1 0;
  height: 100%;
  border: clamp(2px, 0.18cqw, 8px) solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: rgba(8, 13, 22, 0.34);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.red-card .game-win-slots span.is-active {
  border-color: var(--red);
  background: linear-gradient(90deg, rgba(223, 63, 50, 0.95), rgba(255, 124, 111, 0.82));
  box-shadow: 0 0 18px rgba(223, 63, 50, 0.28);
}

.blue-card .game-win-slots span.is-active {
  border-color: var(--blue);
  background: linear-gradient(90deg, rgba(35, 98, 223, 0.95), rgba(103, 154, 255, 0.82));
  box-shadow: 0 0 18px rgba(35, 98, 223, 0.3);
}

.scoreboard-stage:not(.is-bo3) .game-win-slots {
  display: none;
}

.red-card {
  border-left: clamp(5px, 0.4cqw, 16px) solid var(--red);
}

.blue-card {
  border-right: clamp(5px, 0.4cqw, 16px) solid var(--blue);
}

.team-identity {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2cqw, 20px);
  width: 100%;
  min-width: 0;
}

.blue-card .team-identity {
  justify-content: flex-end;
  text-align: right;
}

.logo-slot {
  display: grid;
  flex: 0 0 clamp(40px, 5.4cqw, 260px);
  width: clamp(40px, 5.4cqw, 260px);
  height: clamp(40px, 5.4cqw, 260px);
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: rgba(250,250,250,0.5);
  background: rgba(255, 255, 255, 0.06);
  font-size: clamp(9px, 0.75cqw, 30px);
  font-weight: 900;
}

.logo-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-card.logo-hidden .team-identity {
  justify-content: center;
  text-align: center;
}

.team-card.logo-hidden .logo-slot {
  display: none;
}

.team-card.team-name-hidden {
  grid-template-rows: 1fr;
  align-items: center;
}

.team-card.team-name-hidden .team-identity {
  position: absolute;
  top: clamp(10px, 1.1cqw, 42px);
  left: 50%;
  width: auto;
  max-width: 70%;
  justify-content: center;
  transform: translateX(-50%);
}

.team-card.team-name-hidden.logo-hidden {
  grid-template-rows: 1fr;
  align-items: center;
}

.team-card.team-name-hidden.logo-hidden .team-identity {
  display: none;
}

.team-copy {
  display: grid;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  gap: 0;
  justify-items: center;
  text-align: center;
}

.team-name {
  display: block;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  padding-bottom: 0.16em;
  font-size: clamp(10px, 1.48cqw, 68px);
  font-weight: 950;
  line-height: 1.16;
  max-height: 2.48em;
  overflow-wrap: anywhere;
  text-align: center;
  text-overflow: clip;
  white-space: pre-wrap;
  word-break: break-word;
}

.team-side {
  display: none;
  color: rgba(250,250,250,0.5);
  font-size: clamp(8px, 0.78cqw, 34px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.score-value {
  align-self: end;
  justify-self: center;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  padding-bottom: 0.08em;
  margin-top: clamp(8px, 1.1cqw, 18px);
  color: #FAFAFA;
  font-family: var(--font-main);
  font-size: clamp(72px, 10.8cqw, 520px);
  font-weight: 950;
  line-height: 1.06;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  transform: translateY(-0.22em);
}

.score-value.is-score-rendered {
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-roll-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  will-change: auto;
}

.score-effect-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform-origin: 50% 55%;
  will-change: auto;
}

.score-static-inner {
  will-change: auto;
}

.score-roll-column {
  position: relative;
  display: inline-block;
  overflow: hidden;
  box-sizing: content-box;
  width: 0.62em;
  height: 1.04em;
  padding-inline: 0.04em;
  contain: layout paint;
}

.score-roll-column.is-space {
  width: 0.34em;
  padding-inline: 0;
}

.score-roll-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 2.08em;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.score-roll-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 1.04em;
  line-height: 1.04;
}

.score-roll-column.is-static .score-roll-cell {
  height: 1.04em;
}

.score-value.is-score-up .score-effect-shell {
  animation: scoreWholeHit 320ms cubic-bezier(0.12, 0.9, 0.18, 1);
  will-change: transform;
}

.score-value.is-score-down .score-effect-shell {
  animation: scoreWholeDip 300ms cubic-bezier(0.14, 0.86, 0.18, 1);
  will-change: transform;
}

.low-performance-mode .score-value.is-score-up .score-effect-shell {
  animation-name: scoreWholeHitLite;
  animation-duration: 320ms;
  will-change: transform;
}

.low-performance-mode .score-value.is-score-down .score-effect-shell {
  animation-name: scoreWholeDipLite;
  animation-duration: 300ms;
  will-change: transform;
}

.low-performance-mode .score-value.is-score-coalesced .score-roll-track {
  animation: none !important;
}

.score-value.is-score-up .score-roll-column.is-changing .score-roll-track {
  animation: scoreRollTrackUp 200ms linear forwards;
}

.score-value.is-score-down .score-roll-column.is-changing .score-roll-track {
  transform: translate3d(0, -1.04em, 0);
  animation: scoreRollTrackDown 180ms linear forwards;
}

.red-card .score-value {
  color: var(--red);
}

.blue-card .score-value {
  color: var(--blue);
}

.team-card.team-name-hidden .score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - clamp(30px, 3.8cqw, 150px));
  height: calc(100% - clamp(22px, 2.6cqw, 110px));
  margin-top: 0;
  padding-bottom: 0;
  font-size: clamp(88px, 13.1cqw, 560px);
  line-height: 0.82;
  transform: translate(-50%, calc(-50% - 0.1em));
}

.team-card.team-name-hidden.logo-hidden .score-value {
  font-size: clamp(94px, 13.7cqw, 590px);
  transform: translate(-50%, calc(-50% - 0.1em));
}

.scoreboard-stage.is-header-empty .score-value {
  font-size: clamp(88px, 12.4cqw, 560px);
}

.scoreboard-stage.is-header-empty .team-card.team-name-hidden .score-value {
  font-size: clamp(98px, 14.2cqw, 620px);
}

.theme-day .scoreboard-stage {
  color: #101828;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(135deg, #FAFAFA, #EBEBEB);
}

.theme-day .stage-bg img {
  opacity: 0.52;
  filter: saturate(0.95) contrast(0.96);
}

.theme-day .stage-bg::after {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
}

.theme-day .scoreboard-stage::before {
  opacity: 0.7;
  background: linear-gradient(90deg, rgba(223, 63, 50, 0.34) 0%, rgba(223, 63, 50, 0.16) 52%, transparent 100%);
}

.theme-day .scoreboard-stage::after {
  opacity: 0.7;
  background: linear-gradient(270deg, rgba(35, 98, 223, 0.36) 0%, rgba(35, 98, 223, 0.17) 52%, transparent 100%);
}

.theme-day .match-title,
.theme-day .match-header.is-round-promoted .round-title,
.theme-day .timer-value {
  color: #111827;
}

.theme-day .round-title,
.theme-day .team-side {
  color: #3F3F3F;
}

.theme-day .team-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.78),
    0 18px 42px rgba(15, 23, 42, 0.08);
}

.theme-day .red-card {
  border-left-color: var(--red);
}

.theme-day .blue-card {
  border-right-color: var(--blue);
}

.scoreboard-stage.is-reversed-teams::before {
  left: auto;
  right: 0;
  background: linear-gradient(270deg, rgba(223, 63, 50, 0.62) 0%, rgba(223, 63, 50, 0.24) 48%, transparent 100%);
}

.scoreboard-stage.is-reversed-teams::after {
  right: auto;
  left: 0;
  background: linear-gradient(90deg, rgba(35, 98, 223, 0.62) 0%, rgba(35, 98, 223, 0.24) 48%, transparent 100%);
}

.theme-day .scoreboard-stage.is-reversed-teams::before {
  background: linear-gradient(270deg, rgba(223, 63, 50, 0.34) 0%, rgba(223, 63, 50, 0.16) 52%, transparent 100%);
}

.theme-day .scoreboard-stage.is-reversed-teams::after {
  background: linear-gradient(90deg, rgba(35, 98, 223, 0.36) 0%, rgba(35, 98, 223, 0.17) 52%, transparent 100%);
}

.scoreboard-stage.is-reversed-teams .red-card {
  grid-column: 3;
  grid-row: 1;
  border-left: 1px solid var(--stage-line);
  border-right: clamp(5px, 0.4cqw, 16px) solid var(--red);
}

.scoreboard-stage.is-reversed-teams .timer-zone {
  grid-column: 2;
  grid-row: 1;
}

.scoreboard-stage.is-reversed-teams .blue-card {
  grid-column: 1;
  grid-row: 1;
  border-left: clamp(5px, 0.4cqw, 16px) solid var(--blue);
  border-right: 1px solid var(--stage-line);
}

.scoreboard-stage.is-reversed-teams .red-card:not(.logo-hidden):not(.team-name-hidden) .team-identity {
  justify-content: flex-end;
  text-align: right;
}

.scoreboard-stage.is-reversed-teams .blue-card:not(.logo-hidden):not(.team-name-hidden) .team-identity {
  justify-content: flex-start;
  text-align: left;
}

.theme-day .custom-message {
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(17, 24, 39, 0.88);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
}

.theme-day .screen-upcoming-matches > div {
  color: rgba(17, 24, 39, 0.9);
}

.theme-day .carousel-vs {
  color: rgba(17, 24, 39, 0.72);
}

.theme-day .screen-upcoming-matches {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
}

.theme-day .timer-value.is-warning {
  color: #d92d20;
}

.theme-day .display-fullscreen-button {
  color: rgba(17, 24, 39, 0.72);
  background: rgba(255, 255, 255, 0.54);
}

[data-visible].is-hidden {
  display: none !important;
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 96px;
  overscroll-behavior: contain;
}

.control-stack::-webkit-scrollbar {
  width: 8px;
}

.control-stack::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #D4D4D4;
}

.control-stack > .control-panel {
  min-width: 0;
  flex: 0 0 auto;
}

.tournament-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "planner"
    "schedule"
    "snapshots";
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 0 24px 16px;
}

.team-layout,
.ranking-layout {
  min-height: 0;
  overflow: auto;
  padding: 0 24px 16px;
}

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

.team-setup-panel,
.ranking-layout .tournament-standings-panel {
  width: min(1480px, 100%);
  box-sizing: border-box;
  max-width: 1480px;
  margin: 0 auto;
}

.tournament-actions-panel {
  grid-area: actions;
}

.tournament-schedule-panel {
  grid-area: schedule;
}

.tournament-bracket-panel {
  grid-area: bracket;
}

.tournament-trash-panel {
  grid-area: trash;
}

.tournament-snapshot-panel {
  grid-area: snapshots;
  margin-bottom: 28px;
}

.tournament-planner-panel {
  grid-area: planner;
}

.schedule-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  border: 1px solid #E1E1E1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #FAFAFA;
}

.schedule-source-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.schedule-source-copy strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.schedule-source-copy span {
  color: #747474;
  font-size: 11px;
  font-weight: 800;
}

.schedule-source-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 6px;
  border: 1px solid #DDDDDD;
  border-radius: 10px;
  padding: 4px;
  background: #fff;
}

.schedule-source-toggle .button {
  min-height: 36px;
  border-color: transparent;
  white-space: nowrap;
}

.schedule-source-toggle .button.is-active {
  color: #fff;
  border-color: #315ad9;
  background: #315ad9;
  box-shadow: 0 5px 14px rgba(49, 90, 217, 0.2);
}

.schedule-source-toggle .button:disabled:not(.is-active) {
  opacity: 0.45;
}

.generated-schedule-builder.is-hidden,
.import-schedule-panel.is-hidden,
.import-schedule-mapping-panel.is-hidden {
  display: none;
}

.import-schedule-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid #b9cafa;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(145deg, #FAFAFA, #F3F3F3);
  box-shadow: inset 4px 0 0 #315ad9;
}

.import-schedule-heading,
.import-schedule-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-schedule-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.import-schedule-heading strong,
.import-schedule-preview-heading strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.import-schedule-heading span,
.import-schedule-preview-heading span {
  color: #767676;
  font-size: 11px;
  font-weight: 800;
}

.import-schedule-file-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.import-schedule-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.import-schedule-controls label {
  display: grid;
  gap: 5px;
  color: #696969;
  font-size: 11px;
  font-weight: 900;
}

.import-schedule-controls select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #D8D8D8;
  border-radius: 9px;
  padding: 0 10px;
  color: #172033;
  background: #fff;
  font-weight: 850;
}

.import-schedule-feedback {
  display: block;
  min-height: 38px;
  border: 1px solid #c8d5f6;
  border-radius: 9px;
  padding: 9px 11px;
  color: #40516e;
  background: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.55;
}

.import-schedule-feedback[data-status="success"] {
  color: #505050;
  border-color: #D3D3D3;
  background: #F7F7F7;
}

.import-schedule-feedback[data-status="error"] {
  color: #a13636;
  border-color: #efc2c2;
  background: #fff3f3;
}

.import-schedule-feedback[data-status="warning"] {
  color: #8b5712;
  border-color: #edce8e;
  background: #fff8e8;
}

.import-schedule-mapping-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #e1c170;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(145deg, #FDFDFD, #F7F7F7);
  box-shadow: inset 4px 0 0 #d99a24;
}

.import-mapping-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-mapping-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.import-mapping-heading strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.import-mapping-heading span {
  color: #7b6336;
  font-size: 11px;
  font-weight: 800;
}

.import-mapping-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.import-mapping-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
}

.import-mapping-toolbar label,
.import-mapping-grid label {
  display: grid;
  gap: 5px;
  color: #696969;
  font-size: 11px;
  font-weight: 900;
}

.import-mapping-toolbar select,
.import-mapping-toolbar input,
.import-mapping-grid select {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid #d6c9a8;
  border-radius: 9px;
  padding: 0 10px;
  color: #172033;
  background: #fff;
  font-weight: 850;
}

.import-mapping-toolbar small {
  color: #8a7650;
  font-size: 10px;
  line-height: 1.4;
}

.import-mapping-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 9px;
}

.import-mapping-grid label {
  min-width: 0;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.import-mapping-grid label[data-mapping-field="redName"],
.import-mapping-grid label[data-mapping-field="redCode"] {
  border-color: rgba(205, 69, 57, 0.3);
  background: rgba(205, 69, 57, 0.055);
}

.import-mapping-grid label[data-mapping-field="blueName"],
.import-mapping-grid label[data-mapping-field="blueCode"] {
  border-color: rgba(49, 90, 217, 0.28);
  background: rgba(49, 90, 217, 0.055);
}

.import-mapping-grid label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.import-mapping-grid label strong {
  overflow: hidden;
  color: #3F3F3F;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-mapping-grid label em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 6px;
  color: #747474;
  background: #F2F2F2;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
}

.import-mapping-grid label em[data-status="certain"] {
  color: #187044;
  background: #F3F3F3;
}

.import-mapping-grid label em[data-status="review"] {
  color: #9a5c0d;
  background: #fff0c9;
}

.import-mapping-sample {
  display: grid;
  gap: 4px;
  border-top: 1px dashed #ddc996;
  padding-top: 9px;
  color: #616161;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.5;
}

.import-mapping-sample strong {
  color: #403722;
  font-size: 11px;
  font-weight: 950;
}

.import-schedule-preview {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid #DFDFDF;
  border-radius: 11px;
  padding: 10px;
  background: #fff;
}

.import-schedule-table-wrap {
  max-height: 310px;
  overflow: auto;
  border: 1px solid #E6E6E6;
  border-radius: 9px;
}

.import-schedule-table {
  min-width: 820px;
}

.import-schedule-table th,
.import-schedule-table td {
  padding-block: 9px;
}

.import-schedule-table th:nth-child(3),
.import-schedule-table td:nth-child(3),
.import-schedule-table th:nth-child(4),
.import-schedule-table td:nth-child(4) {
  background: rgba(205, 69, 57, 0.055);
}

.import-schedule-table th:nth-child(5),
.import-schedule-table td:nth-child(5),
.import-schedule-table th:nth-child(6),
.import-schedule-table td:nth-child(6) {
  background: rgba(49, 90, 217, 0.055);
}

@media (max-width: 980px) {
  .schedule-source-bar,
  .import-schedule-heading,
  .import-schedule-preview-heading,
  .import-mapping-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-source-toggle,
  .import-schedule-controls,
  .import-mapping-toolbar,
  .import-mapping-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .import-schedule-file-actions,
  .import-mapping-actions {
    flex-wrap: wrap;
  }
}

.qualifier-draw-panel {
  width: min(1480px, 100%);
  box-sizing: border-box;
  max-width: 1480px;
  margin: 0 auto;
}

.qualifier-draw-header p {
  margin: 3px 0 0;
  color: #6F6F6F;
  font-size: 12px;
  font-weight: 750;
}

.qualifier-points-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #E8E8E8;
  padding-top: 10px;
}

.qualifier-points-settings > strong {
  margin-right: 4px;
  color: #3F3F3F;
  font-size: 13px;
}

.qualifier-points-settings label,
.random-team-import-control {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  border: 1px solid #DFDFDF;
  border-radius: 8px;
  padding: 0 8px;
  color: #6F6F6F;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.qualifier-points-settings input,
.random-team-import-control input {
  width: 48px;
  height: 26px;
  border: 0;
  padding: 0 4px;
  color: #111827;
  background: transparent;
  font: inherit;
  font-weight: 950;
  text-align: center;
}

.qualifier-points-settings em,
.random-team-import-control em {
  color: #A1A1A1;
  font-style: normal;
}

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

.snapshot-empty {
  min-height: 38px;
  border: 1px dashed #DDDDDD;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.snapshot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--panel-strong);
}

.snapshot-row strong {
  overflow: hidden;
  color: #3F3F3F;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-row.is-safety-snapshot {
  border-color: #9ab1ff;
  background: #F6F6F6;
}

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

.planner-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  width: min(1080px, 100%);
  display: grid;
  gap: 6px;
  margin: 0 auto 8px;
  padding: 6px 8px;
  border: 1px solid rgba(221,221,221,0.92);
  border-radius: 12px;
  background: rgba(251,251,251,0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.planner-tool-row,
.planner-preset-row,
.planner-round-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.planner-tool {
  min-height: 36px;
  border: 1px solid #C5C5C5;
  border-radius: 8px;
  padding: 0 12px;
  color: #1f2937;
  background: #FBFBFB;
  font-size: 13px;
  font-weight: 950;
  cursor: grab;
}

.planner-tool:active {
  cursor: grabbing;
}

.planner-preset-row {
  gap: 6px;
}

.planner-preset-row label {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #DDDDDD;
  border-radius: 8px;
  padding: 4px 7px;
  color: #6F6F6F;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.planner-preset-card {
  position: relative;
  padding-right: 26px !important;
  cursor: grab;
  user-select: none;
}

.planner-preset-card:active {
  cursor: grabbing;
}

.planner-preset-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 10px;
  height: 14px;
  background:
    radial-gradient(circle, #A1A1A1 1.5px, transparent 1.6px) 0 0 / 5px 5px;
  transform: translateY(-50%);
}

.planner-preset-row select,
.planner-preset-row input {
  width: 100%;
  min-width: 0;
  height: 26px;
  border: 0;
  color: #111827;
  background: transparent;
  font: inherit;
}

.planner-custom-preset {
  display: none !important;
}

.planner-custom-preset.is-visible {
  display: grid !important;
}

.planner-custom-preset span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.planner-custom-preset input {
  width: 36px;
  text-align: center;
}

.planner-custom-preset em {
  color: #6F6F6F;
  font-size: 11px;
  font-style: normal;
}

.planner-round-summary {
  justify-content: center;
}

.planner-round-summary:empty {
  display: none;
}

.planner-round-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #E2E2E2;
  border-radius: 999px;
  padding: 0 10px;
  color: #3F3F3F;
  background: #FBFBFB;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.planner-round-chip strong {
  color: #111827;
  font-weight: 1000;
}

.planner-round-chip em {
  color: #6F6F6F;
  font-style: normal;
}

.planner-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid #E2E2E2;
  border-radius: 10px;
  padding: 10px 12px;
  color: #3F3F3F;
  background: #FBFBFB;
  font-size: 14px;
  font-weight: 900;
}

.planner-summary strong {
  color: #0f172a;
  font-size: 17px;
}

.planner-board {
  min-height: 360px;
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid #E2E2E2;
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(#F4F4F4 1px, transparent 1px),
    linear-gradient(90deg, #F4F4F4 1px, transparent 1px),
    #fff;
  background-size: 40px 40px;
}

.plan-canvas {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  min-width: max-content;
  min-height: 315px;
  padding: 8px 10px;
}

.plan-team-box,
.planner-empty {
  border: 1px solid #DDDDDD;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.plan-team-box {
  display: grid;
  width: 210px;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #1d4ed8;
  background: linear-gradient(180deg, #F1F1F1, #E7E7E7);
  border-color: #bfd4f4;
}

.plan-team-box strong {
  color: #0f172a;
  font-size: 64px;
  line-height: 1;
}

.plan-team-box span {
  color: #3F3F3F;
  font-size: 18px;
  font-weight: 950;
}

.planner-empty {
  display: grid;
  width: 310px;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  color: #6F6F6F;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.planner-empty strong {
  color: #0f172a;
  font-size: 18px;
}

.planner-empty span {
  max-width: 240px;
}

.plan-flow-connector {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 76px;
  align-self: stretch;
  min-height: 2px;
}

.plan-flow-connector::before {
  content: "";
  width: 100%;
  border-top: 2px solid #111827;
}

.plan-flow-connector::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #111827;
  border-right: 2px solid #111827;
  transform: translateY(-50%) rotate(45deg);
}

.plan-stage-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  align-self: stretch;
  width: 500px;
  min-height: 430px;
  padding: 0;
}

.plan-stage-config {
  display: grid;
  gap: 10px;
  border: 1px solid #DDDDDD;
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.plan-stage-qualifier > .plan-stage-config {
  border-left: 5px solid #1d4ed8;
  background: linear-gradient(180deg, rgba(232,232,232,0.96), rgba(255, 255, 255, 0.94));
}

.plan-stage-group > .plan-stage-config {
  border-left: 5px solid #16a34a;
  background: linear-gradient(180deg, rgba(244,244,244,0.92), rgba(255, 255, 255, 0.94));
}

.plan-stage-knockout {
  width: auto;
  min-width: 820px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.plan-stage-knockout > .plan-stage-config {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(212, 58, 48, 0.22);
  border-left: 5px solid #d43a30;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(232,232,232,0.88), rgba(255, 255, 255, 0.94));
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.plan-stage-knockout > .plan-output-panel {
  min-width: max-content;
}

.plan-stage-head,
.plan-stage-metrics,
.plan-stage-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-stage-head strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 1000;
}

.plan-stage-metrics span,
.plan-stage-output {
  color: #6F6F6F;
  font-size: 13px;
  font-weight: 900;
}

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

.plan-stage-grid label {
  display: grid;
  gap: 3px;
  color: #6F6F6F;
  font-size: 12px;
  font-weight: 900;
}

.plan-stage-grid input,
.plan-stage-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  min-height: 30px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.plan-qualifier-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(29, 78, 216, 0.14);
  padding-top: 9px;
}

.plan-qualifier-generate,
.plan-qualifier-points {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.plan-qualifier-generate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.plan-qualifier-generate strong,
.plan-qualifier-points strong {
  color: #3F3F3F;
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.plan-qualifier-generate > span {
  color: #6F6F6F;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-qualifier-points label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #6F6F6F;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.plan-qualifier-points input {
  width: 42px;
  min-height: 30px;
  box-sizing: border-box;
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  padding: 0 5px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-align: center;
}

@media (max-width: 1500px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .view-tabs {
    position: static;
    order: 10;
    width: 100%;
    justify-content: center;
    margin-inline: auto;
    transform: none;
  }
}

@media (max-width: 760px) {
  .plan-qualifier-controls {
    grid-template-columns: 1fr;
  }
}

.plan-stage-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-stage-summary-chips span {
  min-height: 26px;
  border: 1px solid rgba(221,221,221,0.9);
  border-radius: 999px;
  padding: 4px 9px;
  color: #3F3F3F;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 950;
}

.plan-stage-rounds {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
}

.plan-stage-rounds header {
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 1000;
}

.plan-round-config-strip {
  display: flex;
  gap: var(--plan-round-gap, 52px);
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.plan-round-config-card {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  align-content: start;
  border: 1px solid rgba(212, 58, 48, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.plan-round-config-card strong {
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 1000;
}

.plan-round-config-card em {
  color: #6F6F6F;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.plan-round-config-card label {
  display: grid;
  gap: 3px;
  color: #6F6F6F;
  font-size: 11px;
  font-weight: 900;
}

.plan-round-config-card select,
.plan-round-config-card input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  padding: 0 7px;
  color: #111827;
  background: #fff;
  font: inherit;
}

.plan-output-panel {
  display: grid;
  align-content: center;
  justify-content: stretch;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 8px 4px;
  background: transparent;
  box-shadow: none;
}

.plan-linear-output-panel {
  align-content: start;
  gap: 10px;
}

.plan-column-info-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(221,221,221,0.96);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.plan-column-info-card.is-frozen,
.plan-knockout-round-title.is-frozen {
  border-color: #D4D4D4;
  background: rgba(244,244,244,0.96);
  box-shadow: none;
}

.plan-lock-state {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  color: #535353 !important;
  background: #E7E7E7;
  font-size: 10px !important;
  font-weight: 950;
}

.planner-board.is-schedule-locked .plan-canvas {
  cursor: default;
}

.plan-stage-config.is-plan-preset-over,
.plan-column-info-card.is-plan-preset-over,
.plan-round-config-card.is-plan-preset-over,
.plan-round-inline-fields.is-plan-preset-over {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08), 0 14px 30px rgba(15, 23, 42, 0.08);
}

.plan-column-info-qualifier {
  border-left: 5px solid #1d4ed8;
  background: linear-gradient(180deg, rgba(232,232,232,0.92), rgba(255, 255, 255, 0.96));
}

.plan-column-info-group {
  border-left: 5px solid #16a34a;
  background: linear-gradient(180deg, rgba(244,244,244,0.88), rgba(255, 255, 255, 0.96));
}

.plan-column-info-head,
.plan-column-info-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-column-info-head strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 1000;
}

.plan-column-info-metrics span {
  color: #6F6F6F;
  font-size: 13px;
  font-weight: 950;
}

.plan-column-fields-menu {
  display: grid;
  gap: 8px;
}

.plan-column-fields-menu > summary {
  width: max-content;
  min-height: 26px;
  border: 1px solid rgba(221,221,221,0.9);
  border-radius: 999px;
  padding: 4px 10px;
  color: #3F3F3F;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.plan-column-fields .plan-stage-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-output-title {
  margin-bottom: 10px;
  color: #3F3F3F;
  font-size: 14px;
  font-weight: 1000;
  text-align: center;
}

.plan-output-stack {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.plan-output-stack::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  border-left: 2px solid #111827;
}

.plan-output-box,
.plan-output-more {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 2px solid #111827;
  border-radius: 3px;
  padding: 5px 8px;
  color: #111827;
  background: #fff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
}

.plan-output-box::before,
.plan-output-more::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  width: 18px;
  border-top: 2px solid #111827;
  transform: translateY(-50%);
}

.plan-output-more {
  border-style: dashed;
  color: #6F6F6F;
}

.plan-group-output-panel,
.plan-knockout-output-panel {
  overflow: auto;
}

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

.plan-group-box {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid rgba(22, 163, 74, 0.26);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.plan-group-box header {
  color: #15803d;
  font-size: 13px;
  font-weight: 1000;
}

.plan-group-seeds {
  display: grid;
  gap: 5px;
}

.plan-group-seeds span,
.plan-group-box footer b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #DDDDDD;
  border-radius: 6px;
  padding: 5px 7px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
}

.plan-group-box footer {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 7px;
}

.plan-group-box footer b {
  border-color: rgba(22, 163, 74, 0.32);
  color: #515151;
  background: rgba(244,244,244,0.7);
}

.plan-group-box em {
  color: #A1A1A1;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.plan-knockout-tree-mini {
  position: relative;
  min-width: max-content;
  overflow: visible;
}

.plan-knockout-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.plan-knockout-line {
  fill: none;
  stroke: #111827;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.plan-knockout-round-title {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 4px;
  min-height: 154px;
  padding: 8px;
  border: 1px solid rgba(221,221,221,0.96);
  border-radius: 8px;
  color: #3F3F3F;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
  transform: translateX(-50%);
}

.plan-knockout-round-title strong {
  color: #3F3F3F;
  font-size: 13px;
  line-height: 1.15;
}

.plan-knockout-round-title em,
.plan-knockout-round-title span {
  display: block;
  color: #6F6F6F;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.25;
}

.plan-knockout-round-title span {
  color: #535353;
}

.plan-round-inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 2px;
  border-radius: 6px;
}

.plan-round-inline-fields label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.plan-round-inline-fields label > span {
  display: block;
  color: #6F6F6F;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.plan-round-inline-fields select,
.plan-round-inline-fields input {
  width: 100%;
  min-width: 0;
  min-height: 24px;
  border: 1px solid #D4D4D4;
  border-radius: 6px;
  padding: 0 5px;
  color: #111827;
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 950;
  text-align: center;
}

.plan-knockout-round-title-final {
  border-color: rgba(245, 158, 11, 0.45);
  color: #b45309;
  background: rgba(251,251,251,0.94);
}

.plan-knockout-match {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: stretch;
  border: 2px solid #111827;
  border-radius: 6px;
  padding: 6px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.plan-knockout-match span {
  color: #6F6F6F;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
}

.plan-knockout-match b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #DDDDDD;
  border-radius: 5px;
  padding: 4px 6px;
  overflow: hidden;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-knockout-match.is-champion {
  border-color: #f59e0b;
  background: #FBFBFB;
}

.publication-layout {
  min-height: 0;
  overflow: auto;
  padding: 0 24px 16px;
}

.publication-kind-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 4px;
  border: 1px solid #DFDFDF;
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.publication-kind-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #6F6F6F;
  background: transparent;
  font-weight: 900;
}

.publication-kind-toggle button.is-active {
  color: #fff;
  background: #1d4ed8;
}

.publication-panel {
  min-height: calc(100vh - 92px);
}

.publication-stage {
  min-height: 620px;
  padding: 24px;
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(212, 58, 48, 0.11), transparent 32%),
    linear-gradient(240deg, rgba(43, 101, 255, 0.12), transparent 34%),
    #FBFBFB;
  border: 1px solid #E3E3E3;
}

.publication-stage.is-list-view {
  height: calc(100vh - 210px);
  min-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.publication-stage.is-tree-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 210px);
  min-height: 560px;
  overflow: hidden;
}

.publication-stage.is-list-view .publication-title {
  position: sticky;
  top: -24px;
  z-index: 4;
  margin: -24px -24px 18px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(221,221,221,0.9);
  background: rgba(251,251,251,0.96);
  backdrop-filter: blur(10px);
}

.publication-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.publication-title span {
  color: #0f172a;
  font-size: 30px;
  font-weight: 1000;
}

.publication-title b {
  color: #1d4ed8;
  font-size: 16px;
}

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

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

.publication-team-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 62px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #E6E6E6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.publication-team-item strong {
  align-self: stretch;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1d4ed8;
  font-size: 18px;
}

.publication-team-item span {
  overflow: hidden;
  padding: 0 16px;
  color: #111827;
  font-size: 19px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-ranking-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 100px 190px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 16px;
  border: 1px solid #E6E6E6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #1f2937;
}

.publication-ranking-row.is-qualified {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(90deg, rgba(155,155,155,0.18), rgba(255, 255, 255, 0.86));
}

.publication-ranking-row strong {
  color: #1d4ed8;
  font-size: 26px;
  text-align: center;
}

.publication-ranking-row span,
.publication-ranking-row b {
  overflow: hidden;
  font-size: 20px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-ranking-row em {
  color: #6F6F6F;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}

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

.publication-match-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(161,161,161,0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.publication-match-card header,
.publication-match-card footer {
  color: #6F6F6F;
  font-size: 14px;
  font-weight: 900;
}

.publication-side {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 52px;
  align-items: center;
  min-height: 52px;
  border-radius: 9px;
  padding: 0 12px;
}

.publication-side span {
  font-size: 12px;
  font-weight: 1000;
}

.publication-side b {
  overflow: hidden;
  color: #0f172a;
  font-size: 20px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-side strong {
  font-size: 22px;
  text-align: right;
}

.publication-side.is-red-side {
  background: linear-gradient(90deg, rgba(211, 58, 48, 0.23), rgba(255, 255, 255, 0.72));
  border-left: 5px solid #d43a30;
}

.publication-side.is-blue-side {
  background: linear-gradient(90deg, rgba(43, 101, 255, 0.22), rgba(255, 255, 255, 0.72));
  border-left: 5px solid #2b65ff;
}

.publication-side.is-red-side span,
.publication-side.is-red-side strong {
  color: #d43a30;
}

.publication-side.is-blue-side span,
.publication-side.is-blue-side strong {
  color: #2b65ff;
}

.publication-tree-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.publication-tree-canvas {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%) scale(var(--publication-tree-scale, 1));
  transform-origin: top center;
}

.publication-tree-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.publication-tree-line {
  fill: none;
  stroke: #4ba35c;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.publication-tree-line.status-completed {
  stroke: #d43a30;
}

.publication-tree-line.status-active {
  stroke: #e6a02c;
}

.publication-tree-root,
.publication-tree-match {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #4ba35c;
  border-radius: 10px;
  color: #111827;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.publication-tree-root {
  left: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
}

.publication-tree-root strong {
  color: #15803d;
  font-size: 25px;
  font-weight: 1000;
}

.publication-tree-root span,
.publication-tree-root em {
  color: #6F6F6F;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
}

.publication-tree-match {
  display: grid;
  grid-template-rows: 22px 1fr 1fr;
  gap: 4px;
  padding: 7px;
}

.publication-tree-match.status-completed {
  border-color: #d43a30;
}

.publication-tree-match.status-active {
  border-color: #e6a02c;
  background: #FAFAFA;
}

.publication-tree-match header {
  overflow: hidden;
  color: #6F6F6F;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-tree-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  min-height: 27px;
  border-radius: 6px;
  padding: 0 9px;
}

.publication-tree-team.is-red-side {
  border-left: 5px solid #d43a30;
  background: linear-gradient(90deg, rgba(212, 58, 48, 0.2), rgba(255, 255, 255, 0.78));
}

.publication-tree-team.is-blue-side {
  border-left: 5px solid #2b65ff;
  background: linear-gradient(90deg, rgba(43, 101, 255, 0.19), rgba(255, 255, 255, 0.78));
}

.publication-tree-team b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 1000;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-tree-team strong {
  font-size: 17px;
  text-align: right;
}

.publication-tree-team.is-red-side strong {
  color: #d43a30;
}

.publication-tree-team.is-blue-side strong {
  color: #2b65ff;
}

.publication-tree-column-title {
  position: absolute;
  top: 0;
  margin: 0;
  color: #3F3F3F;
  font-size: 18px;
  font-weight: 1000;
  text-align: center;
}

.medal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  min-height: 430px;
}

.medal-card {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 300px;
  border-radius: 18px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  opacity: 0.34;
  transform: translateY(18px) scale(0.96);
  transition: 260ms ease;
}

.medal-card.is-revealed {
  opacity: 1;
  transform: none;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.medal-card span {
  font-size: 24px;
  font-weight: 1000;
}

.medal-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 34px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.medal-card em {
  color: rgba(255, 255, 255, 0.66);
  font-style: normal;
  font-weight: 900;
}

.medal-champion {
  min-height: 360px;
  background: linear-gradient(145deg, #f59e0b, #111827 72%);
}

.medal-runner {
  background: linear-gradient(145deg, #A1A1A1, #111827 72%);
}

.medal-third {
  background: linear-gradient(145deg, #b45309, #111827 72%);
}

.publication-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: #6F6F6F;
  font-size: 22px;
  font-weight: 900;
}

.tournament-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 10px;
  align-items: stretch;
}

.team-layout .tournament-config {
  grid-template-columns: minmax(0, 1fr);
}

.team-info-details {
  display: grid;
  gap: 10px;
}

.team-info-details > summary,
.secondary-menu > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: #3F3F3F;
  background: var(--panel-strong);
  font-weight: 1000;
  cursor: pointer;
}

.team-info-details > summary small,
.secondary-menu > summary small {
  color: #6F6F6F;
  font-size: 13px;
  font-weight: 900;
}

.team-info-details[open] > summary {
  margin-bottom: 10px;
}

.team-info-details.is-locked > summary {
  border-color: rgba(245, 158, 11, 0.45);
  background: #F9F9F9;
}

.secondary-menu {
  display: grid;
  gap: 10px;
}

.secondary-menu-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.tournament-team-input,
.tournament-options label {
  display: grid;
  gap: 6px;
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 850;
}

.tournament-team-input textarea,
.tournament-options input,
.tournament-options select {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font: inherit;
}

.tournament-team-input textarea {
  min-height: 156px;
  resize: vertical;
  line-height: 1.35;
}

.tournament-options {
  display: grid;
  gap: 10px;
  align-content: start;
}

.team-logo-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.team-logo-row,
.team-roster-empty {
  display: grid;
  grid-template-columns: 38px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: var(--panel-strong);
}

.team-seed-label {
  display: inline-grid;
  min-width: 34px;
  min-height: 24px;
  place-items: center;
  border-radius: 6px;
  padding: 0 6px;
  color: #1d4ed8;
  background: #EFEFEF;
  font-size: 11px;
  font-weight: 1000;
}

.team-roster-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.team-logo-thumb {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #6F6F6F;
  background: #F2F2F2;
  font-size: 10px;
  font-weight: 900;
}

.team-logo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.team-logo-upload {
  position: relative;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.team-logo-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.team-logo-upload.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.team-logo-upload.is-disabled input {
  cursor: not-allowed;
}

.schedule-table-wrap {
  overflow: auto;
  max-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-table,
.standings-table,
.result-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.schedule-table th,
.schedule-table td,
.standings-table th,
.standings-table td {
  border-bottom: 1px solid #F1F1F1;
  padding: 8px 9px;
  color: #3F3F3F;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.schedule-table th,
.standings-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6F6F6F;
  background: #FAFAFA;
  font-weight: 900;
}

.schedule-table tr.is-current td {
  background: #F4F4F4;
}

.schedule-table tr.status-completed td {
  background: rgba(220, 38, 38, 0.035);
}

.schedule-table tr.status-active td {
  background: rgba(245, 158, 11, 0.08);
}

.schedule-table tr.status-upcoming td {
  background: rgba(127,127,127,0.045);
}

.schedule-table tr.is-current td {
  background: rgba(245, 158, 11, 0.12);
}

.schedule-table tr.is-column-frozen td {
  border-bottom-color: #E7E7E7;
}

.schedule-table tr.is-column-frozen .schedule-drag-handle {
  color: #A1A1A1;
  background: #F4F4F4;
  cursor: not-allowed;
}

.schedule-locked-action {
  color: #6F6F6F;
  font-size: 12px;
  font-weight: 900;
}

.schedule-drag-column {
  display: none;
  width: 46px;
}

.schedule-table.is-reordering .schedule-drag-column {
  display: table-cell;
}

.schedule-drag-handle {
  display: inline-grid;
  place-items: center;
  border: 1px solid #E2E2E2;
  border-radius: 7px;
  width: 30px;
  height: 28px;
  color: #6F6F6F;
  background: #fff;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  cursor: grab;
}

.schedule-table.is-reordering tbody tr {
  cursor: grab;
}

.schedule-table tr.is-dragging td {
  opacity: 0.54;
}

.schedule-table tr.is-drop-target td {
  box-shadow: inset 0 0 0 2px rgba(29, 78, 216, 0.24);
}

.schedule-status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
}

.bracket-board {
  overflow-x: auto;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(29, 78, 216, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(29, 78, 216, 0.035) 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
}

.bracket-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.bracket-tree {
  position: relative;
  width: var(--bracket-width, max-content);
  height: var(--bracket-height, 320px);
  min-width: max-content;
}

.bracket-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: #535353;
  font-size: 12px;
  font-weight: 900;
}

.bracket-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.legend-dot.status-completed {
  background: #dc2626;
}

.legend-dot.status-active {
  background: #f59e0b;
}

.legend-dot.status-upcoming {
  background: #16a34a;
}

.bracket-lines {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.bracket-line {
  fill: none;
  stroke: rgba(22, 163, 74, 0.5);
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2.25;
}

.bracket-line.status-completed {
  stroke: rgba(220, 38, 38, 0.62);
}

.bracket-line.status-active {
  stroke: rgba(245, 158, 11, 0.74);
}

.bracket-line.status-upcoming {
  stroke: rgba(22, 163, 74, 0.58);
}

.bracket-columns {
  position: relative;
  z-index: 1;
  width: var(--bracket-width, 100%);
  height: var(--bracket-height, 320px);
}

.bracket-column {
  position: absolute;
  top: 0;
  width: var(--bracket-column-width, 245px);
  height: var(--bracket-height, 320px);
}

.bracket-column h3 {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  color: #3F3F3F;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.bracket-match-card {
  position: absolute;
  left: 0;
  width: 100%;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 118px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.06),
    inset 0 1px rgba(255, 255, 255, 0.86);
}

.bracket-match-card.status-completed {
  border-color: rgba(220, 38, 38, 0.34);
  background: #F7F7F7;
  box-shadow:
    0 10px 22px rgba(220, 38, 38, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.86);
}

.bracket-match-card.status-active {
  border-color: rgba(245, 158, 11, 0.62);
  background: #FBFBFB;
  box-shadow:
    0 10px 22px rgba(245, 158, 11, 0.12),
    inset 0 1px rgba(255, 255, 255, 0.86);
}

.bracket-match-card.status-upcoming {
  border-color: rgba(22, 163, 74, 0.36);
  background: #FCFCFC;
  box-shadow:
    0 10px 22px rgba(22, 163, 74, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.86);
}

.bracket-match-label,
.bracket-match-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #F1F1F1;
  border-radius: 7px;
  min-height: 30px;
  padding: 5px 7px;
  background: #FCFCFC;
}

.bracket-team.is-winner {
  border-width: 1.5px;
}

.bracket-match-card.status-active .bracket-team {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(251,251,251,0.7);
}

.bracket-match-card.status-upcoming .bracket-team {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(250,250,250,0.66);
}

.bracket-team.is-red-side,
.bracket-match-card.status-active .bracket-team.is-red-side,
.bracket-match-card.status-upcoming .bracket-team.is-red-side {
  border-color: rgba(220, 38, 38, 0.24);
  background:
    linear-gradient(90deg, rgba(220, 38, 38, 0.22), rgba(254, 242, 242, 0.82) 58%, rgba(255, 255, 255, 0.86));
  box-shadow: inset 4px 0 0 #dc2626;
}

.bracket-team.is-blue-side,
.bracket-match-card.status-active .bracket-team.is-blue-side,
.bracket-match-card.status-upcoming .bracket-team.is-blue-side {
  border-color: rgba(37, 99, 235, 0.24);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(239, 246, 255, 0.82) 58%, rgba(255, 255, 255, 0.86));
  box-shadow: inset 4px 0 0 #2563eb;
}

.bracket-team.is-red-side.is-winner {
  border-color: rgba(220, 38, 38, 0.44);
  box-shadow:
    inset 4px 0 0 #dc2626,
    0 0 0 1px rgba(220, 38, 38, 0.12);
}

.bracket-team.is-blue-side.is-winner {
  border-color: rgba(37, 99, 235, 0.44);
  box-shadow:
    inset 4px 0 0 #2563eb,
    0 0 0 1px rgba(37, 99, 235, 0.12);
}

.bracket-team b {
  grid-column: 2;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team strong {
  grid-column: 3;
  min-width: 24px;
  color: #16a34a;
  font-size: 15px;
  font-weight: 950;
  text-align: right;
}

.bracket-team.is-red-side strong,
.bracket-match-card.status-active .bracket-team.is-red-side strong,
.bracket-match-card.status-completed .bracket-team.is-red-side strong {
  color: #dc2626;
}

.bracket-team.is-blue-side strong,
.bracket-match-card.status-active .bracket-team.is-blue-side strong,
.bracket-match-card.status-completed .bracket-team.is-blue-side strong {
  color: #2563eb;
}

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

.trash-item,
.trash-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel-strong);
}

.trash-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.trash-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.trash-meta span,
.trash-meta em,
.trash-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.trash-meta b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-meta em {
  font-style: normal;
}

.score-control-panel {
  order: 1;
}

.timer-control-panel {
  order: 2;
}

.sound-control-panel {
  order: 3;
  grid-column: 1 / -1;
}

.match-settings-panel {
  order: 3;
}

.result-history-panel {
  order: 4;
}

.control-panel {
  padding: 14px;
}

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

.setting-list > * {
  min-width: 0;
}

.setting-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 82px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 5px 5px 10px;
  background: var(--panel-strong);
}

.setting-popover-wrap {
  position: relative;
}

.text-setting-row {
  grid-template-columns: 82px minmax(0, 1fr) 38px 38px;
}

.setting-row.no-toggle {
  grid-template-columns: 82px minmax(0, 1fr);
}

.setting-hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-list-row {
  align-items: start;
}

.team-list-row textarea {
  min-height: 92px;
  resize: vertical;
}

.team-name-setting-row {
  align-items: stretch;
}

.team-name-setting-row > .visibility-toggle {
  align-self: center;
}

.team-autocomplete-wrap {
  position: relative;
  min-width: 0;
}

.team-autocomplete-wrap textarea {
  width: 100%;
}

.team-autocomplete-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  display: none;
  overflow-y: auto;
  max-height: 190px;
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.team-autocomplete-panel.is-open {
  display: grid;
  gap: 3px;
}

.team-autocomplete-option {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: #1f2937;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

.team-autocomplete-option:hover,
.team-autocomplete-option.is-active {
  color: #fff;
  background: #1d4ed8;
}

.setting-row > span:first-child {
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 800;
}

.setting-row input[type="text"],
.setting-row textarea,
.setting-row .row-value,
.hotkey-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  min-height: 32px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.setting-row input[type="text"]:focus,
.setting-row textarea:focus,
.hotkey-input:focus {
  border-color: #3d72e0;
  box-shadow: 0 0 0 3px rgba(35, 98, 223, 0.14);
}

.carousel-editor-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-strong);
}

.carousel-editor-panel > .ghost-button {
  min-height: 36px;
  font-size: 14px;
}

.carousel-editor {
  display: grid;
  gap: 8px;
}

.carousel-item-row {
  display: grid;
  grid-template-columns: 42px minmax(136px, 0.9fr) minmax(158px, 1.28fr) 94px 54px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-strong);
}

.carousel-item-row.is-dragging {
  opacity: 0.58;
}

.carousel-item-row select,
.carousel-item-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  min-height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.carousel-item-row select {
  height: 36px;
  padding-right: 28px;
  font-style: normal;
  font-weight: 800;
}

.carousel-drag-button {
  min-width: 0;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
}

.carousel-duration-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.carousel-duration-field input {
  text-align: center;
}

.danger-button {
  color: #b42318;
}

.setting-row textarea {
  min-height: 54px;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.3;
  resize: none;
}

.mono-input,
.hotkey-input {
  font-variant-numeric: tabular-nums;
}

.mode-row {
  grid-template-columns: 92px minmax(0, 1fr);
}

.fit-row {
  grid-template-columns: 92px minmax(0, 1fr);
}

.mode-toggle,
.fit-toggle {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mode-toggle {
  grid-template-columns: 1fr 1fr;
}

.fit-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.mode-toggle button,
.fit-toggle button {
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  min-height: 32px;
  padding: 0 7px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.mode-toggle button.is-active,
.fit-toggle button.is-active {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.safe-area-row {
  grid-template-columns: 82px repeat(4, minmax(0, 1fr));
}

.safe-area-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.safe-area-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  min-height: 32px;
  padding: 0 6px;
  color: var(--ink);
  background: #fff;
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.safe-area-row.is-disabled {
  opacity: 0.54;
}

.timer-setting-row {
  grid-template-columns: 82px minmax(0, 1fr) 92px;
}

.timer-setting-row input:last-child {
  text-align: center;
}

.file-row {
  grid-template-columns: 82px minmax(88px, 1fr) minmax(44px, auto) minmax(44px, auto) 38px;
}

.background-row {
  grid-template-columns: 82px minmax(88px, 1fr) minmax(44px, auto) minmax(44px, auto);
}

.file-button {
  position: relative;
  min-height: 32px;
  padding: 0 9px;
  color: #3F3F3F;
  background: #fff;
  font-size: 12px;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.row-value {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.setting-row .ghost-button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.icon-button.is-off {
  color: #A1A1A1;
  background: #F4F4F4;
}

.text-style-toggle {
  color: #6F6F6F;
}

.text-style-toggle.is-active {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.text-style-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: none;
  width: min(100%, 560px);
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

.text-style-popover.is-open {
  display: block;
}

.text-style-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 54px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #D4D4D4;
  border-left: 1px solid #D4D4D4;
  background: #fff;
  transform: rotate(45deg);
}

.score-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score-sound-grid {
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 8px;
}

.score-lock-notice {
  display: none;
  margin: -2px 0 10px;
  border: 1px solid #f6c76f;
  border-radius: 7px;
  padding: 8px 10px;
  color: #8a5200;
  background: #F7F7F7;
  font-size: 13px;
  font-weight: 850;
}

.score-lock-notice.is-visible {
  display: block;
}

.score-control-panel.is-score-locked .score-control,
.score-control-panel.is-score-locked .game-win-side,
.score-control-panel.is-score-locked .own-goal-grid {
  opacity: 0.68;
}

.own-goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.score-match-format,
.game-win-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.match-stage-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.match-stage-selector.is-hidden {
  display: none;
}

.match-stage-selector button {
  min-height: 36px;
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 950;
}

.match-stage-selector button.is-active {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.score-option-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: #3F3F3F;
  background: var(--panel-strong);
  font-size: 13px;
  font-weight: 850;
}

.timer-prestart-toggle {
  margin-top: 8px;
}

.low-performance-mode .switch-track,
.low-performance-mode .switch-track span,
.low-performance-mode .medal-card {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

.low-performance-mode .score-value.is-score-up .score-effect-shell,
.low-performance-mode .score-value.is-score-down .score-effect-shell {
  text-shadow: none !important;
}

.low-performance-mode .score-value.is-score-up .score-roll-column.is-changing .score-roll-track {
  animation: scoreRollTrackUpLite 150ms linear forwards;
}

.low-performance-mode .score-value.is-score-down .score-roll-column.is-changing .score-roll-track {
  animation: scoreRollTrackDownLite 140ms linear forwards;
}

.low-performance-mode .team-card,
.low-performance-mode .custom-message,
.low-performance-mode .screen-upcoming-matches {
  backdrop-filter: none;
}

.low-performance-mode .stage-bg img {
  filter: none;
}

.game-win-control.is-hidden {
  display: none;
}

.game-win-side {
  display: grid;
  grid-template-columns: 38px minmax(46px, 1fr) 38px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-strong);
}

.game-win-side strong {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.red-win-side {
  border-color: rgba(223, 63, 50, 0.22);
  background: rgba(223, 63, 50, 0.045);
}

.blue-win-side {
  border-color: rgba(35, 98, 223, 0.22);
  background: rgba(35, 98, 223, 0.055);
}

.hold-win-button {
  position: relative;
  overflow: hidden;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #535353;
  font-size: 20px;
  font-weight: 1000;
  cursor: pointer;
}

.hold-win-button::after {
  display: none;
}

.red-win-side .hold-win-button {
  background: var(--red);
}

.blue-win-side .hold-win-button {
  background: var(--blue);
}

.hold-win-button.is-holding {
  box-shadow: 0 0 0 3px rgba(35, 98, 223, 0.14);
}

.own-goal-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.own-goal-grid input,
.score-match-format select,
.game-win-control input {
  width: 100%;
  min-width: 0;
  border: 1px solid #E2E2E2;
  border-radius: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.game-win-control input {
  text-align: center;
  font-weight: 950;
}

.score-match-format label,
.game-win-control label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.score-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.red-control {
  border-color: rgba(223, 63, 50, 0.28);
  background: var(--red-soft);
}

.blue-control {
  border-color: rgba(35, 98, 223, 0.26);
  background: var(--blue-soft);
}

.score-control-title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 950;
  text-align: center;
}

.red-control .score-control-title,
.red-control .score-edit-input {
  color: var(--red);
}

.blue-control .score-control-title,
.blue-control .score-edit-input {
  color: var(--blue);
}

.score-control-grid {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 8px;
}

.score-edit-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--font-main);
  font-size: 54px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;
}

.score-edit-input:focus {
  border-color: currentColor;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 98, 223, 0.13);
}

.score-edit-input.is-score-up {
  animation: controlScoreFlash 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.score-edit-input.is-score-down {
  animation: controlScoreDip 340ms ease-out;
}

.score-edit-input::-webkit-outer-spin-button,
.score-edit-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.score-button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.red-control .score-button {
  background: var(--red);
}

.blue-control .score-button {
  background: var(--blue);
}

@keyframes scoreWholeHit {
  0% {transform:translate3d(0,0,0) scale(1);}
  12% {transform:translate3d(-.085em,-.03em,0) scale(1.095);}
  28% {transform:translate3d(.078em,.024em,0) scale(1.045);}
  44% {transform:translate3d(-.055em,-.012em,0) scale(1.028);}
  62% {transform:translate3d(.035em,.008em,0) scale(1.014);}
  80% {transform:translate3d(-.018em,0,0) scale(1.004);}
  100% {transform:translate3d(0,0,0) scale(1);}
}

@keyframes carouselSlideUp {
  0% {
    opacity: 0;
    transform: translateY(72%);
  }
  58% {
    opacity: 1;
    transform: translateY(-8%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes carouselOldSlideUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-82%);
  }
}

@keyframes scoreWholeDip {
  0% {transform:translate3d(0,0,0) scale(1);}
  18% {transform:translate3d(0,.075em,0) scale(.955);}
  42% {transform:translate3d(0,-.035em,0) scale(1.02);}
  68% {transform:translate3d(0,.018em,0) scale(.992);}
  100% {transform:translate3d(0,0,0) scale(1);}
}

@keyframes scoreWholeHitLite {
  0% {transform:translate3d(0,0,0) scale(1);}
  12% {transform:translate3d(-.085em,-.03em,0) scale(1.095);}
  28% {transform:translate3d(.078em,.024em,0) scale(1.045);}
  44% {transform:translate3d(-.055em,-.012em,0) scale(1.028);}
  62% {transform:translate3d(.035em,.008em,0) scale(1.014);}
  80% {transform:translate3d(-.018em,0,0) scale(1.004);}
  100% {transform:translate3d(0,0,0) scale(1);}
}

@keyframes scoreWholeDipLite {
  0% {transform:translate3d(0,0,0) scale(1);}
  18% {transform:translate3d(0,.075em,0) scale(.955);}
  42% {transform:translate3d(0,-.035em,0) scale(1.02);}
  68% {transform:translate3d(0,.018em,0) scale(.992);}
  100% {transform:translate3d(0,0,0) scale(1);}
}

@keyframes scoreRollTrackUpLite {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -1.04em, 0);
  }
}

@keyframes scoreRollTrackDownLite {
  from {
    transform: translate3d(0, -1.04em, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scoreRollTrackUp {
  0% {
    transform: translate3d(0, 0, 0);
  }
  18% {
    transform: translate3d(0, -0.18em, 0);
  }
  40% {
    transform: translate3d(0, -0.48em, 0);
  }
  66% {
    transform: translate3d(0, -0.82em, 0);
  }
  88% {
    transform: translate3d(0, -1.08em, 0);
  }
  100% {
    transform: translate3d(0, -1.04em, 0);
  }
}

@keyframes scoreRollTrackDown {
  0% {
    transform: translate3d(0, -1.04em, 0);
  }
  18% {
    transform: translate3d(0, -0.86em, 0);
  }
  40% {
    transform: translate3d(0, -0.56em, 0);
  }
  66% {
    transform: translate3d(0, -0.22em, 0);
  }
  88% {
    transform: translate3d(0, 0.04em, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes controlScoreFlash {
  0%,
  100% {
    filter: brightness(1);
    transform: translateX(0);
  }
  22% {
    filter: brightness(1.3) drop-shadow(0 0 10px currentColor);
    transform: translateX(-1px);
  }
  38% {
    transform: translateX(2px);
  }
  54% {
    transform: translateX(-1px);
  }
}

@keyframes controlScoreDip {
  0%,
  100% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(2px);
  }
}

.result-history-panel {
  overflow: hidden;
}

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

.result-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 12px;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid #F1F1F1;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #3F3F3F;
  background: #FAFAFA;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.result-table td {
  color: #1f2937;
  font-weight: 700;
}

.result-table td:first-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

.result-table td:last-child {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.result-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.result-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.result-dialog-card {
  display: grid;
  gap: 16px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: #172033;
  background: #fff;
}

.result-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-dialog-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-dialog-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.icon-close-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #6F6F6F;
  background: #FAFAFA;
  font: 700 22px/1 Arial, sans-serif;
  cursor: pointer;
}

.result-save-preview,
.result-detail-summary {
  display: grid;
  gap: 5px;
  border: 1px solid #E2E2E2;
  border-radius: 8px;
  padding: 14px;
  background: #F9F9F9;
}

.result-save-preview span,
.result-detail-summary span,
.result-detail-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.result-save-preview strong,
.result-detail-summary > strong {
  font-size: 20px;
  line-height: 1.3;
}

.result-save-preview em {
  color: #535353;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.result-note-field {
  display: grid;
  gap: 7px;
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 900;
}

.result-note-field textarea {
  resize: vertical;
  min-height: 86px;
  border: 1px solid #D7D7D7;
  border-radius: 8px;
  padding: 10px 12px;
  color: #172033;
  background: #fff;
  font: inherit;
  line-height: 1.5;
}

.result-save-time-note {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.result-detail-content {
  display: grid;
  gap: 12px;
}

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

.result-detail-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.result-detail-grid span,
.result-detail-note > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.result-detail-grid strong {
  font-size: 15px;
}

.red-detail { color: var(--red); }
.blue-detail { color: var(--blue); }

.result-detail-note {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.result-detail-note p {
  margin: 0;
  color: #3F3F3F;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
  white-space: pre-wrap;
}

.hotkey-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.hotkey-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hotkey-input {
  min-height: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.hotkey-input.is-conflict {
  border-color: #e22d2d;
  color: #b42318;
  background: #F4F4F4;
}

.text-style-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.text-style-title span {
  color: #3F3F3F;
  font-size: 14px;
  font-weight: 950;
}

.text-style-title .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

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

.text-style-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.text-style-grid input {
  width: 100%;
  min-width: 0;
  border: 1px solid #D4D4D4;
  border-radius: 7px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.text-style-grid input[type="color"] {
  padding: 3px;
}

.sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.sound-setting-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 8px;
}

.sound-card {
  display: grid;
  grid-template-columns: auto 24px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-strong);
  color: #3F3F3F;
  font-weight: 800;
}

.sound-setting-toggle,
.sound-preview-button {
  color: #6F6F6F;
}

.sound-setting-toggle.is-active,
.sound-preview-button.is-previewing {
  border-color: #1d4ed8;
  color: #fff;
  background: #1d4ed8;
}

.sound-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.sound-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 20px;
}

.sound-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 7px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.sound-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 11px;
  height: 16px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 14px 14px 0;
}

.sound-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 45;
  display: none;
  width: min(360px, calc(100vw - 48px));
  border: 1px solid #D4D4D4;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

.sound-popover.is-open {
  display: grid;
  gap: 10px;
}

.sound-popover::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid #D4D4D4;
  border-bottom: 1px solid #D4D4D4;
  background: #fff;
  transform: rotate(45deg);
}

.sound-popover-title,
.sound-upload-row,
.sound-gain-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sound-popover-title span {
  color: #3F3F3F;
  font-size: 14px;
  font-weight: 950;
}

.sound-popover-title .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.sound-file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-gain-control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.sound-gain-control b {
  color: #3F3F3F;
  font-weight: 950;
}

.sound-gain-control input {
  width: 100%;
  accent-color: #1d4ed8;
}

.display-only {
  display: none;
}

.publication-display-only {
  display: none;
}

body.publication-display-mode {
  overflow: hidden;
  background: #F7F7F7;
}

body.publication-display-mode .app-shell > :not(.publication-display-only) {
  display: none !important;
}

body.publication-display-mode .publication-display-only {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  padding: clamp(18px, 3vw, 48px);
  box-sizing: border-box;
}

body.publication-display-mode .publication-display-only.is-scrollable-publication {
  overflow: hidden;
}

.publication-display-stage.publication-stage {
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  transform: scale(var(--publication-fit-scale, 1));
  transform-origin: top center;
}

body.publication-display-mode .publication-display-stage.is-list-view,
body.publication-display-mode .publication-display-stage.is-tree-view {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  transform: none;
}

body.publication-display-mode .publication-display-stage.is-list-view {
  overflow-y: auto;
}

body.publication-display-mode .display-fullscreen-button {
  position: fixed;
  opacity: 0.72;
}

body.display-mode {
  overflow: hidden;
  background: #05070c;
}

body.display-mode .operator-only {
  display: none !important;
}

body.display-mode .display-only {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #05070c;
}

body.display-mode .display-stage {
  width: 100vw;
  height: 100vh;
  max-height: 56.25vw;
  max-width: 177.777vh;
}

body.display-mode .display-stage.fit-fill,
body.display-mode .display-stage.fit-safe {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
}

body.display-mode .display-stage.fit-fill .stage-content {
  top: 50%;
  left: 50%;
  width: min(100vw, 177.777vh);
  height: min(100vh, 56.25vw);
  transform: translate(-50%, -50%);
}

body.display-mode .display-stage.fit-safe .stage-content {
  inset: var(--safe-top, 6%) var(--safe-right, 6%) var(--safe-bottom, 6%) var(--safe-left, 6%);
  transform: none;
}

.display-fullscreen-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.display-stage:hover .display-fullscreen-button {
  opacity: 1;
}

.display-stage.is-display-fullscreen .display-fullscreen-button,
.display-fullscreen-button.is-fullscreen {
  opacity: 0.86;
}

@media (max-width: 1180px) {
  body:not(.display-mode) {
    overflow: auto;
  }

  body:not(.display-mode) .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .operator-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .control-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }

  .preview-panel {
    position: relative;
    max-height: none;
    overflow: visible;
  }

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

@media (max-width: 780px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-brand-cluster {
    align-items: stretch;
    flex-direction: column;
  }

  .project-switcher {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .operator-layout {
    padding: 0 14px 18px;
  }

  .control-stack,
  .score-controls,
  .pinned-controls,
  .sound-grid {
    grid-template-columns: 1fr;
  }

  .match-nav-panel,
  .match-nav-actions,
  .result-detail-grid {
    grid-template-columns: 1fr;
  }

  .scoredesk-source-control {
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 8px;
  }

  .result-actions {
    justify-content: flex-start;
  }

	  .setting-row,
	  .text-setting-row,
	  .file-row,
	  .background-row,
	  .mode-row,
	  .fit-row,
	  .safe-area-row,
	  .timer-setting-row,
	  .carousel-item-row {
	    grid-template-columns: 1fr;
	  }

  .fit-toggle,
  .safe-area-row label {
    grid-template-columns: 1fr;
  }

  .text-style-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .text-style-popover::before {
    display: none;
  }

  .setting-row > span:first-child {
    grid-column: auto;
  }

  .file-row .ghost-button {
    grid-column: auto;
  }

  .icon-button {
    justify-self: start;
  }
}

/* Only shown if the local score checkpoint cannot be written. */
.local-score-save-warning:not([hidden]) { padding: 10px 14px; background: #fff1cf; color: #663c00; border: 1px solid #b87900; border-radius: 8px; }

/* Finite local score feedback; reduced motion retains a quiet visible acknowledgement. */
@keyframes scoreAcknowledged {from {opacity:.65;} to {opacity:1;}}
@media (prefers-reduced-motion:reduce) {
  .score-value.is-score-up .score-effect-shell,
  .score-value.is-score-down .score-effect-shell,
  .low-performance-mode .score-value.is-score-up .score-effect-shell,
  .low-performance-mode .score-value.is-score-down .score-effect-shell {animation:scoreAcknowledged 140ms ease-out;will-change:opacity;}
}

/* 061: make the team name itself identify the side. Existing score controls remain intact. */
.red-card .team-name{color:#ffe0e0}.blue-card .team-name{color:#d8e8ff}
