/* Holdfast - Manu Arcade No. XXXIX
   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 "best" star gauge glyph goes gold. */
.gauge-glyph.gold { color: var(--gold-deep); }

/* When the wall is wounded the integrity gauge flares oxblood. */
#hearts.low { color: var(--oxblood-bright); }

/* ---- Warden tray ---------------------------------------------------- */
.tray {
  display: flex;
  gap: clamp(6px, 1.6vw, 12px);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 640px;
}
.tray-card {
  position: relative;
  flex: 1 1 0;
  min-width: 72px;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: clamp(7px, 1.6vw, 11px) 6px clamp(6px, 1.4vw, 9px);
  border-radius: 11px;
  border: 1px solid rgba(122,104,80,.45);
  background: linear-gradient(180deg, var(--parchment-warm), var(--parchment-deep));
  color: var(--ink-soft);
  cursor: pointer;
  overflow: hidden;
  font-family: var(--body);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 6px rgba(58,46,34,.22);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease),
    border-color .18s var(--ease), filter .18s var(--ease);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.tray-card:hover { transform: translateY(-2px); border-color: rgba(90,26,31,.45); }
.tray-card:active { transform: translateY(0) scale(.97); }

/* Selected warden: oxblood seal. */
.tray-card[aria-pressed="true"] {
  border-color: var(--oxblood);
  box-shadow: inset 0 0 0 1px var(--oxblood), 0 4px 12px rgba(90,26,31,.32);
  background: linear-gradient(180deg, #f3e7c6, #e6d2a2);
}

/* Cannot afford: dim and desaturate, but keep it readable. */
.tray-card.cant-afford {
  filter: saturate(.45) brightness(.92);
  opacity: .62;
  cursor: not-allowed;
}

.tray-glyph {
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1;
  color: var(--oxblood);
}
.tray-card[data-kind="caster"] .tray-glyph { color: var(--gold-deep); }
.tray-card[data-kind="gatherer"] .tray-glyph { color: var(--amber); }
.tray-card[data-kind="bulwark"] .tray-glyph { color: var(--ink-soft); }
.tray-card[data-kind="flare"] .tray-glyph { color: var(--oxblood-bright); }

.tray-name {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: clamp(10px, 2.4vw, 12px);
  color: var(--ink);
}
.tray-cost {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: clamp(12px, 2.8vw, 15px);
  color: var(--oxblood);
}
.tray-cost > span:first-child { font-size: .8em; color: var(--gold-deep); }

/* Cooldown sweep fills from the bottom while a warden recharges. */
.tray-cooldown {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: rgba(90,26,31,.22);
  pointer-events: none;
  transition: height .12s linear;
}

/* ---- The cloister board --------------------------------------------- */
.board-frame {
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: 96vw;
}
#board {
  display: block;
  touch-action: manipulation;
  border-radius: 6px;
  max-width: 100%;
  cursor: pointer;
  background:
    radial-gradient(120% 90% at 18% 50%, rgba(217,148,65,.10), rgba(217,148,65,0) 55%),
    linear-gradient(180deg, #140f0a 0%, #1b140d 55%, #221810 100%);
}

/* Instruction caption floats over the board until the first placement. */
.hint-overlay {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 6%, 38px);
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: 86%;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(13px, 3.4vw, 16px);
  color: var(--gold-bright);
  text-shadow: 0 1px 0 rgba(0,0,0,.65), 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);
}

/* The lose treatment on the seal, mirroring the house convention. */
.seal-face { line-height: 1; transition: transform .3s var(--ease); }
.seal.lose { background: radial-gradient(circle at 38% 32%, #5a6a86, #2f3a52 60%, #161b28 100%); color: #bcd6f2; }
.seal.win { background: radial-gradient(circle at 38% 32%, var(--gold-bright), var(--gold) 55%, var(--gold-deep) 100%); color: #2a1d0c; }
.seal:active .seal-face { transform: rotate(-90deg); }

@media (max-width: 420px) {
  .hud { gap: 8px; }
  .gauge { font-size: clamp(17px, 5vw, 22px); }
  .tray-card { min-width: 64px; }
}
