/* The character creator: the game's captain screen (index.html) and creator.html. Its own sheet, kept to
   the creator, in the game's high-seas dress (pirate.css): tarred
   oak and brass for the ship's furniture, parchment for what the world says, the game's own fonts.
   Wide screens: the tabs down the left, the captain in the middle, the choices on the right.
   Phones: presets, the captain, the tabs, then the choices, which scroll, with the two buttons at the foot. */
@font-face { font-family: Archivo; src: url(../explorer/assets/archivo.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'IM Fell English SC'; src: url(fonts/im-fell-english-sc.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url(fonts/cinzel-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

/* The creator's own tokens, on the creator and its dialogs only, so the game's own are left as they are. */
#creator, .cr-dialog {
  --sans: Archivo, system-ui, -apple-system, Segoe UI, sans-serif;
  --pirate: 'IM Fell English SC', Georgia, serif;
  --display: 'Cinzel', Georgia, serif;
  --night: #0c0906; --text: #f6e7c3; --text-soft: rgba(239, 220, 180, .82);
  --brass: #c9a24a; --brass-dark: #8a6424; --brass-glow: #f0d38a; --blood: #9e2a1c;
  --line: rgba(201, 162, 74, .45); --focus: #63fff0;
  --wood: repeating-linear-gradient(92deg, rgba(0,0,0,.18) 0 2px, transparent 2px 9px, rgba(255,220,160,.04) 9px 11px, transparent 11px 23px), linear-gradient(180deg, #3b2716, #24170d);
  --panel: linear-gradient(180deg, rgba(40, 26, 15, .97), rgba(26, 17, 10, .98));
  --parch: linear-gradient(160deg, #f3e4c1, #eedcb3 50%, #d9bf8a);
  --ink: #2a1d10;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.cr-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* creator.html, the page of its own (html.cr-page). In the game the page is the game's (see "In the game" below). */
html.cr-page, html.cr-page body { margin: 0; height: 100%; background: #0c0906; color: #f6e7c3; font: 15px/1.45 Archivo, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; }
html.cr-page body { overflow: hidden; }
#creator, .cr-dialog { color: var(--text); font: 15px/1.45 var(--sans); }

/* Buttons on the creator: no stronger than a plain button selector on the creator itself, so each part's own
   class wins; the dialogs' are stronger, over the game's own dialog buttons. */
:where(#creator) button, .cr-dialog button { font: 400 16px/1.1 var(--pirate); letter-spacing: .03em; color: var(--text); background: var(--wood); border: 1.5px solid var(--brass-dark); border-radius: 6px; padding: 9px 13px; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,220,160,.18), 0 3px 8px rgba(0,0,0,.35); text-shadow: 0 1px 0 #000; transition: border-color .15s, color .15s, transform .12s; }
:where(#creator) button:hover, .cr-dialog button:hover { border-color: var(--brass); color: #fff4d6; transform: none; }
:where(#creator) button:active, .cr-dialog button:active { transform: translateY(1px); }
:where(#creator, .cr-dialog) :is(button, canvas, input):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(#creator, .cr-dialog) [tabindex="-1"]:focus { outline: none; }
:where(#creator) button.primary, .cr-dialog button.primary { background: linear-gradient(180deg, #b8321f, #7c1d11); border-color: var(--brass); color: #fff1cf; }
:where(#creator) button.primary:hover, .cr-dialog button.primary:hover { background: linear-gradient(180deg, #cc3b26, #8c2214); }

/* ---------------------------------------------------------------- layout */
#creator {
  height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(340px, 400px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "head head head" "tabs stage panel" "tabs stage actions";
}
.cr-head { grid-area: head; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 18px; background: var(--wood); border-bottom: 1.5px solid var(--brass-dark); }
.cr-head :is(h1, h2) { margin: 0; font: 700 26px/1.1 var(--display); color: #f6e2b0; text-shadow: 0 2px 0 #3a250e; }
.cr-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-presets-label { font: 400 16px/1 var(--pirate); color: var(--brass); margin-right: 2px; }
.cr-preset { font-size: 15px; padding: 8px 12px; }
.cr-preset[aria-pressed="true"] { border-color: var(--brass-glow); box-shadow: 0 0 0 2px var(--brass), 0 0 14px rgba(201,162,74,.35); }
.cr-usecode { border-style: dashed; }

.cr-tabs { grid-area: tabs; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; background: var(--panel); border-right: 1px solid var(--line); }
.cr-tab { text-align: left; font-size: 19px; padding: 12px 14px; }
.cr-tab[aria-selected="true"] { background: linear-gradient(180deg, #d9b25a, #9c7228); color: #231505; border-color: var(--brass-glow); text-shadow: none; }

.cr-stage { grid-area: stage; position: relative; min-height: 0; background: radial-gradient(ellipse at 50% 40%, #33505c, #0f1a20 75%); }
#cr-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#cr-canvas:active { cursor: grabbing; }
.cr-loading, .cr-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 16px; border-radius: 6px; background: rgba(12, 9, 6, .8); border: 1px solid var(--line); font: 400 18px/1.3 var(--pirate); text-align: center; max-width: calc(100% - 32px); }
.cr-status { font: 15px/1.4 var(--sans); }
/* A part that would not download: what happened, and a way to try again (app.js partMissing). Low on the
   stage, above Close-up, so the face stays in sight in the close-up. */
.cr-retry { width: min(340px, calc(100% - 32px)); top: auto; bottom: 62px; transform: translateX(-50%); }
.cr-retry p { margin: 0 0 10px; }
.cr-stage-note { position: absolute; left: 12px; top: 12px; margin: 0; padding: 6px 10px; border-radius: 6px; background: rgba(12, 9, 6, .7); border: 1px solid var(--line); font: 400 15px/1.2 var(--pirate); pointer-events: none; }
.cr-stage-tools { position: absolute; right: 12px; bottom: 12px; left: 12px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; pointer-events: none; }
.cr-stage-tools > * { pointer-events: auto; }
/* Beside Close-up rather than in the corner, where the Oracle's glass stands at the edge of the picture. */
.cr-turn-hint { font: 400 15px/1 var(--pirate); color: rgba(246, 231, 195, .8); text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, .6); white-space: nowrap; pointer-events: none; }
.cr-zoom { white-space: nowrap; }
.cr-zoom[aria-pressed="true"] { border-color: var(--brass-glow); box-shadow: 0 0 0 2px var(--brass); }

.cr-panel { grid-area: panel; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
.cr-panels { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 18px 18px; overscroll-behavior: contain; }
.cr-note { margin: 12px 18px 0; padding: 9px 12px; border-radius: 6px; font-size: 14px; line-height: 1.4; background: rgba(255, 214, 140, .1); border: 1px solid rgba(255, 214, 140, .35); color: #fff1d6; }
.cr-actions { grid-area: actions; display: flex; gap: 10px; padding: 12px 18px 16px; background: var(--panel); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cr-actions button { flex: 1; font-size: 20px; padding: 13px 14px; }

/* ---------------------------------------------------------------- rows */
.cr-row { padding: 12px 0 10px; border-bottom: 1px solid rgba(201, 162, 74, .18); }
.cr-row:last-child { border-bottom: 0; }
.cr-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cr-label { font: 400 18px/1.1 var(--pirate); color: var(--brass); letter-spacing: .03em; }
.cr-lock { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: transparent; border-color: rgba(201, 162, 74, .3); box-shadow: none; }
.cr-lock svg { width: 17px; height: 17px; fill: none; stroke: var(--text-soft); stroke-width: 1.8; stroke-linecap: round; }
.cr-lock svg .shackle { transform-origin: 13px 9px; transition: transform .15s; transform: rotate(28deg) translate(1px, -1px); }
.cr-lock.on { background: linear-gradient(180deg, #d9b25a, #9c7228); border-color: var(--brass-glow); }
.cr-lock.on svg { stroke: #231505; }
.cr-lock.on svg rect { fill: #231505; }
.cr-lock.on svg .shackle { transform: none; }
.cr-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.cr-chip { font: 700 13px/1.1 var(--sans); letter-spacing: .02em; padding: 10px 13px; text-shadow: none; min-height: 40px; }
.cr-chip.on, .cr-set .cr-chip.on { background: linear-gradient(180deg, #d9b25a, #9c7228); color: #231505; border-color: var(--brass-glow); }
.cr-set .cr-chip::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 1.5px solid currentColor; border-radius: 2px; }
.cr-set .cr-chip.on::before { background: #231505; box-shadow: inset 0 0 0 2px #d9b25a; }
.cr-swatch { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid rgba(0, 0, 0, .6); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 5px rgba(0,0,0,.4); position: relative; }
.cr-swatch.on { outline: 2.5px solid var(--brass-glow); outline-offset: 2px; }
.cr-swatch.on::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff8e6; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); }
.cr-swatch:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.cr-hint { margin: 7px 0 0; font-size: 13px; color: var(--text-soft); }
.cr-hint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cr-hint a:hover, .cr-hint a:focus-visible { color: var(--text); }

/* The two bodies, as pictures (app.js BODY_PIC is the picture's size). */
.cr-bodies { gap: 10px; }
.cr-body { display: grid; justify-items: center; gap: 4px; padding: 6px 8px 8px; min-width: 96px; }
.cr-body .cr-pic { width: 80px; height: 104px; }
.cr-body-name { font: 400 17px/1 var(--pirate); }
.cr-body.on { border-color: var(--brass-glow); box-shadow: 0 0 0 2px var(--brass), 0 0 14px rgba(201,162,74,.35); }
.cr-pic { display: block; border-radius: 4px; overflow: hidden; background: rgba(0, 0, 0, .25); }
.cr-pic canvas { display: block; width: 100%; height: 100%; }
.cr-pic.loading { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.12), rgba(255,255,255,.04)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- surprise me */
/* The captains scroll; Back to before and Done stay at the foot, in sight on any screen. */
.cr-spin { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cr-spin-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px 12px; overscroll-behavior: contain; }
.cr-spin h2 { margin: 0 0 4px; font: 700 20px/1.2 var(--display); color: #f6e2b0; }
.cr-spin-lede { margin: 0 0 12px; font-size: 14px; color: var(--text-soft); }
.cr-spin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cr-cand { display: grid; gap: 6px; }
.cr-cand-pick { padding: 4px; }
.cr-cand-pick .cr-pic { width: 100%; aspect-ratio: 2 / 3; }
.cr-cand-pick[aria-pressed="true"] { border-color: var(--brass-glow); box-shadow: 0 0 0 2px var(--brass), 0 0 14px rgba(201,162,74,.35); }
/* Without a preview a captain in the spin is its colours (skin, hair, coat) and a few words. */
.cr-cand-pick .cr-pic.cr-pic-words { aspect-ratio: auto; display: grid; align-content: start; gap: 6px; padding: 7px 5px; background: rgba(0, 0, 0, .3); text-align: left; }
.cr-no-preview .cr-cand { grid-template-rows: 1fr auto; }
.cr-no-preview .cr-cand-pick { display: grid; }
.cr-dots { display: flex; gap: 3px; }
.cr-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 1.5px solid rgba(0, 0, 0, .6); }
.cr-cand-words { font: 700 12px/1.3 var(--sans); letter-spacing: 0; text-shadow: none; overflow-wrap: anywhere; }
/* Without a preview (no WebGL here): no turning, no close-up, and the bodies are their names. */
.cr-no-preview .cr-stage-tools, .cr-no-preview .cr-body .cr-pic, .cr-no-preview .cr-stage-note { display: none; }
.cr-no-preview #cr-canvas { cursor: default; }
.cr-keep { font: 700 12px/1 var(--sans); padding: 8px 4px; text-shadow: none; }
.cr-keep[aria-pressed="true"] { background: linear-gradient(180deg, #d9b25a, #9c7228); color: #231505; border-color: var(--brass-glow); }
.cr-spin-actions { flex: none; display: flex; gap: 8px; padding: 10px 18px; border-top: 1px solid rgba(201, 162, 74, .25); }
.cr-spin-actions button { flex: 1 1 0; }

/* ---------------------------------------------------------------- dialogs */
.cr-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; padding: 22px 22px 16px; border: 0; border-radius: 4px; color: var(--ink); background: var(--parch);
  box-shadow: inset 0 0 38px rgba(110, 62, 18, .5), 0 18px 44px rgba(0, 0, 0, .6); }
.cr-dialog::backdrop { background: rgba(8, 6, 4, .6); }
.cr-dialog h2 { margin: 0 0 8px; font: 700 22px/1.2 var(--display); color: var(--ink); }
.cr-dialog p { margin: 0 0 10px; }
.cr-code-label { display: block; font: 400 17px/1.2 var(--pirate); color: #5c4630; margin-bottom: 6px; }
.cr-code { width: 100%; font: 700 22px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .08em; text-align: center; padding: 12px 8px; color: var(--ink); background: #fff8e8; border: 1.5px solid #8a6424; border-radius: 4px; }
.cr-small { font-size: 13px; color: #5c4630; margin-top: 8px !important; }
.cr-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cr-dialog-actions button { flex: 1 1 auto; }
.cr-copy-msg, .cr-code-err { min-height: 1.4em; margin: 8px 0 0 !important; font-size: 14px; }
.cr-code-err { color: #8c1d12; }

/* ---------------------------------------------------------------- in the game */
/* The game's captain screen (index.html #captain, captain.js): the creator fills the screen over the game,
   with the captain's name, a Name row, colours from a photo, the share code on the captain card by Set sail,
   and Back to the title. */
#captain.screen { padding: 0; display: block; place-items: normal; background: #0c0906; backdrop-filter: none; }
.cr-who { position: absolute; left: 14px; top: 10px; margin: 0; max-width: calc(100% - 28px); font: 700 24px/1.15 var(--display); color: #f6e2b0; text-shadow: 0 2px 0 #3a250e, 0 0 12px rgba(0, 0, 0, .6); pointer-events: none; overflow-wrap: anywhere; }
.cr-who ~ .cr-stage-note { top: 50px; }
#creator #cap-invite { margin: 12px 18px 0; font-size: 14px; }
.cr-name-row { display: grid; gap: 6px; }
.cr-name { width: 100%; font: 16px/1.2 var(--sans); color: var(--text); background: rgba(0, 0, 0, .35); border: 1.5px solid var(--brass-dark); border-radius: 6px; padding: 10px 12px; }
.cr-name::placeholder { color: rgba(239, 220, 180, .5); }
.cr-photo .cr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cr-file-btn { display: inline-block; font: 400 16px/1 var(--pirate); color: var(--text); background: rgba(0, 0, 0, .3); border: 1.5px dashed var(--brass-dark); border-radius: 6px; padding: 10px 14px; cursor: pointer; }
.cr-file-btn:hover { border-color: var(--brass); color: #fff4d6; }
.cr-file:focus-visible + .cr-file-btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.cr-photo-box { display: grid; gap: 6px; margin-top: 10px; }
#cr-photo { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); cursor: crosshair; touch-action: none; }
/* Your face from a photo (app.js faceRow): the file inputs behind their buttons, the face finder's
   download, what happened, and the nudge. */
.cr-face .cr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cr-face-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-face-bar { display: block; width: 100%; height: 8px; margin-top: 10px; accent-color: var(--brass); }
.cr-face-status { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; font-size: 14px; line-height: 1.4; background: rgba(255, 214, 140, .1); border: 1px solid rgba(255, 214, 140, .35); color: #fff1d6; }
.cr-face-tools { display: grid; gap: 8px; margin-top: 10px; }
.cr-face-fit { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; color: var(--text-soft); }
.cr-face-fit input { width: 100%; min-height: 28px; accent-color: var(--brass); }
.cr-face-actions { display: flex; flex-wrap: wrap; gap: 7px; }
/* The captain card: the share code as the captain stands, copied with one press, over Back, Surprise me
   and Set sail. */
.cr-actions:has(.cr-card) { flex-wrap: wrap; }
.cr-card { flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.cr-card-label { font: 400 16px/1 var(--pirate); color: var(--brass); }
.cr-card-code { font: 700 17px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; color: #fff4dc; user-select: all; }
.cr-actions .cr-card button { flex: none; font-size: 14px; padding: 7px 10px; margin-left: auto; }
.cr-card-msg { flex: 1 0 100%; font-size: 13px; color: var(--text-soft); min-height: 0; }
.cr-card-msg:empty { display: none; }
.cr-card-note { flex: 1 0 100%; margin: 0; font-size: 12px; color: var(--text-soft); }
.cr-actions #cr-back { flex: 0 0 auto; }
/* What a new player still needs before Set sail, just above it; Set sail waits, dimmed. */
.cr-need { flex: 1 0 100%; margin: 0; text-align: right; font-size: 15px; line-height: 1.35; color: #ffe2a6; }
.cr-need[hidden] { display: none; }
.cr-actions #cr-sail:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1000px) {
  #creator { grid-template-columns: 124px minmax(0, 1fr) minmax(300px, 360px); }
  .cr-tab { font-size: 17px; padding: 11px 10px; }
}
/* Phones held upright (and any narrow window taller than it is wide). */
@media (max-width: 760px) and (max-aspect-ratio: 1/1) {
  #creator {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(200px, 40vh) auto minmax(0, 1fr) auto;
    grid-template-areas: "head" "stage" "tabs" "panel" "actions";
  }
  .cr-head { padding: 8px 16px 10px; gap: 6px 10px; }
  .cr-head :is(h1, h2) { font-size: 20px; width: 100%; }
  /* Presets wrap onto a second line rather than scroll sideways, so every one is in sight. */
  .cr-presets { gap: 6px; }
  .cr-preset { flex: none; font-size: 14px; padding: 8px 9px; }
  .cr-presets-label { flex: none; font-size: 15px; }
  .cr-tabs { flex-direction: row; gap: 4px; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .cr-tab { flex: 1 0 auto; text-align: center; font-size: 15px; padding: 10px 6px; }
  .cr-panel, .cr-actions { border-left: 0; }
  .cr-panels { padding: 4px 16px 14px; }
  .cr-note { margin: 8px 16px 0; font-size: 13px; }
  /* During a spin the tabs make way for the captains (app.js spinMode), and the advice goes under them. */
  .cr-spinning .cr-tabs { display: none; }
  .cr-spin-scroll { display: flex; flex-direction: column; padding: 8px 16px 8px; }
  .cr-spin h2 { font-size: 17px; margin-bottom: 8px; }
  .cr-spin-lede { order: 1; margin: 10px 0 0; font-size: 13px; }
  .cr-spin-actions { padding: 8px 16px; }
  .cr-spin-actions button { font-size: 15px; padding: 8px 10px; }
  .cr-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .cr-actions button { font-size: 18px; padding: 12px; }
  .cr-stage-tools { right: 8px; bottom: 8px; left: 10px; }
  .cr-retry { bottom: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.3; text-align: left; }
  .cr-retry p { margin: 0; flex: 1; }
  .cr-retry button { flex: none; font-size: 14px; padding: 8px 10px; }
  .cr-zoom { font-size: 14px; padding: 8px 10px; }
  .cr-turn-hint { font-size: 13px; }
}
@media (max-width: 760px) and (max-aspect-ratio: 1/1) and (max-height: 700px) {
  #creator { grid-template-rows: auto minmax(170px, 34vh) auto minmax(0, 1fr) auto; }
}
/* A phone held upright: when the creator opens (app.js focusStart, choices at the top), a new player sees the
   Name box and both bodies together. The name's label sits beside its box, the rows are slimmer, the body
   pictures smaller, and the stage gives up a little height (28vh: the notice under the Name box, that the name
   and progress are saved to jasonqlu.com, takes two lines here). */
@media (max-width: 760px) and (max-aspect-ratio: 1/1) {
  #creator { grid-template-rows: auto minmax(170px, 28vh) auto minmax(0, 1fr) auto; }
  .cr-row { padding: 8px 0 7px; }
  .cr-row-head { margin-bottom: 4px; }
  .cr-lock { width: 30px; height: 30px; }
  .cr-name-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; }
  .cr-name { padding: 8px 10px; }
  .cr-name-row .cr-hint { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.35; }
  .cr-body .cr-pic { width: 56px; height: 73px; }
  .cr-body { min-width: 76px; padding: 4px 6px 6px; }
  .cr-body-name { font-size: 15px; }
}
/* Short and wide: a phone on its side. The side-by-side layout, with the header on one line where it fits
   and the tabs, rows and buttons slimmer, so the choices keep more than a row in sight. */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  #creator { grid-template-columns: 112px minmax(0, 1fr) clamp(270px, 38vw, 340px); }
  .cr-head { padding: 6px 14px; gap: 6px 14px; }
  .cr-head :is(h1, h2) { font-size: 18px; white-space: nowrap; }
  .cr-presets { gap: 5px; }
  .cr-presets-label { display: none; }
  .cr-preset { font-size: 13px; padding: 6px 8px; white-space: nowrap; }
  .cr-tabs { gap: 4px; padding: 8px 8px; }
  .cr-tab { font-size: 15px; padding: 8px 10px; }
  .cr-panels { padding: 2px 14px 10px; }
  .cr-row { padding: 8px 0 7px; }
  .cr-row-head { margin-bottom: 4px; }
  .cr-lock { width: 30px; height: 30px; }
  .cr-chip { min-height: 36px; padding: 8px 12px; }
  .cr-actions { padding: 8px 14px 10px; }
  .cr-actions button { font-size: 16px; padding: 9px 10px; }
  .cr-spin-scroll { padding: 8px 14px; }
  .cr-spin h2 { font-size: 17px; }
  .cr-spin-lede { display: none; }
  .cr-spin-actions { padding: 6px 14px; }
  .cr-spin-actions button { padding: 7px 10px; font-size: 15px; }
  .cr-body .cr-pic { width: 56px; height: 73px; }
  .cr-body { min-width: 76px; padding: 4px 6px 6px; }
  .cr-body-name { font-size: 15px; }
}
/* The game's additions on phones, upright or on their side: the name and the captain card smaller. */
@media (max-width: 760px) and (max-aspect-ratio: 1/1), (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .cr-who { font-size: 18px; top: 8px; left: 12px; }
  .cr-who ~ .cr-stage-note { top: 38px; }
  .cr-card { padding: 5px 8px; }
  .cr-card-label { font-size: 14px; }
  .cr-card-code { font-size: 14px; }
  .cr-card-note { display: none; }
}
/* On its side the choices are narrow: the code and Copy keep to one line, the label left to screen readers. */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .cr-card-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  :where(#creator) button, .cr-dialog button { transition: none; }
  .cr-pic.loading { animation: none; }
}
