/* Arson on the web.
 *
 * The editor's world: its charcoal panels and hairline borders, its copper
 * icons with their ember glow, JetBrains Mono for numbers and code. The
 * public pages add a forge at night behind it -- coals glowing under the
 * editor's own viewport grid -- and type with an industrial voice. */

* { box-sizing: border-box; }
html { background: var(--night); color: var(--text); }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 17px/1.55 var(--body);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--ember-hot); text-underline-offset: 3px; }
.mono, .num { font-family: var(--mono); }

/* ── The forge behind everything ── */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.sky .grid {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  background-image:
    linear-gradient(rgba(207, 131, 82, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 131, 82, 0.13) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, black 10%, transparent 85%);
}
.sky .coals {
  position: absolute; inset: auto -20% -35% -20%; height: 75%;
  background:
    radial-gradient(40% 55% at 28% 70%, rgba(255, 120, 40, 0.42), transparent 70%),
    radial-gradient(35% 45% at 72% 78%, rgba(255, 170, 90, 0.30), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(150, 50, 20, 0.55), transparent 75%);
  filter: blur(8px);
  animation: smoulder 7s ease-in-out infinite alternate;
}
@keyframes smoulder {
  from { opacity: 0.8; transform: translateY(0) scale(1); }
  to { opacity: 1; transform: translateY(-2%) scale(1.03); }
}

/* ── Bar ── */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  border-bottom: 1px solid rgba(62, 62, 66, 0.6);
  background: linear-gradient(rgba(20, 19, 21, 0.85), rgba(20, 19, 21, 0.4));
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.mark span { font: 900 26px/1 var(--display); letter-spacing: 0.12em; }
.bar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons, like the editor's ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  font: 700 15px/1 var(--body); letter-spacing: 0.02em;
  border-radius: 6px; border: 1px solid var(--hair);
  color: var(--text); background: var(--panel); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.btn.ember {
  color: #2a1606;
  border-color: var(--ember-hot);
  background: linear-gradient(180deg, #ffb070, var(--ember) 55%, #e2682a);
  box-shadow: 0 0 0 1px rgba(255, 220, 168, 0.25), 0 8px 26px -8px var(--ember-glow);
}
.btn.ember:hover { box-shadow: 0 0 0 1px rgba(255, 220, 168, 0.4), 0 10px 34px -6px var(--ember-glow); }
.btn.ghost { background: rgba(43, 43, 46, 0.6); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
[data-view] { display: none; }
[data-view].shown { display: block; }

/* ── Landing: make a tiny game, then keep building it ── */
/* The preview (toy.js) is fixed behind the page: the hero, the choices and
 * the gem step all sit over it, so every choice is seen the moment it is made. */
.landing.shown { display: block; position: relative; }
.stage { position: fixed; inset: 0; z-index: -1; background: linear-gradient(#1b1a1c, #0d0c0d); overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.8s ease; touch-action: pan-y; }
.stage.live canvas { opacity: 1; }
/* The loading mark, until the preview's first frame; it fades with the canvas coming in. */
.stage-loader { position: absolute; left: 50%; top: 38%; margin-left: -32px; transition: opacity 0.6s ease; }
.stage.live .stage-loader, .stage.nogl .stage-loader { opacity: 0; animation: none; }
body.playing .stage-loader { display: none; }
.stage .veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 9, 10, 0.72) 0%, rgba(10, 9, 10, 0.25) 40%, rgba(10, 9, 10, 0) 62%),
    linear-gradient(0deg, rgba(10, 9, 10, 0.55) 0%, rgba(10, 9, 10, 0) 30%);
}
body.on-landing .sky { display: none; }
body.on-landing .bar { background: rgba(14, 13, 15, 0.42); border-bottom-color: rgba(255, 255, 255, 0.08); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
body.on-landing main { max-width: none; padding: 0; }
body.on-landing .foot { position: relative; background: #0d0c0d; }

.hero {
  min-height: calc(100svh - 64px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) clamp(36px, 9vh, 96px); max-width: 1400px; margin: 0 auto; pointer-events: none;
}
.hero > * { pointer-events: auto; }
.hero h1 {
  margin: 0; display: flex; flex-direction: column;
  font: 900 clamp(60px, 8.6vw, 156px)/0.86 var(--display); text-transform: uppercase; letter-spacing: -0.01em;
  color: #fbf5ee; text-shadow: 0 6px 50px rgba(0, 0, 0, 0.45);
}
.hero h1 .l1, .hero h1 .l2 { display: block; opacity: 0; transform: translateY(40px); animation: slam 0.9s cubic-bezier(.16, 1, .3, 1) forwards; }
.hero h1 .l1 { animation-delay: 0.1s; }
.hero h1 .l2 { animation-delay: 0.28s; }
.hero h1 em, .yours h2 em {
  font-style: normal; color: transparent;
  background: linear-gradient(180deg, #fff4dc 0%, var(--ember-hot) 25%, var(--ember) 60%, #c4441b 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 24px rgba(255, 120, 40, 0.45));
}
@keyframes slam { to { opacity: 1; transform: none; } }
.hero .lede {
  max-width: 32em; margin: 24px 0 28px; font-size: clamp(17px, 1.5vw, 21px); color: #ece3da;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  opacity: 0; animation: rise 0.8s 0.5s cubic-bezier(.2, .8, .2, 1) forwards;
}
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; opacity: 0; animation: rise 0.8s 0.65s cubic-bezier(.2, .8, .2, 1) forwards; }
.btn.big { min-height: 58px; padding: 0 26px; font-size: 17px; border-radius: 10px; gap: 12px; }
.btn.wide { width: min(420px, 100%); }
.btn.ember.big { animation: breathe 3.2s ease-in-out 2s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 1px rgba(255, 220, 168, 0.45), 0 14px 48px -6px rgba(255, 130, 50, 0.75); } }

/* ── The choices: cards over the preview ── */
.story { position: relative; padding: 18vh var(--gutter) 26vh; max-width: 1400px; margin: 0 auto; pointer-events: none; }
.step, .yours {
  pointer-events: auto; padding: 24px 24px 22px; border-radius: 16px;
  background: rgba(16, 15, 16, 0.7); border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.85);
}
.step { width: min(440px, 100%); margin: 0 0 62vh; }
/* Every card on the left: the hero stands in the right half. */
/* The body font, not the monospace one: on the homepage these labels were
 * the only thing asking for it, and it is 22 KB. */
.n { margin: 0 0 10px; font: 700 12px/1 var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember); }
.step h2, .yours h2, .windows h2 {
  margin: 0 0 16px; font: 800 clamp(34px, 3.6vw, 54px)/0.95 var(--display); text-transform: uppercase; color: #f8f1e9;
}
.step p { margin: 0 0 16px; color: #d9cfc5; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choice {
  min-height: 48px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  font: 700 16px/1 var(--body); color: #e8ded4; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.choice:hover { background: rgba(255, 150, 70, 0.12); border-color: rgba(255, 150, 70, 0.5); }
.choice:active { transform: scale(0.96); }
/* Chosen: outlined in ember, so it never looks like the filled button that
   moves you on (Next step, Done). */
.choice.on { color: var(--ember-hot); background: rgba(255, 150, 70, 0.14); border: 2px solid var(--ember); box-shadow: inset 0 0 0 1px rgba(255, 190, 130, 0.15); }
.placed { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.tally { font: 900 44px/1 var(--display); color: var(--ember-hot); min-width: 2.4em; }
.pips { display: flex; gap: 6px; }
.pips i { width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); background: rgba(255, 255, 255, 0.14); transition: background 0.2s ease, box-shadow 0.2s ease; }
.pips i.on { background: #6fd8ff; box-shadow: 0 0 12px rgba(111, 216, 255, 0.8); }
.choice.go:disabled { opacity: 0.35; cursor: default; }
.choice.go:not(:disabled) { color: #2a1606; background: linear-gradient(180deg, #ffb070, var(--ember) 60%, #e2682a); border-color: var(--ember-hot); animation: breathe 2.4s ease-in-out infinite; }
.step .next { margin-top: 16px; }
.step .next[hidden] { display: none; }
.step { scroll-margin: 84px 0 calc(16px + env(safe-area-inset-bottom)); }

/* ── The hand that shows where to tap ── */
.hand { position: fixed; left: 0; top: 0; width: 64px; height: 64px; z-index: 25; pointer-events: none; }
.hand[hidden] { display: none; }
.hand svg { width: 64px; height: 64px; fill: #fbf5ee; stroke: #1a1412; stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }

/* ── Your game, at the bottom ── */
.yours { position: relative; max-width: 760px; margin: 0 auto 0; text-align: center; padding: 34px 26px 30px; border-color: rgba(255, 150, 70, 0.35); }
.yours .frame {
  position: relative; display: block; margin: 8px auto 18px; aspect-ratio: 16 / 9; width: 100%; padding: 0;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255, 150, 70, 0.35); background: rgba(0, 0, 0, 0.25);
}
.yours .frame canvas { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, filter 0.3s ease; }
.yours .frame:hover canvas { transform: scale(1.03); }
/* A play button on the picture, as a video shows one. */
.bigplay {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #ffb070, var(--ember) 60%, #e2682a); box-shadow: 0 10px 40px -6px rgba(255, 130, 50, 0.8), 0 0 0 6px rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease;
}
/* The drawing already sits a little right of its box's middle, which is
   what makes a play triangle look centred in a circle; nothing more. */
.bigplay svg { width: 38px; height: 38px; fill: #2a1606; }
.yours .frame:hover .bigplay { transform: scale(1.08); }
.frame-note { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-weight: 700; color: #fbf5ee; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.frame-note[hidden] { display: none; }
#play:disabled { cursor: default; }
#play:disabled canvas { filter: grayscale(0.5) brightness(0.55); }
#play:disabled .bigplay { opacity: 0.45; animation: none; }
.yours .small { font-size: 14px; max-width: 30em; margin: 14px auto 0; }
.yours .btn.ghost { margin: 0 auto; }

/* ── The Windows editor ── */
.windows, .hood { position: relative; background: #0d0c0d; }
.windows {
  margin-top: 16vh; padding: clamp(60px, 10vh, 110px) var(--gutter); border-top: 1px solid rgba(255, 150, 70, 0.18);
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: end;
}
.windows::before {
  content: ""; position: absolute; left: 0; right: 0; top: -160px; height: 160px; pointer-events: none;
  background: linear-gradient(rgba(13, 12, 13, 0), #0d0c0d);
}
.windows > div { max-width: 640px; }
.windows p { color: #cfc5bb; }
.soonbox { justify-self: start; padding: 14px 18px; border-radius: 10px; border: 1px dashed var(--hair); color: var(--muted); font: 600 14px/1.3 var(--mono); }

/* ── Under the hood ── */
.hood { padding: clamp(40px, 8vh, 90px) var(--gutter) clamp(70px, 12vh, 130px); }
.hood h2 { margin: 0 auto 30px; max-width: 1400px; font: 900 clamp(38px, 5vw, 76px)/0.9 var(--display); text-transform: uppercase; color: #f6efe7; }
.grid {
  max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 14px; overflow: hidden;
}
.grid div { background: #151415; padding: 24px 22px 26px; display: flex; flex-direction: column; gap: 10px; }
.grid b { font: 800 21px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ember-hot); }
.grid span { color: #b9aea4; font-size: 15px; }
.soon { font: 600 10px/1 var(--mono); font-style: normal; letter-spacing: 0.1em; color: var(--night); background: var(--copper); padding: 3px 6px; border-radius: 4px; vertical-align: middle; margin-left: 6px; }

/* ── Playing: the preview, full screen, the page out of the way ── */
body.playing { overflow: hidden; }
body.playing .bar, body.playing .hero, body.playing .story, body.playing .yours, body.playing .windows,
body.playing .hood, body.playing .foot, body.playing .stage .veil { visibility: hidden; }
body.playing .stage { z-index: 20; }
body.playing .stage canvas { touch-action: none; }
.playview { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.playview[hidden] { display: none; }
.hud {
  position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 18px; border-radius: 999px; pointer-events: auto;
  background: rgba(14, 13, 14, 0.72); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px);
  font: 800 22px/1 var(--display); color: #fbf5ee; letter-spacing: 0.04em;
}
.hud .mono { font: 700 15px/1 var(--body); font-variant-numeric: tabular-nums; color: var(--ember-hot); }
.hud .btn { min-height: 38px; }
/* Centred by margins, not a transform: the rise animation ends on
   `transform: none`, which threw away a translate(-50%, -50%) and left the
   card hanging off the bottom right of a phone. */
.won {
  position: absolute; inset: 0; margin: auto; height: max-content; max-height: calc(100% - 32px); overflow: auto;
  width: min(460px, calc(100vw - 32px)); box-sizing: border-box;
  text-align: center; padding: 30px 24px; border-radius: 18px; pointer-events: auto;
  background: rgba(16, 15, 16, 0.82); border: 1px solid rgba(255, 150, 70, 0.45); backdrop-filter: blur(12px);
  animation: rise 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
.won h2 { margin: 0 0 6px; font: 900 56px/0.9 var(--display); text-transform: uppercase; color: var(--ember-hot); }
.won .cta { justify-content: center; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn .ico { width: 0.95em; height: 0.95em; margin-right: 9px; fill: currentColor; flex: none; }
@media (max-width: 520px) {
  .hud { gap: 10px; padding: 5px 5px 5px 14px; font-size: 18px; max-width: calc(100vw - 24px); white-space: nowrap; }
  .hud .mono { font-size: 13px; }
  .hud .btn { min-height: 34px; padding: 0 14px; font-size: 14px; }
  .won { padding: 24px 18px; }
  .won h2 { font-size: 40px; }
  .won .cta .btn { flex: 1 1 100%; }
}
.stage.nogl::after { content: "This browser can't show the preview, but the editor link above still works."; position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: var(--muted); }

/* ── Accounts: one glass card, centred, in the landing's voice ── */
.auth.shown { display: grid; place-items: center; min-height: calc(100dvh - 160px); padding: clamp(24px, 6vh, 72px) 0; }
.auth-card {
  width: min(420px, 100%); padding: 34px 30px 26px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(36, 34, 37, 0.78), rgba(22, 21, 23, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 150, 70, 0.04);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: rise 0.45s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-card.center { text-align: center; }
.auth-card.center .arson-loader { margin: 6px auto 18px; }
.auth-mark { display: block; margin: 0 0 18px; filter: drop-shadow(0 6px 18px rgba(255, 90, 30, 0.35)); }
.auth-title { margin: 0; font: 800 clamp(34px, 5vw, 42px)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.01em; color: #f8f1e9; }
.auth-sub { margin: 10px 0 22px; color: #b9b0a7; font-size: 15.5px; }
.auth-foot { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 15px; text-align: center; }
.auth-foot a, .label-row a { color: var(--ember-hot); text-decoration: none; font-weight: 600; }
.auth-foot a:hover, .label-row a:hover { text-decoration: underline; }

.fields { display: grid; gap: 16px; }
.fields label { display: grid; gap: 7px; font-weight: 600; font-size: 14px; color: #d9d0c7; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label-row small, .fields small { color: var(--muted); font-weight: 400; font-size: 13px; }
input {
  min-height: 48px; width: 100%; padding: 0 14px;
  font: 400 16px/1 var(--body); color: var(--text);
  background: rgba(10, 9, 11, 0.55); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder { color: #6f6963; }
input:hover { border-color: rgba(255, 255, 255, 0.18); }
input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 4px rgba(255, 150, 70, 0.16); background: rgba(10, 9, 11, 0.7); }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; border-radius: 10px; }
.status { min-height: 1.3em; margin: 0; font-size: 14.5px; color: var(--muted); }
.status:empty { min-height: 0; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.status.big { margin-top: 10px; font-size: 17px; }
/* A label kept for screen readers but not shown: its words are text, so the
   label's own type is set to nothing and the field brings its own back. */
.sr { display: block; font-size: 0; line-height: 0; }
.sr input { font-size: 16px; line-height: 1; }
.device-ask { margin: 0; color: #d9d0c7; }
input.code { font: 600 26px/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase; text-align: center; min-height: 60px; }

/* ── Pages: a heading, then cards ── */
.page.shown { display: block; padding: clamp(28px, 6vh, 64px) 0 64px; animation: rise 0.4s cubic-bezier(.2, .8, .2, 1) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .grow { flex: 1; min-width: 0; }
.eyebrow { margin: 0 0 6px; font: 700 12px/1 var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ember); }
.page-title { margin: 0; font: 900 clamp(44px, 6vw, 72px)/0.9 var(--display); text-transform: uppercase; color: #f8f1e9; overflow-wrap: anywhere; }
.page-meta { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.crumb { color: var(--ember); text-decoration: none; }
.crumb:hover { color: var(--ember-hot); }
.dim { color: var(--muted); }

.new-project { display: flex; gap: 10px; flex-wrap: wrap; width: min(460px, 100%); }
.new-project input { flex: 1 1 220px; }
.new-project .status { flex-basis: 100%; }

/* Project cards: a cover made from the name, so two projects never look alike. */
.project-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.project-card {
  display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, rgba(36, 34, 37, 0.85), rgba(24, 23, 25, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: 0 24px 60px -36px rgba(0, 0, 0, 0.9);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: rgba(255, 150, 70, 0.4); box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 150, 70, 0.15); }
.project-cover { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.project-cover b { font: 900 64px/1 var(--display); text-transform: uppercase; color: rgba(255, 255, 255, 0.92); text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35); }
.project-cover .chip { position: absolute; top: 12px; right: 12px; background: rgba(12, 11, 13, 0.6); backdrop-filter: blur(8px); }
.project-body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.project-body strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-body small { color: var(--muted); font-size: 13.5px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state img { filter: drop-shadow(0 8px 28px rgba(255, 90, 30, 0.4)); }
.empty-state h3 { margin: 16px 0 6px; font: 800 30px/1 var(--display); text-transform: uppercase; color: #f1e9e1; }
.empty-state p { margin: 0 auto; max-width: 30em; }

/* A project: files on the left, people and settings on the right. */
.project-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.side { display: grid; gap: 20px; }
.card {
  padding: 20px 20px 22px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(36, 34, 37, 0.8), rgba(24, 23, 25, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: 0 24px 60px -36px rgba(0, 0, 0, 0.9);
}
.card-title { margin: 0 0 14px; font: 800 22px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: #f1e9e1; }
.card-empty { margin: 6px 0 0; color: var(--muted); }
.usage { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin: -4px 0 16px; }
.usage span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #e2682a, var(--ember), var(--ember-hot)); }
.file-list, .people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; font-size: 14.5px; }
.file-list li:hover { background: rgba(255, 255, 255, 0.04); }
.file-list .path { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--muted); font: 400 12.5px/1 var(--mono); }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 800 15px/1 var(--display); color: #2a1606; }
.person { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.person small { color: var(--muted); font-size: 12.5px; }
.icon-btn { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10, 9, 11, 0.55); border: 1px solid rgba(255, 255, 255, 0.08); }
.seg label { position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.seg input { position: absolute; opacity: 0; pointer-events: none; min-height: 0; }
.seg label:has(input:checked) { color: #2a1606; background: linear-gradient(180deg, #ffb070, var(--ember) 60%, #e2682a); box-shadow: 0 4px 14px -6px var(--ember-glow); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ember); outline-offset: 2px; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline label { flex: 1 1 160px; }
.inline .status { flex-basis: 100%; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 107, 74, 0.28); background: rgba(255, 107, 74, 0.05); }
.danger-zone div { display: grid; gap: 3px; min-width: 0; }
.danger-zone small { color: var(--muted); font-size: 13px; }
.card > .danger-zone:first-of-type { margin-top: 0; }
#p-guest-tools .danger-zone { margin-top: 0; }
.btn.danger { color: #fff1ea; border-color: rgba(255, 107, 74, 0.6); background: linear-gradient(180deg, #e2552f, #b83a1c); flex: none; }
.btn.danger:hover { box-shadow: 0 8px 22px -8px rgba(255, 90, 50, 0.7); }

.chip {
  font: 700 11.5px/1 var(--body); letter-spacing: 0.04em; padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12); color: #cfc6bd;
}
.chip.owner { color: var(--ember-hot); border-color: rgba(255, 150, 70, 0.5); }
.chip.editor { color: #e9c9a4; }
.chip:empty { display: none; }

@media (max-width: 860px) {
  .project-layout { grid-template-columns: 1fr; }
  .page-head { align-items: stretch; }
  .page-head .btn.big { width: 100%; }
}

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px var(--gutter); color: var(--muted); font-size: 13px;
  border-top: 1px solid rgba(62, 62, 66, 0.5);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ── A phone ── */
@media (max-width: 760px) {
  .stage .veil { background: linear-gradient(0deg, rgba(10, 9, 10, 0.82) 0%, rgba(10, 9, 10, 0.25) 50%, rgba(10, 9, 10, 0.05) 100%); }
  .hero h1 { font-size: clamp(54px, 16vw, 92px); }
  .cta .btn { flex: 1 1 100%; }
  .step, .step:nth-child(even) { margin: 0 auto 56vh; }
  /* Room between the title and the first card: with the card at the bottom
     of the screen, the title's buttons have scrolled away rather than
     sitting over the character. */
  .story { padding-top: 75svh; }
  .windows { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .bigplay { width: 68px; height: 68px; }
  .bigplay svg { width: 30px; height: 30px; }
}
@media (min-width: 761px) and (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero h1 .l1, .hero h1 .l2, .live-tag, .hero .lede, .hero .cta, .ticker { opacity: 1; transform: none; }
}


/* A clean frame of the live scene, for capturing the poster (?shot). */
body.shot .hero, body.shot .story, body.shot .hood, body.shot .final, body.shot .bar, body.shot .foot, body.shot .stage .veil, body.shot .stage .poster { display: none !important; }
body.shot .stage canvas { opacity: 1; transition: none; }
.stage-debug { position: fixed; left: 8px; bottom: 8px; z-index: 50; margin: 0; padding: 6px 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.75); color: #9ed27a; font: 11px/1.3 var(--mono); pointer-events: none; white-space: pre-wrap; max-width: calc(100vw - 16px); }
