/* Run 6: felt scale, dice bed, record card, HUD, badges. Loaded last. */

#stage { touch-action: pan-y; }
.shine { display: none !important; }

.app.play .felt.scaled {
  width: 354px;
  height: 471px;
  flex: none;
  transform: scale(var(--felt-k, 1));
  transform-origin: top center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: calc(471px * (var(--felt-k, 1) - 1));
}
.app.play .page:has(.felt.scaled) { overflow: auto; }

.presswrap {
  display: flex;
  gap: 6px;
  align-items: stretch;
  grid-template-columns: none;
}
.presswrap .press-btn,
.press-btn.power {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
}
.press-btn .pl1,
.press-btn small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.press-btn small { font-size: 10px; }
.undodisc, .clearchip { flex: 0 0 32px; }
@media (max-width: 390px) {
  .clearchip { display: none; }
}

.hud { min-width: 0; overflow: hidden; }
.hud-row2 { gap: 8px; overflow: hidden; flex-wrap: nowrap; min-width: 0; width: 100%; max-width: 100%; }
.hud-bank { flex: 0 0 auto; min-width: 0; }
.hud-bank strong { white-space: nowrap; }
.heater.compact b { white-space: nowrap; }
.hud-puck { min-width: 0; }
@media (max-width: 480px) {
  .pointword {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .heater.compact b { display: none; }
  .fairpill, .fairchip, .hud-row2 .fairlink {
    width: 44px;
    min-width: 44px;
    height: 28px;
    padding: 0;
    overflow: hidden;
  }
}

.dice-live.warm .cube3d .f {
  box-shadow: inset 0 0 calc(var(--s) * .08) rgba(0, 0, 0, .18), 0 0 10px #FFB347;
}
.dice-live.hot .cube3d .f {
  box-shadow: inset 0 0 calc(var(--s) * .08) rgba(0, 0, 0, .18), 0 0 12px #FF7A1A;
}
.dice-live.blazing .cube3d .f {
  box-shadow: inset 0 0 calc(var(--s) * .08) rgba(0, 0, 0, .18), 0 0 8px #E5381E, 0 0 24px #FFD36A;
}
@media (prefers-reduced-motion: reduce) {
  .dice-live.warm .cube3d .f,
  .dice-live.hot .cube3d .f,
  .dice-live.blazing .cube3d .f {
    box-shadow: inset 0 0 0 2px currentColor;
  }
}

.winstamp b {
  white-space: nowrap;
  font-size: clamp(40px, 12vw, 56px);
}
.dome-screen .rollstrip { flex-wrap: nowrap; overflow: hidden; }
@media (max-height: 500px) and (orientation: landscape) {
  .app.play .machine {
    width: auto;
    max-height: calc(100% - 56px);
    height: 100%;
    margin-top: 0;
  }
  .app.play .dome-screen .result-line { font-size: 18px; margin: 0; }
  .app.play .dome-screen .rollstrip { display: none; }
  .app.play .dome-cast { transform: scale(.72); transform-origin: left bottom; }
}

.recordlayer {
  position: fixed;
  inset: auto;
  left: 12px;
  right: 12px;
  top: calc(var(--hud-h, 99px) + 8px);
  bottom: calc(var(--dock-h, 167px) + 28px);
  z-index: 30;
  background: none;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}
.recordlayer .sunburst { display: none; }
.recordcard {
  pointer-events: auto;
  width: min(100%, 420px);
  max-height: 100%;
  overflow: auto;
  background: linear-gradient(180deg, #123F2B, #0A2A1C);
  border: 2px solid #C9A961;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: 16px 16px 14px;
  color: #f6edd8;
  text-align: left;
}
.recordcard .recordtop { display: flex; gap: 12px; align-items: flex-start; }
.record-billie { width: 96px; height: auto; flex: 0 0 96px; }
.record-speech {
  font-family: "Fredoka", sans-serif;
  background: #fff;
  color: #1a1208;
  border-radius: 14px;
  padding: 8px 12px;
  margin: 0;
}
.recordcount {
  font-family: "VT323", monospace;
  font-size: 56px;
  line-height: .9;
  color: #FFD36A;
  background: #140F08;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  margin: 8px 0 0;
}
.recordmeta, .recordwhere, .ask { margin: 4px 0; color: #d7c7a1; }
.recorderr { color: #ffb4a8; min-height: 1.2em; margin: 0; }
.inits { display: flex; gap: 8px; }
.init {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 28px;
  border-radius: 10px;
  border: 1px solid #C9A961;
  background: #140F08;
  color: #FFD36A;
}
.recordcard .actions { display: flex; gap: 8px; margin-top: 10px; }
.recordcard .actions .go { flex: 1; min-height: 44px; }
.recordcard .skiplink, .recordcard .ghost {
  min-height: 44px;
  background: transparent;
  color: #f6edd8;
  border: 1px solid rgba(255, 255, 255, .25);
}
@media (max-height: 500px) {
  .recordlayer { top: 52px; right: 144px; bottom: 12px; }
}

.boardhead .led {
  font-family: "VT323", monospace;
  color: #FFD36A;
  background: #140F08;
  display: inline-block;
  padding: 2px 8px;
  letter-spacing: .04em;
}
.boardrow {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.boardrow.you {
  background: linear-gradient(90deg, #3B2F14, #1E1709);
  border: 1.5px solid #C9A961;
  border-radius: 12px;
}
.medal { font-weight: 800; }
.medal.g { color: #E9C46A; }
.medal.s { color: #C9CFD6; }
.medal.b { color: #C98A4B; }
.tierchip {
  font-size: 10px;
  letter-spacing: .08em;
  border-radius: 999px;
  padding: 2px 6px;
  text-transform: uppercase;
}
.tierchip.cold { color: #8FA3B3; }
.tierchip.warm { color: #FFB347; }
.tierchip.hot { color: #FF7A1A; }
.tierchip.blazing { color: #FFD36A; }
.youtag, .latesttag {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .08em;
  margin-left: 6px;
  color: #C9A961;
}
.liverow {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #123F2B;
  color: #d7ffe8;
}
.boardfoot { color: #b7a88a; font-size: 12px; }
.stropts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.stropts button { min-height: 32px; padding: 0 8px; border-radius: 999px; border: 1px solid rgba(226,188,98,.4); color: #f6edd8; font-size: 11px; }
.stropts button.on { background: #c9a961; color: #1a1208; }

.badgegrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.badgetile {
  background: transparent;
  border: 0;
  color: inherit;
  text-align: center;
  padding: 4px;
  min-height: 44px;
}
.badgetile img { width: 100%; height: auto; display: block; }
.badgetile small { display: block; font-size: 11px; line-height: 1.2; min-height: 2.4em; }
.badgebar { height: 4px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; }
.badgebar i { display: block; height: 100%; background: #C9A961; }
.badgetoast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--dock-h, 176px) + 8px);
  z-index: 35;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: #10281c;
  border: 1px solid #C9A961;
  color: #f6edd8;
  pointer-events: auto;
}
.badgetoast img.art { width: 54px; height: auto; }
.badgetoast img.billie { width: 64px; height: auto; }
.limitchip {
  font-size: 10px;
  color: #FFD36A;
  border: 1px solid #C9A961;
  border-radius: 999px;
  padding: 2px 6px;
}
.resumekey { min-height: 44px; }

@media (min-width: 700px) {
  .badgegrid { grid-template-columns: repeat(5, 1fr); }
}
