/* Tallow - Manu Arcade No. XXV
   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. */

/* The candle stage: a portrait panel holding the candle + the word slots. */
.stage-frame {
  width: min(420px, 94vw);
  display: flex;
  justify-content: center;
}
#stage {
  display: block;
  touch-action: manipulation;
  border-radius: 6px;
  max-width: 100%;
  /* A faint candle-glow vignette behind the canvas pixels (matches the ground
     painted in the renderer so resize seams never flash). */
  background:
    radial-gradient(90% 50% at 50% 30%, rgba(227,183,84,.12), rgba(227,183,84,0) 60%),
    linear-gradient(180deg, #1b1410 0%, #221a12 54%, #2a2015 100%);
}

/* The on-screen alphabet. Three staggered rows of beeswax-tinted keys. */
.keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 1.4vw, 9px);
  width: min(560px, 96vw);
  user-select: none;
}
.key-row {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 8px);
  width: 100%;
}
.key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 52px;
  aspect-ratio: 3 / 4;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(15px, 4.2vw, 24px);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.45), rgba(0,0,0,.02)),
    var(--parchment-warm);
  border: 1px solid rgba(122,104,80,.45);
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(122,104,80,.30), inset 0 1px 0 rgba(255,255,255,.5);
  transition:
    transform .1s var(--ease), background .2s var(--ease),
    color .2s var(--ease), border-color .2s var(--ease), box-shadow .12s var(--ease);
}
.key:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(0,0,0,.02)), var(--cream);
  border-color: rgba(90,26,31,.4);
}
.key:active:not(:disabled),
.key.pressed {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(122,104,80,.30), inset 0 1px 3px rgba(0,0,0,.18);
}

/* A correct guess: the key warms to gold and dims out of play. */
.key.correct {
  color: var(--parchment);
  background: radial-gradient(circle at 40% 30%, var(--gold-bright), var(--gold) 60%, var(--gold-deep) 100%);
  border-color: var(--gold-deep);
  box-shadow: 0 2px 0 rgba(156,120,38,.4), 0 0 12px rgba(227,183,84,.45);
}
/* A wrong guess: the key chars to a spent, oxblood ember. */
.key.wrong {
  color: rgba(241,230,200,.65);
  background: linear-gradient(180deg, var(--oxblood-bright), var(--oxblood-deep));
  border-color: var(--oxblood-deep);
  box-shadow: 0 2px 0 rgba(61,15,18,.4), inset 0 1px 2px rgba(0,0,0,.3);
}
.key:disabled { cursor: default; }

/* The seal's "won" flourish + a candle-flame nod on press. */
.seal-face { line-height: 1; transition: transform .3s var(--ease); }
.seal.won {
  background: radial-gradient(circle at 38% 32%, var(--gold-bright), var(--gold) 55%, var(--gold-deep) 100%);
}
.seal:active .seal-face { transform: scale(1.1) rotate(-8deg); }

@media (max-width: 420px) {
  .hud { gap: 10px; }
  .keyboard { gap: 5px; }
  .key-row { gap: 4px; }
  .key { border-radius: 6px; }
}

/* Keys never need the chunky lift on coarse pointers where it can mis-fire. */
@media (prefers-reduced-motion: reduce) {
  .key, .key.pressed, .seal-face { transition: none; }
}
