/* Sprocket — Manu Arcade No. XXXVII
   Game-specific styling only. The shell (masthead, hud, seal, toggles,
   board-frame, overlay, colophon) comes from ../_shared/palette.css.
   No em dashes in any on-screen copy by house style. */

/* Gauge glyph accents. */
.gauge-glyph.gold { color: var(--gold-deep); }
.gauge-glyph.apple { color: var(--oxblood-bright); }

/* The framed playfield is a wide landscape pane for a ride. */
.board-frame {
  width: min(760px, 96vw);
  display: flex;
  justify-content: center;
}
#board {
  display: block;
  touch-action: none;          /* we own drawing + steering on the canvas */
  cursor: crosshair;
  border-radius: 6px;
  max-width: 100%;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(217,148,65,.10), rgba(217,148,65,0) 60%),
    linear-gradient(180deg, #120d09 0%, #1c140d 60%, #241a10 100%);
}
body:not(.editing) #board { cursor: default; }

/* Now-riding label under the HUD. */
.level-name-row {
  margin: 2px 0 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  color: var(--ink-light);
  font-size: 16px;
}
.level-name-row .now-riding { color: var(--ink-light); opacity: .8; }
.level-name-row #level-name { color: var(--oxblood); font-style: normal; font-family: var(--display); font-weight: 600; }

/* Controls hint floats over the lower pane until first input. */
.hint-overlay {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 5%, 24px);
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: 92%;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(11px, 2.6vw, 15px);
  color: var(--gold-bright);
  text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 0 14px rgba(227,183,84,.35);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.hint-overlay.gone { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* Death toast pinned to the top of the pane. */
.death-toast {
  position: absolute;
  left: 50%; top: clamp(8px, 4%, 18px);
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(61,15,18,.82);
  color: var(--parchment);
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .12em;
  font-size: clamp(10px, 2.4vw, 13px);
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.death-toast[hidden] { display: none; }

/* ===== Touch controls ===== */
.controls {
  width: min(760px, 96vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 18px);
}
.ctrl-group { display: flex; gap: clamp(8px, 2vw, 16px); }
.ctrl-btn {
  min-width: clamp(58px, 14vw, 84px);
  min-height: clamp(54px, 12vw, 72px);
  border-radius: 14px;
  border: 1px solid rgba(122,104,80,.4);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.06)), var(--parchment-deep);
  box-shadow: inset 0 0 0 1px rgba(200,156,58,.4), 0 3px 8px rgba(58,46,34,.22);
  color: var(--oxblood);
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1;
  cursor: pointer;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  display: grid; place-items: center;
  transition: transform .1s var(--ease), background .15s var(--ease), filter .15s var(--ease);
}
.ctrl-btn:hover { filter: brightness(1.04); }
.ctrl-btn.held, .ctrl-btn:active {
  transform: translateY(1px) scale(.97);
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.02)), var(--parchment-shadow);
}
.ctrl-btn.gas {
  color: var(--parchment);
  background: radial-gradient(circle at 40% 30%, var(--oxblood-bright), var(--oxblood) 60%, var(--oxblood-deep) 100%);
  border-color: var(--oxblood);
}
.ctrl-btn.turn {
  min-width: clamp(48px, 10vw, 60px);
  min-height: clamp(44px, 9vw, 56px);
  font-size: clamp(20px, 4vw, 26px);
  border-radius: 50%;
}

/* ===== Editor toolbar ===== */
#editor {
  width: min(760px, 96vw);
  display: none; flex-direction: column; gap: 10px;  /* shown only via body.editing */
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.04)), var(--parchment-deep);
  box-shadow: inset 0 0 0 1px rgba(200,156,58,.5), 0 8px 22px rgba(58,46,34,.22);
}
body.editing #editor { display: flex; }
.ed-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.ed-tool, .ed-mini {
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .08em;
  font-size: 12px; color: var(--ink-soft);
  background: var(--cream);
  border: 1px solid rgba(122,104,80,.35);
  padding: 8px 11px; border-radius: 8px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.ed-mini { min-width: 38px; text-align: center; }
.ed-tool:hover, .ed-mini:hover { border-color: rgba(90,26,31,.45); }
.ed-tool[aria-pressed="true"], .ed-mini[aria-pressed="true"] {
  background: var(--oxblood); color: var(--parchment); border-color: var(--oxblood);
}
.ed-name {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  background: var(--cream); border: 1px solid rgba(122,104,80,.4);
  padding: 9px 12px; border-radius: 8px; min-width: 150px;
}
.ed-select {
  font-family: var(--body); font-size: 14px; color: var(--ink-soft);
  background: var(--cream); border: 1px solid rgba(122,104,80,.4);
  padding: 9px 10px; border-radius: 8px; max-width: 160px;
}
.ed-select:disabled { opacity: .5; }
#editor .btn { font-size: 12px; padding: 9px 14px; }
.ed-msg {
  margin: 0; text-align: center;
  font-family: var(--hand); font-style: italic; color: var(--ink-light); font-size: 15px;
  min-height: 1.2em;
}

/* ===== Course chooser ===== */
.level-panel { width: min(520px, 92vw); text-align: left; }
.level-h2 { font-family: var(--display); font-style: italic; font-weight: 500; color: var(--ink); font-size: clamp(26px, 4vw, 36px); margin: 0 0 14px; text-align: center; }
.level-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; margin: 0 0 18px; padding-right: 4px; }
.level-group {
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .2em;
  font-size: 11px; color: var(--oxblood); margin: 12px 0 4px;
}
.level-group:first-child { margin-top: 0; }
.level-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-bottom: 1px solid rgba(122,104,80,.22);
  padding: 10px 8px; cursor: pointer; border-radius: 6px;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.level-row:hover { background: rgba(90,26,31,.06); border-color: rgba(200,156,58,.4); }
.level-row-name { font-family: var(--display); font-size: 19px; color: var(--ink); font-weight: 600; }
.level-row-best { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-light); font-family: var(--caps); letter-spacing: .06em; }

/* The seal "lose" treatment. */
.seal-face { line-height: 1; transition: transform .3s var(--ease); }
.seal.lose { background: radial-gradient(circle at 38% 32%, #6b5a48, #3a2e22 60%, #1a1410 100%); }

/* Editor / play visibility swap. */
body.editing .play-only { display: none; }
body:not(.editing) .editor-only { display: none; }
/* Play-only overlays that live inside the shared board. */
body.editing .hint-overlay,
body.editing .death-toast { display: none; }

@media (max-width: 560px) {
  .ctrl-btn { min-width: 52px; }
  .hud { gap: 8px; }
  .ed-actions { gap: 6px; }
}
