/* Cipher — Manu Arcade No. XXXVI
   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.gold { color: var(--gold-deep); }

/* The fairness promise under the title: the brand stance, stated plainly. */
.promise {
  margin: 6px 0 0; font-family: var(--caps); text-transform: uppercase;
  letter-spacing: .18em; font-size: 11px; color: var(--forest-bright);
}

/* The framed playfield holds a dark board so the warm glows read. */
.board-frame { display: flex; justify-content: center; width: max-content; max-width: 96vw; }
#board {
  display: block; touch-action: none; border-radius: 6px; max-width: 100%;
  background:
    radial-gradient(120% 90% at 50% 50%, rgba(217,148,65,.06), rgba(217,148,65,0) 60%),
    linear-gradient(180deg, #120d09 0%, #1a130c 55%, #241a10 100%);
}

/* Course title sits above the board. */
.course-title {
  margin: 0; text-align: center; font-family: var(--caps);
  text-transform: uppercase; letter-spacing: .18em; font-size: 13px;
  color: var(--ink-light);
}

/* Instruction caption over the board until the first move. */
.hint-overlay {
  position: absolute; left: 50%; bottom: clamp(14px, 6%, 36px);
  transform: translateX(-50%); margin: 0; width: max-content; max-width: 88%;
  text-align: center; font-family: var(--hand); font-style: italic;
  font-size: clamp(13px, 3.2vw, 16px); 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; opacity: 1; transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.hint-overlay.gone { opacity: 0; transform: translateX(-50%) translateY(8px); }

.seal-face { line-height: 1; transition: transform .3s var(--ease); }
.seal:active .seal-face { transform: rotate(-90deg); }

/* On-screen direction dial for touch play. */
.dpad {
  position: relative; width: clamp(130px, 38vw, 162px); height: clamp(130px, 38vw, 162px);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 6px; margin-top: 2px;
}
.dpad-btn {
  border: 1px solid rgba(122,104,80,.45);
  background: linear-gradient(180deg, var(--parchment-warm), var(--parchment-deep));
  color: var(--oxblood); border-radius: 12px; font-size: clamp(15px, 4.2vw, 19px);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 5px rgba(58,46,34,.25);
  transition: transform .1s var(--ease), background .15s var(--ease), color .15s var(--ease);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.dpad-btn:active { transform: scale(.92); background: var(--oxblood); color: var(--parchment); }
.dpad-btn.up { grid-column: 2; grid-row: 1; }
.dpad-btn.left { grid-column: 1; grid-row: 2; }
.dpad-btn.right { grid-column: 3; grid-row: 2; }
.dpad-btn.down { grid-column: 2; grid-row: 3; }
@media (hover: hover) and (pointer: fine) { .dpad { display: none; } }
.dpad.hidden { display: none; }

/* ---- small button variant + wide overlay ---- */
.btn.small { font-size: 12px; padding: 8px 12px; }
.overlay-card.wide { width: min(620px, 92vw); }

/* ---- leaf select grid ---- */
.levels-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; margin: 4px 0 18px; text-align: left;
}
.mine-head {
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .18em;
  font-size: 12px; color: var(--oxblood); margin: 6px 0 8px;
}
.leaf {
  border: 1px solid rgba(122,104,80,.4); border-radius: 9px; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.04)), var(--parchment-warm);
  cursor: pointer; transition: transform .12s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
  text-align: left; font: inherit; color: var(--ink-soft); display: block; width: 100%;
}
.leaf:hover { transform: translateY(-2px); border-color: var(--oxblood); box-shadow: 0 6px 16px rgba(58,46,34,.2); }
.leaf .num { font-family: var(--caps); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--oxblood); }
.leaf .nm { display: block; font-family: var(--display); font-style: italic; font-size: 19px; color: var(--ink); line-height: 1.1; margin-top: 2px; }
.leaf .meta { display: block; font-size: 12px; color: var(--ink-light); margin-top: 4px; }
.leaf.locked { opacity: .55; cursor: not-allowed; }
.leaf.locked:hover { transform: none; box-shadow: none; border-color: rgba(122,104,80,.4); }
.leaf.done .num::after { content: " \2713"; color: var(--forest-bright); }
.leaf.del { border-style: dashed; }

/* ---- editor ---- */
.editor-panel {
  width: min(760px, 96vw);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.04)), var(--parchment-deep);
  border-radius: 12px; padding: 12px 14px 14px;
  box-shadow: inset 0 0 0 1px rgba(200,156,58,.5), inset 0 0 0 3px rgba(122,104,80,.18), 0 12px 30px rgba(58,46,34,.22);
}
.editor-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0; }
.editor-now { font-family: var(--display); font-size: 18px; color: var(--ink); }
.editor-now #tool-name { color: var(--oxblood); font-style: italic; }
.editor-tip, .editor-note { font-family: var(--hand); font-style: italic; color: var(--ink-light); font-size: 14px; }
.editor-note { margin: 6px 0 0; color: var(--forest-bright); }

.palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.pal-group { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 8px; border: 1px dashed rgba(122,104,80,.3); }
.pal {
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer; padding: 0;
  border: 1px solid rgba(122,104,80,.4); background: #1a130c; display: grid; place-items: center;
  transition: transform .1s var(--ease), border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.pal:hover { transform: translateY(-1px); border-color: var(--oxblood); }
.pal.sel { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(227,183,84,.6); }
.pal canvas { display: block; border-radius: 6px; }
.pal-label { width: 100%; font-family: var(--caps); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--ink-light); margin: 2px 0 0; }

.editor-meta label, .editor-actions { font-family: var(--caps); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--ink-light); }
.editor-meta label { display: inline-flex; align-items: center; gap: 6px; }
.editor-meta input {
  font: inherit; font-family: var(--body); text-transform: none; letter-spacing: 0;
  font-size: 14px; padding: 5px 8px; border-radius: 6px; border: 1px solid rgba(122,104,80,.45);
  background: var(--cream); color: var(--ink); width: 72px;
}
.editor-meta input#ed-name { width: 160px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 420px) {
  .hud { gap: 8px; }
  .gauge { font-size: clamp(17px, 5vw, 22px); }
  .pal { width: 34px; height: 34px; }
}
