:root {
  color-scheme: light;
  --ink: #222338;
  --muted: #64677a;
  --line: #e3e3ec;
  --violet: #6842e8;
  --lilac: #f0ecff;
  --lime: #cee987;
  --page: #f7f8fc;
  font-family: Inter, 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: 0;
  font-weight: 700;
}
button,
select,
input,
textarea {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8d78fa;
  outline-offset: 3px;
}
button:not(:disabled):hover {
  filter: brightness(0.955);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2,
h3 {
  line-height: 1.35;
}
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  flex: none;
}
i[data-icon] svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sitebar {
  height: 58px;
  flex: none;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.sitebar-inner {
  width: 100%;
  padding-inline: clamp(12px, 2vw, 32px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand,
.tools,
.brand-section,
.section-title,
.field-cap,
.field-cap h3,
.match-buttons,
.dialog-head,
.dialog-foot,
.editor-tools {
  display: flex;
  align-items: center;
}
.brand {
  text-decoration: none;
  color: inherit;
  gap: 11px;
  white-space: nowrap;
}
.brand b {
  font-size: 22px;
  letter-spacing: -1.6px;
  font-weight: 900;
}
.brand-line {
  height: 18px;
  width: 1px;
  background: #dddde5;
  margin: 0 4px;
}
.brand-section {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 650;
  color: #666779;
  letter-spacing: -0.5px;
}
.tools {
  gap: 8px;
}
.tool,
.secondary {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  min-height: 36px;
  padding: 6px 12px;
  color: #424457;
  font-size: 14px;
  letter-spacing: -0.35px;
}
.tool i,
.secondary i {
  font-size: 17px;
}
.shell {
  width: 100%;
  min-height: 0;
  flex: 1;
  display: grid;
  padding: clamp(5px, 0.8vw, 12px);
}
.stripes {
  display: inline-block;
  transform: skew(-22deg);
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}
.panel {
  background: white;
  border: 1px solid #dedee9;
  border-radius: 18px;
  box-shadow: 0 3px 9px #22223d05;
  min-width: 0;
}
.section-title {
  gap: 10px;
}
.section-title > i {
  color: var(--violet);
  font-size: 21px;
}
.section-title h1,
.section-title h2,
.dialog h2 {
  font-size: 19px;
  letter-spacing: -0.9px;
  font-weight: 850;
}
.subtle,
.edit {
  background: transparent;
  min-height: 32px;
  font-size: 13px;
  color: #605e77;
  gap: 6px;
  padding: 2px 5px;
}
.subtle i,
.edit i {
  font-size: 16px;
}
.muted {
  color: #6a697b;
}
.icon-button {
  height: 33px;
  width: 33px;
  border-radius: 8px;
  font-size: 18px;
}
.icon-button:hover {
  background: var(--lilac);
}
.arena-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.stage {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background-color: #eae7fa;
  background-image:
    radial-gradient(ellipse at 52% 37%, #f7f5ffb8, transparent 69%),
    linear-gradient(#8b75c81b 1px, transparent 1px), linear-gradient(90deg, #8b75c81b 1px, transparent 1px);
  background-size:
    100% 100%,
    24px 24px,
    24px 24px;
}
.stage:before,
.stage:after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: 35%;
  aspect-ratio: 1;
  transform: rotate(39deg);
  border: 1px solid #9c8cc13f;
  border-radius: 18%;
  box-shadow:
    0 0 0 12px #d3cce8,
    0 0 0 15px #e6e1f4,
    0 0 0 22px #dcd6ee;
  z-index: -1;
}
.stage:before {
  left: -23%;
  top: -36%;
}
.stage:after {
  right: -27%;
  bottom: -39%;
}
.stage-lines {
  position: absolute;
  inset: 11px;
  border: 1px solid #c7bfdf66;
  border-radius: 4px;
  pointer-events: none;
  clip-path: polygon(
    0 0,
    16% 0,
    16% 1%,
    0.3% 1%,
    0.3% 10%,
    0 10%,
    0 0,
    100% 0,
    100% 10%,
    99.7% 10%,
    99.7% 0.5%,
    88% 0.5%,
    88% 0,
    100% 0,
    100% 100%,
    83% 100%,
    83% 99.5%,
    99.7% 99.5%,
    99.7% 90%,
    100% 90%,
    100% 100%,
    0 100%,
    0 90%,
    0.3% 90%,
    0.3% 99.5%,
    15% 99.5%,
    15% 100%,
    0 100%
  );
}
#arena {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.hud {
  position: absolute;
  top: 12px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  min-height: 40px;
  z-index: 3;
}
.hud > span {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fffffff2;
  border: 1px solid #d8d3e8;
  border-radius: 7px;
  min-height: 27px;
  padding: 3px 9px;
  color: #4e4a64;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 3px #37245809;
}
#phaseBadge b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8d79d1;
}
.playing #phaseBadge b {
  background: #599800;
}
.paused #phaseBadge b {
  background: #d7742a;
}
.survivors i {
  color: #71668c;
  font-size: 14px;
}
.survivors strong {
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
}
.stage-decal {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 17px;
  bottom: 12px;
  color: #746a92;
  letter-spacing: 1.8px;
  font:
    800 10px/1.3 Arial,
    sans-serif;
  letter-spacing: 1.6px;
  pointer-events: none;
}
.decal-dot {
  display: block;
  width: 7px;
  height: 7px;
  border: 1.6px solid currentColor;
  transform: rotate(45deg);
}
.stripes {
  position: absolute;
  width: 47px;
  height: 8px;
  right: 18px;
  bottom: 14px;
  color: #a99fc9;
}
.camera-caption {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 7px;
  background: #24243fdf;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.stage:has(.camera-caption:not([hidden])) .stripes {
  visibility: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.match-buttons {
  gap: 5px;
  flex: none;
}
.count-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgb(17 15 34 / 77%);
  z-index: 2;
}
.count-layer span {
  color: #fff;
  font-size: clamp(72px, 16vmin, 160px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-weight: 950;
  text-shadow:
    0 5px 0 #493377,
    0 9px 22px #211a4a80;
}
.paused .count-layer span {
  border-radius: 14px;
  background: #231e43dc;
  padding: 10px 23px;
  font-size: 24px;
  letter-spacing: -1px;
  text-shadow: none;
}
.paused .count-layer {
  background: rgb(24 21 43 / 42%);
}
.setup-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 19px 20px 20px;
}
.field-cap {
  justify-content: space-between;
  gap: 10px;
}
.field-cap h3 {
  gap: 7px;
  font-size: 15px;
  letter-spacing: -0.55px;
  font-weight: 800;
}
.field-cap h3 i {
  color: #716d86;
  font-size: 16px;
}
.qty {
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--lilac);
  color: #6847cf;
  min-width: 23px;
  height: 22px;
  padding-inline: 5px;
  font:
    bold 13px/1 Arial,
    sans-serif;
}
.edit {
  border: 1px solid #dcdce6;
  padding: 2px 8px;
  border-radius: 7px;
  min-height: 27px;
  font-size: 12px;
}
.edit i {
  font-size: 13px;
}
.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
  max-height: 163px;
  overflow: auto;
  scrollbar-width: thin;
}
.roster-empty {
  font-size: 14px;
  color: var(--muted);
  grid-column: 1/-1;
  padding: 7px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid #e9e7ef;
  border-radius: 9px;
  padding: 5px 7px;
  min-height: 35px;
  background: #faf9fd;
}
.chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.45px;
}
.top-icon {
  --top: #9367ff;
  display: inline-block;
  width: 25px;
  height: 25px;
  flex: none;
  position: relative;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 9deg,
    color-mix(in srgb, var(--top), #221638 28%) 0 10deg,
    var(--top) 11deg 35deg,
    color-mix(in srgb, var(--top), white 58%) 36deg 45deg
  );
  clip-path: polygon(
    20% 7%,
    42% 8%,
    54% 0,
    75% 8%,
    81% 18%,
    94% 22%,
    100% 46%,
    90% 61%,
    92% 76%,
    70% 93%,
    54% 92%,
    44% 100%,
    24% 89%,
    19% 76%,
    7% 71%,
    0 48%,
    9% 35%,
    8% 21%
  );
  box-shadow: inset 0 0 0 2px #30234550;
  vertical-align: middle;
}
.top-icon:before,
.top-icon:after {
  content: '';
  position: absolute;
  inset: 19%;
  border-radius: 50%;
  border: 1.4px solid #fffc;
  background: color-mix(in srgb, var(--top), white 25%);
  box-shadow: 0 0 0 1.3px #33235280;
}
.top-icon:after {
  inset: 35%;
  border: 1px solid #fff9;
  background: #f8f6ff;
  box-shadow: 0 0 0 1px #3e365d55;
}
.top-icon[data-pattern='bolt'] {
  transform: rotate(25deg);
}
.top-icon[data-pattern='orbit']:before {
  border-style: double;
  border-width: 3px;
}
.avatar {
  object-fit: cover;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--top, #7954e6);
  flex: none;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  width: 100%;
  margin: 17px 0;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid #e0dfe9;
  border-radius: 8px;
  overflow: hidden;
  height: 32px;
}
.stepper button {
  width: 31px;
  height: 100%;
  font-size: 18px;
  color: #646377;
}
.stepper output {
  display: block;
  min-width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}
.speed-field {
  margin: 16px 0 9px;
}
.field-cap small {
  font-size: 12px;
  color: var(--muted);
}
.segments {
  display: flex;
  gap: 3px;
  border-radius: 9px;
  background: #f0eff5;
  padding: 3px;
}
.segments button {
  flex: 1;
  padding: 6px 0;
  font-size: 13px;
  border-radius: 6px;
  color: #696779;
}
.segments button[aria-pressed='true'] {
  background: white;
  box-shadow: 0 1px 4px #322c5719;
  color: #6140c9;
}
.primary {
  background: var(--violet);
  color: white;
  border-radius: 10px;
  padding: 11px 20px;
  min-height: 42px;
  letter-spacing: -0.45px;
}
.race-controls {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: calc(100% - 220px);
}
.race-controls .secondary {
  min-height: 40px;
  box-shadow: 0 2px 8px #22223a20;
  white-space: nowrap;
}
.start {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 8px 22px;
  min-width: 134px;
  min-height: 40px;
  max-width: min(40vw, 360px);
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 850;
  background: linear-gradient(100deg, #7250eb, #6340dd);
  box-shadow: 0 3px 7px #6842e822;
}
.options-link {
  align-self: flex-start;
  margin-top: 18px;
}
.start:after {
  content: '';
  position: absolute;
  right: -6px;
  top: 0;
  height: 100%;
  width: 44px;
  transform: skew(-23deg);
  background: repeating-linear-gradient(90deg, transparent 0 8px, #ffffff0c 8px 13px);
  z-index: -1;
}
.start i {
  font-size: 16px;
}
.start i svg {
  fill: currentColor;
}
body.expanded-view {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}
.expanded-view .shell,
:fullscreen .shell {
  padding: 0;
}
.expanded-view .arena-panel,
:fullscreen .arena-panel {
  border: 0;
  border-radius: 0;
}
.result {
  --result-inset: clamp(20px, 4vw, 40px);
  width: min(880px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e2daef;
  border-radius: 28px;
  box-shadow: 0 24px 90px #24133542;
}
.result[open] {
  display: flex;
  flex-direction: column;
}
.result::backdrop {
  background: #251a3d83;
  backdrop-filter: blur(4px);
}
.result-header,
.result-heading {
  display: flex;
  align-items: center;
}
.result-header {
  flex: none;
  justify-content: space-between;
  padding: clamp(12px, 2.8dvh, 24px) var(--result-inset) 10px;
}
.result-heading {
  gap: 10px;
  color: #453e5b;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.result-heading i {
  color: var(--violet);
  font-size: 1.18em;
}
#closeResult {
  width: 44px;
  height: 44px;
  margin-right: -8px;
  font-size: 23px;
  color: #696179;
}
.result-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline: var(--result-inset);
}
.result-scroll:focus-visible {
  outline: 2px solid #a08adf;
  outline-offset: -3px;
}
.result-board {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(16px, 3dvh, 30px);
  min-height: clamp(208px, 32dvh, 320px);
  padding: clamp(20px, 4dvh, 40px) clamp(14px, 3vw, 32px);
  border: 1px solid #e4d9f6;
  border-radius: 20px;
  background: #f4effe;
  text-align: center;
}
.result h2 {
  color: #50349f;
  font-size: clamp(29px, 4vw, 51px);
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
#winners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 144px), 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}
.winner-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: 16px 10px;
  border: 1px solid #e9e0f6;
  border-radius: 15px;
  background: #fff;
}
.winner-card .name {
  min-width: 0;
  max-width: 100%;
  color: #393047;
  font-size: clamp(19px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.winner-card .avatar,
.winner-card .top-icon {
  width: clamp(64px, 8vw, 96px);
  height: auto;
  aspect-ratio: 1;
}
.winner-card .avatar {
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--top, #9c83ce);
}
.result[data-layout='single'] .winner-card {
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}
.result[data-layout='single'] .avatar,
.result[data-layout='single'] .top-icon {
  width: clamp(100px, min(18vw, 24dvh), 164px);
}
.result[data-layout='single'] .name,
.result[data-name-in-title] h2 {
  color: #50349f;
  font-size: clamp(36px, 5.5vw, 72px);
}
.result[data-name-in-title] #winners {
  order: -1;
}
.result[data-name-in-title] .name {
  display: none;
}
.result[data-long-title] h2 {
  font-size: clamp(22px, 3vw, 36px);
}
.result-actions {
  display: grid;
  flex: none;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  padding: clamp(14px, 3dvh, 26px) var(--result-inset) clamp(17px, 3dvh, 28px);
  background: white;
}
.result-actions button {
  min-width: 0;
  min-height: clamp(48px, 7dvh, 64px);
  padding: 8px 12px;
  border-radius: 13px;
  font-size: clamp(16px, 1.8vw, 21px);
}
.dialog {
  padding: 0;
  border: 1px solid #dbd9e5;
  border-radius: 17px;
  box-shadow: 0 26px 90px #25203a30;
  width: min(650px, calc(100vw - 24px));
  max-height: min(87dvh, 850px);
  overflow: auto;
}
.dialog[open] {
  display: flex;
  flex-direction: column;
}
.dialog::backdrop {
  background: #201b3e73;
}
.dialog-head,
.dialog-foot {
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px;
  flex: none;
}
.dialog-head {
  border-bottom: 1px solid var(--line);
}
.dialog-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fcfbff;
}
.dialog-scroll {
  overflow: auto;
  padding: 18px 21px;
}
.compact {
  width: min(410px, calc(100vw - 24px));
}
.dialog form {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dialog input:not([type='checkbox']):not([type='range']):not([type='color']),
.dialog textarea,
.dialog select {
  border: 1px solid #d8d7e2;
  background: #fff;
  border-radius: 7px;
  padding: 7px 9px;
  min-width: 0;
}
.dialog textarea {
  width: 100%;
  resize: vertical;
}
.editor-tools {
  justify-content: space-between;
  gap: 8px;
}
.editor-tools label {
  font-size: 15px;
  font-weight: 750;
}
.editor-tools input {
  width: 55px;
  margin-left: 6px;
}
.editor-tools small,
.hint {
  color: var(--muted);
}
.hint,
.notice {
  font-size: 13px;
  line-height: 1.6;
}
.hint {
  margin: 9px 0;
}
.notice:not(:empty) {
  background: #fff7df;
  color: #76540e;
  padding: 7px 9px;
  margin-block: 7px;
  border-radius: 6px;
}
.bulk {
  background: #f5f3fc;
  border-radius: 9px;
  margin-top: 12px;
  padding: 10px;
}
.bulk label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}
.bulk button {
  margin-top: 5px;
}
.entry-row {
  display: grid;
  grid-template-columns: 38px minmax(80px, 1fr) 36px 76px 30px;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px solid #edeaf3;
}
.photo-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #f1eef8;
  border-radius: 9px;
  overflow: hidden;
  font-size: 17px;
}
.photo-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.photo-remove {
  padding: 2px;
  color: #785464;
  font-size: 11px;
}
.entry-row input[type='color'] {
  border: 1px solid var(--line);
  width: 34px;
  height: 33px;
  background: white;
  border-radius: 7px;
  padding: 3px;
}
.entry-row select {
  font-size: 13px;
}
.add {
  margin-top: 12px;
}
.option-fields {
  display: grid;
  gap: 11px;
}
.option-fields label {
  font-size: 14px;
  font-weight: 750;
}
.option-fields input:not([type='checkbox']) {
  display: block;
  margin-top: 5px;
  width: 100%;
}
.option-fields .hint {
  margin: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.check input {
  accent-color: var(--violet);
  width: 18px;
  height: 18px;
}
.sound-fields {
  display: grid;
  gap: 20px;
}
.sound-row {
  display: grid;
  grid-template-columns: 1fr auto 42%;
  align-items: center;
  gap: 7px;
}
.sound-row label[for] {
  font-size: 12px;
  color: var(--muted);
}
.sound-row input[type='range'] {
  width: 100%;
  accent-color: var(--violet);
}
#confirmText {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.65;
}
#toast {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 9px;
  padding: 11px 16px;
  background: #2b2641;
  color: #fff;
  font-size: 14px;
  width: max-content;
  max-width: 90vw;
}
@media (max-width: 760px) {
  .sitebar {
    height: 50px;
  }
  .sitebar-inner {
    padding-inline: 12px;
  }
  .shell {
    padding: 4px;
  }
  .brand {
    gap: 7px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .brand b {
    font-size: 19px;
  }
  .brand-line {
    display: none;
  }
  .brand {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 7px;
    row-gap: 0;
    line-height: 1.1;
  }
  .brand img {
    grid-row: span 2;
  }
  .brand-section {
    font-size: 12px;
  }
  .tool {
    padding: 7px;
    font-size: 13px;
    min-height: 33px;
  }
  .tools {
    gap: 6px;
  }
  .section-title {
    gap: 6px;
  }
  .race-controls {
    top: 8px;
    max-width: calc(100% - 190px);
  }
  .race-controls .start {
    min-width: 96px;
    padding: 7px 12px;
    font-size: 14px;
  }
  .race-controls .secondary {
    padding: 5px 7px;
    font-size: 13px;
    min-height: 36px;
  }
  .panel {
    border-radius: 14px;
  }
  .section-title h2 {
    font-size: 17px;
  }
  .hud {
    top: 9px;
    left: 9px;
    right: 9px;
    min-height: 36px;
  }
  .hud > span {
    font-size: 11px;
    padding: 2px 6px;
    min-height: 24px;
  }
  .stage-decal {
    left: 11px;
    bottom: 8px;
    font-size: 9px;
  }
  .stripes {
    right: 11px;
    bottom: 10px;
  }
  .roster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 125px;
  }
  .chip {
    gap: 4px;
    padding: 4px;
  }
  .top-icon {
    width: 23px;
    height: 23px;
  }
  .setup-body {
    padding: 14px 16px 16px;
  }
  .result {
    --result-inset: clamp(12px, 3vw, 20px);
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 21px;
  }
  .result-board {
    padding: 20px 12px;
    border-radius: 15px;
  }
  #winners {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  }
  .result-actions {
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
  }
  .result-actions button {
    gap: 5px;
    padding-inline: 7px;
  }
  .dialog-scroll {
    padding: 14px;
  }
  .dialog-head,
  .dialog-foot {
    padding: 12px 14px;
  }
  .entry-row {
    grid-template-columns: 31px minmax(55px, 1fr) 29px 64px 25px;
    gap: 4px;
  }
  .entry-row .photo-btn {
    width: 30px;
    height: 32px;
  }
  .entry-row input[type='color'] {
    width: 28px;
  }
  .entry-row .icon-button {
    width: 25px;
  }
  .entry-row select {
    padding: 7px 2px;
  }
  .entry-row input {
    font-size: 14px;
  }
}
@media (max-width: 470px) {
  #screen span {
    display: none;
  }
  .tool {
    gap: 4px;
    white-space: nowrap;
  }
  .brand {
    column-gap: 5px;
  }
  .brand b {
    font-size: 17px;
  }
  .tools {
    gap: 4px;
  }
  .sitebar-inner {
    padding-inline: 10px;
    gap: 6px;
  }
  .match-buttons {
    gap: 2px;
  }
  .race-controls .secondary {
    gap: 3px;
  }
}
@media (max-width: 430px) {
  .hud {
    min-height: 26px;
  }
  .race-controls {
    top: 41px;
    max-width: calc(100% - 24px);
  }
  .race-controls .start {
    max-width: min(66vw, 240px);
  }
}
@media (max-width: 370px) {
  .sitebar-inner {
    padding-inline: 6px;
  }
  .tools .tool {
    padding-inline: 5px;
  }
  .brand b {
    font-size: 15px;
  }
  .roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand img {
    width: 25px;
    height: 25px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .sitebar {
    height: 40px;
  }
  .shell {
    padding: 3px;
  }
  .start,
  .match-buttons .secondary {
    min-height: 31px;
    padding-block: 4px;
  }
  .race-controls,
  .hud {
    top: 5px;
  }
  .hud {
    min-height: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
