:root {
  color-scheme: light;
  --bg: #eef5f8;
  --surface: #ffffff;
  --surface-soft: #f7fbfb;
  --ink: #14202f;
  --muted: #5a6676;
  --line: #d5dde6;
  --line-strong: #99a9bb;
  --primary: #2563eb;
  --primary-ink: #0b2b6b;
  --accent: #12805c;
  --gold: #c88910;
  --red: #c2413a;
  --shadow: 0 16px 36px rgba(20, 32, 47, 0.14);
  --radius: 8px;
}

.theme-jumpmap {
  --bg: #eef7ed;
  --primary: #2563eb;
  --primary-ink: #12306e;
  --accent: #15803d;
  --gold: #b7791f;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)),
    var(--bg);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(1500px, calc(100% - clamp(14px, 2.5vw, 40px)));
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(6px, 1vw, 14px) 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 0.8vw, 12px);
}

.top-controls {
  position: fixed;
  top: 6px;
  right: max(8px, calc((100vw - 1500px) / 2));
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.topbar {
  min-height: clamp(46px, 6vh, 62px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body:not([data-screen]) .topbar,
body[data-screen="setup"] .topbar {
  padding-right: clamp(228px, 22vw, 286px);
}

.brand-block {
  flex: 0 1 260px;
  min-width: 0;
}

.brand-kicker,
.screen-kicker {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1,
.screen-heading h2,
.result-header h2,
.result-header p {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.05;
  letter-spacing: 0;
  padding-block: 2px;
}

.display-mode-toggle,
.top-controls .compact-action {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(47, 123, 214, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0d2b55;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(18, 48, 110, 0.12);
  backdrop-filter: blur(4px);
}

.display-mode-toggle {
  min-width: clamp(88px, 8vw, 118px);
  background: rgba(255, 255, 255, 0.96);
}

.top-controls .qr-open-action {
  min-width: 40px;
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.68);
  background: var(--primary);
}

.top-controls [data-action="enter-fullscreen"],
.top-controls [data-action="exit-fullscreen"] {
  min-width: 78px;
}

.display-mode-toggle:hover,
.display-mode-toggle:focus-visible,
.top-controls .compact-action:hover,
.top-controls .compact-action:focus-visible {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.top-controls .qr-open-action:hover,
.top-controls .qr-open-action:focus-visible {
  background: #1d4ed8;
}

.mode-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
}

.mode-prompt-modal.is-hidden {
  display: none;
}

.mode-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 23, 38, 0.76);
  backdrop-filter: blur(4px);
}

.mode-prompt-card {
  position: relative;
  z-index: 1;
  width: min(94vw, 720px);
  max-height: calc(100dvh - clamp(24px, 6vw, 64px));
  display: grid;
  gap: clamp(10px, 1.4vw, 16px);
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98) 42%),
    #ffffff;
  padding: clamp(16px, 2.4vw, 24px);
  box-shadow: 0 26px 86px rgba(0, 0, 0, 0.34);
  overflow: auto;
  text-align: center;
}

.mode-prompt-head {
  display: grid;
  gap: 8px;
}

.mode-prompt-head h2,
.mode-prompt-head p {
  margin: 0;
}

.mode-prompt-head h2 {
  color: #102033;
  font-size: clamp(26px, 3.7vw, 40px);
  line-height: 1.05;
}

.mode-prompt-head p {
  max-width: 39rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 800;
  line-height: 1.45;
}

.mode-prompt-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 12px);
}

.mode-prompt-choice {
  min-width: 0;
  min-height: clamp(98px, 12vw, 126px);
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    #ffffff;
  color: #102033;
  padding: clamp(11px, 1.5vw, 15px);
  text-align: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  touch-action: manipulation;
}

.mode-prompt-choice b {
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.05;
  word-break: keep-all;
}

.mode-prompt-choice span {
  color: #536273;
  font-size: clamp(12px, 1.25vw, 13px);
  font-weight: 800;
  line-height: 1.35;
}

.mode-prompt-choice.is-recommended {
  border-color: rgba(37, 99, 235, 0.68);
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.98), rgba(191, 219, 254, 0.68)),
    #ffffff;
  box-shadow:
    0 14px 30px rgba(37, 99, 235, 0.17),
    inset 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.mode-prompt-choice:hover,
.mode-prompt-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.78);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.82)),
    #ffffff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.15);
}

.mode-prompt-note {
  margin: 0;
  display: grid;
  gap: 4px;
  border: 2px solid rgba(37, 99, 235, 0.32);
  border-left-width: 7px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(96, 165, 250, 0.18), rgba(239, 246, 255, 0.96)),
    #eff6ff;
  color: #174153;
  padding: clamp(10px, 1.5vw, 14px) clamp(12px, 1.8vw, 16px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  text-align: left;
}

.mode-prompt-note strong {
  color: #1d4ed8;
  font-size: clamp(16px, 1.9vw, 21px);
  line-height: 1.1;
}

.mode-prompt-note span {
  color: #385266;
  font-size: clamp(12px, 1.35vw, 14px);
  font-weight: 900;
  line-height: 1.45;
}

.mode-prompt-note b {
  color: #102033;
}

body.mode-prompt-open {
  overflow: hidden;
}

body[data-screen="play"] .display-mode-toggle,
body[data-screen="result"] .display-mode-toggle,
body[data-screen="play"] .top-controls,
body[data-screen="result"] .top-controls {
  display: none;
}

.jump-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.6vw, 28px);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 84% 20%, rgba(255, 240, 184, 0.46), rgba(255, 240, 184, 0) 34%),
    linear-gradient(180deg, #f6edda 0%, #e8d8b8 100%);
  overflow: hidden;
}

.jump-loading-screen[hidden] {
  display: none;
}

html.start-loading-open,
body.start-loading-open {
  overflow: hidden;
}

.jump-loading-grid {
  width: min(680px, 100%);
  max-height: calc(100dvh - clamp(16px, 5.2vw, 56px));
  display: grid;
  gap: clamp(8px, 1.2vw, 14px);
}

.jump-loading-screen[data-loading-count="2"],
.jump-loading-screen[data-loading-count="3"],
.jump-loading-screen[data-loading-count="4"] {
  place-items: stretch;
}

.jump-loading-screen[data-loading-count="2"] .jump-loading-grid,
.jump-loading-screen[data-loading-count="3"] .jump-loading-grid,
.jump-loading-screen[data-loading-count="4"] .jump-loading-grid {
  width: 100%;
  height: 100%;
  max-height: none;
}

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

.jump-loading-grid.player-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.jump-loading-card {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: grid;
  gap: clamp(7px, 1.4dvh, 12px);
  border: 1px solid rgba(31, 47, 74, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(31, 47, 74, 0.15);
  padding: clamp(12px, 2.3vw, 24px);
  text-align: center;
}

.jump-loading-card.is-split-card {
  height: 100%;
  min-height: 0;
  grid-template-columns: 1fr;
  align-content: stretch;
  gap: clamp(6px, 1dvh, 10px);
  padding: clamp(9px, 1.3vw, 16px);
  text-align: left;
}

.jump-loading-kicker {
  display: block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.jump-loading-copy h2 {
  margin: 4px 0 0;
  color: #14202f;
  font-size: clamp(21px, 3.2vw, 30px);
  line-height: 1.1;
  letter-spacing: 0;
}

.jump-loading-copy p {
  margin: 6px auto 0;
  max-width: 34em;
  color: #4f5f79;
  font-size: 14px;
  line-height: 1.42;
  font-weight: 800;
}

.jump-loading-mode {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(47, 98, 200, 0.12);
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.jump-loading-mode strong {
  display: block;
  margin-bottom: 4px;
  color: #203761;
  font-size: 13px;
  font-weight: 900;
}

.jump-loading-mode p {
  margin: 0;
  color: #35507e;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 800;
}

.jump-loading-tips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px 10px;
  color: #2e3d57;
  font-size: 13px;
  line-height: 1.34;
  text-align: left;
}

.jump-loading-tips li::before {
  content: "•";
  display: inline-block;
  margin-right: 8px;
  color: #2f62c8;
  font-weight: 900;
}

.jump-loading-fact {
  border: 1px solid rgba(47, 98, 200, 0.2);
  border-radius: 12px;
  background: rgba(245, 249, 255, 0.88);
  padding: 10px 12px;
  text-align: left;
}

.jump-loading-fact-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #244f9f;
  font-size: 12px;
  font-weight: 900;
}

.jump-loading-fact-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2f62c8;
}

.jump-loading-fact p {
  margin: 6px 0 0;
  color: #253752;
  font-size: 14px;
  line-height: 1.36;
  font-weight: 800;
}

.jump-loading-fact-source {
  margin-top: 5px;
  color: #5a6676;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.jump-loading-stage {
  position: relative;
  height: clamp(108px, 19dvh, 176px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 47, 74, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(191, 228, 255, 0.92) 0%, rgba(238, 248, 255, 0.9) 48%, rgba(218, 239, 200, 0.9) 49%, rgba(166, 208, 131, 0.95) 100%);
}

.jump-loading-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.82) 0 8%, transparent 9%),
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.66) 0 7%, transparent 8%);
  opacity: 0.72;
}

.jump-loading-path {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 22%;
  height: 22px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.14)),
    #39404a;
  box-shadow: 0 8px 0 rgba(20, 32, 47, 0.12);
}

.jump-loading-sprite {
  position: absolute;
  left: 50%;
  bottom: calc(22% + 13px);
  width: clamp(82px, 14dvh, 136px);
  height: clamp(82px, 14dvh, 136px);
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 8px rgba(20, 32, 47, 0.22));
  image-rendering: pixelated;
}

.jump-loading-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(47, 123, 214, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.jump-loading-progress i {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  transition: width 180ms ease;
}

.jump-loading-card.is-split-card .jump-loading-copy h2 {
  font-size: clamp(19px, 2vw, 26px);
}

.jump-loading-card.is-split-card .jump-loading-copy p,
.jump-loading-card.is-split-card .jump-loading-mode p,
.jump-loading-card.is-split-card .jump-loading-tips,
.jump-loading-card.is-split-card .jump-loading-fact p {
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: 1.34;
}

.jump-loading-card.is-split-card .jump-loading-stage {
  height: clamp(84px, 16dvh, 132px);
  min-height: 0;
}

.jump-loading-card.is-split-card .jump-loading-sprite {
  width: clamp(70px, 12dvh, 108px);
  height: clamp(70px, 12dvh, 108px);
}

.jump-loading-card.is-split-card .jump-loading-tips {
  grid-template-columns: 1fr;
}

@media (min-width: 680px) and (min-height: 560px) {
  .jump-loading-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.78fr);
    align-items: stretch;
    text-align: left;
  }

  .jump-loading-copy,
  .jump-loading-mode,
  .jump-loading-tips,
  .jump-loading-fact,
  .jump-loading-progress {
    grid-column: 1;
  }

  .jump-loading-stage {
    grid-column: 2;
    grid-row: 1 / span 5;
    height: 100%;
    min-height: 240px;
  }
}

@media (max-height: 720px) {
  .jump-loading-screen {
    padding: 8px;
  }

  .jump-loading-card {
    max-height: calc(100dvh - 16px);
    gap: 6px;
    padding: 10px;
  }

  .jump-loading-kicker {
    font-size: 12px;
  }

  .jump-loading-copy h2 {
    margin-top: 2px;
    font-size: 21px;
  }

  .jump-loading-copy p,
  .jump-loading-mode p,
  .jump-loading-tips,
  .jump-loading-fact p {
    font-size: 12px;
    line-height: 1.28;
  }

  .jump-loading-mode,
  .jump-loading-fact {
    padding: 7px 9px;
  }

  .jump-loading-tips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 9px;
  }

  .jump-loading-fact-source {
    margin-top: 3px;
  }

  .jump-loading-stage {
    height: 96px;
    min-height: 96px;
  }

  .jump-loading-sprite {
    width: 76px;
    height: 76px;
  }

  .jump-loading-progress {
    height: 10px;
  }
}

@media (min-width: 900px) and (max-height: 720px) {
  .jump-loading-card {
    width: min(900px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.44fr);
    align-items: stretch;
    text-align: left;
  }

  .jump-loading-copy,
  .jump-loading-mode,
  .jump-loading-tips,
  .jump-loading-fact,
  .jump-loading-progress {
    grid-column: 1;
  }

  .jump-loading-stage {
    grid-column: 2;
    grid-row: 1 / span 5;
    height: 100%;
    min-height: 0;
  }

  .jump-loading-copy p,
  .jump-loading-mode p,
  .jump-loading-fact p {
    max-width: none;
  }
}

.jump-loading-screen[data-loading-count="2"] .jump-loading-card,
.jump-loading-screen[data-loading-count="3"] .jump-loading-card,
.jump-loading-screen[data-loading-count="4"] .jump-loading-card {
  width: 100%;
  grid-template-columns: 1fr;
  text-align: left;
}

.jump-loading-screen[data-loading-count="2"] .jump-loading-copy,
.jump-loading-screen[data-loading-count="2"] .jump-loading-mode,
.jump-loading-screen[data-loading-count="2"] .jump-loading-tips,
.jump-loading-screen[data-loading-count="2"] .jump-loading-fact,
.jump-loading-screen[data-loading-count="2"] .jump-loading-progress,
.jump-loading-screen[data-loading-count="3"] .jump-loading-copy,
.jump-loading-screen[data-loading-count="3"] .jump-loading-mode,
.jump-loading-screen[data-loading-count="3"] .jump-loading-tips,
.jump-loading-screen[data-loading-count="3"] .jump-loading-fact,
.jump-loading-screen[data-loading-count="3"] .jump-loading-progress,
.jump-loading-screen[data-loading-count="4"] .jump-loading-copy,
.jump-loading-screen[data-loading-count="4"] .jump-loading-mode,
.jump-loading-screen[data-loading-count="4"] .jump-loading-tips,
.jump-loading-screen[data-loading-count="4"] .jump-loading-fact,
.jump-loading-screen[data-loading-count="4"] .jump-loading-progress {
  grid-column: auto;
}

.jump-loading-screen[data-loading-count="2"] .jump-loading-stage,
.jump-loading-screen[data-loading-count="3"] .jump-loading-stage,
.jump-loading-screen[data-loading-count="4"] .jump-loading-stage {
  grid-column: auto;
  grid-row: auto;
  height: clamp(84px, 16dvh, 132px);
  min-height: 0;
}

body[data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jump-loading-grid.player-count-2 {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body[data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jump-loading-grid.player-count-2 [data-loading-panel="0"] {
  order: 2;
  transform: none;
}

body[data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jump-loading-grid.player-count-2 [data-loading-panel="1"] {
  order: 1;
  transform: rotate(180deg);
  transform-origin: center;
}

.session-badge,
.timer-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 9px 12px;
  font-weight: 900;
  box-shadow: 0 2px 0 rgba(20, 32, 47, 0.08);
  white-space: nowrap;
}

.topbar-right,
.topbar-actions,
.play-nav-actions,
.play-status-actions,
.result-header-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-right {
  justify-content: flex-end;
}

.qr-open-action {
  min-width: 48px;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2dvh, 24px) clamp(12px, 4vw, 44px);
  overflow: hidden;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.56);
  cursor: pointer;
}

.qr-modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100dvh - clamp(16px, 4dvh, 48px));
  border: 1px solid rgba(30, 41, 59, 0.18);
  border-radius: 22px;
  background: #ffffff;
  padding: clamp(12px, 2.4dvh, 26px);
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  gap: clamp(8px, 2dvh, 22px);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}

.qr-modal-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-modal-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(22px, 4vw, 40px);
  line-height: 1.05;
}

.qr-large {
  width: min(460px, 100%, calc(100dvh - 172px));
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #ffffff;
  padding: clamp(10px, 2vw, 18px);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 8px rgba(248, 250, 252, 0.9);
}

.qr-svg {
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}

.qr-url-text {
  margin: 0;
  color: #334155;
  font-size: clamp(11px, 1.7dvh, 13px);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-height: 640px) and (orientation: landscape) {
  .qr-modal-card {
    width: min(620px, calc(100vw - 24px));
    border-radius: 16px;
    padding: 10px;
    gap: 7px;
  }

  .qr-modal-head h2 {
    font-size: clamp(20px, 4dvh, 28px);
  }

  .qr-modal-head .screen-kicker {
    display: none;
  }

  .qr-large {
    width: min(460px, 100%, calc(100dvh - 118px));
    padding: 8px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 5px rgba(248, 250, 252, 0.9);
  }
}

.qr-fallback {
  color: #b91c1c;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

html.qr-modal-open,
body.qr-modal-open {
  overflow: hidden;
}

body.gugudan-report-open {
  overflow: hidden;
}

.gugudan-report-modal {
  position: fixed;
  inset: 0;
  z-index: 610;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 28px);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(3px);
}

.gugudan-report-card {
  width: min(1080px, 100%);
  max-height: min(94dvh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 76px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}

.gugudan-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 2vw, 22px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  background: #f8fafc;
}

.gugudan-report-head h2,
.gugudan-report-head p,
.gugudan-report-section h3,
.gugudan-report-section p {
  margin: 0;
}

.gugudan-report-head h2 {
  color: #0f172a;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.gugudan-report-head p {
  margin-top: 5px;
  color: #64748b;
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gugudan-report-close-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 16px;
}

.gugudan-report-body {
  min-height: 0;
  overflow: auto;
  padding: clamp(12px, 2vw, 22px);
  display: grid;
  gap: clamp(10px, 1.4vw, 16px);
}

.gugudan-report-hero {
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: 12px;
  background: #f8fafc;
  padding: clamp(14px, 2vw, 22px);
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.gugudan-report-hero span,
.gugudan-report-metrics span,
.gugudan-report-section-head span,
.gugudan-dan-card span,
.gugudan-report-note {
  color: #64748b;
  font-weight: 900;
}

.gugudan-report-hero strong {
  display: block;
  color: #0f172a;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.gugudan-report-hero p {
  color: #14202f;
  font-size: clamp(16px, 1.9vw, 22px);
  font-weight: 900;
  line-height: 1.3;
}

.gugudan-report-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.gugudan-report-metrics div,
.gugudan-dan-card,
.gugudan-report-section {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
}

.gugudan-report-metrics div {
  min-width: 0;
  padding: 12px;
}

.gugudan-report-metrics strong {
  display: inline-block;
  margin-top: 5px;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.gugudan-report-metrics em {
  margin-left: 4px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.gugudan-report-section {
  padding: clamp(12px, 1.6vw, 18px);
  display: grid;
  gap: 12px;
}

.gugudan-report-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.gugudan-report-section-head h3 {
  color: #0f172a;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

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

.gugudan-report-empty {
  margin: 0;
  color: #166534;
  font-size: 15px;
  font-weight: 900;
}

.gugudan-weak-row {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: #f8fafc;
}

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

.gugudan-weak-meta strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 900;
}

.gugudan-weak-meta span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.gugudan-weak-track {
  height: 18px;
  border-radius: 999px;
  background: #e5edf2;
  overflow: hidden;
}

.gugudan-weak-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d97706;
}

.gugudan-weak-row.risk-danger .gugudan-weak-track i {
  background: #dc2626;
}

.gugudan-weak-row.risk-warning .gugudan-weak-track i {
  background: #d97706;
}

.gugudan-dan-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.gugudan-dan-card {
  min-width: 0;
  padding: 10px 8px;
  text-align: center;
  display: grid;
  gap: 4px;
}

.gugudan-dan-card b {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.gugudan-dan-card strong {
  color: #14202f;
  font-size: 18px;
  font-weight: 900;
}

.gugudan-dan-card.risk-ok {
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, 0.28);
}

.gugudan-dan-card.risk-warning {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.32);
}

.gugudan-dan-card.risk-danger {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.3);
}

.gugudan-heatmap {
  display: grid;
  grid-template-columns: 30px repeat(9, minmax(52px, 1fr));
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gugudan-heatmap-cell {
  min-width: 52px;
  min-height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 5px 3px;
  text-align: center;
  background: #f8fafc;
}

.gugudan-heatmap-cell strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.gugudan-heatmap-cell span {
  color: #475569;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.gugudan-heatmap-cell.is-label {
  min-width: 30px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  background: transparent;
  border-color: transparent;
}

.gugudan-heatmap-cell.level-ok {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.32);
}

.gugudan-heatmap-cell.level-warning {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.35);
}

.gugudan-heatmap-cell.level-danger {
  background: #fecaca;
  border-color: rgba(220, 38, 38, 0.38);
}

.gugudan-heatmap-cell.level-none {
  background: #f1f5f9;
  opacity: 0.7;
}

.gugudan-report-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.timer-pill {
  min-width: 86px;
  text-align: center;
  color: #ffffff;
  background: var(--primary-ink);
  border-color: var(--primary-ink);
  font-variant-numeric: tabular-nums;
}

.play-topline .timer-pill {
  min-width: 126px;
  min-height: 44px;
  display: grid;
  place-items: center;
  gap: 1px;
  line-height: 1;
  font-size: 20px;
}

.play-topline .timer-pill::before {
  content: "남은 시간";
  display: block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.theme-jumpmap .play-topline .timer-pill {
  color: #0d2b55;
  border-color: #2f7bd6;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #bfe4ff 0%, #dff3ff 52%, #a9cf73 53%, #6fa04c 100%);
  box-shadow:
    inset 0 -3px 0 rgba(37, 93, 44, 0.22),
    0 3px 0 rgba(18, 48, 110, 0.22);
}

.theme-jumpmap .play-topline .timer-pill::before {
  color: #1f6f39;
}

body[data-screen="play"] .play-topline .timer-pill {
  min-width: 108px;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 18px;
}

body[data-screen="play"] .play-topline .timer-pill::before {
  font-size: 10px;
}

.screen-stack {
  min-height: 0;
}

body[data-screen="play"],
body[data-screen="result"] {
  overflow: hidden;
}

body[data-screen="play"] .app-shell,
body[data-screen="result"] .app-shell {
  height: 100dvh;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

body[data-screen="play"] .app-shell {
  width: calc(100% - 8px);
  padding: 4px 0;
}

body[data-screen="play"] .topbar,
body[data-screen="result"] .topbar {
  display: none;
}

body[data-screen="play"] .screen-stack,
body[data-screen="result"] .screen-stack {
  min-height: 0;
  overflow: hidden;
}

.screen {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: clamp(10px, 1.1vw, 16px);
}

.is-hidden,
.screen.is-hidden {
  display: none !important;
}

.screen-heading,
.result-header,
.play-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(8px, 1vw, 12px);
}

body[data-screen="play"] .play-topline {
  min-height: 0;
  gap: 8px;
  margin-bottom: 4px;
}

body[data-screen="play"] .play-nav-actions,
body[data-screen="play"] .play-status-actions {
  flex-wrap: nowrap;
}

body[data-screen="play"] .compact-action {
  min-height: 34px;
  padding-inline: 10px;
}

.screen-heading h2,
.result-header h2 {
  font-size: clamp(23px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.current-summary,
.result-header p {
  color: var(--muted);
  font-weight: 900;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(10px, 1.2vw, 16px);
  align-items: start;
}

.showcase-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.settings-card {
  padding: clamp(10px, 1vw, 14px);
  display: grid;
  gap: clamp(8px, 0.9vw, 12px);
}

.file-mode-warning {
  min-width: 0;
  border: 1px solid rgba(220, 38, 38, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff7ed, #fff1f2);
  color: #7f1d1d;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.file-mode-warning b,
.file-mode-warning span,
.file-mode-warning a {
  overflow-wrap: anywhere;
}

.file-mode-warning b {
  font-size: 14px;
  font-weight: 900;
}

.file-mode-warning span {
  color: #9f1239;
  font-size: 13px;
  font-weight: 800;
}

.file-mode-warning a {
  color: #1d4ed8;
  font-weight: 900;
}

.showcase-card {
  display: grid;
  grid-template-rows: minmax(250px, 1fr) auto;
  min-height: clamp(360px, 54dvh, 520px);
}

.skyline {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.skyline {
  background:
    linear-gradient(180deg, #bfe4ff 0%, #eaf7ff 48%, #e0f4d4 49%, #a6d083 100%);
}

.skyline::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(56, 92, 60, 0.14));
}

.quiz-float {
  position: absolute;
  width: clamp(74px, 12vw, 150px);
  padding: 8px;
  border: 1px solid rgba(20, 32, 47, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 22px rgba(20, 32, 47, 0.12);
}

.quiz-float-a {
  top: 10%;
  left: 7%;
  transform: rotate(-7deg);
}

.quiz-float-b {
  top: 16%;
  right: 8%;
  transform: rotate(6deg);
}

.plate {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 8px 7px rgba(20, 32, 47, 0.22));
}

.plate-a {
  width: 45%;
  left: 6%;
  bottom: 18%;
}

.plate-b {
  width: 34%;
  right: 11%;
  bottom: 39%;
}

.plate-c {
  width: 26%;
  right: 16%;
  bottom: 12%;
}

.hero-character {
  position: absolute;
  width: clamp(104px, 20vw, 230px);
  object-fit: contain;
  filter: drop-shadow(0 16px 14px rgba(20, 32, 47, 0.24));
}

.hero-sejong {
  left: 18%;
  bottom: 22%;
}

.hero-leesunsin {
  right: 18%;
  bottom: 16%;
  width: clamp(92px, 16vw, 190px);
}

.showcase-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: var(--primary-ink);
}

.showcase-strip span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 900;
  text-align: center;
}

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

.field-block label,
.field-label {
  min-width: 0;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 900;
}

.setup-select-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(128px, 0.6fr);
  gap: 8px;
  align-items: end;
}

.segmented,
.time-grid,
.character-grid {
  display: grid;
  gap: 8px;
}

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

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

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

.user-character-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--player-color, var(--primary));
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 7px;
  display: grid;
  gap: 7px;
}

.user-character-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-character-head b {
  color: var(--player-color, var(--primary));
  font-size: 13px;
  font-weight: 900;
}

.user-character-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.character-choice-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.option-button,
.character-button,
.primary-action,
.ghost-action {
  border-radius: var(--radius);
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: normal;
}

.option-button,
.character-button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
}

.option-button {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 6px;
  line-height: 1.1;
}

.option-button-main,
.option-button-note {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-button-main {
  font-size: 14px;
}

.option-button-note {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}

.option-button.is-selected,
.character-button.is-selected {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.option-button.is-selected .option-button-note {
  color: rgba(255, 255, 255, 0.82);
}

.option-button:disabled,
.option-button.is-disabled {
  color: #7b8794;
  border-style: dashed;
  background: #eef2f7;
  opacity: 0.52;
  cursor: not-allowed;
}

.character-button {
  min-height: 68px;
  padding: 6px 5px;
  display: grid;
  grid-template-rows: 42px auto;
  align-items: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.character-button span:last-child {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
}

.user-character-card .character-button.is-selected {
  color: #102033;
  border-color: var(--player-color, var(--primary));
  background: var(--player-color, var(--primary));
}

.character-button img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.random-character-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, #bfe4ff, #a3d267);
  color: #0d2b55;
  font-size: 24px;
  font-weight: 900;
}

.setup-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gugudan-status-action {
  min-width: 0;
}

.gugudan-status-check {
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.gugudan-status-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.gugudan-status-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.gugudan-status-copy b {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.gugudan-status-description {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.gugudan-status-toggle {
  flex: 0 0 auto;
  min-width: 48px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: #0d2b55;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.gugudan-status-toggle:hover,
.gugudan-status-toggle:focus-visible {
  border-color: rgba(37, 99, 235, 0.62);
  background: #eff6ff;
}

.gugudan-status-body {
  display: grid;
  gap: 8px;
}

.gugudan-status-check.is-collapsed .gugudan-status-description,
.gugudan-status-check.is-collapsed .gugudan-status-body {
  display: none;
}

.gugudan-status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.gugudan-status-actions .ghost-action {
  width: 100%;
  min-height: 38px;
  padding-inline: 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
}

.weakness-practice-action {
  border-color: rgba(37, 99, 235, 0.32);
  background: #f8fbff;
}

.primary-action,
.ghost-action {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
}

.compact-action {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 13px;
}

.primary-action {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 3px 0 rgba(20, 32, 47, 0.22);
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-action {
  color: var(--ink);
  background: #ffffff;
}

.danger-action {
  color: #7f1d1d;
  border-color: rgba(194, 65, 58, 0.5);
  background: #fff7f7;
}

.audio-action {
  min-width: 82px;
}

.audio-action[aria-pressed="true"] {
  color: #5f3b00;
  border-color: rgba(200, 137, 16, 0.45);
  background: #fff8df;
}

.setup-actions {
  display: grid;
  align-items: stretch;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(153, 169, 187, 0.5);
}

.start-action {
  width: 100%;
  min-height: 52px;
  border-width: 2px;
  font-size: clamp(17px, 1.5vw, 22px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 5px 0 rgba(20, 32, 47, 0.26);
}

.start-action.is-loading {
  cursor: wait;
  filter: saturate(0.92);
}

.gugudan-status-panel {
  border: 1px solid rgba(30, 41, 59, 0.14);
  border-left: 5px solid #0ea5e9;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.gugudan-status-panel.is-error {
  border-left-color: #ef4444;
}

.gugudan-status-panel.is-success {
  border-left-color: #22c55e;
}

.gugudan-status-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gugudan-status-head b {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.gugudan-status-head span {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.gugudan-status-grid div {
  min-width: 0;
  border: 1px solid rgba(30, 41, 59, 0.1);
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px;
}

.gugudan-status-grid span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.gugudan-status-grid b {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.gugudan-status-message {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.gugudan-status-message.is-strong {
  color: #166534;
}

.error-text {
  min-height: 20px;
  color: var(--red);
  font-weight: 900;
}

.error-text.is-loading {
  color: #1e3a8a;
}

.play-screen {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: clamp(6px, 0.8vw, 10px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.play-title {
  display: none;
}

.play-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.game-stage,
.question-area {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.stage-panel {
  height: 100%;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.map-stage-panel {
  grid-template-rows: minmax(0, 1fr);
}

.stage-head {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.compact-score-row {
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
}

.score-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 7px;
}

.score-chip,
.result-tile,
.player-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 8px;
}

.score-chip {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  border-left: 5px solid var(--player-color, var(--line));
}

.score-chip:hover,
.score-chip:focus-visible {
  border-color: var(--player-color, var(--primary));
}

.score-chip b,
.result-tile b,
.player-tile b {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score-chip span,
.result-tile span,
.player-tile span {
  display: block;
  margin-top: 3px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.score-chip.active-player {
  border-color: var(--player-color, var(--primary));
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.quiz-gauge-button {
  min-width: 82px;
  min-height: 30px;
  border: 1px solid rgba(91, 62, 23, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff7d6 0%, #f2c94c 100%);
  color: #3b2a14;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 0 rgba(76, 46, 15, 0.18);
  white-space: nowrap;
}

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

.jumpmap-world {
  position: relative;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.jumpmap-world {
  background:
    linear-gradient(180deg, #cde9ff 0%, #eef9ff 42%, #e1f2d7 43%, #aed086 100%);
}

.jumpmap-world::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 15%;
  height: 5px;
  background: rgba(20, 32, 47, 0.22);
  transform: rotate(-17deg);
  transform-origin: left center;
}

.game-platform {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px rgba(20, 32, 47, 0.18));
}

.game-platform.p1 { left: 5%; bottom: 10%; width: 27%; }
.game-platform.p2 { left: 25%; bottom: 27%; width: 23%; }
.game-platform.p3 { left: 46%; bottom: 44%; width: 24%; }
.game-platform.p4 { left: 66%; bottom: 61%; width: 27%; }

.jumper {
  position: absolute;
  width: clamp(44px, 7vw, 72px);
  height: clamp(58px, 9vw, 92px);
  display: grid;
  place-items: center;
  transform: translate(-50%, 10px);
  transition: left 220ms ease, bottom 220ms ease;
  z-index: 3;
}

.jumper img {
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(20, 32, 47, 0.24));
}

.jumper-label {
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: rgba(20, 32, 47, 0.86);
  color: #ffffff;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.question-area {
  display: none;
}

.map-view-grid {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  gap: 8px;
  touch-action: none;
  overscroll-behavior: contain;
}

.map-view-grid.player-count-1 {
  grid-template-columns: 1fr;
}

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

.map-view-grid.player-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-view-grid.player-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.map-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #cde9ff 0%, #eef9ff 42%, #e1f2d7 43%, #aed086 100%);
  overflow: hidden;
  overflow: clip;
  touch-action: none;
}

.player-viewport.is-active {
  border-color: var(--player-color, var(--primary));
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.player-viewport-hud {
  position: absolute;
  left: 8px;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  pointer-events: none;
}

.player-viewport-stats {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.player-viewport-name,
.player-viewport-stat,
.height-record-badge {
  min-width: 0;
  border-radius: 999px;
  background: rgba(20, 32, 47, 0.78);
  color: #ffffff;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(20, 32, 47, 0.2);
}

.player-viewport-name {
  color: var(--player-color, #ffffff);
}

.player-viewport-stat b {
  color: #ffffff;
}

.height-record-badge {
  position: absolute;
  left: 50%;
  top: 58px;
  z-index: 4;
  transform: translateX(-50%);
  color: #0d2b55;
  border: 1px solid rgba(93, 138, 37, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.4)),
    linear-gradient(90deg, #fef3c7, #a3d267);
  box-shadow: 0 3px 0 rgba(18, 48, 110, 0.18);
  white-space: nowrap;
}

.player-mini-gauge {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 45px;
  z-index: 4;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  pointer-events: none;
}

.player-mini-gauge-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 48%, #22c55e 100%);
  transition: width 120ms linear, background 120ms ease;
}

.player-viewport.is-gauge-empty .player-mini-gauge-fill {
  background: linear-gradient(90deg, rgba(194, 65, 58, 0.78), rgba(248, 113, 113, 0.7));
}

.map-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.touch-controls {
  position: absolute;
  left: clamp(8px, 1.2vw, 14px);
  bottom: clamp(8px, 1.2vw, 14px);
  display: flex;
  align-items: end;
  gap: clamp(20px, 2.8vw, 36px);
  pointer-events: none;
  z-index: 5;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.touch-button {
  position: relative;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  width: clamp(50px, 5.2vw, 62px);
  min-height: 50px;
  border: 2px solid rgba(20, 32, 47, 0.28);
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(18, 48, 110, 0.82);
  box-shadow: 0 3px 0 rgba(20, 32, 47, 0.24);
  font-weight: 900;
  font-size: 18px;
}

.touch-button::before {
  content: "";
  position: absolute;
  inset: -4px;
}

.touch-jump {
  width: clamp(76px, 7.8vw, 96px);
  min-height: 58px;
  margin-left: clamp(28px, 6vw, 76px);
  background: rgba(21, 128, 61, 0.9);
}

.quiz-map-button {
  position: absolute;
  right: clamp(8px, 1.2vw, 14px);
  bottom: clamp(8px, 1.2vw, 14px);
  min-width: clamp(92px, 9vw, 116px);
  min-height: 48px;
  padding-inline: 12px;
  font-size: 13px;
  z-index: 6;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}

.touch-button.is-active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(20, 32, 47, 0.24);
}

.map-view-grid.player-count-3 .touch-controls,
.map-view-grid.player-count-4 .touch-controls {
  left: 8px;
  bottom: 8px;
  gap: 14px;
}

.map-view-grid.player-count-3 .touch-button,
.map-view-grid.player-count-4 .touch-button {
  width: 42px;
  min-height: 42px;
  font-size: 15px;
}

.map-view-grid.player-count-3 .touch-jump,
.map-view-grid.player-count-4 .touch-jump {
  width: 66px;
  min-height: 48px;
  margin-left: clamp(46px, 4vw, 54px);
}

.map-view-grid.player-count-3 .quiz-map-button,
.map-view-grid.player-count-4 .quiz-map-button {
  right: 8px;
  bottom: 8px;
  min-width: 76px;
  min-height: 42px;
  padding-inline: 7px;
  font-size: 11px;
}

@media (min-width: 431px) and (max-width: 1100px) {
  .map-view-grid.player-count-3 .quiz-map-button,
  .map-view-grid.player-count-4 .quiz-map-button {
    bottom: 64px;
  }
}

.map-view-grid.player-count-2 .quiz-card,
.map-view-grid.player-count-3 .quiz-card,
.map-view-grid.player-count-4 .quiz-card {
  padding: clamp(6px, 0.7vw, 10px);
  gap: clamp(4px, 0.55vw, 8px);
}

.map-view-grid.player-count-2 .quiz-meta-line,
.map-view-grid.player-count-3 .quiz-meta-line,
.map-view-grid.player-count-4 .quiz-meta-line {
  font-size: clamp(11px, 1vw, 15px);
}

.map-view-grid.player-count-2 .quiz-progress-badge,
.map-view-grid.player-count-3 .quiz-progress-badge,
.map-view-grid.player-count-4 .quiz-progress-badge {
  min-width: 48px;
  padding: 3px 7px;
}

.quiz-layer {
  position: absolute;
  inset: 0;
  z-index: 260;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  border-radius: inherit;
  background: rgba(12, 10, 8, 0.5);
  overflow: hidden;
  touch-action: none;
  pointer-events: auto;
}

.quiz-layer[hidden] {
  display: none;
}

.quiz-card {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  border: 2px solid rgba(48, 35, 24, 0.9);
  border-radius: 14px;
  background: rgba(255, 248, 236, 0.98);
  box-shadow: 0 12px 28px rgba(10, 8, 6, 0.28);
  padding: clamp(8px, 1vw, 14px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(6px, 0.8vw, 10px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
}

.quiz-header {
  min-height: 0;
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.quiz-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6f5a46;
  font-size: clamp(15px, 1.45vw, 20px);
  font-weight: 900;
}

.quiz-progress-badge {
  flex: 0 0 auto;
  min-width: 68px;
  border: 2px solid rgba(48, 35, 24, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #2f241b;
  padding: 5px 10px;
  text-align: center;
}

.quiz-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(6px, 0.8vw, 10px);
  align-items: stretch;
}

.quiz-card.has-choice-images .quiz-body {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 0.42fr) minmax(0, 0.58fr);
}

.quiz-card.no-question-image.has-choice-images .quiz-body {
  grid-template-rows: minmax(0, 0.24fr) minmax(0, 0.76fr);
}

.quiz-card.has-question-image.has-text-choices .quiz-body {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 0.58fr) minmax(0, 0.42fr);
}

.quiz-card .choice-grid {
  min-height: 0;
}

.quiz-card .choice-button {
  min-height: 0;
  height: 100%;
}

.quiz-card .question-image-wrap {
  min-height: 0;
}

.run-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(20px, auto);
  gap: 9px;
}

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

.run-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 9px;
}

.run-card b {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.run-card span {
  display: block;
  margin-top: 4px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.active-run-card {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.question-kicker {
  color: #2f241b;
  font-size: clamp(18px, 2.1vw, 38px);
  line-height: 1.12;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.map-view-grid.player-count-2 .question-kicker,
.map-view-grid.player-count-3 .question-kicker,
.map-view-grid.player-count-4 .question-kicker {
  font-size: clamp(15px, 1.35vw, 24px);
}

.question-text {
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 3px dashed rgba(48, 35, 24, 0.2);
  border-radius: 14px;
  background: #ffffff;
  padding: clamp(14px, 1.8vw, 24px);
  color: #2f241b;
  text-align: center;
  font-size: clamp(34px, 6vw, 82px);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.question-image-wrap {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  border: 3px dashed rgba(48, 35, 24, 0.2);
  border-radius: 14px;
  background: #ffffff;
  padding: clamp(5px, 0.8vw, 10px);
  overflow: hidden;
}

.question-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.choice-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.1vw, 12px);
}

.choice-button {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 3px solid rgba(46, 35, 24, 0.4);
  border-radius: 16px;
  background: #ffffff;
  color: #2f241b;
  padding: clamp(8px, 0.9vw, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  overflow: hidden;
}

.choice-button.has-image-choice {
  padding: 0;
}

.choice-button.choice-tone-1 { background: rgba(255, 229, 229, 0.85); }
.choice-button.choice-tone-2 { background: rgba(221, 234, 255, 0.85); }
.choice-button.choice-tone-3 { background: rgba(255, 248, 204, 0.9); }
.choice-button.choice-tone-4 { background: rgba(222, 247, 228, 0.9); }

.choice-text {
  display: block;
  max-width: 100%;
  color: #2f241b;
  font-size: clamp(28px, 4vw, 58px);
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: var(--primary);
}

.choice-button[disabled] {
  cursor: default;
  opacity: 0.72;
}

.choice-index {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(35, 23, 16, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #2b211a;
  font-size: 22px;
  font-weight: 900;
  z-index: 2;
}

.map-view-grid.player-count-2 .choice-index,
.map-view-grid.player-count-3 .choice-index,
.map-view-grid.player-count-4 .choice-index {
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.map-view-grid.player-count-2 .choice-media,
.map-view-grid.player-count-3 .choice-media,
.map-view-grid.player-count-4 .choice-media {
  padding: 5px;
}

.choice-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(8px, 0.8vw, 12px);
}

.choice-media img,
.choice-button img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.choice-button.is-correct {
  border-width: 6px;
  border-color: rgba(22, 163, 74, 0.9);
  box-shadow: inset 0 0 0 6px rgba(22, 163, 74, 0.25);
}

.choice-button.is-wrong {
  border-width: 6px;
  border-color: rgba(220, 38, 38, 0.9);
  box-shadow: inset 0 0 0 6px rgba(220, 38, 38, 0.2);
}

.feedback-line {
  min-height: 24px;
  color: #4b3a2a;
  font-size: clamp(14px, 1.6vw, 24px);
  line-height: 1.15;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.feedback-line.correct {
  color: var(--accent);
}

.feedback-line.wrong {
  color: var(--red);
}

.result-screen {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #edf3f1;
  box-shadow: none;
  padding: clamp(10px, 2vw, 24px);
}

.result-screen:not(.is-hidden) {
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.result-modal {
  width: min(1320px, 100%);
  max-height: calc(100dvh - clamp(20px, 4vw, 48px));
  min-height: 0;
  border: 1px solid rgba(30, 41, 59, 0.18);
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.18);
  padding: clamp(12px, 1.8vw, 22px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(9px, 1.2vw, 14px);
  overflow: hidden;
}

.result-header {
  margin-bottom: 0;
  padding: clamp(10px, 1.2vw, 16px);
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.result-header h2 {
  color: #0f172a;
  font-size: clamp(26px, 3.1vw, 40px);
  line-height: 1.04;
  text-shadow: none;
}

.result-header p {
  margin-top: 5px;
  color: #475569;
  font-weight: 900;
}

.result-header .screen-kicker {
  color: #64748b;
}

.result-header .timer-pill {
  display: none;
}

.result-grid {
  display: none;
  min-height: 0;
  max-height: clamp(76px, 12dvh, 124px);
  overflow: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  padding-right: 2px;
}

.result-summary-heading {
  grid-column: 1 / -1;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.result-tile {
  min-height: 54px;
  display: grid;
  align-content: center;
  border-color: rgba(30, 41, 59, 0.12);
  background: #ffffff;
  padding: 7px;
  word-break: keep-all;
  overflow-wrap: normal;
}

.result-tile.is-time {
  grid-column: span 2;
}

.result-tile span {
  font-size: clamp(15px, 1.5vw, 20px);
  white-space: nowrap;
}

.result-tile b {
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-results {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: auto;
  align-self: center;
  align-content: center;
  gap: clamp(10px, 1.2vw, 16px);
  padding: 2px;
}

.player-results.player-count-1 {
  grid-template-columns: minmax(0, 1fr);
}

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

.player-results.player-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.player-results-heading {
  display: none;
}

.player-result-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(30, 41, 59, 0.13);
  border-top: 5px solid color-mix(in srgb, var(--player-color, var(--primary)) 30%, #94a3b8);
  border-radius: var(--radius);
  background: #ffffff;
  padding: clamp(14px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.player-result-content {
  width: 100%;
  max-width: 620px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto;
  grid-auto-rows: auto;
  gap: clamp(8px, 0.9vw, 12px);
  margin-block: auto;
  margin-inline: auto;
}

@media (min-width: 760px) and (min-height: 820px) {
  body[data-screen="result"] .result-modal {
    min-height: min(calc(100dvh - clamp(20px, 4vw, 48px)), clamp(640px, 70dvh, 900px));
  }

  body[data-screen="result"] .player-results {
    align-self: stretch;
  }

  body[data-screen="result"] .player-result-card {
    min-height: clamp(360px, 42dvh, 520px);
  }
}

.jumpmap-face-result-center {
  display: none;
}

.player-card-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.player-card-head span,
.player-card-head em {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f7;
  color: #334155;
  font-size: clamp(12px, 0.95vw, 14px);
  font-style: normal;
  font-weight: 900;
}

.player-card-head strong {
  min-width: 0;
  color: #102033;
  font-size: clamp(15px, 1.25vw, 20px);
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-result-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(8px, 0.9vw, 12px);
}

.player-title-panel,
.player-height-panel {
  min-width: 0;
  min-height: clamp(118px, 10.5vw, 154px);
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: clamp(9px, 1vw, 13px);
}

.player-title-panel {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
  display: grid;
  grid-template-columns: clamp(50px, 5vw, 68px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(7px, 0.8vw, 10px);
  background: #ffffff;
  box-shadow: inset 4px 0 0 rgba(71, 85, 105, 0.16);
}

.player-height-panel {
  display: grid;
  align-content: center;
}

.player-title-panel > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.player-title-panel span,
.player-height-panel span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.player-title-panel strong,
.player-height-panel strong,
.player-title-panel em,
.player-height-panel em {
  min-width: 0;
  display: block;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-title-panel strong {
  color: #0f172a;
  font-size: clamp(19px, 1.55vw, 27px);
  line-height: 1.06;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-height-panel strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: clamp(36px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
}

.player-title-panel em,
.player-height-panel em {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-results.player-count-3 .player-title-panel,
.player-results.player-count-4 .player-title-panel {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.player-results.player-count-3 .player-title-panel .grade-badge-mark,
.player-results.player-count-4 .player-title-panel .grade-badge-mark {
  width: clamp(48px, 4.6vw, 58px);
}

.player-results.player-count-3 .player-title-panel em,
.player-results.player-count-4 .player-title-panel em {
  white-space: nowrap;
}

.player-results.player-count-3 .player-title-panel > div:last-child,
.player-results.player-count-4 .player-title-panel > div:last-child {
  width: 100%;
  justify-items: center;
}

.player-support-line {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-support-line span {
  min-width: min(100%, 112px);
  flex: 1 1 112px;
  border: 1px solid rgba(30, 41, 59, 0.1);
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-support-line b {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-session {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-scoreplate {
  min-width: 0;
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: var(--radius);
  color: #0f172a;
  background: #f8fafc;
  padding: 10px;
  box-shadow: none;
}

.player-scoreplate b {
  display: block;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}

.player-scoreplate strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.player-scoreplate span {
  display: block;
  margin-top: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.18;
}

.player-grade-badge {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
  min-width: 0;
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  padding: clamp(7px, 0.8vw, 10px);
  display: grid;
  grid-template-columns: clamp(48px, 5vw, 68px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(7px, 0.8vw, 10px);
  box-shadow: inset 4px 0 0 rgba(71, 85, 105, 0.18);
}

.grade-badge-mark {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.grade-badge-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grade-badge-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
}

.grade-badge-mark::before {
  content: "";
  display: none;
}

.player-grade-badge > div:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.player-grade-badge span,
.player-grade-badge b,
.player-grade-badge strong,
.player-grade-badge em {
  min-width: 0;
  display: block;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-grade-badge > div:last-child > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.player-grade-badge b {
  color: var(--grade-ink);
  font-size: clamp(15px, 1.2vw, 20px);
  line-height: 1.05;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-grade-badge strong {
  color: #0f172a;
  font-size: clamp(16px, 1.45vw, 24px);
  line-height: 1.08;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-grade-badge em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.player-grade-badge[data-grade-key="first-jump"] {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
}

.player-grade-badge[data-grade-key="tower-climb"] {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
}

.player-grade-badge[data-grade-key="highland"] {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
}

.player-grade-badge[data-grade-key="summit"] {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
}

.player-grade-badge[data-grade-key="record"] {
  --grade-a: #475569;
  --grade-b: #cbd5e1;
  --grade-ink: #1e293b;
}

@media (max-width: 1150px) {
  body[data-screen="result"] .player-title-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  body[data-screen="result"] .player-title-panel .grade-badge-mark {
    width: clamp(42px, 4.5vw, 54px);
  }

  body[data-screen="result"] .player-title-panel > div:last-child {
    width: 100%;
    justify-items: center;
  }

  body[data-screen="result"] .player-title-panel strong {
    font-size: clamp(16px, 2.1vw, 21px);
  }

  body[data-screen="result"] .player-height-panel strong {
    font-size: clamp(30px, 4.5vw, 44px);
  }
}

.player-status-line {
  min-width: 0;
  border-radius: 12px;
  color: #103d62;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(163, 230, 53, 0.16));
  padding: 8px 10px;
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: normal;
  display: grid;
  gap: 3px;
}

.player-status-line span,
.player-status-line b,
.player-status-line em {
  min-width: 0;
  display: block;
}

.player-status-line span {
  color: #64748b;
  font-size: 11px;
  line-height: 1;
}

.player-status-line b {
  color: #0d2b55;
  font-size: clamp(18px, 1.6vw, 28px);
  line-height: 1.05;
}

.player-status-line em {
  color: #2563eb;
  font-size: 12px;
  font-style: normal;
  line-height: 1.15;
}

.player-card-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  gap: clamp(7px, 0.7vw, 10px);
}

.player-card-main div {
  min-width: 0;
  min-height: 0;
  border-radius: 12px;
  background: rgba(226, 240, 255, 0.78);
  padding: clamp(7px, 0.7vw, 10px);
  display: grid;
  align-content: center;
}

.player-card-main b,
.player-card-main span {
  display: block;
  word-break: keep-all;
  overflow-wrap: normal;
}

.player-card-main b {
  color: #0d47a1;
  font-size: clamp(17px, 2vw, 30px);
  line-height: 1;
  white-space: nowrap;
}

.player-card-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(11px, 0.85vw, 13px);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-height-meter,
.player-accuracy-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.player-height-meter i,
.player-accuracy-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.player-height-meter i {
  background: #475569;
}

.player-accuracy-meter i {
  background: #94a3b8;
}

.result-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.result-modal.has-gugudan-record {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: auto;
}

.result-modal.has-gugudan-record .player-results.player-count-1 {
  align-self: stretch;
  align-content: center;
}

.gugudan-record-panel {
  min-width: 0;
  border: 1px solid rgba(30, 41, 59, 0.14);
  border-left: 5px solid #2563eb;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: clamp(10px, 1.2vw, 14px);
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.55fr) minmax(300px, 1fr);
  align-items: center;
  gap: 10px;
}

.gugudan-record-copy {
  min-width: 0;
}

.gugudan-record-copy b {
  display: block;
  color: #0f172a;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.2;
}

.gugudan-record-copy p {
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.gugudan-student-field {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  gap: 5px;
}

.gugudan-student-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(30, 41, 59, 0.18);
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.gugudan-student-field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
  border-color: #2563eb;
  background: #ffffff;
}

.gugudan-record-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gugudan-record-actions .primary-action,
.gugudan-record-actions .ghost-action {
  width: 100%;
  min-height: 42px;
  padding-inline: 10px;
  font-size: 13px;
}

.gugudan-record-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gugudan-record-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.gugudan-record-status.is-error {
  color: #b91c1c;
}

.gugudan-record-status.is-success {
  color: #166534;
}

@media (min-width: 900px) {
  .result-modal.has-gugudan-record {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.78fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "header header"
      "players record"
      "actions actions";
    overflow: hidden;
  }

  .result-modal.has-gugudan-record .result-header {
    grid-area: header;
  }

  .result-modal.has-gugudan-record .player-results {
    grid-area: players;
    align-self: stretch;
  }

  .result-modal.has-gugudan-record .gugudan-record-panel {
    grid-area: record;
    align-self: stretch;
    align-content: start;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: auto;
  }

  .result-modal.has-gugudan-record .gugudan-record-actions {
    grid-template-columns: 1fr;
  }

  .result-modal.has-gugudan-record .result-actions {
    grid-area: actions;
  }
}

@media (max-width: 1050px) {
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    order: -1;
  }

  .showcase-card {
    display: none;
  }

  .play-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .play-screen {
    min-height: 0;
  }

  .stage-panel {
    gap: 7px;
  }

  .stage-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-area {
    max-height: 142px;
  }

  .run-panel {
    grid-template-rows: auto auto;
  }

  .map-run-card {
    display: none;
  }

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

  .score-row {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }
}

@media (max-width: 720px) {
  .mode-prompt-modal {
    padding: 10px;
  }

  .mode-prompt-card {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    gap: 10px;
    border-radius: 12px;
    padding: 14px;
  }

  .mode-prompt-head h2 {
    font-size: clamp(25px, 8vw, 34px);
  }

  .mode-prompt-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-prompt-choice {
    min-height: 74px;
    gap: 4px;
    padding: 10px;
    text-align: center;
  }

  .mode-prompt-choice b {
    font-size: 22px;
  }

  .mode-prompt-choice span {
    font-size: 12px;
  }

  .app-shell {
    width: min(100% - 10px, 1500px);
    padding-block: 5px;
    gap: 5px;
  }

  .topbar {
    min-height: 46px;
    gap: 6px;
    flex-wrap: wrap;
    align-items: stretch;
  }

  body:not([data-screen]) .topbar,
  body[data-screen="setup"] .topbar {
    padding-right: 0;
    padding-top: 28px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .brand-block {
    flex: 1 1 180px;
  }

  .top-controls {
    top: 5px;
    right: 7px;
    gap: 4px;
    justify-content: flex-end;
  }

  .top-controls .compact-action,
  .display-mode-toggle {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .display-mode-toggle {
    min-width: 88px;
  }

  .top-controls .qr-open-action {
    min-width: 36px;
  }

  .top-controls [data-action="enter-fullscreen"],
  .top-controls [data-action="exit-fullscreen"] {
    min-width: 70px;
  }

  .brand-kicker {
    display: none;
  }

  .session-badge {
    padding: 7px 9px;
    font-size: 12px;
  }

  .screen {
    padding: 8px;
  }

  .screen-heading,
  .result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .screen-heading h2,
  .result-header h2 {
    font-size: 22px;
  }

  .current-summary {
    font-size: 13px;
    line-height: 1.25;
  }

  .result-screen {
    padding: 8px;
  }

  .result-modal {
    max-height: calc(100dvh - 16px);
    padding: 10px;
    gap: 6px;
  }

  .result-header {
    padding-bottom: 8px;
  }

  .result-header h2 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 112px;
  }

  .result-summary-heading {
    font-size: 12px;
  }

  .result-tile {
    min-height: 54px;
    padding: 6px;
  }

  .result-tile.is-time {
    grid-column: span 2;
  }

  .result-tile span {
    font-size: clamp(15px, 4vw, 20px);
  }

  .player-results,
  .player-results.player-count-1,
  .player-results.player-count-2,
  .player-results.player-count-3,
  .player-results.player-count-4 {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(148px, auto);
    overflow: auto;
    gap: 7px;
    justify-content: stretch;
  }

  .player-results-heading {
    font-size: 13px;
  }

  .player-result-card {
    padding: 6px;
    gap: 5px;
    grid-template-rows: auto;
    grid-auto-rows: auto;
  }

  .player-status-line {
    padding: 6px 7px;
    font-size: 12px;
  }

  .player-grade-badge {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 6px;
    gap: 6px;
  }

  .grade-badge-mark {
    border-radius: 12px;
  }

  .grade-badge-mark::after {
    inset: 5px;
    border-radius: 9px;
  }

  .player-grade-badge > div:last-child > span,
  .player-grade-badge em {
    font-size: 10px;
  }

  .player-grade-badge b {
    font-size: 14px;
  }

  .player-grade-badge strong {
    font-size: 17px;
  }

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

  .player-card-main b {
    font-size: 16px;
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-actions .primary-action,
  .result-actions .ghost-action {
    flex: 1 1 140px;
    min-height: 38px;
  }

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

  .setup-select-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(104px, 0.65fr);
    gap: 6px;
  }

  .setup-select-row .field-block {
    gap: 5px;
  }

  .setup-select-row label {
    font-size: 12px;
  }

  .setup-select-row select {
    min-height: 38px;
    padding-inline: 7px;
    font-size: 12px;
  }

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

  .option-button {
    min-height: 38px;
    font-size: 13px;
  }

  .settings-card {
    padding: 10px;
    gap: 10px;
  }

  .gugudan-status-check {
    padding: 9px;
  }

  .gugudan-status-body {
    gap: 7px;
    margin-top: 7px;
  }

  .gugudan-status-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .gugudan-status-actions .ghost-action {
    min-height: 40px;
    padding-inline: 6px;
    font-size: 12px;
  }

  .character-button {
    min-height: 64px;
    grid-template-rows: 38px auto;
    padding: 5px;
  }

  .character-button img,
  .random-character-mark {
    width: 38px;
    height: 38px;
  }

  .showcase-card {
    min-height: 270px;
    grid-template-rows: minmax(214px, 1fr) auto;
  }

  .showcase-strip {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 7px;
  }

  .showcase-strip span {
    min-height: 30px;
    font-size: 11px;
  }

  .play-screen {
    height: 100%;
    padding: 8px;
  }

  .play-topline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 8px;
  }

  .ghost-action,
  .primary-action {
    min-height: 38px;
    padding-inline: 10px;
  }

  .timer-pill {
    min-width: 72px;
    padding: 8px 9px;
  }

  .play-topline .timer-pill {
    min-width: 98px;
    min-height: 38px;
    font-size: 17px;
    padding: 5px 7px;
  }

  .play-topline .timer-pill::before {
    font-size: 10px;
  }

  .play-layout {
    gap: 8px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .stage-panel {
    padding: 7px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stage-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .quiz-gauge-button {
    min-height: 28px;
    min-width: 78px;
    font-size: 11px;
  }

  .score-chip {
    padding: 6px;
  }

  .score-chip b,
  .score-chip span {
    font-size: 11px;
  }

  .question-area {
    padding: 8px;
    max-height: 118px;
  }

  .run-panel {
    gap: 6px;
  }

  .run-card {
    padding: 6px;
  }

  .run-card b,
  .run-card span {
    font-size: 11px;
  }

  .active-run-card {
    display: none;
  }

  .touch-controls {
    gap: 20px;
  }

  .touch-button {
    width: 50px;
    min-height: 46px;
    font-size: 16px;
  }

  .touch-jump {
    width: 80px;
    min-height: 54px;
  }

  .quiz-map-button {
    min-width: 88px;
    min-height: 46px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .map-view-grid {
    gap: 6px;
  }

  .map-view-grid.player-count-2,
  .map-view-grid.player-count-3 {
    grid-template-columns: repeat(var(--split-columns, 2), minmax(0, 1fr));
  }

  .map-view-grid.player-count-3 {
    --split-columns: 3;
  }

  .player-viewport-hud {
    left: 5px;
    top: 5px;
    right: 5px;
    gap: 4px;
  }

  .player-viewport-name,
  .player-viewport-stat,
  .height-record-badge {
    padding: 4px 6px;
    font-size: 10px;
  }

  .player-mini-gauge {
    left: 5px;
    right: 5px;
    top: 37px;
    height: 6px;
  }

  .height-record-badge {
    top: 48px;
  }

  .quiz-layer {
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 3px;
    background: rgba(12, 10, 8, 0.5);
  }

  .quiz-card {
    width: 100%;
    height: 100%;
    max-height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 7px;
    gap: 6px;
  }

  .quiz-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.36fr) minmax(0, 0.64fr);
    gap: 6px;
  }

  .quiz-card .choice-button {
    min-height: 0;
  }

  .question-kicker {
    font-size: clamp(18px, 5.2vw, 28px);
    line-height: 1.16;
  }

  .quiz-meta-line {
    font-size: clamp(13px, 3.8vw, 17px);
  }

  .quiz-progress-badge {
    min-width: 54px;
    padding: 3px 8px;
  }

  .question-text {
    padding: 10px;
    font-size: clamp(28px, 8vw, 42px);
  }

  .question-image-wrap {
    padding: 5px;
    border-width: 2px;
  }

  .question-image-wrap img {
    height: 100%;
  }

  .choice-grid {
    gap: 8px;
  }

  .choice-button {
    padding: 10px;
    border-width: 2px;
    border-radius: 14px;
  }

  .choice-text {
    font-size: clamp(18px, 5.6vw, 30px);
  }

  .choice-index {
    width: 30px;
    height: 30px;
    border-width: 1px;
    font-size: 16px;
  }

  .feedback-line {
    min-height: 24px;
    font-size: clamp(16px, 4vw, 22px);
  }

  .jumper-label {
    display: none;
  }
}

@media (min-width: 900px) and (max-height: 650px) {
  .map-view-grid.player-count-3 .quiz-card,
  .map-view-grid.player-count-4 .quiz-card {
    padding: 4px;
    gap: 3px;
  }

  .map-view-grid.player-count-3 .quiz-header,
  .map-view-grid.player-count-4 .quiz-header {
    gap: 2px;
  }

  .map-view-grid.player-count-3 .quiz-meta-line,
  .map-view-grid.player-count-4 .quiz-meta-line {
    font-size: 11px;
    gap: 5px;
  }

  .map-view-grid.player-count-3 .quiz-progress-badge,
  .map-view-grid.player-count-4 .quiz-progress-badge {
    min-width: 42px;
    padding: 2px 6px;
  }

  .map-view-grid.player-count-3 .question-kicker,
  .map-view-grid.player-count-4 .question-kicker {
    font-size: clamp(13px, 1vw, 18px);
    line-height: 1.08;
  }

  .map-view-grid.player-count-3 .quiz-body,
  .map-view-grid.player-count-4 .quiz-body {
    gap: 4px;
  }

  .map-view-grid.player-count-3 .question-text,
  .map-view-grid.player-count-4 .question-text {
    padding: 7px;
    border-width: 2px;
    border-radius: 10px;
    font-size: clamp(24px, 3vw, 38px);
  }

  .map-view-grid.player-count-3 .choice-grid,
  .map-view-grid.player-count-4 .choice-grid {
    gap: 4px;
  }

  .map-view-grid.player-count-3 .choice-button,
  .map-view-grid.player-count-4 .choice-button {
    padding: 5px;
    border-width: 2px;
    border-radius: 10px;
  }

  .map-view-grid.player-count-3 .choice-text,
  .map-view-grid.player-count-4 .choice-text {
    font-size: clamp(18px, 2.2vw, 30px);
  }

  .map-view-grid.player-count-3 .choice-index,
  .map-view-grid.player-count-4 .choice-index {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .map-view-grid.player-count-3 .feedback-line,
  .map-view-grid.player-count-4 .feedback-line {
    min-height: 17px;
    font-size: clamp(12px, 1vw, 16px);
    line-height: 1.05;
  }
}

@media (max-width: 720px) {
  .map-view-grid.player-count-2 .touch-controls,
  .map-view-grid.player-count-3 .touch-controls,
  .map-view-grid.player-count-4 .touch-controls {
    left: 4px;
    bottom: 4px;
    width: 82px;
    display: grid;
    grid-template-columns: repeat(2, 36px);
    align-items: end;
    column-gap: 10px;
    row-gap: 10px;
  }

  .map-view-grid.player-count-2 .touch-button,
  .map-view-grid.player-count-3 .touch-button,
  .map-view-grid.player-count-4 .touch-button {
    width: 36px;
    min-height: 38px;
    border-width: 1px;
    font-size: 13px;
  }

  .map-view-grid.player-count-2 .touch-jump,
  .map-view-grid.player-count-3 .touch-jump,
  .map-view-grid.player-count-4 .touch-jump {
    grid-column: 1 / -1;
    width: 82px;
    min-height: 38px;
    margin-left: 0;
    font-size: 12px;
  }

  .map-view-grid.player-count-2 .quiz-map-button,
  .map-view-grid.player-count-3 .quiz-map-button,
  .map-view-grid.player-count-4 .quiz-map-button {
    right: 4px;
    bottom: 92px;
    min-width: 54px;
    min-height: 36px;
    padding-inline: 4px;
    font-size: 9px;
    line-height: 1.05;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .topbar {
    gap: 8px;
  }

  .session-badge {
    display: none;
  }

  .setup-screen {
    overflow: auto;
    max-height: none;
  }

  .time-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .option-button {
    min-height: 34px;
    padding: 0 2px;
  }

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

  .play-screen {
    height: 100%;
  }

  .play-layout {
    grid-template-rows: minmax(0, 1fr);
  }

  .play-title {
    font-size: 14px;
  }

  .question-area {
    display: none;
  }

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

  .score-chip {
    padding: 5px;
  }

  .score-chip b,
  .score-chip span {
    font-size: 10px;
  }

  .touch-controls {
    bottom: 6px;
    gap: 16px;
  }

  .map-view-grid.player-count-2 .touch-controls,
  .map-view-grid.player-count-3 .touch-controls,
  .map-view-grid.player-count-4 .touch-controls {
    left: 4px;
    bottom: 4px;
    width: 82px;
    display: grid;
    grid-template-columns: repeat(2, 36px);
    align-items: end;
    column-gap: 10px;
    row-gap: 10px;
  }

  .touch-button {
    width: 46px;
    min-height: 42px;
  }

  .map-view-grid.player-count-2 .touch-button,
  .map-view-grid.player-count-3 .touch-button,
  .map-view-grid.player-count-4 .touch-button {
    width: 36px;
    min-height: 38px;
    border-width: 1px;
    font-size: 13px;
  }

  .touch-jump {
    width: 72px;
    min-height: 50px;
    margin-left: 24px;
  }

  .map-view-grid.player-count-2 .touch-jump,
  .map-view-grid.player-count-3 .touch-jump,
  .map-view-grid.player-count-4 .touch-jump {
    grid-column: 1 / -1;
    width: 82px;
    min-height: 38px;
    margin-left: 0;
    font-size: 12px;
  }

  .quiz-card {
    max-height: calc(100% - 4px);
    padding: 8px;
    gap: 8px;
  }

  .quiz-body {
    grid-template-rows: minmax(0, 0.3fr) minmax(0, 0.7fr);
    gap: 5px;
  }

  .quiz-gauge-button {
    min-width: 66px;
    padding-inline: 4px;
  }

  .quiz-map-button {
    right: 6px;
    bottom: 6px;
    min-width: 76px;
    min-height: 42px;
    font-size: 11px;
  }

  .map-view-grid.player-count-2 .quiz-map-button,
  .map-view-grid.player-count-3 .quiz-map-button,
  .map-view-grid.player-count-4 .quiz-map-button {
    right: 4px;
    bottom: 92px;
    min-width: 54px;
    min-height: 36px;
    padding-inline: 4px;
    font-size: 9px;
    line-height: 1.05;
    white-space: normal;
  }

  .quiz-card .choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-card .choice-button {
    min-height: 0;
    font-size: 12px;
  }

  .question-kicker {
    font-size: clamp(14px, 4.8vw, 22px);
  }

  .question-text {
    font-size: clamp(24px, 9vw, 36px);
  }

  .choice-button {
    padding: 5px;
  }

  .choice-text {
    font-size: clamp(16px, 6.4vw, 26px);
  }

  .choice-index {
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .result-screen {
    max-height: none;
  }
}

body[data-viewport-class="tablet"] .map-view-grid.player-count-2 {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body[data-screen="play"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .map-view-grid.player-count-2 [data-player-viewport="0"] {
  order: 2;
  transform: none;
}

body[data-screen="play"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .map-view-grid.player-count-2 [data-player-viewport="1"] {
  order: 1;
  transform: rotate(180deg);
  transform-origin: center;
}

body[data-screen="play"] .play-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

body[data-screen="play"] .play-screen {
  padding: 4px;
}

body[data-screen="play"] .question-area {
  display: none;
}

body[data-screen="play"] .map-stage-panel {
  padding: 0;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

body[data-screen="play"] .stage-head {
  display: none;
}

body[data-screen="play"] .map-view-grid.player-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-screen {
  padding: 4px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal {
  position: relative;
  width: min(980px, 100%);
  height: calc(100dvh - 12px);
  max-height: none;
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
  padding: 6px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-header,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-grid {
  display: none;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-results.player-count-2 {
  height: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: 5px;
  overflow: hidden;
  padding: 0;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-results-heading {
  display: none;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-result-card[data-result-player="1"] {
  order: 1;
  transform: rotate(180deg);
  transform-origin: center;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-result-card[data-result-player="0"] {
  order: 3;
  transform: none;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-result-card {
  height: 100%;
  border-top: 0;
  border-left: 7px solid var(--player-result-border);
  padding: 8px;
  gap: 6px;
  overflow: auto;
  grid-template-rows: auto;
  grid-auto-rows: auto;
  background:
    linear-gradient(180deg, var(--player-result-bg), #ffffff 40%, var(--player-result-bg-soft)),
    #ffffff;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--player-color, var(--primary)) 20%, rgba(15, 23, 42, 0.08)),
    0 8px 18px rgba(15, 23, 42, 0.05);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-head {
  gap: 5px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-head span,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-head em {
  padding: 3px 7px;
  font-size: 10px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-head strong {
  font-size: clamp(15px, 2vh, 22px);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-session {
  font-size: 10px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-scoreplate {
  padding: 8px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-scoreplate strong {
  font-size: clamp(28px, 4.8vh, 48px);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-scoreplate span {
  font-size: 10px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-grade-badge {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 6px;
  gap: 6px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-grade-badge > div:last-child > span,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-grade-badge em {
  font-size: 10px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-grade-badge b {
  font-size: clamp(13px, 1.8vh, 18px);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-grade-badge strong {
  font-size: clamp(16px, 2.2vh, 24px);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-status-line {
  display: none;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-main {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-main div {
  padding: 6px 5px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-main b {
  font-size: clamp(15px, 2.4vh, 24px);
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-card-main span {
  margin-top: 2px;
  font-size: 10px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-height-meter,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-accuracy-meter {
  height: 6px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center {
  order: 2;
  min-height: 58px;
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-radius: var(--radius);
  color: #ffffff;
  background: #17315f;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(116px, 0.28fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center span,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center dt {
  color: rgba(224, 242, 254, 0.82);
  font-size: 10px;
  font-weight: 900;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center b {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center dl {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center div {
  min-width: 0;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center dd {
  min-width: 0;
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-actions {
  position: static;
  transform: none;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(20, 32, 47, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  justify-content: center;
  gap: 5px;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-actions .primary-action,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-actions .ghost-action {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-screen="result"][data-display-mode="wide"] .player-results {
  grid-template-rows: auto;
  grid-auto-rows: auto;
  align-self: center;
  align-content: center;
  overflow: auto;
}

@media (max-width: 900px) {
  body[data-screen="result"][data-display-mode="wide"] .result-screen {
    padding: 4px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-modal {
    width: 100%;
    height: calc(100dvh - 8px);
    max-height: none;
    padding: 6px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-header {
    padding-bottom: 5px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-header h2 {
    font-size: clamp(20px, 4.6vw, 30px);
  }

  body[data-screen="result"][data-display-mode="wide"] .result-header p {
    margin-top: 2px;
    font-size: 11px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-header .timer-pill,
  body[data-screen="result"][data-display-mode="wide"] .result-header-tools .compact-action {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-grid,
  body[data-screen="result"][data-display-mode="wide"] .player-results-heading,
  body[data-screen="result"][data-display-mode="wide"] .player-card-session,
  body[data-screen="result"][data-display-mode="wide"] .player-status-line {
    display: none;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-results {
    gap: 5px;
    padding: 0;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-result-card {
    border-top: 0;
    border-left: 5px solid color-mix(in srgb, var(--player-color, var(--primary)) 30%, #94a3b8);
    padding: 6px;
    gap: 6px;
    overflow: auto;
    grid-template-rows: auto;
    grid-auto-rows: auto;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-head span,
  body[data-screen="result"][data-display-mode="wide"] .player-card-head em {
    width: fit-content;
    max-width: 100%;
    padding: 3px 6px;
    font-size: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-head strong {
    font-size: clamp(12px, 2.6vw, 16px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-result-content {
    gap: 5px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-result-hero {
    gap: 5px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-height-panel {
    min-height: 0;
    padding: 5px;
    border-radius: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel .grade-badge-mark {
    width: 34px;
    border-radius: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel span,
  body[data-screen="result"][data-display-mode="wide"] .player-height-panel span,
  body[data-screen="result"][data-display-mode="wide"] .player-title-panel em,
  body[data-screen="result"][data-display-mode="wide"] .player-height-panel em {
    font-size: 9px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel strong {
    font-size: clamp(12px, 2.6vw, 16px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-height-panel strong {
    font-size: clamp(22px, 5.1vw, 34px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-support-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-support-line span {
    padding: 5px 6px;
    font-size: 9px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-support-line b {
    display: inline;
    margin-top: 0;
    font-size: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-scoreplate {
    padding: 6px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-scoreplate strong {
    font-size: clamp(20px, 5.2vw, 34px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-scoreplate span,
  body[data-screen="result"][data-display-mode="wide"] .player-scoreplate b {
    font-size: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-grade-badge {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 5px;
    gap: 5px;
    border-radius: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .grade-badge-mark {
    border-radius: 10px;
  }

  body[data-screen="result"][data-display-mode="wide"] .grade-badge-mark::after {
    inset: 5px;
    border-radius: 7px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-grade-badge > div:last-child > span,
  body[data-screen="result"][data-display-mode="wide"] .player-grade-badge em {
    font-size: 9px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-grade-badge b {
    font-size: clamp(12px, 2.4vw, 15px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-grade-badge strong {
    font-size: clamp(13px, 2.8vw, 18px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-status-line {
    padding: 5px 6px;
    gap: 2px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-status-line span,
  body[data-screen="result"][data-display-mode="wide"] .player-status-line em {
    font-size: 9px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-status-line b {
    font-size: clamp(14px, 3.2vw, 20px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-main {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-main div {
    padding: 5px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-main b {
    font-size: clamp(14px, 3.4vw, 20px);
  }

  body[data-screen="result"][data-display-mode="wide"] .player-card-main span {
    margin-top: 1px;
    font-size: 9px;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-height-meter,
  body[data-screen="result"][data-display-mode="wide"] .player-accuracy-meter {
    height: 6px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-actions {
    margin: 0;
    gap: 6px;
  }

  body[data-screen="result"][data-display-mode="wide"] .result-actions .primary-action,
  body[data-screen="result"][data-display-mode="wide"] .result-actions .ghost-action {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 11px;
  }
}

@media (max-width: 1050px) {
  .gugudan-record-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

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

@media (max-width: 720px) {
  .result-modal.has-gugudan-record {
    grid-template-rows: auto auto auto auto;
    overflow: auto;
  }

  .result-modal.has-gugudan-record .player-results,
  .result-modal.has-gugudan-record .player-results.player-count-1 {
    grid-auto-rows: auto;
    align-content: start;
    overflow: visible;
  }

  .gugudan-record-panel {
    padding: 10px;
    gap: 8px;
  }

  .gugudan-record-copy b {
    font-size: 15px;
  }

  .gugudan-record-copy p,
  .gugudan-record-status {
    font-size: 11px;
  }

  .gugudan-record-actions {
    grid-template-columns: 1fr;
  }

  .gugudan-record-actions .primary-action,
  .gugudan-record-actions .ghost-action {
    min-height: 38px;
    font-size: 12px;
  }

  .gugudan-status-action {
    min-width: 0;
  }

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

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

  .gugudan-status-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .gugudan-report-modal {
    padding: 7px;
  }

  .gugudan-report-card {
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 10px;
  }

  .gugudan-report-head {
    padding: 12px;
    align-items: center;
  }

  .gugudan-report-head h2 {
    font-size: 23px;
  }

  .gugudan-report-head p {
    font-size: 11px;
  }

  .gugudan-report-close-button {
    min-height: 36px;
    padding-inline: 12px;
  }

  .gugudan-report-body {
    padding: 10px;
    gap: 9px;
  }

  .gugudan-report-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .gugudan-report-hero strong {
    font-size: 34px;
  }

  .gugudan-report-hero p {
    font-size: 15px;
  }

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

  .gugudan-report-metrics div {
    padding: 9px;
  }

  .gugudan-report-metrics strong {
    font-size: 26px;
  }

  .gugudan-report-section {
    padding: 10px;
    gap: 9px;
  }

  .gugudan-report-section-head {
    display: grid;
    gap: 3px;
  }

  .gugudan-report-section-head h3 {
    font-size: 18px;
  }

  .gugudan-weak-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .gugudan-dan-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gugudan-heatmap {
    grid-template-columns: 24px repeat(9, minmax(42px, 1fr));
    gap: 4px;
  }

  .gugudan-heatmap-cell {
    min-width: 42px;
    min-height: 38px;
    padding: 4px 2px;
  }
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal.has-gugudan-record {
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: auto;
}

/* Result layout refinement: keep the screen quiet and make each player's own result the focus. */
body[data-screen="result"] .result-screen {
  background: #eef3f1;
  overflow: auto;
  overscroll-behavior: contain;
}

body[data-screen="result"] .result-modal {
  width: min(1280px, 100%);
  height: min(820px, calc(100dvh - clamp(20px, 4vw, 48px)));
  max-height: calc(100dvh - clamp(20px, 4vw, 48px));
  border-color: rgba(30, 41, 59, 0.14);
  background: #fbfcfd;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(8px, 1vw, 12px);
}

body[data-screen="result"] .result-modal.is-single-result {
  width: min(920px, 100%);
}

body[data-screen="result"] .result-modal.is-split-result {
  width: min(1500px, 100%);
}

body[data-screen="result"] .result-header {
  padding: clamp(8px, 1vw, 12px) clamp(10px, 1.2vw, 14px);
  border: 1px solid rgba(30, 41, 59, 0.11);
  background: #ffffff;
  box-shadow: none;
}

body[data-screen="result"] .result-header h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.04;
}

body[data-screen="result"] .result-header p {
  margin-top: 4px;
  max-width: 72ch;
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.25;
}

body[data-screen="result"] .result-header .screen-kicker {
  font-size: 12px;
  letter-spacing: 0.04em;
}

body[data-screen="result"] .result-grid {
  display: none;
}

body[data-screen="result"] .player-results {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
  align-content: stretch;
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(8px, 1vw, 12px);
}

body[data-screen="result"] .player-results.player-count-1 {
  grid-template-columns: minmax(0, min(760px, 100%));
  justify-content: center;
}

body[data-screen="result"] .player-result-card {
  height: 100%;
  min-height: 0;
  --player-result-border: color-mix(in srgb, var(--player-color, var(--primary)) 62%, #475569);
  --player-result-bg: color-mix(in srgb, var(--player-color, var(--primary)) 12%, #ffffff);
  --player-result-bg-soft: color-mix(in srgb, var(--player-color, var(--primary)) 5%, #ffffff);
  border-top: 0;
  border-left: 7px solid var(--player-result-border);
  padding: clamp(12px, 1.25vw, 18px);
  background:
    linear-gradient(180deg, var(--player-result-bg), #ffffff 36%, var(--player-result-bg-soft)),
    #ffffff;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--player-color, var(--primary)) 22%, rgba(15, 23, 42, 0.08)),
    0 10px 22px rgba(15, 23, 42, 0.05);
}

body[data-screen="result"] .player-result-card.is-top-rank {
  border-left-color: var(--player-result-border);
}

body[data-screen="result"] .player-result-content {
  max-width: 620px;
  height: 100%;
  align-content: center;
  gap: clamp(9px, 1vw, 13px);
  margin: 0 auto;
}

body[data-screen="result"] .player-results.player-count-3 .player-result-content,
body[data-screen="result"] .player-results.player-count-4 .player-result-content {
  max-width: none;
}

body[data-screen="result"] .player-card-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

body[data-screen="result"] .player-card-head span,
body[data-screen="result"] .player-card-head em {
  background: color-mix(in srgb, var(--player-color, var(--primary)) 18%, #ffffff);
  color: color-mix(in srgb, var(--player-color, var(--primary)) 42%, #0f172a);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: clamp(11px, 0.9vw, 13px);
}

body[data-screen="result"] .player-card-head em {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.18);
}

body[data-screen="result"] .player-card-head strong {
  color: #0f172a;
  font-size: clamp(15px, 1.15vw, 19px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-screen="result"] .player-result-hero {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 0.9vw, 12px);
}

body[data-screen="result"] .player-title-panel,
body[data-screen="result"] .player-height-panel {
  min-height: clamp(112px, 18dvh, 172px);
  border-color: rgba(30, 41, 59, 0.1);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.045);
}

body[data-screen="result"] .player-title-panel {
  grid-template-columns: clamp(54px, 4.6vw, 70px) minmax(0, 1fr);
  justify-items: stretch;
  text-align: left;
}

body[data-screen="result"] .player-results.player-count-3 .player-title-panel,
body[data-screen="result"] .player-results.player-count-4 .player-title-panel {
  grid-template-columns: clamp(42px, 3.5vw, 54px) minmax(0, 1fr);
  justify-items: stretch;
  text-align: left;
}

body[data-screen="result"] .player-title-panel .grade-badge-mark {
  width: 100%;
  max-width: 70px;
  border-radius: 14px;
}

body[data-screen="result"] .player-results.player-count-3 .player-title-panel .grade-badge-mark,
body[data-screen="result"] .player-results.player-count-4 .player-title-panel .grade-badge-mark {
  width: 100%;
  max-width: 54px;
}

body[data-screen="result"] .player-title-panel span,
body[data-screen="result"] .player-height-panel span,
body[data-screen="result"] .player-title-panel em,
body[data-screen="result"] .player-height-panel em {
  font-size: clamp(10px, 0.78vw, 12px);
}

body[data-screen="result"] .player-title-panel strong {
  font-size: clamp(20px, 1.65vw, 28px);
  line-height: 1.08;
  word-break: keep-all;
  overflow-wrap: normal;
}

body[data-screen="result"] .player-results.player-count-3 .player-title-panel strong,
body[data-screen="result"] .player-results.player-count-4 .player-title-panel strong {
  font-size: clamp(16px, 1.25vw, 22px);
}

body[data-screen="result"] .player-height-panel {
  align-content: center;
}

body[data-screen="result"] .player-height-panel strong {
  font-size: clamp(42px, 5vw, 70px);
}

body[data-screen="result"] .player-results.player-count-3 .player-height-panel strong,
body[data-screen="result"] .player-results.player-count-4 .player-height-panel strong {
  font-size: clamp(32px, 3.4vw, 52px);
}

body[data-screen="result"] .player-support-line {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

body[data-screen="result"] .player-support-line span {
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px 9px;
  line-height: 1.18;
}

body[data-screen="result"] .player-support-line b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-screen="result"] .player-height-meter,
body[data-screen="result"] .player-accuracy-meter {
  height: 7px;
  background: rgba(15, 23, 42, 0.09);
}

body[data-screen="result"] .player-height-meter i {
  background: color-mix(in srgb, var(--player-color, var(--primary)) 48%, #64748b);
}

body[data-screen="result"] .player-accuracy-meter i {
  background: #64748b;
}

body[data-screen="result"] .result-actions {
  justify-content: center;
  gap: 8px;
}

body[data-screen="result"] .result-actions .primary-action,
body[data-screen="result"] .result-actions .ghost-action {
  min-width: min(260px, 46%);
}

@media (max-width: 900px) {
  body[data-screen="result"] .result-screen {
    padding: 8px;
  }

  body[data-screen="result"] .result-modal {
    height: calc(100dvh - 16px);
    max-height: none;
    padding: 10px;
  }

  body[data-screen="result"] .result-header {
    padding: 9px;
  }

  body[data-screen="result"] .result-header h2 {
    font-size: clamp(22px, 6vw, 30px);
  }

  body[data-screen="result"] .player-results,
  body[data-screen="result"] .player-results.player-count-1,
  body[data-screen="result"] .player-results.player-count-2,
  body[data-screen="result"] .player-results.player-count-3,
  body[data-screen="result"] .player-results.player-count-4 {
    grid-template-columns: 1fr;
    overflow: auto;
    align-content: start;
  }

  body[data-screen="result"] .player-result-card {
    min-height: 320px;
    height: auto;
  }
}

@media (max-width: 620px) {
  body[data-screen="result"] .result-modal {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  body[data-screen="result"] .result-header {
    align-items: stretch;
  }

  body[data-screen="result"] .result-header-tools {
    padding-right: 0;
  }

  body[data-screen="result"] .player-result-hero {
    grid-template-columns: 1fr;
  }

  body[data-screen="result"] .player-title-panel,
  body[data-screen="result"] .player-height-panel {
    min-height: 104px;
  }

  body[data-screen="result"] .player-support-line {
    grid-template-columns: 1fr;
  }

  body[data-screen="result"] .result-actions .primary-action,
  body[data-screen="result"] .result-actions .ghost-action {
    min-width: 0;
    flex: 1 1 140px;
  }
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal {
  height: calc(100dvh - 12px);
  grid-template-rows: minmax(0, 1fr) auto;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-header,
body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-grid {
  display: none;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-results.player-count-2 {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  overflow: hidden;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-results.player-count-2 .player-result-card {
  min-height: 0;
  height: 100%;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .player-results.player-count-2 .player-result-content {
  align-content: center;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .jumpmap-face-result-center {
  background: #24364d;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal.has-gugudan-record {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal:not(.is-face-result) {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal:not(.is-face-result) .result-header {
  display: flex;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal:not(.is-face-result) .player-results {
  height: 100%;
  align-content: center;
  grid-auto-rows: auto;
  overflow: auto;
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal:not(.is-face-result) .player-result-card {
  height: auto;
}

body[data-screen="result"] .result-modal.has-gugudan-record .player-results {
  align-content: center;
}

body[data-screen="result"][data-display-mode="wide"] .player-results {
  height: 100%;
  align-self: stretch;
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  overflow: hidden;
}

body[data-screen="result"][data-display-mode="wide"] .player-result-card {
  height: 100%;
}

body[data-screen="result"][data-display-mode="wide"] .player-result-content {
  align-content: center;
}

@media (max-width: 980px) {
  body[data-screen="result"][data-display-mode="wide"] .player-result-hero {
    grid-template-columns: 1fr;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-height-panel {
    min-height: 0;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-title-panel {
    grid-template-columns: clamp(38px, 5vw, 48px) minmax(0, 1fr);
    text-align: left;
  }

  body[data-screen="result"][data-display-mode="wide"] .player-title-panel strong,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-title-panel strong,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-title-panel strong {
    font-size: clamp(15px, 2.1vw, 20px);
    word-break: keep-all;
  }

body[data-screen="result"][data-display-mode="wide"] .player-height-panel strong,
body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-height-panel strong,
body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-height-panel strong {
  font-size: clamp(30px, 4.8vw, 48px);
  }
}

/* When a learning-record card is present, treat result and save controls as one result workspace. */
body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) {
  height: min(760px, calc(100dvh - clamp(18px, 3vw, 38px)));
  grid-template-rows: auto auto auto auto;
  align-content: center;
  overflow: auto;
}

body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results {
  height: auto;
  min-height: 0;
  overflow: visible;
  align-self: stretch;
  align-content: center;
  grid-auto-rows: auto;
}

body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-card {
  height: auto;
  min-height: 0;
}

body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-content {
  height: auto;
}

body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-panel {
  align-self: stretch;
  box-shadow: inset 5px 0 0 rgba(37, 99, 235, 0.08);
}

@media (min-width: 760px) {
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) {
    width: min(1180px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .result-header {
    grid-column: 1 / -1;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    overflow: hidden;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-card {
    height: 100%;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-actions {
    grid-template-columns: 1fr;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-status {
    grid-column: auto;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .result-actions {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (max-width: 759px) {
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) {
    height: calc(100dvh - 16px);
    max-height: none;
    align-content: start;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results {
    align-content: start;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-card {
    min-height: 0;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .gugudan-record-actions {
    grid-template-columns: 1fr;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-title-panel,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-height-panel {
    min-height: 92px;
    padding: 9px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-title-panel {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 7px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-title-panel strong {
    font-size: clamp(16px, 4.2vw, 19px);
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-height-panel strong {
    font-size: clamp(34px, 9vw, 44px);
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-support-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-support-line span {
    padding: 6px;
    font-size: 10px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-support-line b {
    font-size: 11px;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-height-meter,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-accuracy-meter {
    height: 5px;
  }
}

body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) {
  height: auto;
  min-height: 0;
  align-content: center;
}

@media (min-width: 760px) {
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) {
    grid-template-rows: auto auto auto;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results {
    height: auto;
    align-self: center;
    overflow: visible;
  }

  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-result-card {
    height: auto;
  }
}

body[data-screen="result"][data-viewport-class="tablet"][data-viewport-orientation="portrait"] .result-modal.has-gugudan-record:not(.is-face-result) {
  height: auto;
  max-height: calc(100dvh - 24px);
}

@media (max-width: 820px) {
  body[data-screen="result"] .player-results.player-count-3 .player-title-panel,
  body[data-screen="result"] .player-results.player-count-4 .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-title-panel,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-title-panel,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results.player-count-3 .player-title-panel,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results.player-count-4 .player-title-panel {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  body[data-screen="result"] .player-results.player-count-3 .player-title-panel > div:last-child,
  body[data-screen="result"] .player-results.player-count-4 .player-title-panel > div:last-child,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-title-panel > div:last-child,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-title-panel > div:last-child,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results.player-count-3 .player-title-panel > div:last-child,
  body[data-screen="result"] .result-modal.has-gugudan-record:not(.is-face-result) .player-results.player-count-4 .player-title-panel > div:last-child {
    width: 100%;
    justify-items: center;
  }

  body[data-screen="result"] .player-results.player-count-3 .player-title-panel .grade-badge-mark,
  body[data-screen="result"] .player-results.player-count-4 .player-title-panel .grade-badge-mark,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-3 .player-title-panel .grade-badge-mark,
  body[data-screen="result"][data-display-mode="wide"] .player-results.player-count-4 .player-title-panel .grade-badge-mark {
    width: clamp(42px, 12vw, 54px);
    max-width: 54px;
  }
}


/* Pinky NE bundled home link */
.pinky-home-link,
.result-actions .pinky-result-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(211, 22, 95, 0.24);
  border-radius: 999px;
  color: #be185d;
  background: rgba(255, 255, 255, 0.94);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.pinky-home-link:hover,
.result-actions .pinky-result-home:hover {
  border-color: rgba(211, 22, 95, 0.42);
  background: #fff5f8;
}
