/* Paddock — duel / play page (game.html) and end-of-run results. Replaces the legacy game.css.
   The stage content (.duel-card, .ranking-*, .single-judge-panel, .game-results-panel) is written by site.js. */

/* Shared header only on the results screen; the run itself is full-screen (HUD). */
body.pd-game-page:not(.pd-game-done) .topbar,
body.pd-game-page:not(.pd-game-done) .sidebar,
body.pd-game-page:not(.pd-game-done) .sidebar-backdrop { display: none !important; }

body.pd-game-done .pd-game-hud,
body.pd-game-done .pd-game-progress,
body.pd-game-done .pd-game-body { display: none !important; }

.pd-game [hidden] { display: none !important; }
.pd-game .cut-corners { clip-path: none !important; }
.pd-game .cut-corners::before { display: none !important; }

.pd-game {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--pd-bg);
  color: var(--pd-ink);
}

/* ---------- HUD ---------- */
.pd-game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 0 var(--pd-gutter);
  border-bottom: 1px solid var(--pd-line);
}

.pd-game-quit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--pd-ink);
  font-family: var(--pd-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.pd-game-quit:hover { color: var(--pd-red-hi); }

.pd-game-hud-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 200px;
  text-align: center;
}

.pd-game-list { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-game-count { font-size: 26px; }

.pd-game-clock { color: var(--pd-ink); font-size: 14px; letter-spacing: 0.08em; }
.pd-game-later.pd-btn { min-height: 44px; }

.pd-game-progress { height: 10px; }
.pd-game-progress > i { transition: width 0.25s ease; }

/* ---------- body ---------- */
.pd-game-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
}

.pd-game-main {
  flex: 999 1 720px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px clamp(16px, 3vw, 40px);
}

body .pd-game .game-context.pd-game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end !important;
  justify-content: space-between;
  gap: 12px;
  width: auto !important;
}

.pd-game-head-copy { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

body .pd-game .game-mode-button {
  display: block;
  width: auto !important;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}

.pd-game-question { font-size: clamp(28px, 3vw, 40px); }
.pd-game-last { flex: none; }

.pd-game-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pd-game-keyhint { display: inline-flex; align-items: center; gap: 8px; }
.pd-game-leader { display: none; }

.pd-game-kc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid #3a3a3e !important;
  color: var(--pd-ink);
  font: 700 13px var(--pd-mono);
  letter-spacing: 0;
}

.pd-game-keyhint .pd-game-kc { width: 28px; height: 28px; font-size: 11px; }

/* ---------- stage: duel ---------- */
body .pd-game .game-stage {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
}

body .pd-game .duel-card {
  position: relative;
  flex: 1 1 300px;
  min-width: 0;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  margin: 0;
  padding: 36px 48px;
  overflow: hidden;
  border: 0;
  background: var(--pd-panel);
  color: var(--pd-ink);
  text-align: left;
  cursor: pointer;
  outline: none;
  transform: none;
  box-shadow: none;
}

body .pd-game .duel-card-left { clip-path: polygon(0 0, 100% 0, calc(100% - 36px) 100%, 0 100%); }
body .pd-game .duel-card-right { clip-path: polygon(36px 0, 100% 0, 100% 100%, 0 100%); padding-left: 72px; }
body .pd-game .duel-card:hover { background: #1a1a1c; }
body .pd-game .duel-card:focus-visible { box-shadow: inset 0 0 0 3px var(--pd-ink); }

.pd-duel-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 6px;
  background: #2a2a2d;
}

.duel-card:hover .pd-duel-bar,
.duel-card:focus-visible .pd-duel-bar { background: var(--pd-red); }

.pd-duel-code {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  height: 52%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1c1c1e repeating-linear-gradient(135deg, transparent 0 10px, #222225 10px 11px);
  color: #232326;
  font-size: 180px;
  pointer-events: none;
}

body .pd-game .duel-card img {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 52%;
  margin: 0;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  pointer-events: none;
}

body .pd-game .duel-card-right img,
body .pd-game .duel-card-right .pd-duel-code { left: 0; }

.pd-duel-meta { order: 1; position: relative; z-index: 2; color: var(--pd-red-hi); }
.pd-duel-meta:empty { display: none; }

body .pd-game .duel-card .game-item-title {
  order: 2;
  position: relative;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--pd-ink);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(40px, 4.4vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-shadow: none;
  overflow-wrap: normal;
  word-break: normal;
}

.pd-duel-hint { order: 3; position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }
.pd-duel-tap { display: none; }

body .pd-game .versus-beam { display: none; }

body .pd-game .versus-badge {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 3;
  margin: 0;
  padding: 14px 30px;
  border: 0;
  border-radius: 0;
  background: var(--pd-red);
  color: #fff;
  clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 56px;
  line-height: 0.92;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: none;
}

@media (hover: none), (pointer: coarse) {
  .pd-duel-hint .pd-game-kc,
  .pd-duel-click,
  .pd-game-keyhint { display: none; }
  .pd-duel-tap { display: inline; }
}

/* loading / error */
body .pd-game .game-loading {
  flex: 1 1 100%;
  min-height: 540px;
  margin: 0;
  padding: 0;
  border: 0;
  background: linear-gradient(90deg, #141415 0, #1f1f22 40%, #141415 80%);
  background-size: 200% 100%;
  animation: pd-skel 1.2s linear infinite;
}

body .pd-game .game-loading > * { display: none; }
.pd-game-error { flex: 1 1 100%; }
.pd-game-error strong { font-size: 28px; }
body.pd-game-failed .pd-game-foot,
body.pd-game-failed .pd-game-table { display: none; }

/* ---------- stage: ranking mode ---------- */
body .pd-game .ranking-mode-panel {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pd-line);
  background: var(--pd-panel);
  clip-path: none;
}

body .pd-game .ranking-mode-head { padding: 18px 20px; }

body .pd-game .ranking-mode-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body .pd-game .ranking-mode-head p { margin: 0; color: var(--pd-mute); font-family: var(--pd-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
body .pd-game .ranking-list { display: flex; flex-direction: column; margin: 0; padding: 0; gap: 0; }

body .pd-game .ranking-row {
  display: flex !important;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 10px 20px;
  border: 0;
  border-top: 1px solid var(--pd-line-2) !important;
  background: none;
  clip-path: none;
  grid-template-columns: none !important;
}

body .pd-game .ranking-row:hover { background: #18181a; }

body .pd-game .ranking-row > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 30px;
  background: var(--pd-ink);
  color: var(--pd-bg);
  clip-path: var(--pd-slant-sm);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 14px;
}

body .pd-game .ranking-row > span::before { content: "P"; }
body .pd-game .ranking-row:first-child > span { background: var(--pd-red); color: #fff; }

body .pd-game .ranking-media {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  clip-path: none;
}

body .pd-game .ranking-media img {
  position: static;
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: var(--pd-panel-2);
}

body .pd-game .ranking-media .game-item-title {
  position: static;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: none;
  color: var(--pd-ink);
  font-family: inherit;
  font-style: normal;
  font-weight: 800;
  font-size: 16px;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

body .pd-game [data-rank-up],
body .pd-game [data-rank-down] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--pd-line);
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
}

body .pd-game [data-rank-up]::before,
body .pd-game [data-rank-down]::before { color: var(--pd-ink); font-size: 14px; }
body .pd-game [data-rank-up]::before { content: "▲"; }
body .pd-game [data-rank-down]::before { content: "▼"; }
body .pd-game [data-rank-up]:hover,
body .pd-game [data-rank-down]:hover { border-color: var(--pd-ink) !important; }

body .pd-game .ranking-recap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 18px 20px 20px auto;
  padding: 0 36px;
  border: 0;
  background: var(--pd-red);
  color: #fff;
  clip-path: var(--pd-slant);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
}

body .pd-game .ranking-recap:hover { background: #ff2a33; }

/* ---------- stage: overrated / underrated ---------- */
body .pd-game .single-judge-panel {
  flex: 1 1 100%;
  display: flex !important;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--pd-panel);
  clip-path: var(--pd-cut);
  grid-template-columns: none !important;
}

body .pd-game .single-judge-panel .game-image-frame {
  position: relative;
  flex: 1 1 380px;
  min-height: 460px;
  margin: 0;
  overflow: hidden;
  background: #1c1c1e repeating-linear-gradient(135deg, transparent 0 10px, #222225 10px 11px);
  clip-path: none;
}

body .pd-game .single-judge-panel .game-image-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body .pd-game .single-judge-panel .game-image-frame .game-item-title { display: none; }

body .pd-game .single-judge-panel > div:last-child {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 40px;
}

body .pd-game .single-judge-panel p { margin: 0; color: var(--pd-red-hi); font-family: var(--pd-mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; }
body .pd-game .single-judge-panel h2 { margin: 0; font-size: clamp(36px, 4vw, 60px); overflow-wrap: normal; }
body .pd-game .judge-actions { display: flex; flex-wrap: wrap; gap: 12px; }

body .pd-game .judge-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 32px;
  border: 0;
  background: var(--pd-red);
  color: #fff;
  clip-path: var(--pd-slant);
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
}

body .pd-game .judge-actions [data-judge="overrated"]::before { content: "▼"; }
body .pd-game .judge-actions [data-judge="overrated"] { color: #fff !important; }
body .pd-game .judge-actions [data-judge="underrated"] { background: var(--pd-ink); color: var(--pd-bg) !important; }
body .pd-game .judge-actions [data-judge="underrated"]::before { content: "▲"; }
body .pd-game .judge-actions button:hover { filter: brightness(1.1); }

/* non-duel modes: no skip, no provisional table */
body.pd-game-page:not([data-game-mode="duel"]):not([data-game-mode="tournament"]):not([data-game-mode="guess-popularity"]) .pd-game-foot,
body.pd-game-page:not([data-game-mode="duel"]):not([data-game-mode="tournament"]):not([data-game-mode="guess-popularity"]) .pd-game-table,
body.pd-game-page:not([data-game-mode="duel"]):not([data-game-mode="tournament"]):not([data-game-mode="guess-popularity"]) .pd-game-last { display: none; }
body.pd-game-page:not([data-game-mode]) .pd-game-foot,
body.pd-game-page:not([data-game-mode]) .pd-game-table { display: flex; }

/* ---------- provisional table ---------- */
.pd-game-table {
  flex: 1 1 320px;
  min-width: 0;
  flex-direction: column;
  display: flex;
  border-left: 1px solid var(--pd-line);
  background: #0f0f10;
}

.pd-game-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px;
}

.pd-game-table-head h2 { margin: 0; font-size: 20px !important; }

.pd-game-trow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  border-top: 1px solid #1f1f22 !important;
}

.pd-game-trow .pd-m { flex: none; }
.pd-game-trow.is-live .pd-m { color: var(--pd-red-hi); }
.pd-game-tname { flex: 1; min-width: 0; overflow: hidden; font-weight: 700; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

.pd-game-remaining {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid #1f1f22 !important;
}

.pd-game-remaining .pd-d { font-size: 40px; }
.pd-game-remaining small { font-family: inherit; font-size: 16px; }

/* ---------- results (Results.dc) ---------- */
.pd-results { padding-top: var(--pd-header-h); }

.pd-podium {
  position: relative;
  overflow: hidden;
  background: #f4f4f1;
  color: #0b0b0c;
}

.pd-podium-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 56px var(--pd-gutter) 0;
}

.pd-podium-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.pd-podium-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pd-podium .pd-m { color: #4a4a4f; }
.pd-podium .pd-podium-kicker { color: var(--pd-red-dark); letter-spacing: 0.4em; }
.pd-podium-title { margin: 0; color: #0b0b0c; font-size: clamp(56px, 7.6vw, 120px) !important; line-height: 0.92 !important; }
.pd-podium-list { color: var(--pd-red); font-size: 22px; text-decoration: none; overflow-wrap: anywhere; }
.pd-podium-list:hover { color: #0b0b0c; }

.pd-podium-figure {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.pd-podium-big { color: var(--pd-red); font-size: 96px; }

.pd-podium-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding-top: 24px;
}

.pd-podium-step { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1 1 260px; max-width: 360px; }
.pd-podium-step.is-p1 { flex: 1 1 280px; max-width: 400px; }

/* Whole artwork visible (contain) over a blurred cover copy, so posters are no longer cropped. */
.pd-podium-img,
.pd-results-card-img {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: #e6e6e2 repeating-linear-gradient(135deg, transparent 0 8px, #d8d8d3 8px 9px);
  isolation: isolate;
}

.pd-podium-img[style]::before,
.pd-results-card-img[style]::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  background: var(--pd-img) center / cover no-repeat;
  filter: blur(18px) brightness(0.7);
}

.pd-podium-img img,
.pd-results-card-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.is-p1 .pd-podium-img { height: 320px; }
.is-p3 .pd-podium-img { height: 220px; }

.pd-podium-name { font-size: 26px; overflow-wrap: anywhere; }
.is-p1 .pd-podium-name { font-size: 34px; }
.is-p3 .pd-podium-name { font-size: 24px; }
.pd-podium .is-p1 .pd-podium-meta { color: var(--pd-red-dark); }

.pd-podium-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 190px;
  padding-top: 18px;
  background: #0b0b0c;
  color: var(--pd-ink);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
}

.pd-podium-block .pd-d { font-size: 120px; }
.is-p1 .pd-podium-block { height: 280px; background: var(--pd-red); color: #fff; clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
.is-p1 .pd-podium-block .pd-d { font-size: 160px; }
.is-p3 .pd-podium-block { height: 130px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
.is-p3 .pd-podium-block .pd-d { font-size: 100px; }

.pd-podium-stripe {
  height: 22px;
  background: linear-gradient(90deg, #0b0b0c 0 6%, transparent 6% 9%, #e10a17 9% 22%, transparent 22% 25%, #0b0b0c 25% 26%, transparent 26% 40%, #e10a17 40% 44%, transparent 44% 60%, #0b0b0c 60% 72%, transparent 72% 76%, #e10a17 76% 92%, transparent 92% 95%, #0b0b0c 95%);
}

.pd-results-main {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 64px var(--pd-gutter) 96px;
}

.pd-results-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.pd-results-class { flex: 999 1 620px; min-width: 0; }

.pd-results-class-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
}

.pd-results-class-head h2 { margin: 0; font-size: 24px !important; }

.pd-results-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--pd-line-2) !important;
}

.pd-results-name { flex: 1 1 200px; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.pd-results-delta { width: 60px; text-align: right; }
.pd-results-class-foot { padding: 16px 20px; border-top: 1px solid var(--pd-line-2) !important; }

.pd-results-telemetry { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pd-results-tel-title { margin: 0; letter-spacing: 0.5em !important; font-size: 11px !important; font-family: var(--pd-mono) !important; font-style: normal; font-weight: 500 !important; }
.pd-results-tel { display: flex; flex-direction: column; gap: 8px; }
.pd-results-tel-head { display: flex; justify-content: space-between; gap: 12px; }
.pd-results-tel-head > span:first-child { font-weight: 700; }

.pd-results-split {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-left: 4px solid var(--pd-red) !important;
  background: var(--pd-panel);
  color: var(--pd-soft);
  line-height: 1.5;
}

.pd-results-split strong { color: var(--pd-ink); }

.pd-results-share { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }

.pd-results-card {
  position: relative;
  flex: 0 1 380px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-top: 6px solid var(--pd-red) !important;
  background: #0b0b0c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.pd-results-card-logo { align-self: flex-start; color: #fff; font-size: 20px; }
.pd-results-card-img { height: 300px; background: #1a1a1d; }
.pd-results-card-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pd-results-card-tag { color: var(--pd-red-hi); }
.pd-results-card-copy .pd-results-card-tag:last-child { color: var(--pd-soft); }
.pd-results-card-title { font-size: 34px; line-height: 1.05; overflow-wrap: anywhere; text-transform: uppercase; }
.pd-results-card-podium { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; }
.pd-results-card-podium li { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-results-thumb {
  flex: none;
  width: 44px;
  height: 58px;
  overflow: hidden;
  background: #1a1a1d;
}

.pd-results-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }

.pd-results-share-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pd-results-share-copy .pd-kicker { letter-spacing: 0.4em; }
.pd-results-share-copy h2 { margin: 0; font-size: 48px !important; }
.pd-results-share-copy p { max-width: 520px; margin: 0; color: var(--pd-soft); font-size: 16px; line-height: 1.6; }
.pd-results-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.pd-results-next .pd-section-head h2 { margin: 0; font-size: 36px; }

.pd-results-next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pd-results-next-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--pd-line);
  background: var(--pd-panel);
  color: var(--pd-ink);
  text-decoration: none;
}

.pd-results-next-card:hover { border-color: var(--pd-ink) !important; color: #fff; }
.pd-results-next-cover { flex: none; width: 64px; height: 80px; background-size: cover; background-position: center; }
.pd-results-next-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pd-results-next-copy strong { font-weight: 800; overflow-wrap: anywhere; }

/* ---------- mobile (DuelMobile) ---------- */
@media (max-width: 760px) {
  body.pd-game-page:not(.pd-game-done) { overflow-x: hidden; }
  .pd-game { min-height: 100vh; min-height: 100dvh; }

  .pd-game-hud { flex-wrap: nowrap; gap: 8px; min-height: 60px; padding: 8px 12px; border-bottom: 0; }
  .pd-game-quit { justify-content: center; width: 44px; height: 44px; }
  .pd-game-quit span,
  .pd-game-clock { display: none; }
  .pd-game-hud-mid { min-width: 0; gap: 3px; }
  .pd-game-list { font-size: 10px; letter-spacing: 0.14em; }
  .pd-game-count { font-size: 20px; }

  .pd-game-later.pd-btn {
    width: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
    clip-path: none;
  }

  .pd-game-later span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pd-game-progress { height: 8px; }

  .pd-game-body { flex-direction: column; flex-wrap: nowrap; }
  .pd-game-main { flex: 1; gap: 8px; padding: 12px; }
  body .pd-game .game-context.pd-game-head { display: none; }

  body .pd-game .game-stage { flex: 1; flex-direction: column; flex-wrap: nowrap; gap: 8px; }

  body .pd-game .duel-card {
    flex: 1 1 0;
    min-height: 230px;
    gap: 8px;
    padding: 18px 20px;
  }

  body .pd-game .duel-card-left { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), 0 100%); padding-bottom: 36px; }
  body .pd-game .duel-card-right { clip-path: polygon(0 22px, 100% 0, 100% 100%, 0 100%); padding-left: 20px; }
  .pd-duel-bar { display: none; }
  .pd-duel-code,
  body .pd-game .duel-card img { top: 0; height: 60%; }
  .pd-duel-code { font-size: 120px; }
  body .pd-game .duel-card-right img,
  body .pd-game .duel-card-right .pd-duel-code { top: 22px; height: calc(60% - 22px); }
  .pd-duel-meta { font-size: 10px; letter-spacing: 0.14em; }
  body .pd-game .duel-card .game-item-title { font-size: 34px; }
  body .pd-game .versus-badge { top: 50%; padding: 10px 22px; font-size: 36px; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }

  .pd-game-foot { flex-wrap: nowrap; gap: 10px; padding: 0 0 8px; }
  .pd-game-foot .game-skip { flex: 1; min-height: 48px; padding: 0 20px; font-size: 13px; }
  .pd-game-keyhint { display: none; }
  .pd-game-leader { display: block; flex: none; width: 96px; font-size: 10px; letter-spacing: 0.14em; line-height: 1.5; text-align: right; }
  .pd-game-leader .pd-ink { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pd-game-table { display: none !important; }

  body .pd-game .game-loading { min-height: 60vh; }
  body .pd-game .single-judge-panel .game-image-frame { flex-basis: 100%; min-height: 260px; }
  body .pd-game .single-judge-panel > div:last-child { padding: 24px 20px; }
  body .pd-game .judge-actions button { flex: 1; padding: 0 16px; }
  body .pd-game .ranking-row { gap: 10px; padding: 10px 12px; }
  body .pd-game .ranking-media img { width: 40px; height: 40px; }
  body .pd-game .ranking-recap { width: calc(100% - 24px); margin: 14px 12px; }

  .pd-podium-inner { gap: 14px; padding-top: 32px; }
  .pd-podium-title { font-size: 48px !important; }
  .pd-podium-list { font-size: 18px; }
  .pd-podium .pd-podium-kicker { letter-spacing: 0.18em; }
  .pd-podium-figure { align-items: flex-start; gap: 4px; text-align: left; }
  .pd-podium-big { font-size: 48px; }
  .pd-results-class-head h2 { font-size: 20px !important; }
  .pd-podium-steps { flex-wrap: nowrap; gap: 6px; padding-top: 12px; }
  .pd-podium-step,
  .pd-podium-step.is-p1 { flex: 1 1 0; max-width: none; gap: 8px; }
  .pd-podium-img { height: 130px; }
  .is-p1 .pd-podium-img { height: 160px; }
  .is-p3 .pd-podium-img { height: 110px; }
  .pd-results-thumb { width: 36px; height: 48px; }
  .pd-podium-name,
  .is-p1 .pd-podium-name,
  .is-p3 .pd-podium-name { font-size: 15px; line-height: 1.05; }
  .pd-podium-meta { font-size: 9px; letter-spacing: 0.08em; }
  .pd-podium-block { height: 90px; padding-top: 10px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }
  .pd-podium-block .pd-d { font-size: 56px; }
  .is-p1 .pd-podium-block { height: 130px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
  .is-p1 .pd-podium-block .pd-d { font-size: 76px; }
  .is-p3 .pd-podium-block { height: 70px; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
  .is-p3 .pd-podium-block .pd-d { font-size: 44px; }

  .pd-results-main { gap: 40px; padding: 32px var(--pd-gutter) 64px; }
  .pd-results-row { gap: 10px 12px; padding: 12px 14px; }
  .pd-results-name { flex-basis: 120px; }
  .pd-results-delta { width: auto; }
  .pd-results-share { gap: 24px; }
  .pd-results-card { flex-basis: 100%; min-width: 0; }
  .pd-results-card-title { font-size: 34px; }
  .pd-results-share-copy { flex-basis: 100%; }
  .pd-results-share-copy h2 { font-size: 34px !important; }
  .pd-results-actions .pd-btn { flex: 1 1 100%; }
  .pd-results-next .pd-section-head h2 { font-size: 28px; }
  .pd-results-next-grid { grid-template-columns: 1fr; }
}

body .pd-game .duel-card img[src^="/src/assets/official/"]:not([src$=".svg"]) {
  object-fit: contain;
  background: #fff;
}

@media (max-width: 760px) {
  body .pd-game .duel-card img[src^="/src/assets/official/"]:not([src$=".svg"]) {
    position: static;
    order: 0;
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    width: calc(100% + 40px);
    max-width: none;
    align-self: center;
    margin: -18px -20px 0;
  }
}

/* ---------- provisional table: collapsible rail (collapsed by default) ---------- */
.pd-game-table-head { align-items: center; justify-content: flex-start; }
.pd-game-table-head h2 { flex: 1; white-space: nowrap; }

.pd-game-table-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--pd-line) !important;
  background: #1f1f22;
  color: var(--pd-ink);
  cursor: pointer;
}

.pd-game-table-toggle:hover { background: var(--pd-red); color: #fff; }
.pd-game-table-toggle svg { transform: rotate(180deg); transition: transform 0.2s ease; }
body.pd-table-collapsed .pd-game-table-toggle svg { transform: none; }

body.pd-table-collapsed .pd-game-table { flex: 0 0 64px; cursor: pointer; }
body.pd-table-collapsed .pd-game-table-head { flex-direction: column; gap: 18px; padding: 22px 0; }
body.pd-table-collapsed .pd-game-table-head h2 { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
body.pd-table-collapsed .pd-game-table-head > span,
body.pd-table-collapsed [data-pd-game-rows],
body.pd-table-collapsed .pd-game-remaining { display: none; }

/* ---------- pre-run setup: number of duels ---------- */
body.pd-game-setup .pd-game-foot,
body.pd-game-setup .pd-game-last,
body.pd-game-setup .pd-game-table { display: none !important; }

.pd-iter {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px);
  border-top: 6px solid var(--pd-red) !important;
  background: var(--pd-panel, #161618);
}

.pd-iter-title { margin: 0; font-size: clamp(36px, 5vw, 56px) !important; line-height: 0.95; }
.pd-iter-copy { margin: 0; color: var(--pd-soft); font-size: 16px; line-height: 1.6; }
.pd-iter-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }

.pd-iter-preset {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--pd-line) !important;
  background: #1f1f22;
  color: var(--pd-ink);
  font: italic 900 18px var(--pd-display);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.pd-iter-preset small { color: var(--pd-soft); font: 500 11px var(--pd-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.pd-iter-preset:hover { border-color: var(--pd-ink) !important; }
.pd-iter-preset.is-active { border-color: var(--pd-red) !important; background: var(--pd-red); color: #fff; }
.pd-iter-preset.is-active small { color: #fff; }

.pd-iter-range { display: flex; flex-direction: column; gap: 10px; }
.pd-iter-range b { color: var(--pd-ink); }
.pd-iter-range input { width: 100%; accent-color: var(--pd-red); cursor: pointer; }
.pd-iter-bounds { display: flex; justify-content: space-between; }

.pd-iter-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--pd-line); }
.pd-iter-stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; background: #0f0f10; }
.pd-iter-stat strong { font-size: 26px; overflow-wrap: anywhere; }
.pd-iter-start { align-self: flex-start; }

@media (max-width: 760px) {
  .pd-iter { gap: 16px; padding: 20px 16px; }
  .pd-iter-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-iter-stat { gap: 6px; padding: 12px 10px; }
  .pd-iter-stat strong { font-size: 17px; }
  .pd-iter-start { align-self: stretch; }
}
.pd-game-table-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- duel panels fill the screen: taller stage, larger artwork, blurred fill ---------- */
body .pd-game .game-stage { flex: 1 1 auto; }
body .pd-game .game-stage > .pd-iter { align-self: flex-start; }
body .pd-game .duel-card { min-height: max(540px, calc(100vh - 340px)); padding-bottom: 28px; }
body .pd-game .duel-card img,
.pd-duel-code { height: 72%; }
body .pd-game .duel-card img { z-index: 2; }
body .pd-game .duel-card img[src^="/src/assets/official/"]:not([src$=".svg"]) { background: transparent; }

.pd-duel-backdrop {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  z-index: 1;
  height: 72%;
  overflow: hidden;
  background: center / cover no-repeat;
  filter: blur(26px) brightness(0.5) saturate(1.2);
  transform: scale(1.15);
  pointer-events: none;
}

.pd-duel-bar,
.pd-duel-meta,
body .pd-game .duel-card .game-item-title,
.pd-duel-hint { z-index: 3; }
body .pd-game .versus-badge { top: 38%; z-index: 4; }

@media (max-width: 760px) {
  body .pd-game .duel-card { min-height: 230px; padding-bottom: 18px; }
  .pd-duel-code,
  body .pd-game .duel-card img,
  .pd-duel-backdrop { top: 0; height: 60%; }
  body .pd-game .duel-card-right img,
  body .pd-game .duel-card-right .pd-duel-code,
  body .pd-game .duel-card-right .pd-duel-backdrop { top: 22px; height: calc(60% - 22px); }
  body .pd-game .versus-badge { top: 50%; }
}

/* ---------- public result page (run.html) ---------- */
.pd-run-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-left: 6px solid var(--pd-red) !important;
  background: var(--pd-panel);
}

.pd-run-cta > div:first-child { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 420px; }
.pd-run-cta h2 { margin: 0; font-size: clamp(28px, 3.4vw, 44px) !important; }
.pd-run-cta p { margin: 0; color: var(--pd-soft); line-height: 1.6; }
.pd-run-cta strong { color: var(--pd-ink); }
.pd-run-page .pd-results { padding-top: 0; }

/* ---------- duel: what the other players picked (after each pick) ---------- */
.pd-game-main { position: relative; }

.pd-split-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 14px;
  width: min(420px, calc(100% - 32px));
  padding: 14px 18px 18px;
  overflow: hidden;
  border-left: 6px solid var(--pd-red) !important;
  background: rgba(11, 11, 12, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -30%);
}

.pd-split-chip.is-on { animation: pd-split 2.1s ease forwards; }
.pd-split-chip strong { color: var(--pd-red-hi); font-size: 40px; line-height: 1; }
.pd-split-chip.is-minority { border-left-color: var(--pd-yellow) !important; }
.pd-split-chip.is-minority strong { color: var(--pd-yellow); }
.pd-split-chip span { color: var(--pd-soft); font-size: 14px; line-height: 1.4; }
.pd-split-chip b { color: var(--pd-ink); }
.pd-split-bar { position: absolute; bottom: 0; left: 0; height: 4px; background: var(--pd-red); }
.pd-split-chip.is-minority .pd-split-bar { background: var(--pd-yellow); }

@keyframes pd-split {
  0% { opacity: 0; transform: translate(-50%, -30%); }
  12%, 72% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -60%); }
}

@media (prefers-reduced-motion: reduce) {
  .pd-split-chip.is-on { animation-duration: 2.4s; animation-timing-function: steps(1, end); }
}

/* ---------- setup: new ranking or complete my ranking ---------- */
.pd-iter-kind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.pd-iter-kind-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--pd-line) !important;
  background: #0f0f10;
  color: var(--pd-ink);
  text-align: left;
  cursor: pointer;
}

.pd-iter-kind-option strong { font: italic 900 17px var(--pd-display); text-transform: uppercase; }
.pd-iter-kind-option small { color: var(--pd-soft); font: 500 11px var(--pd-mono); letter-spacing: 0.06em; }
.pd-iter-kind-option[aria-checked="true"] { border-color: var(--pd-ink) !important; box-shadow: inset 4px 0 0 var(--pd-red); }

/* ---------- My taste (taste.html) ---------- */
.pd-taste { display: flex; flex-direction: column; gap: 24px; max-width: var(--pd-max); margin: 0 auto; padding: 28px var(--pd-gutter) 96px; }
.pd-taste-hero { display: flex; flex-direction: column; gap: 14px; }
.pd-taste-title { margin: 0; font-size: clamp(40px, 5vw, 72px) !important; line-height: 0.92 !important; }
.pd-taste-copy { max-width: 640px; margin: 0; color: var(--pd-soft); font-size: 16px; line-height: 1.6; }
.pd-taste-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pd-taste-play.pd-game { min-height: 0; gap: 16px; background: transparent; }
body .pd-taste-play.pd-game .game-stage { flex: none; }
body .pd-taste-play.pd-game .duel-card { min-height: min(62vh, 620px); }
body .pd-taste-play.pd-game .duel-card img { object-fit: contain; }
.pd-taste-play .pd-game-foot { margin-top: 4px; }
.pd-taste-board { display: flex; flex-direction: column; gap: 20px; }
.pd-taste-board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 32px; }

@media (max-width: 960px) {
  .pd-taste-board-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pd-taste { gap: 24px; padding: 24px 12px 64px; }
  body .pd-taste-play.pd-game .game-stage { flex-direction: column; }
  body .pd-taste-play.pd-game .duel-card { min-height: 32vh; }
  .pd-taste-copy { display: none; }
  .pd-taste-hero { gap: 8px; }
  .pd-taste-stats .pd-stat strong { font-size: 28px; }
  .pd-iter-kind { grid-template-columns: 1fr; }
  .pd-split-chip strong { font-size: 30px; }
}
