/* CREATE Live (/live). Loaded after tokens.css, fonts.css and create.css. Square controls, hard offset shadows, flat
   fills: the site's sticker language. No inline styles anywhere (CSP style-src 'self'); JS only sets transforms. */

.live-main { background: var(--sketchbook); }

/* ---------------------------------------------------------------- stage */
.live-stage { position: relative; height: calc(100svh - 66px); min-height: 460px; max-height: 1100px; background: var(--line-black); overflow: hidden; isolation: isolate; border-bottom: 2px solid var(--line-black); }
@media (min-width: 900px) { .live-stage { height: calc(100svh - 74px); } }
.live-view { position: absolute; inset: 0; }
.lv-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: pointer; }
.lv-map { cursor: crosshair; }
.live-boot { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--sketchbook); font: italic 900 clamp(26px, 4vw, 44px)/1.1 var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 1; }

/* ---------------------------------------------------------------- HUD */
.live-hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.live-hud > *, .lv-top > *, .lv-top-r > * { pointer-events: auto; }
.lv-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.lv-top-r { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; pointer-events: none; }
.lv-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 10px; background: var(--sketchbook); border: 2px solid var(--line-black); box-shadow: 3px 3px 0 0 var(--marker-pink); font: 600 12px/1.2 var(--font-mono); }
.lv-dot { width: 9px; height: 9px; background: var(--marker-pink); border: 1.5px solid var(--line-black); }
.lv-chip.off .lv-dot { background: var(--pencil); }
.lv-live { text-transform: uppercase; letter-spacing: 0.06em; }
.lv-beta { text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; padding: 2px 4px; border: 1.5px solid var(--line-black); }
.lv-presence { font-weight: 400; }
.lv-conn { color: var(--graphite); font-weight: 400; }
.lv-conn:empty { display: none; }
.lv-modes { display: inline-flex; border: 2px solid var(--line-black); background: var(--sketchbook); }
.lv-modes a { font: 600 12px/1 var(--font-mono); padding: 9px 10px; text-decoration: none; color: var(--line-black); border-right: 2px solid var(--line-black); }
.lv-modes a:last-child { border-right: 0; }
.lv-modes a.on { background: var(--line-black); color: var(--sketchbook); }
.lv-sign.btn, .lv-callout-btn.btn { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.lv-who { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--sketchbook); border: 2px solid var(--line-black); font: 600 12px/1 var(--font-mono); }
.lv-badge { background: var(--marker-pink); color: var(--line-black); padding: 3px 5px; text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.lv-out { color: var(--sketchbook); font: 500 12px/1 var(--font-mono); padding: 8px 2px; }
.lv-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: min(320px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 14px; background: var(--sketchbook); border: 2px solid var(--line-black); box-shadow: 5px 5px 0 0 var(--marker-pink); }
.lv-pop .btn { justify-content: flex-start; min-height: 42px; }
.lv-pop img { flex: none; }
.lv-note { margin: 0; font: 400 12px/1.5 var(--font-mono); color: var(--graphite); }

.lv-bottom { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: calc(100% - 24px); display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--sketchbook); border: 2px solid var(--line-black); box-shadow: 4px 4px 0 0 var(--line-black); overflow-x: auto; scrollbar-width: none; }
.lv-bottom::-webkit-scrollbar { display: none; }
.lv-swatches { display: flex; gap: 6px; padding-right: 10px; border-right: 2px solid var(--pencil); }
.lv-swatch { width: 26px; height: 26px; border: 2px solid var(--line-black); cursor: pointer; padding: 0; }
.lv-swatch.v-pink { background: #FF2E88; }
.lv-swatch.v-butter { background: #FFD447; }
.lv-swatch.v-blush { background: #FFB0CE; }
.lv-swatch.v-ink { background: #2B2826; }
.lv-swatch[aria-checked='true'] { outline: 3px solid var(--marker-pink); outline-offset: 2px; }
.lv-emotes { display: flex; gap: 6px; }
.lv-emote { position: relative; flex: none; width: 54px; height: 54px; display: grid; place-items: center; padding: 0; background: var(--sketchbook); border: 2px solid var(--line-black); cursor: pointer; transition: transform var(--hover-ms) steps(2, end); }
.lv-emote:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 0 var(--marker-pink); }
.lv-emote:active { transform: translate(1px, 1px); box-shadow: none; }
.lv-emote img { width: 46px; height: 46px; object-fit: contain; }
.lv-emote kbd { position: absolute; right: 2px; bottom: 1px; font: 600 9px/1 var(--font-mono); color: var(--graphite); }
.lv-emote-t { font: italic 900 13px/1 var(--font-display); }
@media (pointer: coarse) { .lv-emote kbd { display: none; } }

.lv-callout { top: auto; bottom: 90px; right: auto; left: 50%; transform: translateX(-50%); }
.lv-callout h2 { margin: 0 0 4px; }
.lv-callout label { font: 600 12px/1.3 var(--font-mono); }
.lv-callout input, .lv-callout select { min-height: 42px; padding: 8px 10px; border: 2px solid var(--line-black); background: #FFFFFF; font: 400 15px/1.2 var(--font-body); border-radius: 0; width: 100%; }
.lv-row { display: flex; gap: 8px; flex-wrap: wrap; }

.lv-toasts { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: grid; justify-items: center; pointer-events: none; }
.lv-toast { margin: 0; padding: 10px 14px; background: var(--sketchbook); border: 2px solid var(--line-black); box-shadow: 4px 4px 0 0 var(--marker-pink); font: italic 900 18px/1.2 var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 1; text-align: center; }
.lv-banner { position: absolute; top: 68px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: min(640px, calc(100% - 24px)); padding: 10px 12px; background: var(--marker-pink); border: 2px solid var(--line-black); font: italic 900 18px/1.2 var(--font-display); }
.lv-tip { position: absolute; top: 64px; left: 12px; display: flex; gap: 10px; align-items: center; max-width: min(460px, calc(100% - 24px)); padding: 10px 12px; background: var(--sketchbook); border: 2px solid var(--line-black); }
.lv-tip p { margin: 0; font: 500 13px/1.45 var(--font-mono); }
.lv-joy { position: absolute; left: 16px; bottom: 96px; width: 112px; height: 112px; border: 2px solid var(--sketchbook); border-radius: 50%; background: rgb(19 18 17 / 0.35); touch-action: none; display: grid; place-items: center; }
.lv-knob { width: 44px; height: 44px; border-radius: 50%; background: var(--marker-pink); border: 2px solid var(--line-black); }

/* ---------------------------------------------------------------- 2D: controls above and below the plan, never over it */
body.lv-mode-flat .live-stage { height: auto; min-height: 0; max-height: none; display: grid; grid-template-areas: 'top' 'tip' 'view' 'bottom'; gap: 10px; padding: 12px; }
body.lv-mode-flat .live-hud { display: contents; }
body.lv-mode-flat .lv-top { position: static; grid-area: top; }
body.lv-mode-flat .lv-tip { position: static; grid-area: tip; max-width: none; }
body.lv-mode-flat .live-view { position: relative; grid-area: view; width: 100%; max-width: 1100px; justify-self: center; aspect-ratio: 38 / 25; max-height: 64svh; }
body.lv-mode-flat .lv-bottom { position: static; grid-area: bottom; transform: none; justify-self: center; max-width: 100%; }
body.lv-mode-flat .lv-joy { display: none; }
body.lv-mode-flat .live-boot { grid-area: view; position: static; }

/* ---------------------------------------------------------------- TV (/live?tv=1) and overflow */
body.lv-mode-tv .site-header, body.lv-mode-tv .site-footer, body.lv-mode-tv .live-board, body.lv-mode-tv .live-about, body.lv-mode-tv .skip-link, body.lv-mode-tv .menu-sheet { display: none !important; }
body.lv-mode-tv, body.lv-mode-tv .live-main { background: var(--line-black); overflow: hidden; }
body.lv-mode-tv .live-stage { position: fixed; inset: 0; height: auto; min-height: 0; max-height: none; border: 0; }
.lv-tv-canvas { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--line-black); }
.lv-hud-tv .lv-top, .lv-hud-tv .lv-bottom, .lv-hud-tv .lv-joy { display: none; }
body.lv-overflow .lv-bottom, body.lv-overflow .lv-joy, body.lv-overflow .lv-tip, body.lv-overflow .lv-top { display: none; }
body.lv-overflow .lv-banner { top: 12px; bottom: auto; padding: 6px 10px; font-size: 16px; }
body.lv-overflow.lv-mode-flat .live-view { aspect-ratio: 16 / 9; }

/* ---------------------------------------------------------------- the board in words */
.live-board .container { display: grid; gap: 18px; }
.live-board .lead { margin: 0; }
.lv-src { margin: 0 0 12px; font: 500 12px/1.5 var(--font-mono); color: var(--graphite); }
.lv-src[data-src='mock'] { color: var(--marker-pink-deep); font-weight: 600; }
.lv-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--line-black); }
.lv-table th, .lv-table td { text-align: left; padding: 12px 8px; border-bottom: 1.5px solid var(--pencil); vertical-align: middle; }
.lv-table thead th { font: 500 11px/1.2 var(--font-mono); color: var(--graphite); text-transform: lowercase; padding-block: 8px; }
.lv-coin { display: grid; gap: 2px; justify-items: start; }
.lv-sym { font: 900 22px/1.05 var(--font-display); font-variation-settings: 'SOFT' 100; }
.lv-name { font-size: 13px; color: var(--graphite); }
.lv-house { background: var(--marker-pink); font: 600 10px/1 var(--font-mono); padding: 3px 5px; text-transform: uppercase; }
.lv-table .num { font: 600 16px/1.2 var(--font-mono); white-space: nowrap; }
.lv-table .num .lv-note { display: block; font-weight: 400; }
.lv-table .up { color: var(--marker-pink-deep); }
.lv-table .down { color: var(--graphite); }
.lv-spark { width: 110px; height: 30px; display: block; }
.lv-spark path { fill: none; stroke: var(--line-black); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.lv-spark path.up { stroke: var(--marker-pink-deep); }
@media (max-width: 560px) {
  .lv-table th, .lv-table td { padding: 10px 4px; }
  .lv-table thead th:nth-child(4), .lv-table td:nth-child(4) { display: none; }
  .lv-sym { font-size: 19px; }
}
.lv-cols { display: grid; gap: 28px; margin-top: 32px; }
@media (min-width: 900px) { .lv-cols { grid-template-columns: repeat(3, 1fr); } }
.lv-cols h3 { margin: 0 0 12px; }
.lv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lv-list li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1.5px solid var(--pencil); }
.lv-list strong { font: 900 20px/1.1 var(--font-display); font-variation-settings: 'SOFT' 100; }
.lv-empty { margin: 0; display: grid; gap: 4px; }
.lv-empty strong { font: 900 26px/1.1 var(--font-display); font-variation-settings: 'SOFT' 100; }
.lv-empty em { font: italic 900 20px/1.2 var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 1; color: var(--marker-pink-deep); }
.lv-counters { display: grid; gap: 10px; margin: 0 0 10px; }
.lv-counters div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1.5px solid var(--pencil); padding-bottom: 8px; }
.lv-counters dt { font: 500 13px/1.3 var(--font-mono); color: var(--graphite); }
.lv-counters dd { margin: 0; font: 600 22px/1 var(--font-mono); }

.live-about-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .live-about-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.live-facts { margin: 16px 0 0; padding-left: 1.1em; display: grid; gap: 10px; max-width: 38em; }

@media (prefers-reduced-motion: reduce) {
  .lv-emote, .lv-emote:hover, .lv-emote:active { transition: none; transform: none; }
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 640px) {
  .lv-top { flex-direction: column; align-items: stretch; gap: 8px; top: 10px; left: 10px; right: 10px; }
  .lv-top-r { justify-content: flex-start; }
  .lv-chip { align-self: flex-start; font-size: 11px; padding: 6px 8px; gap: 3px 8px; }
  .lv-modes a { padding: 8px 9px; }
  .lv-sign.btn { min-height: 34px; padding: 6px 10px; font-size: 13px; }
  .lv-tip { top: 100px; left: 10px; right: 10px; max-width: none; }
  .lv-tip p { font-size: 12px; }
  .lv-bottom { bottom: 10px; left: 10px; right: 10px; max-width: none; transform: none; justify-content: flex-start; }
  .lv-emote { width: 48px; height: 48px; }
  .lv-emote img { width: 40px; height: 40px; }
  .lv-swatch { width: 24px; height: 24px; }
  .lv-toasts { bottom: 150px; }
  .lv-joy { bottom: 88px; left: 12px; width: 100px; height: 100px; }
  .lv-banner { top: 104px; font-size: 16px; }
  .lv-callout { bottom: 80px; }
  .lv-pop { right: auto; left: 0; }
}
