/* The approved character-first menu. Only the choosing overlay covers the
   viewport; pause/end overlays keep the game's existing layout and styling. */
#overlay.choosing {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #142427;
  isolation: isolate;
}
.start-screen {
  --start-teal: #203537;
  --start-slate: #3b545e;
  --start-gold: #d1b374;
  --start-cream: #eee5ca;
  --start-muted: #b3c2bd;
  box-sizing: border-box;
  width: min(1160px, 100%);
  height: auto;
  min-height: 0;
  max-height: none;
  margin: auto 0;
  padding: 14px 0;
  display: grid;
  gap: 18px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--start-cream);
  font: 15px/1.5 'Trebuchet MS', Arial, sans-serif;
}
.start-screen *, .start-screen *::before, .start-screen *::after { box-sizing: border-box; }
.start-screen .start-heading { text-align: center; padding-bottom: 3px; }
.start-screen .start-eyebrow { margin: 0 0 10px; color: var(--start-gold); font: bold 11px/1.3 'Courier New', monospace; letter-spacing: .18em; }
.start-screen .start-title { margin: 0; font: bold clamp(68px, 7.2vw, 88px)/1.03 Georgia, serif; letter-spacing: -.06em; color: var(--start-cream); text-shadow: 0 4px 0 #17282c; }
.start-screen .start-title em { color: var(--start-gold); font-style: italic; }
.start-screen .start-intro { margin: 14px 0 0; color: var(--start-muted); font-size: 16px; line-height: 1.4; }
.start-screen .start-roster-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.start-screen .start-roster-heading h2 { margin: 0; color: var(--start-cream); font: bold 20px/1.3 Georgia, serif; letter-spacing: normal; }
.start-screen .start-roster-heading > span { color: var(--start-muted); font: 11px/1.4 'Courier New', monospace; }
.start-screen .character-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: visible;
  flex: none;
  scroll-padding: 0;
}
.start-screen .character-option {
  position: relative;
  min-width: 0;
  min-height: 234px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 8px 14px;
  border: 1px solid var(--start-slate);
  border-bottom: 4px solid var(--start-slate);
  border-radius: 9px;
  background: linear-gradient(180deg, #283e43, #203537);
  color: var(--start-cream);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.start-screen .character-option:hover { background: #304b4d; border-color: #8ca099; transform: translateY(-3px); }
.start-screen .character-option[aria-pressed='true'] {
  padding: 12px 8px 14px;
  border: 1px solid var(--start-gold);
  border-bottom: 4px solid var(--start-gold);
  background: linear-gradient(180deg, #3c5356, #294344);
  box-shadow: 0 0 0 1px #d1b37433, 0 8px 18px #101e2533;
}
.start-screen .character-option canvas { width: 144px; height: 144px; max-width: 100%; display: block; object-fit: contain; flex-shrink: 0; border: 0; image-rendering: auto; }
.start-screen .character-option > strong { display: block; font: bold 18px/1.2 'Trebuchet MS', Arial, sans-serif; letter-spacing: .035em; }
.start-screen .character-option[aria-pressed='true'] > strong { color: var(--start-gold); }
.start-screen .character-ability { display: block; min-height: 27px; color: var(--start-muted); font: 11px/1.25 'Courier New', monospace; text-align: center; overflow-wrap: anywhere; }
.start-screen .start-selection { min-height: 68px; padding: 11px 20px; border-left: 3px solid var(--start-gold); border-radius: 0 7px 7px 0; background: #1b2e32; }
.start-screen #chosen-summary { margin: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 15px; row-gap: 3px; align-items: baseline; }
.start-screen #chosen-summary > strong { color: var(--start-gold); font-size: 18px; line-height: 1.3; }
.start-screen #chosen-summary > span { color: var(--start-gold); font: 12px/1.4 'Courier New', monospace; }
.start-screen #chosen-summary > p { grid-column: 1 / -1; margin: 0; color: var(--start-muted); font-size: 14px; line-height: 1.4; }
.start-screen .start-settings { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(160px, .8fr) minmax(270px, 1.25fr); align-items: end; gap: 24px; }
.start-screen .start-difficulty { display: flex; flex-direction: column; gap: 8px; margin: 0; color: var(--start-muted); font: bold 11px/1.3 'Courier New', monospace; letter-spacing: .08em; text-transform: uppercase; }
.start-screen #difficulty-select { width: 100%; min-height: 49px; padding: 10px 15px; border: 1px solid var(--start-slate); border-radius: 5px; background: var(--start-teal); color: var(--start-cream); font: 16px 'Trebuchet MS', Arial, sans-serif; color-scheme: dark; letter-spacing: normal; text-transform: none; }
.start-screen .start-debug { display: flex; align-items: center; gap: 9px; padding-bottom: 14px; color: var(--start-muted); font: 13px/1.5 'Courier New', monospace; cursor: pointer; }
.start-screen #debug-toggle { width: 17px; height: 17px; margin: 0; accent-color: var(--start-gold); }
.start-screen #choose-start { width: 100%; min-width: 0; min-height: 57px; padding: 15px 20px; border: 1px solid #e0c48e; border-radius: 6px; background: var(--start-gold); color: #1b2e32; font: bold 17px/1.3 'Trebuchet MS', Arial, sans-serif; letter-spacing: normal; box-shadow: 0 4px 0 #89764c; cursor: pointer; }
.start-screen #choose-start > span { font-size: 21px; }
.start-screen #choose-start:hover:not(:disabled) { background: #e0c48e; }
.start-screen #choose-start:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #89764c; }
.start-screen #choose-start:disabled { opacity: .55; cursor: wait; }
.start-screen .start-instructions { display: grid; grid-template-columns: 1.1fr 1fr; column-gap: 38px; row-gap: 7px; margin-top: 1px; padding-top: 19px; border-top: 1px solid var(--start-slate); color: var(--start-muted); }
.start-screen .start-goal { grid-column: 1; grid-row: 1; }
.start-screen .start-goal h2 { margin: 0 0 6px; color: var(--start-cream); font: bold 13px/1.3 'Courier New', monospace; letter-spacing: normal; }
.start-screen .start-goal p { margin: 0; font-size: 13px; line-height: 1.45; }
.start-screen .start-controls { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(3, max-content); justify-content: space-between; align-content: start; gap: 12px 14px; padding-top: 2px; }
.start-screen .start-controls > div { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.start-screen .start-controls span { font-size: 12px; }
.start-screen kbd { display: inline-block; min-width: 21px; padding: 1px 6px; border: 1px solid #60747a; border-bottom-width: 2px; border-radius: 4px; background: #293f46; color: var(--start-cream); font: bold 11px/1.4 'Courier New', monospace; box-shadow: 0 2px #0c171a; }
.start-screen .start-duel { grid-column: 1; grid-row: 2; margin: 0; font-size: 11px; line-height: 1.4; }
.start-screen button:focus-visible, .start-screen select:focus-visible, .start-screen input:focus-visible { outline: 3px solid var(--start-gold); outline-offset: 4px; }
@media (max-width: 1050px) {
  .start-screen .character-options { gap: 8px; }
  .start-screen .character-option { min-height: 220px; padding: 13px 5px 15px; }
  .start-screen .character-option[aria-pressed='true'] { padding: 13px 5px 15px; }
  .start-screen .character-option canvas { width: 132px; height: 132px; }
  .start-screen .character-option > strong { font-size: 16px; }
  .start-screen .start-settings { gap: 18px; grid-template-columns: 1fr .8fr 1.3fr; }
}
@media (max-width: 900px) {
  .start-screen .character-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .start-screen .character-option canvas { width: 144px; height: 144px; }
}
@media (max-width: 760px) {
  #overlay.choosing { padding: 20px 16px; }
  .start-screen .start-title { font-size: clamp(48px, 9vw, 64px); }
  .start-screen .start-roster-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .start-screen .start-settings { grid-template-columns: 1fr 1fr; }
  .start-screen #choose-start { grid-column: 1 / -1; }
  .start-screen .start-instructions { grid-template-columns: 1fr; }
  .start-screen .start-controls { grid-column: 1; grid-row: 2; padding: 5px 0; }
  .start-screen .start-duel { grid-column: 1; grid-row: 3; }
}
@media (max-width: 520px) {
  .start-screen .character-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-screen .character-option { min-height: 210px; }
  .start-screen .character-option canvas { width: 132px; height: 132px; }
  .start-screen .start-eyebrow { letter-spacing: .08em; font-size: 10px; }
  .start-screen .start-intro { font-size: 14px; }
  .start-screen .start-controls { grid-template-columns: repeat(2, max-content); justify-content: start; column-gap: 24px; }
}
@media (max-height: 620px) {
  .start-screen { gap: 16px; }
  .start-screen .start-title { font-size: clamp(48px, 6vw, 64px); }
}
@media (prefers-reduced-motion: reduce) { .start-screen .character-option { transition: none; } }
