/* Wordbloom — Manu Arcade
   Chrome (masthead, hud, seal, overlay, colophon) comes from ../_shared/palette.css.
   Only game-specific surfaces live here: the on-screen keyboard, the hint copy,
   and a couple of board-frame tweaks. No em dashes in on-screen copy. */

/* The canvas board: the grid of guess tiles and the blooming flower live here. */
#board {
  display: block;
  touch-action: manipulation;
  border-radius: 6px;
  max-width: 100%;
}

/* ---- On-screen keyboard (DOM, for crisp tap targets) ------------------- */
.keyboard {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.4vw, 8px);
  margin-top: 2px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.kb-row {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 7px);
}
.key {
  flex: 1 1 0;
  min-width: 0;
  height: clamp(46px, 11vw, 56px);
  border: 1px solid rgba(122, 104, 80, .4);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .03)),
    var(--parchment-warm);
  color: var(--ink);
  font-family: var(--caps);
  font-size: clamp(15px, 3.2vw, 19px);
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 3px rgba(58, 46, 34, .18);
  transition: transform .08s var(--ease), filter .12s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.key:hover { filter: brightness(1.04); }
.key:active,
.key.pressed { transform: translateY(2px) scale(.97); filter: brightness(.96); }
.key.wide {
  flex: 1.6 1 0;
  font-size: clamp(11px, 2.4vw, 13px);
  letter-spacing: .12em;
}

/* Letter states, painted by the best-known result so far. */
.key.absent {
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .12)), var(--parchment-shadow);
  color: var(--ink-light);
  border-color: rgba(122, 104, 80, .3);
  box-shadow: inset 0 1px 2px rgba(58, 46, 34, .22);
}
.key.present {
  background: linear-gradient(180deg, var(--amber), #c07f34);
  color: #2a1c0c;
  border-color: #a86a28;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 4px rgba(168, 106, 40, .35);
}
.key.correct {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--forest);
  border-color: var(--gold-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(156, 120, 38, .45);
}

/* ---- Hint copy --------------------------------------------------------- */
.hint {
  text-align: center;
  color: var(--ink-light);
  font-size: 14px;
  padding: 2px 6px 0;
  line-height: 1.5;
  max-width: 560px;
  margin: 2px auto 0;
  min-height: 1.4em;
  transition: opacity .4s var(--ease), color .3s var(--ease);
}
.hint strong { color: var(--oxblood); font-weight: 600; }
.hint.toast { color: var(--oxblood); font-style: italic; font-family: var(--hand); font-size: 16px; }
.hint.gone { opacity: 0; }

/* On phones, give the keyboard and board a touch more breathing room. */
@media (max-width: 460px) {
  .key { height: clamp(42px, 12.5vw, 52px); }
}
