/* ============================================
   Dotmo · game gallery — modern, dark
   ============================================ */
:root {
  --bg: #050505;
  --bg-1: #0a0a0a;
  --bg-2: #111110;
  --bg-3: #1a1a18;
  --line: #1f1f1d;
  --line-2: #2a2a27;
  --fg: #f3f1ea;
  --fg-2: #c8c5bc;
  --fg-3: #8a877e;
  --fg-4: #5a5852;
  --accent: #ff3b2f;
  --radius-card: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shell-pad-x: 56px;
  --gap: 24px;
  --hdr-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'ss01', 'cv11', 'cv02';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* ambient backdrop tint — not a gradient bg, just a single soft glow tied to accent */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 70%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in oklab, var(--accent) 4%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#root, .app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 var(--shell-pad-x);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.dotmo-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.dotmo-dot {
  display: inline-block;
  border-radius: 999px;
  transition: transform 200ms var(--ease), box-shadow 300ms var(--ease);
}
.brand:hover .dotmo-dot { transform: scale(1.15); }
.dotmo-word {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--fg);
  margin-left: -2px;
}

.brand-word {
  display: none; /* the .mo mark is the brand; the dotmo wordmark stays subtle */
}
.brand-tag {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  font-weight: 500;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: color 150ms var(--ease), background 150ms var(--ease);
}
.site-nav-link:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.site-nav-link.is-active {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.site-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hdr-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  cursor: pointer;
  transition: all 150ms var(--ease);
}
.hdr-icon:hover { color: var(--fg); border-color: var(--fg-3); }

.hdr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #fff 40%));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

/* ============================================
   CONTENT
   ============================================ */
.content {
  padding: 56px var(--shell-pad-x) 96px;
  max-width: 1640px;
  margin: 0 auto;
}

.density-compact .content {
  padding-top: 36px;
  padding-bottom: 64px;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-head {
  margin-bottom: 36px;
  max-width: 920px;
}

.section-head-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 18px;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.section-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.section-meta-sep {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-2);
}

.section-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
  margin: 0 0 16px;
  color: var(--fg);
}

.section-desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
  max-width: 600px;
  text-wrap: pretty;
}

/* ============================================
   MOMENT GRID — editorial rhythm
   ============================================ */
.moment-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}
.density-compact .moment-grid { gap: 16px; }

/* simplified: single row of 3 thirds at fixed 16:9 */
.moment-grid.grid-row3 {
  grid-template-columns: repeat(3, 1fr);
}
.moment.moment-third { grid-column: auto; }

@media (max-width: 1100px) {
  .moment-grid.grid-row3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .moment-grid.grid-row3 { grid-template-columns: 1fr; }
}

/* ============================================
   MOMENT CARD
   ============================================ */
.moment {
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
}

.moment-frame {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  isolation: isolate;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}

/* fixed 16:9 (512 / 288) for all previews */
.moment-frame { aspect-ratio: 512 / 288; }

.moment-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated; /* keep the pixel-art crisp */
  transition: transform 1.6s var(--ease), filter 400ms var(--ease);
  filter: saturate(0.85) brightness(0.78) contrast(1.05);
}
.moment.is-hover .moment-image {
  filter: saturate(1.05) brightness(0.95) contrast(1.08);
  transition: transform 6s linear, filter 400ms var(--ease); /* slow Ken-Burns on hover */
}

.moment-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.0) 38%),
    linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.0) 30%);
  pointer-events: none;
  z-index: 2;
}

/* fake video grain overlay — a couple of repeating dot layers, animated */
.moment-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.06) 0.8px, transparent 0.8px),
    radial-gradient(rgba(0,0,0,0.10)        0.8px, transparent 0.8px);
  background-size: 3px 3px, 4px 4px;
  background-position: 0 0, 1px 1px;
  mix-blend-mode: overlay;
  transition: opacity 220ms var(--ease);
}
.moment-grain.is-on { opacity: 0.75; animation: grain-shift 260ms steps(4) infinite; }
@keyframes grain-shift {
  0%   { background-position: 0 0,         1px 1px; }
  25%  { background-position: 1px -2px,    -1px 0; }
  50%  { background-position: -2px 1px,    2px -1px; }
  75%  { background-position: 0 2px,       -1px 1px; }
  100% { background-position: 0 0,         1px 1px; }
}

.moment.is-hover .moment-frame {
  border-color: var(--line-2);
}

/* TOP: tag + LIVE preview */
.moment-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.moment-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  padding: 6px 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
}
.moment-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--fg);
  padding: 6px 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.moment-live.is-on { opacity: 1; transform: translateY(0); }
.moment-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

/* duration */
.moment-duration {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  font-feature-settings: 'tnum';
  color: var(--fg);
  padding: 5px 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* play pill — always visible, pops on hover */
.moment-play {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  color: #0a0a0a;
  background: var(--fg);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 220ms var(--ease);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.moment-play svg {
  margin-left: -2px;
  transform: translateX(0.5px);
}
.moment.is-hover .moment-play {
  background: var(--accent);
  color: #ffffff;
  box-shadow:
    0 4px 14px rgba(0,0,0,0.4),
    0 0 0 1px color-mix(in oklab, var(--accent) 60%, transparent),
    0 0 24px color-mix(in oklab, var(--accent) 40%, transparent);
}
.moment-play:active { transform: scale(0.96); }

/* ============================================
   META BELOW THE FRAME
   ============================================ */
.moment-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}
.moment-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
  color: var(--fg);
  transition: color 160ms var(--ease);
}
.moment.is-hover .moment-title {
  color: var(--fg);
}
.moment-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-3);
  text-wrap: pretty;
}

.density-compact .moment { gap: 10px; }
.density-compact .moment-meta { padding: 0; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-4);
  text-transform: uppercase;
}

/* Hide outline-on-keyboard for cleaner look — keep focus-visible */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================
   PLAY OVERLAY
   ============================================ */
.play-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  transition: opacity 320ms var(--ease), background 480ms var(--ease), backdrop-filter 480ms var(--ease);
  pointer-events: none;
}
.play-overlay.is-on {
  opacity: 1;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
}

.play-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--fg);
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.play-close:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}
.play-close:active { transform: scale(0.94); }

/* ============================================
   STATS PANEL — top-left HUD inside .play-overlay
   PING (browser↔ws RTT) + DENOISE / DECODE (per-block, from model server).
   Ported from Dotmo design v3 .ping-panel.
   ============================================ */
.play-stats {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 5;
}
.ping-panel {
  --ping-color: #4ade80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 11px;
  min-width: 132px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.ping-panel.ping-ok  { --ping-color: #ffd166; }
.ping-panel.ping-bad { --ping-color: var(--accent); }

.ping-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ping-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
}
.ping-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ping-color);
  font-feature-settings: 'tnum';
}
.ping-unit {
  font-size: 10px;
  font-weight: 500;
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.45);
}
.ping-row-sub .ping-label { color: rgba(255, 255, 255, 0.4); }
.ping-value-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.85);
  font-feature-settings: 'tnum';
}

.play-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 480ms var(--ease) 120ms, opacity 320ms var(--ease) 160ms;
}
.play-overlay.is-on .play-stage-wrap {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.play-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 512px;
  text-align: center;
}
.play-meta-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.play-meta-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 22px;
  margin: 0;
  color: var(--fg);
}

.play-stage {
  width: 512px;
  height: 288px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}
.play-stage-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  filter: saturate(1.05) brightness(0.95) contrast(1.08);
  animation: stage-kenburns 16s ease-in-out infinite alternate;
}
@keyframes stage-kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.08) translate(-1.5%, 1%); }
}
.play-stage-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.06) 0.8px, transparent 0.8px),
    radial-gradient(rgba(0,0,0,0.10)        0.8px, transparent 0.8px);
  background-size: 3px 3px, 4px 4px;
  mix-blend-mode: overlay;
  opacity: 0.65;
  animation: grain-shift 220ms steps(4) infinite;
}
.play-stage-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--fg);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  pointer-events: none;
}
.play-stage-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.play-stage-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.play-stage-time {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.04em;
}

.play-actions {
  width: 512px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.play-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0a0a0a;
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 150ms var(--ease), box-shadow 220ms var(--ease);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.play-primary svg { margin-left: -2px; transform: translateX(0.5px); }
.play-primary:hover {
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(0,0,0,0.5),
    0 0 24px color-mix(in oklab, var(--accent) 40%, transparent);
}
.play-primary:active { transform: scale(0.96); }
.play-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.play-reset:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}
.play-reset:active { transform: scale(0.96); }

/* ============================================
   DEMO STAGE — canvas + HUD wired into the
   play overlay's stage frame
   ============================================ */

/* The canvas replaces the static background image when streaming. Keep the
   pixelated look that the source frames already use (256x144 → 512x288). */
.play-stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #000;
  display: block;
}

/* When the stage is "live" (WS connected and frames flowing) the static
   image fades out so the canvas takes over without a hard cut. */
.play-stage.is-live .play-stage-image,
.play-stage.is-live .play-stage-grain {
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

/* Status pill in the top-left of the stage HUD */
.play-stage-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.play-stage-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--fg-3);
}
.play-stage-status-dot.is-connecting { background: var(--fg-3); }
.play-stage-status-dot.is-ready      { background: #00E0B8; box-shadow: 0 0 8px #00E0B8; }
.play-stage-status-dot.is-streaming  {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.play-stage-status-dot.is-error      { background: #FF3B2F; }

/* HUD strip under the stage — two text rows showing live keyboard input
   ("pressed keys") vs the held set the most-recently-rendered frame was
   tagged with by the server ("rendered keys"). The visible gap between
   the two rows is the round-trip latency. */
.demo-hud {
  width: 512px;
  display: grid;
  grid-template-columns: max-content 1fr max-content max-content;
  gap: 6px 18px;
  align-items: baseline;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
}
.demo-hud-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--fg-4);
  white-space: nowrap;
}
.demo-hud-value {
  color: var(--fg);
  font-feature-settings: 'tnum';
}
.demo-hud-value.is-active {
  color: var(--accent);
}
.demo-hud-keys-text {
  color: var(--fg);
  font-size: 12px;
  font-variant-ligatures: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-hud-held-empty {
  color: var(--fg-4);
  font-style: italic;
}

/* Disabled state for the overlay buttons — keep the layout but dim them. */
.play-primary[disabled],
.play-reset[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.play-primary[disabled]:hover {
  background: var(--fg);
  color: #0a0a0a;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

/* ============================================
   KEYBOARD — visual representation of the
   server-aligned held set (60 Hz playback).
   Lifted from Dotmo design v2.
   ============================================ */
.kb {
  width: 600px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  user-select: none;
}
.kb-row {
  display: flex;
  gap: 6px;
}
.kb-key {
  --kb-bg: #141413;
  --kb-fg: #6a6863;
  --kb-border: rgba(255, 255, 255, 0.05);
  flex: 1 0 0;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--kb-bg);
  color: var(--kb-fg);
  border: 1px solid var(--kb-border);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.02);
  position: relative;
  transition: color 90ms var(--ease), background 90ms var(--ease), border-color 90ms var(--ease), transform 120ms var(--ease);
}
.kb-key-mod {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #4a4844;
}
.kb-key-space {
  font-size: 10px;
}

.kb-key.is-on {
  --kb-bg: color-mix(in oklab, var(--accent) 18%, #141413);
  --kb-fg: #fff;
  --kb-border: color-mix(in oklab, var(--accent) 70%, transparent);
  color: #fff;
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent),
    0 0 18px color-mix(in oklab, var(--accent) 35%, transparent);
}
