:root {
  --ink: #0b0a09;
  --ink-2: #14120f;
  --paper: #ece4d4;
  --muted: #8f8677;
  --faint: rgba(236, 228, 212, 0.14);
  --gold: #c9a46a;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); overflow: hidden; }
body { font-family: var(--serif); font-size: 18px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 300; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.65) 100%);
}
.grain {
  position: fixed; inset: -100%; pointer-events: none; z-index: 2; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.8s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); } 80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 14px 22px; border-radius: 999px; border: 1px solid var(--faint); background: transparent;
  cursor: pointer; text-decoration: none; transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn--primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--primary:hover { background: var(--gold); border-color: var(--gold); }
.btn--ghost:hover { border-color: var(--paper); }
.btn--small { padding: 9px 14px; font-size: 10px; }

/* Loader */
.loader {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px;
  background: var(--ink); transition: opacity 1.4s var(--ease), visibility 1.4s;
}
.loader.is-gone { opacity: 0; visibility: hidden; }
.loader__inner { max-width: 620px; text-align: center; }
.loader__kicker { color: var(--muted); }
.loader__title { font-weight: 300; font-size: clamp(64px, 12vw, 148px); line-height: 0.9; margin: 0.15em 0 0.25em; letter-spacing: -0.02em; }
.loader__title em, .wordmark em { font-style: italic; color: var(--gold); }
.loader__line { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; color: rgba(236, 228, 212, 0.75); font-style: italic; margin: 0 auto 2.5em; max-width: 30em; }
.loader__progress { color: var(--muted); }
.loader__enter { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: rise 1.2s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Chrome */
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: 22px 32px; pointer-events: none; animation: rise 1.6s var(--ease) both;
}
.chrome > * { pointer-events: auto; }
.wordmark { font-size: 26px; text-decoration: none; font-weight: 400; letter-spacing: -0.01em; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); transition: color 0.3s; }
.nav a:hover, .nav a.is-active { color: var(--paper); }
.sound-toggle { background: none; border: 0; cursor: pointer; padding: 4px; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.bars i { width: 2px; height: 3px; background: var(--paper); transition: height 0.3s; }
.sound-on .bars i { animation: bar 1.1s ease-in-out infinite alternate; }
.sound-on .bars i:nth-child(2) { animation-delay: -0.3s; } .sound-on .bars i:nth-child(3) { animation-delay: -0.6s; } .sound-on .bars i:nth-child(4) { animation-delay: -0.9s; }
@keyframes bar { from { height: 3px; } to { height: 12px; } }

/* Projected labels */
.labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.label {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  transform-origin: 0 50%; transition: opacity 0.6s var(--ease); background: none; border: 0; padding: 0; text-align: left;
}
.label__num { display: block; color: var(--gold); }
.label__title { display: block; font-size: 24px; font-style: italic; font-weight: 300; line-height: 1.1; }
.label__by { display: block; color: var(--muted); margin-top: 4px; }
.label::before { content: ""; position: absolute; left: -18px; top: 50%; width: 10px; height: 1px; background: var(--faint); }
.label.is-hover .label__title { color: var(--gold); }
.label--fragment .label__title { font-size: 17px; }
.label--fragment.is-open .label__title { color: var(--gold); }
.label.is-behind { opacity: 0.25; }

.modes { position: fixed; right: 32px; bottom: 22px; z-index: 6; display: flex; border: 1px solid var(--faint); border-radius: 999px; overflow: hidden; background: rgba(11, 10, 9, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modes button { background: none; border: 0; padding: 9px 16px; cursor: pointer; color: var(--muted); font: inherit; letter-spacing: inherit; text-transform: inherit; transition: color 0.3s, background 0.3s; }
.modes button:hover { color: var(--paper); }
.modes button.is-active { background: var(--paper); color: var(--ink); }
.tour-caption { position: fixed; left: 50%; top: 18%; transform: translate(-50%, 8px); z-index: 6; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.tour-caption.is-on { opacity: 1; transform: translate(-50%, 0); }
.tour-caption span { display: block; color: var(--gold); }
.tour-caption span:last-child { color: var(--muted); margin-top: 6px; }
.tour-caption b { display: block; font-weight: 300; font-style: italic; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; margin-top: 6px; }
.is-manifesto .modes, .is-manifesto .tour-caption { visibility: hidden; }
.hint { position: fixed; bottom: 28px; left: 0; right: 0; text-align: center; color: var(--muted); z-index: 6; pointer-events: none; margin: 0; }

/* World info */
.world-info {
  position: fixed; left: 32px; bottom: 32px; z-index: 6; max-width: 440px;
  animation: rise 1.6s 0.6s var(--ease) both;
}
.back { text-decoration: none; color: var(--muted); }
.back:hover { color: var(--paper); }
.world-info__meta { color: var(--gold); margin: 22px 0 4px; }
.world-info__title { font-weight: 300; font-style: italic; font-size: clamp(42px, 5vw, 72px); line-height: 0.95; margin: 0; letter-spacing: -0.015em; }
.world-info__creator { color: var(--muted); margin: 10px 0 14px; font-size: 18px; }
.world-info__creator span { color: var(--paper); }
.world-info__statement { font-size: 19px; line-height: 1.45; color: rgba(236, 228, 212, 0.82); margin: 0 0 16px; }
.world-info__edit { color: var(--muted); text-decoration: none; }
.world-info__edit:hover { color: var(--paper); }

/* Fragment panel */
.fragment {
  position: fixed; right: 32px; top: 50%; z-index: 7; width: min(400px, calc(100vw - 64px));
  transform: translateY(-50%); padding: 32px; background: rgba(11, 10, 9, 0.72); border: 1px solid var(--faint);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: slide 0.9s var(--ease) both;
}
.fragment { max-height: calc(100vh - 140px); overflow-y: auto; }
@keyframes slide { from { opacity: 0; transform: translate(24px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
.fragment__close { position: absolute; top: 14px; right: 16px; background: none; border: 0; cursor: pointer; color: var(--muted); }
.fragment__index { color: var(--gold); margin: 0 0 10px; }
.fragment__title { font-weight: 300; font-style: italic; font-size: 34px; line-height: 1.05; margin: 0 0 16px; }
.fragment__text { font-size: 19px; line-height: 1.55; margin: 0 0 18px; white-space: pre-line; color: rgba(236, 228, 212, 0.88); }
.fragment__link { color: var(--gold); text-decoration: none; }
.plot__meta { color: var(--muted); margin: -8px 0 14px; }
.plot__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.is-manifesto .plot { visibility: hidden; }

/* Manifesto */
.manifesto { position: fixed; inset: 0; z-index: 8; overflow-y: auto; background: rgba(11, 10, 9, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 1s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.manifesto__inner { max-width: 680px; margin: 0 auto; padding: 140px 24px 120px; }
.manifesto__inner > .mono { color: var(--gold); }
.manifesto h2 { font-weight: 300; font-style: italic; font-size: clamp(44px, 6vw, 72px); line-height: 1; margin: 8px 0 32px; }
.manifesto p { font-size: 21px; line-height: 1.6; color: rgba(236, 228, 212, 0.86); }
.manifesto__open::first-letter { font-size: 3.4em; float: left; line-height: 0.85; padding: 6px 14px 0 0; color: var(--gold); }
.is-manifesto .world-info, .is-manifesto .labels, .is-manifesto .hint, .is-manifesto .fragment { visibility: hidden; }
.manifesto__tenets { margin: 40px 0; padding-left: 1.6em; line-height: 2.2; color: var(--paper); font-size: 11.5px; }

/* Editor */
.editor { position: fixed; top: 0; bottom: 0; left: 0; z-index: 8; width: min(460px, 100vw); overflow-y: auto; background: rgba(11, 10, 9, 0.78); border-right: 1px solid var(--faint); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: slide-left 0.9s var(--ease) both; }
@keyframes slide-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.editor__form { padding: 96px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.editor__kicker { color: var(--gold); margin: 0; }
.editor__title { font-weight: 300; font-style: italic; font-size: 44px; margin: -12px 0 4px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { color: var(--muted); padding: 0; }
.field small { text-transform: none; letter-spacing: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field input:not([type=radio]):not([type=range]):not([type=color]), .field textarea, .field select, .fragment-item input, .fragment-item textarea {
  width: 100%; background: rgba(236, 228, 212, 0.04); border: 1px solid var(--faint); color: var(--paper);
  font-family: var(--serif); font-size: 18px; padding: 10px 12px; border-radius: 4px; outline: none; transition: border-color 0.3s;
}
.field select { font-family: var(--mono); font-size: 12px; }
.field textarea, .fragment-item textarea { resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus, .fragment-item input:focus, .fragment-item textarea:focus { border-color: var(--gold); }
input[type=range] { accent-color: var(--gold); width: 100%; }
output { color: var(--paper); }
.segmented { display: flex; border: 1px solid var(--faint); border-radius: 999px; overflow: hidden; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 9px 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; color: var(--muted); }
.segmented input:checked + span { background: var(--paper); color: var(--ink); }
.segmented input:focus-visible + span { outline: 1px solid var(--gold); }
.palette { display: flex; gap: 10px; align-items: center; }
.palette input[type=color] { width: 44px; height: 44px; border: 1px solid var(--faint); border-radius: 50%; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.palette input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.palette input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.palette input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.palette select { flex: 1; }
.forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form-type { position: relative; }
.form-type input { position: absolute; opacity: 0; pointer-events: none; }
.form-type span { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--faint); border-radius: 4px; padding: 10px; cursor: pointer; transition: border-color 0.3s; }
.form-type b { font-weight: 400; font-style: italic; font-size: 18px; }
.form-type small { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.form-type input:checked + span { border-color: var(--gold); }
.form-type input:checked + span b { color: var(--gold); }
.form-type input:focus-visible + span { outline: 1px solid var(--gold); }
.fragments-list { display: flex; flex-direction: column; gap: 12px; }
.fragment-item { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--faint); border-radius: 4px; position: relative; }
.fragment-item input, .fragment-item textarea { font-size: 16px; padding: 8px 10px; }
.fragment-item .remove { position: absolute; top: -9px; right: 8px; background: var(--ink); border: 1px solid var(--faint); border-radius: 999px; font-family: var(--mono); font-size: 10px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.fragment-item .numeral { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 0.12em; }
.build__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.build__presets button { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; background: none; color: var(--paper); border: 1px solid var(--faint); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.build__presets button:hover { border-color: var(--gold); color: var(--gold); }
.build__add { display: flex; gap: 8px; }
.build__add select { flex: 1; }
.build__form, .piece { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px; border: 1px solid var(--faint); border-radius: 4px; position: relative; }
.build__form > span, .piece__name { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; }
.build__form label, .piece label { display: flex; flex-direction: column; gap: 2px; }
.build__form label span, .piece label span { font-size: 9px; color: var(--muted); }
.piece .tones { display: flex; gap: 6px; align-items: center; }
.piece .tones button { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--faint); cursor: pointer; padding: 0; }
.piece .tones button.is-on { outline: 1px solid var(--gold); outline-offset: 2px; }
.piece .remove { position: absolute; top: -9px; right: 8px; background: var(--ink); border: 1px solid var(--faint); border-radius: 999px; font-family: var(--mono); font-size: 10px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.build__list { display: grid; gap: 12px; }
.build__paste summary { cursor: pointer; color: var(--muted); font-size: 10px; }
.build__paste textarea { width: 100%; margin: 8px 0; font-family: var(--mono); font-size: 11px; background: transparent; color: var(--paper); border: 1px solid var(--faint); border-radius: 4px; padding: 8px; }
.editor__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.editor__actions .btn--primary { flex-basis: 100%; }
.file-btn { cursor: pointer; }
.editor__note { color: var(--muted); line-height: 1.8; text-transform: none; letter-spacing: 0.02em; font-size: 11px; }
.editor__note code { color: var(--paper); }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--paper); color: var(--ink); padding: 12px 20px; border-radius: 999px; animation: rise 0.6s var(--ease) both; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: var(--ink); }

/* Showing the process */
.world-info__story { display: block; margin: 0 0 14px; }
.world-info.is-reading { filter: opacity(0.3); transition: filter 0.6s; }
.story {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 8; width: min(600px, 100vw); overflow-y: auto;
  padding: 88px 44px 64px; background: rgba(11, 10, 9, 0.86); border-left: 1px solid var(--faint);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: storyIn 0.9s var(--ease) both;
}
@keyframes storyIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.story .fragment__close { top: 76px; right: 28px; }
.story__kicker { color: var(--gold); margin: 0 0 8px; }
.story__title { font-weight: 300; font-style: italic; font-size: clamp(32px, 4vw, 46px); line-height: 1; margin: 0 0 36px; }
.story__steps { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 1px solid var(--faint); display: grid; gap: 44px; }
.story__step { position: relative; }
.story__step::before { content: ''; position: absolute; left: -31px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--ink); }
.story__when { color: var(--gold); margin: 0 0 6px; }
.story__step-title { font-weight: 300; font-style: italic; font-size: 28px; line-height: 1.1; margin: 0 0 12px; }
.story__text { font-size: 19px; line-height: 1.6; margin: 0 0 18px; white-space: pre-line; color: rgba(236, 228, 212, 0.88); }
.media-list { display: grid; gap: 18px; margin: 4px 0 18px; }
.media { margin: 0; }
.media img, .media video { display: block; width: 100%; height: auto; border-radius: 3px; background: #000; }
.media audio { width: 100%; }
.media figcaption { color: var(--muted); font-size: 10px; margin-top: 8px; text-transform: none; letter-spacing: 0.04em; line-height: 1.6; }
.media__frame { position: relative; width: 100%; border-radius: 3px; overflow: hidden; background: #000; }
.media__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media__3d { display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--faint); border-radius: 3px; cursor: grab; touch-action: none; }
.media__error { color: var(--muted); font-size: 11px; }
.sketch { display: block; width: 100%; height: auto; border: 1px solid var(--faint); border-radius: 3px; background: rgba(236, 228, 212, 0.02); }
.sketch path { stroke-linecap: round; stroke-linejoin: round; }
.sketch.is-drawing path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.melody { display: grid; gap: 8px; }
.melody svg { width: 100%; height: 110px; border: 1px solid var(--faint); border-radius: 3px; background: rgba(236, 228, 212, 0.02); }
.melody__play, .tool-btn { justify-self: start; background: none; border: 1px solid var(--faint); border-radius: 999px; color: var(--paper); padding: 6px 14px; cursor: pointer; font-size: 10px; }
.melody__play:hover, .tool-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Media in the workshop */
.media-edit { display: grid; gap: 8px; margin-top: 4px; }
.media-edit__add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.media-edit__add span { color: var(--muted); font-size: 9px; margin-right: 4px; }
.media-row { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--faint); border-radius: 4px; position: relative; }
.media-row__kind { font-family: var(--mono); font-size: 9px; color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; }
.media-row input[type=text], .media-row input[type=url], .media-row textarea, .media-row select { font: 14px var(--serif, inherit); background: transparent; color: var(--paper); border: 1px solid var(--faint); border-radius: 4px; padding: 6px 8px; }
.media-row textarea { font-family: var(--mono); font-size: 11px; }
.media-row__show { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 9px; }
.field .media-row__show input { width: auto; flex: none; margin: 0; padding: 0; }
.media-row .constellation { max-height: 160px; }
.constellation { display: block; width: 100%; height: auto; border: 1px solid var(--faint); border-radius: 3px; font-family: var(--serif); font-style: italic; }
.poem { font-style: italic; font-size: 22px; line-height: 1.5; padding: 6px 0 6px 16px; border-left: 1px solid var(--gold); }
.poem p { margin: 0; }
.media-row .thumb { max-height: 90px; justify-self: start; border-radius: 3px; }
.media-row .sketch, .media-row .melody svg { max-height: 120px; }
.media-row .remove { position: absolute; top: -9px; right: 8px; background: var(--ink); border: 1px solid var(--faint); border-radius: 999px; font-family: var(--mono); font-size: 10px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.step-item { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--faint); border-radius: 4px; position: relative; }
.step-item .numeral { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 0.12em; }
.step-item input, .step-item textarea { font-size: 16px; padding: 8px 10px; background: transparent; color: var(--paper); border: 1px solid var(--faint); border-radius: 4px; font-family: inherit; }
.step-item > .remove { position: absolute; top: -9px; right: 8px; background: var(--ink); border: 1px solid var(--faint); border-radius: 999px; font-family: var(--mono); font-size: 10px; padding: 2px 8px; cursor: pointer; color: var(--muted); }

/* Making tools: sketch pad and melody grid */
.tool { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(11, 10, 9, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 16px; }
.tool__box { width: min(820px, 100%); max-height: 100%; overflow: auto; background: var(--ink); border: 1px solid var(--faint); border-radius: 6px; padding: 22px; display: grid; gap: 14px; }
.tool__title { font-weight: 300; font-style: italic; font-size: 28px; margin: 0; }
.tool__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool__bar label { display: flex; gap: 6px; align-items: center; font-size: 10px; color: var(--muted); }
.tool canvas.pad { width: 100%; aspect-ratio: 4 / 3; background: rgba(236, 228, 212, 0.03); border: 1px solid var(--faint); border-radius: 4px; touch-action: none; cursor: crosshair; }
.grid-roll { display: grid; gap: 2px; user-select: none; }
.grid-roll button { aspect-ratio: 1; border: 1px solid var(--faint); background: transparent; border-radius: 2px; cursor: pointer; padding: 0; min-width: 0; }
.grid-roll button.is-on { background: var(--gold); border-color: var(--gold); }
.grid-roll button.is-beat { border-color: rgba(236, 228, 212, 0.28); }
.grid-roll button.is-now { outline: 1px solid var(--paper); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--faint); cursor: pointer; padding: 0; }
.swatch.is-on { outline: 1px solid var(--gold); outline-offset: 2px; }

@media (max-width: 760px) {
  .story { padding: 72px 20px 48px; }
  .story .fragment__close { top: 60px; right: 16px; }
  body { font-size: 16px; }
  .chrome { padding: 16px; }
  .nav { gap: 14px; }
  .nav a[data-nav="manifesto"] { display: none; }
  .hint { display: none; }
  .modes { right: 50%; transform: translateX(50%); bottom: 14px; }
  .world-info { left: 16px; right: 16px; bottom: 20px; }
  .world-info__statement { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .fragment { right: 16px; left: 16px; width: auto; top: auto; bottom: 16px; transform: none; animation: rise 0.8s var(--ease) both; }
  .label__title { font-size: 18px; }
  .editor { width: 100vw; height: 58vh; top: auto; border-right: 0; border-top: 1px solid var(--faint); }
  .editor__form { padding: 24px 16px 40px; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  * { animation-duration: 0.01ms !important; }
}
