:root {
  color-scheme: dark;
  --bg: #080b0f;
  --gold: #b89159;
  --light-gold: #e5cb97;
  --text: #e8e6df;
  --muted: #8b9095;
  --line: rgba(184, 145, 89, .2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
footer .legal-links { display:flex; flex-wrap:wrap; justify-content:center; gap:10px 22px; letter-spacing:.02em; text-transform:none; font-size:10px; line-height:1.7; }
footer .legal-links a { color:#b7aa92; text-decoration:none; }
footer .legal-links a:hover { color:#e5cb97; text-decoration:underline; text-underline-offset:3px; }
footer .legal-links a:focus-visible { outline:1px solid #e5cb97; outline-offset:4px; }
@media(max-width:760px) { footer:has(.legal-links) { flex-wrap:wrap; gap:16px; } footer .legal-links { order:3; flex-basis:100%; justify-content:flex-start; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  background: radial-gradient(ellipse at 48% 35%, #17212a55, transparent 64%), var(--bg);
  color: var(--text);
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
button:focus-visible { outline: 2px solid var(--light-gold); outline-offset: 5px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 1px solid var(--light-gold); outline-offset: 3px; }
input:not([type="radio"]), textarea { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 4px; background: #10171d; color: var(--text); font: inherit; font-size: 14px; }
textarea { resize: vertical; line-height: 1.6; }
input:disabled, textarea:disabled { opacity: .6; }
label { font-size: 12px; color: #c8bda7; }
.start-form { width: min(100%, 520px); text-align: left; display: grid; gap: 12px; }
.start-form label:not(:first-child) { margin-top: 8px; }
.start-form .start-dice { width: 100%; }
.new-game:has(.start-form) { padding-top: 35px; padding-bottom: 50px; }
.form-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0; }
.reflection-form { border: 1px solid var(--line); background: #11181e; border-radius: 5px; padding: 20px; display: grid; gap: 12px; margin-bottom: 20px; }
.reflection-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 15px; }
.reflection-form legend { font-size: 10px; color: var(--muted); padding: 0 0 12px; }
.reflection-form fieldset label { display: flex; align-items: center; gap: 6px; }
input[type="radio"] { accent-color: var(--light-gold); }
.reflection-form button:disabled { opacity: .4; }
.session-summary { color: #b9aa8d; font-size: 12px; line-height: 1.8; margin-bottom: 22px; overflow-wrap: anywhere; }
.session-summary summary, .history summary { cursor: pointer; }
.session-summary p { white-space: pre-wrap; }
.history { font-size: 12px; line-height: 1.7; color: #b9aa8d; margin: 22px 0; }
.history ol { padding-left: 22px; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.history p { white-space: pre-wrap; overflow-wrap: anywhere; color: #aab1b4; }
.save-error { color: #edc1a4; background: #50382640; border: 1px solid #ab744540; padding: 18px; border-radius: 5px; font-size: 13px; line-height: 1.7; }
.overview .reflection-form, .overview .history { display: none; }
.admin-app main { padding-bottom: 50px; }
.admin-app a { color: var(--light-gold); font-size: 12px; }
.admin-login { display: grid; gap: 12px; max-width: 520px; margin: 30px 0; }
.admin-layout { display: grid; grid-template-columns: minmax(240px,.65fr) minmax(0,1.35fr); gap: 30px; align-items: start; }
.admin-games { list-style: none; padding: 0; margin: 0; }
.admin-game { display: block; text-align: left; width: 100%; padding: 18px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 5px; background: #10171d; color: var(--light-gold); overflow-wrap: anywhere; }
.admin-game small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.admin-query, .admin-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-app .reading-panel { overflow-wrap: anywhere; }
.admin-turn { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; font-size: 13px; line-height: 1.8; }
.admin-turn h3 { color: var(--light-gold); font: 400 22px Georgia, serif; }
.admin-turn details { margin-top: 15px; }
.app { max-width: 1280px; margin: auto; padding: 0 42px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 18px; }
.author-mark { flex: 0 0 44px; width: 44px; height: 66px; background: url('./assets/author-reference.jpeg') -20px -12px / 150px 150px no-repeat; }
h1 { margin: 0; font: 400 23px/1.2 Georgia, "Times New Roman", serif; text-transform: uppercase; letter-spacing: .15em; color: var(--light-gold); }
.brand p { margin: 9px 0 0; font-size: 9px; letter-spacing: .27em; text-transform: uppercase; color: #a5a39c; }
.prototype-label { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 10px 0 10px 18px; border-left: 1px solid var(--line); }
main { padding-top: 38px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; max-width: 1090px; margin: 0 auto 10px; gap: 16px; }
.eyebrow { margin: 0 0 11px; font-size: 9px; font-weight: 400; letter-spacing: .22em; color: #939690; text-transform: uppercase; }
h2 { margin: 0; font: 400 37px/1.1 Georgia, "Times New Roman", serif; color: var(--light-gold); }
h2 span { color: #505456; font-size: 18px; padding-left: 7px; }
.range { text-align: right; padding-bottom: 4px; }
.range > span { display: block; font: 400 22px/1 Georgia, serif; color: #b69d73; letter-spacing: .08em; }
.range small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.field { position: relative; width: 100%; aspect-ratio: 1.52376; overflow: hidden; isolation: isolate; }
.field-light { position: absolute; inset: 4% 1% 2%; background: radial-gradient(ellipse at 26% 50%, #6d84951c, transparent 65%); pointer-events: none; }
#board { display: block; width: 100%; height: 100%; position: relative; overflow: hidden; }
.sector-square { fill: #0e141a; stroke: #857455; stroke-width: .65; vector-effect: non-scaling-stroke; }
.sector-arc { fill: none; stroke: #9d865e; stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.sector-group { transition: opacity 650ms ease; }
.sector-group.inactive { opacity: .34; }
.sector-group.active { opacity: 1; }
.sector-group.active .sector-square { fill: url('#surface'); stroke: #b7955e; }
.sector-group.active .sector-arc { stroke: url('#gold'); stroke-width: 1.45; }
.cell-disc { fill: #101820; stroke: #b99864; stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill 180ms, stroke 180ms; }
.cell-label { fill: #d5c5a6; font-family: Georgia, serif; dominant-baseline: central; text-anchor: middle; }
.cell.selected .cell-disc { fill: url('#gold'); stroke: #f0d6a4; stroke-width: 1.25; }
.cell.selected .cell-label { fill: #1c1812; }
.cell.flow-arrival .cell-disc { fill: url('#flow-gold'); stroke: #fff2cf; }
.cell.shadow-arrival .cell-disc { fill: #090b0e; stroke: #cab68d; }
.cell.shadow-arrival .cell-label { fill: #e5cb97; }
.cell-ring { fill: none; stroke: #dec294; stroke-width: .65; vector-effect: non-scaling-stroke; opacity: 0; }
.cell.selected .cell-ring { opacity: .55; }
#active-outline { fill: none; stroke: #cfac7550; stroke-width: .65; vector-effect: non-scaling-stroke; pointer-events: none; }
#sector-watermark { fill: #b891591a; font-family: Georgia, serif; font-size: .28px; pointer-events: none; }
#cell-targets { position: absolute; inset: 0; }
.cell-target { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: transparent; border: 0; padding: 0; }
.cell-target:hover { box-shadow: 0 0 0 1px #e5cb9770; }
.cell-target:focus-visible { outline-offset: 2px; }
.field.moving .cell-target { visibility: hidden; }
.field.moving #sector-watermark { opacity: 0; }
#sector-watermark { transition: opacity 300ms ease; }
.field-caption { position: absolute; left: 14%; bottom: 15%; display: flex; gap: 8px; align-items: center; font-size: 8px; letter-spacing: .13em; text-transform: uppercase; color: #898477; pointer-events: none; }
.caption-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.sector-nav { display: flex; justify-content: center; gap: 18px; margin: 0 0 24px; }
.sector-tab { border: 0; border-bottom: 1px solid transparent; background: transparent; padding: 8px 5px 10px; min-width: 28px; font: 400 12px/1 Georgia, serif; color: #697078; transition: color 200ms, border-color 200ms; }
.sector-tab:hover { color: var(--light-gold); }
.sector-tab[aria-current="step"] { color: var(--light-gold); border-color: var(--gold); }
.controls { max-width: 1090px; margin: auto; padding-top: 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.sector-control { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #9c805840; border-radius: 3px; background: #10151a; padding: 14px 20px; font-size: 11px; letter-spacing: .025em; min-height: 46px; }
.sector-control > span:first-child:not(:last-child) { white-space: nowrap; }
.sector-control:hover:not(:disabled) { border-color: #b8915999; background: #191c1f; }
.sector-control.forward { border-color: #b8915980; color: var(--light-gold); }
.sector-control:disabled, .cell-arrow:disabled { opacity: .32; }
.cell-nav { display: flex; gap: 19px; align-items: center; }
.cell-arrow { display: grid; place-items: center; width: 40px; height: 42px; border: 0; background: transparent; color: var(--light-gold); font-size: 20px; }
.cell-arrow:hover:not(:disabled) { background: #b8915912; }
.cell-status { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.cell-status > span:first-child { font-size: 10px; color: var(--muted); }
.cell-status strong { font: 400 27px/1 Georgia, serif; color: var(--light-gold); min-width: 32px; }
.cell-status .total { font: 400 14px/1 Georgia, serif; color: #747678; }
.hint { text-align: center; margin: 24px 0 32px; font-size: 10px; line-height: 1.8; color: #848a8f; }
.hint span { color: #85837a; margin-left: 12px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid #ffffff08; padding: 20px 0 24px; color: #676d72; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.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; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .9fr); gap: 34px; align-items: start; }
.board-column { min-width: 0; }
#motion-effects { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.reading-panel { position: sticky; top: 20px; max-height: calc(100svh - 150px); min-height: 200px; overflow-y: auto; scrollbar-color: #796440 #0f1419; scrollbar-width: thin; padding: 22px; background: linear-gradient(145deg, #18212980, #10151a); border: 1px solid var(--line); border-radius: 8px; }
.reading-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.link-heading { font-size: 29px; line-height: 1.2; }
.reading-status { font-size: 11px; color: var(--muted); margin-bottom: 0; }
.link-names { font: 400 15px/1.5 Georgia, serif; color: #bfb6a4; margin-bottom: 0; }
.reading-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.reading-nav button { border: 1px solid var(--line); background: #0d141a; color: #c9b88f; padding: 7px 9px; font-size: 10px; border-radius: 3px; }
.meaning-card h3, .link-meaning h3 { margin: 0 0 14px; color: var(--light-gold); font: 400 23px/1.3 Georgia, serif; }
.meaning-card > .eyebrow { font-size: 8px; margin-top: 6px; }
.meaning-card p, .link-meaning p, .full-link p { font-size: 13px; line-height: 1.75; color: #c4c7c5; overflow-wrap: anywhere; }
.card-quote { margin: 20px 0; padding: 1px 0 1px 16px; border-left: 1px solid #b8915960; font: 400 16px/1.6 Georgia, serif; color: #ceb998; }
.meaning-card p.card-question, .link-meaning p.card-question { padding: 14px 16px; background: #b8915910; color: #e5cb97; font-size: 13px; }
.card-disclosure { margin-bottom: 22px; }
.card-disclosure > summary, .card-context > summary, .link-details > summary { cursor: pointer; color: #bba881; font-size: 12px; line-height: 1.6; padding: 9px 0; }
.card-disclosure > summary { border-bottom: 1px solid #b8915928; }
.card-disclosure .meaning-card { padding-top: 16px; }
.card-context > summary { font-size: 11px; color: #9eacb1; }
.card-context p { font-size: 12px; }
.link-meaning { border-top: 1px solid #b8915950; padding-top: 21px; }
[data-kind="shadow"] .link-heading { color: #beb8aa; }
.turn-actions { margin: 18px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.roll-button, .link-button { min-height: 46px; border: 1px solid #b8915980; border-radius: 4px; padding: 10px 17px; font-size: 12px; }
.roll-button { flex: 1; color: #201b12; background: linear-gradient(135deg, #dbc08a, #a17d47); }
#dice-result { display: inline-grid; place-items: center; width: 23px; margin-right: 10px; font: 400 23px Georgia, serif; }
.link-button { color: var(--light-gold); background: #171e24; }
.link-button[data-kind="shadow"] { background: #06090d; }
.turn-actions button:disabled { opacity: .4; cursor: default; }
.browse-label { display: block; margin: 12px 0 8px; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
#browse-cell { width: 100%; padding: 11px 13px; background: #11171d; color: #c5bda9; border: 1px solid var(--line); border-radius: 4px; font: 12px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.controls { gap: 8px; }
.controls .sector-control { padding: 11px 9px; gap: 6px; font-size: 9px; }
.cell-nav { gap: 5px; }
.cell-status { gap: 5px; }
.cell-status strong { font-size: 23px; }
.cell-arrow { width: 30px; }
.hint { margin: 16px 0 24px; font-size: 9px; }
.hint span { display: block; margin-left: 0; }
.new-game { min-height: min(65svh, 570px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 16px; background: radial-gradient(ellipse at center, #b8915910, transparent 65%); }
.new-game h2 { font-size: clamp(34px, 5vw, 60px); }
.new-game > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 22px 0 32px; }
.start-dice { flex: none; display: flex; justify-content: space-between; align-items: center; width: min(100%, 420px); min-height: 90px; padding: 25px 34px; font: 400 27px Georgia, serif; box-shadow: 0 10px 70px #b8915918; }
.start-dice:disabled { opacity: .4; }
.game-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.game-toolbar .sector-control { font-size: 11px; }
.overview { grid-template-columns: 1fr; }
.overview .reading-panel, .overview .controls, .overview .turn-actions, .overview .sector-nav, .overview .browse-label, .overview #browse-cell, .overview .hint { display: none; }
.overview-field { max-width: 860px; margin: 0 auto 24px; }
.overview-field #active-outline, .overview-field #sector-watermark, .overview-field #cell-targets, .overview-field .field-caption { display: none; }
.overview-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 30px; }
.overview-sector { border: 1px solid var(--line); border-radius: 5px; padding: 16px; background: #11181e; }
.overview-sector h3 { margin: 0 0 16px; font: 400 18px Georgia, serif; color: var(--light-gold); }
.overview-row { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.overview-row button { aspect-ratio: 1; padding: 0; border: 1px solid #b9986470; border-radius: 50%; background: #0b1117; color: #d5c5a6; font: 400 clamp(11px, 1.4vw, 17px) Georgia, serif; }
.overview-row button:hover { background: #b8915920; border-color: var(--light-gold); }
.overview-row button[aria-pressed="true"] { background: linear-gradient(135deg, #dbc08a, #a17d47); color: #201b12; border-color: #f0d6a4; }
@media (max-width: 1000px) {
  .admin-layout { grid-template-columns: 1fr; }
  .play-layout { grid-template-columns: 1fr; gap: 24px; }
  .reading-panel { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 760px) {
  .app { padding: 0 22px; }
  .header { padding: 20px 0; }
  h1 { font-size: 19px; letter-spacing: .1em; }
  .brand { gap: 12px; }
  .prototype-label { font-size: 8px; max-width: 86px; line-height: 1.5; }
  .brand p { font-size: 8px; letter-spacing: .15em; }
  main { padding-top: 28px; }
  h2 { font-size: 30px; }
  .sector-nav { gap: 11px; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 20px; }
  .cell-nav { grid-column: 1 / -1; grid-row: 1; justify-content: center; gap: 24px; }
  .sector-control { padding: 13px 10px; font-size: 10px; gap: 6px; }
  .hint span { display: none; }
  .reading-panel { padding: 18px; }
  .overview-cells { grid-template-columns: 1fr; }
  .overview-row button { font-size: 14px; }
}
@media (max-width: 450px) {
  .app { padding: 0 16px; }
  .header { gap: 6px; padding: 16px 0; }
  .author-mark { flex-basis: 33px; width: 33px; height: 50px; background-size: 114px 114px; background-position: -15px -9px; }
  h1 { font-size: 15px; }
  .brand p { margin-top: 7px; font-size: 6px; letter-spacing: .13em; }
  .prototype-label { border-left: 0; padding-left: 0; font-size: 7px; text-align: right; max-width: 64px; }
  .eyebrow { font-size: 7px; letter-spacing: .16em; }
  .range > span { font-size: 17px; }
  .range small { font-size: 8px; }
  .sector-nav { gap: 6px; margin-bottom: 17px; }
  .sector-tab { min-width: 24px; font-size: 11px; }
  .field-caption { font-size: 6px; gap: 5px; left: 12%; }
  .hint { margin: 20px 0 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
