:root {
  color-scheme: light;
  --ink: #39352d;
  --muted: #655e51;
  --paper: #f5efdf;
  --panel: #fff9e9;
  --line: #c7bba0;
  --accent: #a55945;
  --accent-dark: #854532;
  --teal: #486e60;
  --game-brightness: 1;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top left, #e6e6d3, transparent 55%),
    repeating-linear-gradient(94deg, transparent 0 5px, rgba(123, 99, 69, .025) 6px 7px),
    var(--paper);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button {
  border: 1px solid rgba(70, 57, 44, .36);
  box-shadow: 0 2px 0 rgba(74, 61, 43, .15);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 0 18px;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(89, 121, 98, 0.55);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.game-shell {
  width: min(960px, 100%);
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.hud > div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  align-content: center;
  padding: 12px 16px;
  box-shadow: 1px 3px 0 rgba(74, 61, 43, 0.09);
}

.label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.hud strong {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#powerStatus {
  font-size: 18px;
}

canvas, .controls, .touch-tools { touch-action: none; user-select: none; }
.touch-tools {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: none;
  gap: 4px;
}
.touch-tools.above-plots { bottom: 21%; }
.touch-tools button { width: 44px; min-height: 44px; padding: 4px; opacity: .88; }
@media (pointer: coarse) {
  .touch-tools:not([hidden]) { display: flex; }
}
.touch-used .touch-tools:not([hidden]) { display: flex; }
.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #494b3f;
  box-shadow: 0 18px 40px rgba(74, 61, 43, 0.16);
}

#ghostStatus {
  position: absolute;
  right: 8px;
  bottom: 58px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #39352d;
  color: white;
  font-weight: 700;
  pointer-events: none;
}
#challengeResult input { max-width: 100%; }

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  filter: brightness(var(--game-brightness));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Flex column + auto margins: centered when it fits, scrolls from the top when it doesn't
   (the old grid place-content:center pushed overflowing content above scrollTop 0). */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  text-align: center;
  background: rgba(246, 238, 216, 0.96);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay-inner {
  margin: auto 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 76px);
  line-height: 0.95;
}

.overlay p {
  max-width: 640px;
  margin: 0 0 6px;
  color: #584f43;
  font-size: 17px;
}

.setup-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  margin: 4px 0 8px;
}

.field {
  display: grid;
  gap: 6px;
  text-align: left;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.difficulty-picker,
.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.difficulty-button,
.mode-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #e9dfc9;
}

.difficulty-button.active,
.mode-button.active {
  background: var(--teal);
}

.skin-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.skin-button {
  min-height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  padding: 0;
}

.skin-button[data-skin="coral"] {
  background: #a55945;
}

.skin-button[data-skin="teal"] {
  background: #486e60;
}

.skin-button[data-skin="gold"] {
  background: #c89e50;
}

.skin-button[data-skin="violet"] {
  background: #967e9a;
}

.skin-button.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(89, 121, 98, 0.35);
}

.pk-connect {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

.loadout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee5d0;
  padding: 9px 10px;
}

.menu-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.helper-text {
  color: #584f43;
  font-size: 13px;
  text-align: left;
}

.result-panel {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 8px;
}

.result-panel.hidden {
  display: none;
}

.result-panel > div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #e9dfc9;
  padding: 10px;
}

.result-panel strong {
  font-size: 18px;
}

#startButton.hidden {
  display: none;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.controls-buttons {
  display: flex;
  gap: 10px;
}

.controls p {
  margin: 0;
}

.opponent-panel,
.boss-panel,
.leaderboard,
.achievements,
.tasks {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 1px 3px 0 rgba(74, 61, 43, 0.09);
}

.opponent-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.opponent-heading h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.opponent-heading strong {
  color: var(--teal);
}

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

.opponent-grid > div {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  background: #f5efdf;
  padding: 10px 12px;
}

#pkFrenzyLabel {
  color: var(--accent);
}

.pk-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pk-result-actions.hidden {
  display: none;
}

.boss-panel {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}

.boss-icon {
  width: 96px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(135deg, rgba(195, 152, 78, 0.34), rgba(162, 94, 69, 0.22));
  border: 1px solid var(--line);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  transition: transform 120ms ease;
}

.boss-icon.sparrow {
  color: #b7791f;
}

.boss-icon.jay {
  color: #3282d8;
}

.boss-icon.cardinal {
  color: #d92d43;
}

.boss-icon.owl {
  color: #8d6e63;
}

.boss-icon.falcon,
.boss-icon.eagle,
.boss-icon.kite {
  color: #64748b;
}

.boss-icon.cleared {
  color: var(--teal);
}

.boss-icon.hit {
  transform: scale(0.94) rotate(-3deg);
}

.boss-info {
  min-width: 0;
}

.boss-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.boss-heading h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.boss-skill {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.boss-heading strong {
  color: var(--accent-dark);
  white-space: nowrap;
}

.boss-health {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #ded6bf;
}

.boss-health-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  transition: width 180ms ease;
}

.boss-health-fill.hit {
  filter: brightness(1.28);
}

.boss-damage {
  min-height: 22px;
  margin-top: 8px;
  color: var(--accent-dark);
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
}

.boss-damage.pop {
  animation: damage-pop 520ms ease;
}

@keyframes damage-pop {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.leaderboard h2,
.achievements h2,
.tasks h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.ghost-button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.ghost-button:hover {
  background: #eadfc8;
  color: var(--ink);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: #f5efdf;
  padding: 10px 12px;
  color: var(--muted);
}

.leaderboard-list strong {
  color: var(--ink);
}

.empty-rank {
  color: var(--muted);
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.achievement-item {
  display: grid;
  gap: 4px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
  color: var(--muted);
}

.achievement-item strong {
  color: var(--ink);
}

.achievement-item.locked {
  opacity: 0.56;
}

.achievement-item.unlocked {
  border-color: rgba(89, 121, 98, 0.42);
  background: rgba(89, 121, 98, 0.08);
}

.helper-dark {
  margin: -4px 0 12px;
  color: var(--muted);
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
}

.task-item strong,
.task-item span,
.task-progress small {
  display: block;
}

.task-item span,
.task-progress small {
  color: var(--muted);
}

.task-item.ready {
  border-color: rgba(195, 152, 78, 0.66);
  background: rgba(195, 152, 78, 0.1);
}

.task-item.done {
  border-color: rgba(89, 121, 98, 0.48);
  background: rgba(89, 121, 98, 0.08);
}

.task-progress {
  min-width: 92px;
  text-align: right;
  font-weight: 700;
}

.achievement-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(89, 121, 98, 0.38);
  border-radius: 8px;
  background: #fff9e9;
  box-shadow: 0 18px 36px rgba(74, 61, 43, 0.18);
  color: var(--ink);
  font-weight: 700;
  padding: 14px 16px;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(51, 54, 45, 0.60);
}

.achievement-toast.hidden,
.tutorial-overlay.hidden {
  display: none;
}

.tutorial-panel {
  width: min(500px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #fff9e9;
  box-shadow: 2px 5px 0 rgba(64, 56, 44, .22), 0 16px 42px rgba(64, 56, 44, .18);
  padding: 22px;
}

.tutorial-panel h2 {
  margin: 4px 0 10px;
}

.tutorial-panel ul {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
}

.menu-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 8px;
  background: #fff9e9;
  box-shadow: 2px 5px 0 rgba(64, 56, 44, .22), 0 16px 42px rgba(64, 56, 44, .18);
  padding: 20px;
}

.menu-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-heading h2 {
  margin: 2px 0 0;
}

.menu-coins {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-weight: 700;
}

.menu-content,
.weapon-list {
  display: grid;
  gap: 10px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

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

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

.choice-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.choice-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #eee5d2;
  color: var(--ink);
}

.choice-button:hover {
  background: #e2dbc4;
}

.choice-button.active {
  background: var(--teal);
  color: #fff9e9;
}

.choice-button[data-avatar="classic"] {
  border-bottom: 5px solid #8b5a2b;
}

.choice-button[data-avatar="ranger"] {
  border-bottom: 5px solid #2f5f4e;
}

.choice-button[data-avatar="gold"] {
  border-bottom: 5px solid #c89e50;
}

.choice-button[data-avatar="night"] {
  border-bottom: 5px solid #39352d;
}

.menu-skin-picker {
  grid-template-columns: repeat(4, minmax(56px, 1fr));
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: 3px;
  color: var(--muted);
}

.setting-row input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--teal);
}

.setting-row input[type="range"] {
  width: min(240px, 40vw);
  min-height: 24px;
  accent-color: var(--accent);
}

.pk-server-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
  text-align: left;
}

.pk-server-settings summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.pk-server-settings[open] summary {
  margin-bottom: 10px;
}

.pk-server-settings .field {
  margin-bottom: 10px;
}

.pk-server-settings input {
  border: 1px solid var(--line);
  background: #fff9e9;
}

.pk-server-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weapon-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
}

.weapon-card.equipped {
  border-color: rgba(89, 121, 98, 0.48);
  background: rgba(89, 121, 98, 0.08);
}

.weapon-card h3 {
  margin: 0 0 4px;
}

.weapon-card p {
  margin: 0;
  color: var(--muted);
}

.weapon-card button {
  min-width: 96px;
}

.bag-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5efdf;
  padding: 12px;
}

.item-card.empty {
  opacity: 0.62;
}

.item-card h3,
.item-card p {
  margin: 0;
}

.item-card p,
.item-value span {
  color: var(--muted);
}

.item-value {
  min-width: 92px;
  text-align: right;
}

.item-actions {
  display: flex;
  gap: 8px;
}

#resultLoot {
  font-size: 14px;
  line-height: 1.25;
}

@media (max-width: 620px) {
  body {
    padding: 14px;
  }

  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .hud > div:last-child {
    grid-column: span 2;
  }

  .hud > div {
    min-height: 58px;
  }

  .overlay {
    padding: 14px;
  }

  .overlay p {
    font-size: 15px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .controls-buttons > button {
    flex: 1;
  }

  .difficulty-picker,
  .mode-picker,
  .skin-picker,
  .choice-grid,
  .choice-grid.two,
  .menu-buttons,
  .pk-connect,
  .opponent-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .opponent-heading,
  .boss-heading,
  .leaderboard-heading,
  .leaderboard-list li {
    align-items: stretch;
    flex-direction: column;
  }

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

  .boss-icon {
    width: 100%;
    max-height: 120px;
  }

  .achievement-list {
    grid-template-columns: 1fr;
  }

  .weapon-card,
  .task-item,
  .setting-row {
    grid-template-columns: 1fr;
  }

  .bag-summary,
  .item-card,
  .item-actions {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .item-value,
  .task-progress {
    text-align: left;
  }

  .setting-row input[type="range"] {
    width: 100%;
  }
}

.career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}
.career-grid dt { font-size: 0.85rem; }
.career-grid dd { margin: 0; font-weight: 700; }
.field select, .setting-group textarea { width: 100%; max-width: 100%; }

/* Field-guide plates use the same ink, ochre and sage pigments as the stage. */
.hud strong, h1, h2, h3, .achievement-item strong {
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
}
.hud .label, .menu-heading .label { letter-spacing: .08em; font-size: 11px; font-weight: 700; }
.hud > div, .menu-panel, .tutorial-panel, .stage-wrap { border: 1px solid #a69a7f; }
.menu-panel, .tutorial-panel, .hud > div {
  background: linear-gradient(120deg, #fff9e9, #f4ecd8);
}
.menu-heading { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.menu-heading h2 { font-size: 30px; }
.overlay h1 { font-style: italic; color: #453e31; }
.overlay .mode-button, .overlay .difficulty-button { color: var(--ink); }
.overlay .mode-button.active, .overlay .difficulty-button.active { color: #fff9e9; }
button:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
#ghostStatus { background: #f8edcf; color: var(--ink); border: 1px solid #8b8067; }
.field-illustration { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; pointer-events: none; }
.hud .field-illustration { width: 21px; height: 21px; margin: -3px 5px 0 -3px; }
button .field-illustration { width: 25px; height: 25px; margin-right: 4px; }
.weapon-card .field-illustration, .item-card .field-illustration, .task-item .field-illustration {
  float: left; width: 70px; height: 44px; margin: 0 12px 0 0;
}
.weapon-card .field-illustration { width: 88px; }
.achievement-item { grid-template-columns: 36px minmax(0, 1fr); align-content: center; column-gap: 7px; }
.achievement-item .field-illustration { grid-row: span 2; align-self: center; width: 38px; height: 44px; }
.achievement-item.locked { opacity: 1; }
.achievement-item.locked .field-illustration { filter: saturate(.5); }
.achievement-item span { font-size: 13px; line-height: 1.35; }
.boss-icon .field-illustration { width: 80%; height: 80%; }
.skin-button .field-illustration { background: #f4ecd8; border-radius: 50%; margin: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

[hidden] { display:none !important; }
.hud { grid-template-columns:repeat(5,minmax(0,1fr)) auto; align-items:center; }
.overlay h1 {font-size:clamp(30px,4vw,48px)}
.setup-panel {width:min(680px,100%);grid-template-columns:1fr 1fr;gap:7px 14px}
.setup-panel .field:has(.mode-picker){grid-column:1/-1;grid-row:1}
.setup-panel .field:has(.menu-buttons),.setup-panel .field:has(.pk-connect){grid-column:1/-1}
.menu-buttons {grid-template-columns:repeat(6,1fr)}
.menu-buttons button {padding:4px;font-size:13px}
.overlay-inner {gap:6px}
.overlay:has(#resultPanel:not(.hidden)) .setup-panel {order:2}
nav[aria-label="Field journal"] {display:flex;gap:6px;margin-top:14px}
[data-journal][aria-pressed=false]{background:var(--panel);color:var(--ink)}
@keyframes paper-open {from{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:none}}
.menu-panel,.tutorial-panel {animation:paper-open 160ms ease-out}
@media(max-width:620px){.hud{grid-template-columns:repeat(3,1fr)}.setup-panel{grid-template-columns:1fr}.menu-buttons{grid-template-columns:repeat(3,1fr)}.stage-wrap:has(.overlay:not(.hidden)){aspect-ratio:auto}.stage-wrap:has(.overlay:not(.hidden)) canvas{position:absolute;inset:0}.overlay:not(.hidden){position:relative}.mode-picker,.difficulty-picker{grid-template-columns:repeat(3,1fr)}}

@media(min-width:621px){.hud{grid-template-columns:repeat(6,minmax(0,1fr)) auto}}

/* The field report occupies the stage after a round. */
.overlay:not([data-result]) :is([data-result-art], [data-result-summary], [data-result-menu]),
.overlay[data-result] .setup-panel { display: none; }
.overlay[data-result] { background: rgba(234, 226, 200, .96); }
.overlay[data-result] .overlay-inner {
  width: min(100%, 650px);
  padding: clamp(12px, 2vw, 24px);
  background: #fbf5e4;
  border: 1px solid #998b70;
  border-radius: 6px 14px 8px 12px;
  box-shadow: 3px 4px 0 #c9bda3;
}
[data-result-art] img { width: 52px; height: 44px; object-fit: contain; }
.overlay[data-result] h1 { font-size: clamp(25px, 4vw, 40px); }
[data-result-summary] { display: flex; width: 100%; border-block: 1px solid #bdaf90; padding: 8px; }
[data-result-summary] > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
[data-result-summary] > div + div { border-left: 1px solid #cebea1; }
[data-result-summary] span { font-size: 13px; overflow-wrap: anywhere; }
[data-result-summary] strong { font: bold 26px Georgia, serif; color: #345546; }
.overlay[data-result] #challengeResult { order: 1; }
.overlay[data-result] :is(#startButton, #pkResultActions, [data-result-menu]) { order: 2; }
