:root {
  color-scheme: dark;
  --page: #0c0b17;
  --panel: #151328;
  --panel-deep: #101020;
  --line: #39334e;
  --muted: #beb8d0;
  --ink: #f9f5ff;
  --purple: #c4b1fb;
  --gold: #f3d9a8;
  --mint: #a4ead1;
  --rose: #ffabae;
  --radius: 16px;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { background: var(--page); color: var(--ink); margin: 0; overflow: hidden; }
body::before {
  position: fixed;
  inset: -10px;
  z-index: -1;
  content: "";
  background: url('./assets/syphon.webp') center / cover no-repeat;
  opacity: .27;
  filter: blur(7px);
}
a { color: var(--purple); text-underline-offset: .22em; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #e1ccff; outline-offset: 3px; }
h1, h2, h3, p, dl, ol, ul { margin: 0; }
h1, h2, .entry strong { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.08; }
h1 { font-size: clamp(2rem, 3.8vw, 3.65rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2.15rem); letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.3; }
small { font-size: .85rem; }
#app { height: 100dvh; display: flex; flex-direction: column; }
.page-width { width: min(1200px, calc(100% - 44px)); margin-inline: auto; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 20; transform: translateY(-200%); background: var(--panel); padding: .6rem 1rem; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { height: 55px; border-bottom: 1px solid var(--line); background: #10101dea; flex: none; }
.topbar-content { width: min(1200px, calc(100% - 44px)); height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; gap: .55rem; align-items: center; color: var(--ink); text-decoration: none; font-size: .88rem; letter-spacing: .14em; white-space: nowrap; }
.brand img { display: block; flex: none; }
.brand strong { color: var(--gold); }
.topbar nav { display: flex; align-items: center; gap: 1.45rem; }
.topbar nav a, .nav-button { color: var(--muted); font-size: .9rem; text-decoration: none; }
.topbar nav a:hover, .topbar nav [aria-current] { color: var(--ink); text-decoration: underline; }
.topbar .language {
  min-height: 36px;
  padding: .2rem .25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17152a;
  color: var(--ink);
  font: inherit;
}
.entry-options.tutorial-only { grid-template-columns: minmax(0, 1fr); }
.nav-button { padding: .28rem .7rem; background: transparent; border: 1px solid var(--line); border-radius: 7px; }
.nav-button:hover { border-color: var(--purple); color: var(--ink); }

.landing, .selection { min-height: 0; flex: 1 1 auto; padding-top: 18px; overflow: auto; scrollbar-color: #51496f transparent; }
.landing { display: flex; flex-direction: column; }
.hero { flex: 1 0 auto; min-height: 360px; max-height: 530px; position: relative; display: flex; align-items: center; padding: clamp(24px, 5vw, 70px); isolation: isolate; overflow: hidden; border: 1px solid #5d4b77; border-radius: 20px; background: #18122b url('./assets/syphon.webp') center 55% / cover no-repeat; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #0b0a19 0%, #100c20ea 26%, #150f24ab 50%, #18102c17 85%), linear-gradient(0deg,#100c24a0,transparent 58%); }
.hero-copy { max-width: 500px; }
.eyebrow { color: var(--purple); font-size: .86rem; font-weight: 650; letter-spacing: .075em; }
.diamond { width: .44rem; height: .44rem; margin-right: .38rem; display: inline-block; vertical-align: .12em; transform: rotate(45deg); background: var(--gold); }
.dot { margin-inline: .25rem; }
.hero h1 { font-size: clamp(3rem, 7.6vw, 80px); margin-block: .12em .25em; white-space: nowrap; color: #fff9fd; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-copy > p:not(.eyebrow) { color: #eee7f6; font-size: 1.075rem; line-height: 1.6; max-width: 420px; }
.hero-question { display: block; color: var(--gold); margin-top: 1.15rem; }
.entry-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.entry { display: flex; align-items: center; gap: 1rem; min-height: 107px; padding: 1rem clamp(14px, 3vw, 26px); text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(130deg, #201a35, #151225 70%); }
.entry:hover { border-color: var(--purple); background: #241e3c; }
.entry > span:nth-child(2) { flex: 1; }
.entry strong { display: block; font-size: clamp(1.25rem, 2.4vw, 1.8rem); margin-bottom: .35rem; }
.entry small { color: var(--muted); }
.entry-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; color: var(--gold); border: 1px solid #63516e; background: #2b213a; border-radius: 12px; font-size: 1.5rem; }
.learn-icon { color: var(--purple); background: #292241; border-color: #554779; }
.entry i { width: 9px; height: 9px; border-top: 1px solid var(--gold); border-right: 1px solid var(--gold); transform: rotate(45deg); margin-right: .25rem; }
.credits { border-top: 1px solid var(--line); margin-top: 18px; padding: .85rem .4rem; text-align: center; color: var(--muted); font-size: .85rem; }
.credits span { color: var(--gold); margin: 0 .25rem; }

.section-intro { margin-block: 0 1.2rem; }
.section-intro h1 { margin-block: .35rem .45rem; }
.section-intro p, .configuration p { color: var(--muted); }
.back-link { font-size: .9rem; }
.configuration { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 4vw, 3rem); max-width: 850px; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 4vw, 2.5rem); background: linear-gradient(120deg, #1d1830, #141325); }
.configuration h2 { margin: .25rem 0 .5rem; }
.configuration label, .modal-notes label { display: block; color: var(--muted); font-size: .9rem; margin-top: .75rem; }
select { display: block; width: 100%; padding: .55rem .65rem; background: #1c1832; border: 1px solid #685984; border-radius: 8px; }
.facts { display: flex; gap: 1.6rem; margin-bottom: .8rem; }
.facts dt { color: var(--muted); font-size: .83rem; }
.facts dd { margin: 0; font-weight: 650; }
.config-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 .55rem; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 42px; border-radius: 8px; padding: .48rem .7rem; line-height: 1.18; font-size: .94rem; font-weight: 650; text-decoration: none; }
.primary { color: #191323; background: var(--gold); border: 1px solid var(--gold); }
.primary:hover { background: #ffeccc; border-color: #ffeccc; }
.secondary { color: var(--ink); border: 1px solid #635878; background: #1e1932; }
.secondary:hover { border-color: var(--purple); }
.identity { padding: 1.2rem; border: 1px solid #403853; border-radius: 12px; background: #151226; }
.identity h3 { margin-top: .55rem; }
.identity-mark { display: grid; place-items: center; width: 54px; aspect-ratio: 1; border-radius: 12px; border: 1px solid #756295; background: linear-gradient(140deg, #362755, #562857); font: 1.8rem Georgia, serif; color: var(--gold); }
.attributes { list-style: none; padding: 0; margin-top: .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.attributes li { display: flex; align-items: center; justify-content: space-between; gap: .35rem; font-size: .85rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.attr-perception { color: #b6efaf; }
.attr-charisma { color: #ffdd87; }
.attr-courage { color: #ffaaa9; }
.attr-technology { color: #a5d6ff; }

.workspace { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-block: 18px 14px; }
.tutorial-attributes { display: flex; flex: none; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.tutorial-attributes > .text-button { flex: none; font-size: .85rem; }
.tutorial-attributes dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; width: min(100%, 560px); }
.tutorial-attributes dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem; padding: .2rem .45rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: .85rem; }
.tutorial-attributes dd { margin: 0; font-weight: 750; }
.tutorial-attributes .current-attribute { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.workspace-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(270px, 345px) minmax(0, 1fr); gap: 12px; }
.tutorial-workspace .workspace-layout { grid-template-rows: minmax(0, 1fr) clamp(155px, 29vh, 214px); }
.guide-pane, .board-pane, .personal-pane { min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.guide-pane { display: flex; flex-direction: column; grid-row: 1 / -1; }
.guide-top { border-bottom: 1px solid var(--line); padding: 14px 15px 10px; }
.round-phases { display: flex; flex-wrap: wrap; list-style-position: inside; padding: 0; gap: .3rem .65rem; margin: .4rem 0 .45rem; font-size: .87rem; color: var(--muted); }
.round-phases [aria-current] { font-weight: 700; color: var(--gold); }
.progress-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .83rem; gap: .5rem; }
progress { display: block; appearance: none; height: .36rem; width: 100%; margin-top: .35rem; border: 0; border-radius: 1rem; overflow: hidden; background: #312944; color: var(--purple); }
progress::-webkit-progress-bar { background: #312944; }
progress::-webkit-progress-value { background: var(--purple); }
progress::-moz-progress-bar { background: var(--purple); }
.guide-scroll { min-height: 0; overflow: auto; padding: 14px 15px 16px; flex: 1; scrollbar-color: #51496f transparent; }
.guide-scroll h1 { font-size: clamp(1.55rem, 2.6vw, 2.25rem); margin: 0 0 .85rem; }
.guide-scroll p { font-size: .95rem; color: #e0d9eb; margin-top: .25rem; }
.instruction { padding-left: .65rem; border-left: 2px solid #766494; margin-bottom: .85rem; }
.reference-row { display: flex; align-items: start; gap: .15rem .65rem; flex-wrap: wrap; margin-bottom: .6rem; }
.source { color: var(--muted); }
.source a { color: var(--muted); }
.action-box, .result, .reason { padding: .65rem .7rem; border-radius: 9px; margin-top: .6rem; }
.action-box { border: 1px solid #a68b60; }
.action-box h3 { color: var(--gold); }
.result { border: 1px solid #527669; background: #1a2a2b; }
.result h3 { color: var(--mint); }
.reason { border: 1px solid #625477; }
.controls { flex: none; display: grid; gap: .45rem; border-top: 1px solid var(--line); padding: .58rem .7rem; }
.controls .primary { height: 48px; }
.controls .secondary { min-height: 36px; }
.save-error { color: var(--rose); font-size: .85rem; }
.mobile-tabs { display: none; }

.board-pane { padding: 14px 15px; display: flex; flex-direction: column; overflow: auto; scrollbar-color: #51496f transparent; }
.pane-heading { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.pane-heading h2 { font-size: clamp(1.35rem, 2.35vw, 2rem); }
.pill { color: var(--purple); background: #292241; border: 1px solid #524668; border-radius: 99px; padding: .2rem .55rem; white-space: nowrap; font-size: .83rem; }
.table-surface, .map-location { border: 1px solid #433a55; border-radius: 12px; background-color: #111023; background-image: linear-gradient(135deg,#141126f0,#151428c2), repeating-linear-gradient(90deg,transparent 0 26px,#463953 27px 28px); }
.table-view { flex: 1 1 0; min-height: 0; overflow: auto; border-radius: 12px; scrollbar-color: #51496f transparent; }
.table-surface { min-height: 100%; padding: .65rem .7rem; display: flex; flex-direction: column; justify-content: start; }
.syphon-surface { background-image: linear-gradient(100deg,#18132af4,#17142da8), url('./assets/syphon.webp'); background-size: cover; background-position: center 70%; }
.board-controls { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .3rem .65rem; }
.position-marker { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; color: #eee0fe; background: #34284c; border: 1px solid #726098; border-radius: 6px; padding: .12rem .45rem; font-size: .82rem; }
.position-marker::before { content: ""; display: block; width: .36rem; height: .36rem; transform: rotate(45deg); background: var(--purple); }
.text-button { padding: 0; color: var(--gold); background: none; border: 0; text-align: start; text-decoration: underline; text-underline-offset: .2em; }
.text-button:hover { color: #fff0d4; }
.board-controls .text-button, .reference-row .text-button { font-size: .85rem; }
.table-map { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: .35rem; margin-bottom: .55rem; }
.table-map > div { min-width: 0; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-deep); font-size: .82rem; }
.table-map > div[aria-current] { border-color: #79669d; background: #26203b; }
.table-map button { font-size: .79rem; }
.table-map button + button { margin-left: .25rem; }
.map-here { display: inline-block; margin-left: .15rem; color: var(--purple); font-size: .75rem; }
.pieces { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; }
.active-pieces { flex: 1; align-items: start; gap: .75rem; }
.piece { width: min(100%, 172px); min-height: 87px; position: relative; display: flex; flex-direction: column; border: 1px solid #5e4d76; border-radius: 10px; padding: 0; background: #221b36; color: var(--ink); }
.piece-body, .piece-play { display: flex; flex-direction: column; flex: 1 1 auto; align-items: start; width: 100%; text-align: start; border-radius: inherit; padding: 0 .48rem .52rem; border: 0; background: transparent; }
.piece strong { font-size: .86rem; line-height: 1.15; margin-bottom: .18rem; }
.piece small { font-size: .75rem; line-height: 1.13; color: var(--muted); padding-right: 1.2rem; }
.piece-art { display: block; width: calc(100% + .96rem); margin: 0 -.48rem .35rem; height: 30px; border-radius: 9px 9px 0 0; background: repeating-linear-gradient(142deg, transparent 0 13px,#ddc5ff38 14px 15px), linear-gradient(135deg,#453366,#6b488e); }
.teal .piece-art { background: repeating-linear-gradient(142deg,transparent 0 13px,#a8fff548 14px 15px), linear-gradient(125deg,#215760,#345c78); }
.pink .piece-art { background: repeating-linear-gradient(142deg,transparent 0 13px,#ffbbda38 14px 15px), linear-gradient(125deg,#57346f,#713953); }
.covered .piece-art { background: repeating-linear-gradient(45deg,#552c55 0 5px,#3b264e 6px 11px); }
.is-target { border-color: #f6dbac !important; box-shadow: inset 0 0 0 1px #e8c994, 0 0 14px #f7ce792b; }
.piece-play:hover { background: #4a3b54; }
.zoom { position: absolute; right: 3px; bottom: 3px; width: 29px; height: 26px; padding: 0; line-height: 1; border: 1px solid #6f6086; background: #1a1631; border-radius: 6px; color: var(--purple); }
.zoom:hover { background: #41365b; }
.marker-list, .cube-list { display: flex; gap: .25rem; margin: 0 1.9rem .35rem .48rem; }
.marker, .cube-list span { width: 1.25rem; height: 1.25rem; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: .7rem; background: #181728; }
.cube-list span { width: .7rem; height: .7rem; border-radius: 2px; color: #80aea7; }
.cube-list .filled { background: var(--mint); }
.grid-strip { flex: none; display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; padding-top: .55rem; }
.grid-strip small { display: block; font-size: .73rem; color: var(--muted); }
.grid-slots { display: grid; grid-template-columns: repeat(16, 1fr); gap: .17rem; width: min(100%, 465px); }
.grid-slot { min-width: 0; display: grid; place-items: center; height: 23px; border: 1px solid #51466a; color: #b4a1d6; border-radius: 5px; background: #2a2241; font-size: .85rem; padding: 0; }
.grid-slot.revealed { color: var(--ink); background: #504170; }
.setup-map { display: grid; gap: .5rem; }
.map-location { padding: .7rem; }
.map-location h3 { margin-bottom: .55rem; display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.overview-foot { display: flex; flex-wrap: wrap; gap: .6rem 1rem; padding-top: .65rem; }

.personal-pane { padding: .55rem .75rem .4rem; display: flex; flex-direction: column; overflow: auto; scrollbar-color: #51496f transparent; }
.personal-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .2rem .65rem; font-size: .86rem; color: var(--muted); }
.personal-heading .text-button { font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .27rem; margin-top: .32rem; }
.stats > div { background: #1e1a31; border-radius: 5px; padding: .1rem .25rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3rem; }
.stats dt { color: var(--muted); font-size: .75rem; }
.stats dd { margin: 0; font-weight: 750; font-size: .91rem; }
.gain { color: var(--mint); }
.loss { color: var(--rose); }
.hand-header { margin-top: .27rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .4rem; font-size: .8rem; }
.hand-header span { color: var(--muted); }
.hand { flex: none; display: flex; gap: .35rem; overflow: auto hidden; padding: .22rem .15rem .3rem; scrollbar-color: #645682 transparent; }
.hand-card { min-width: 105px; width: 110px; min-height: 64px; }
.hand-card .piece-art { height: 14px; }
.hand-card strong { font-size: .77rem; }
.hand-card small { font-size: .68rem; }

@media (min-width: 791px) {
  .active-pieces .piece { width: clamp(155px, 17vw, 220px); min-height: 135px; }
  .active-pieces .piece-art { height: 49px; }
  .active-pieces .piece-body, .active-pieces .piece-play { padding-bottom: .65rem; }
  .active-pieces .piece strong { font-size: 1rem; }
  .active-pieces .piece small { font-size: .85rem; }
  .active-pieces .marker-list, .active-pieces .cube-list { margin-bottom: .6rem; }
}

dialog { color: var(--ink); background: var(--panel); width: min(700px, calc(100% - 24px)); height: min(465px, calc(100dvh - 24px)); padding: 0; border: 1px solid #76638e; border-radius: var(--radius); box-shadow: 0 12px 50px #000b; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #090714c9; }
.modal-head { padding: .8rem 1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.modal-content { flex: 1; min-height: 0; display: grid; grid-template-columns: .8fr 1fr; gap: .7rem; padding: .7rem; }
.modal-diagram { display: flex; align-items: center; padding: .6rem; border: 1px solid #514468; border-radius: 12px; background: radial-gradient(ellipse at center,#3d2c61,#17142a 70%); }
.hotspots { display: grid; width: 100%; gap: .55rem; }
.diagram-part { min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .55rem; border: 1px solid #695482; border-radius: 8px; background: #211a37; font-weight: 650; }
.hotspot { flex: 0 0 2.05rem; }
.hotspot { border-radius: 50%; width: 2.05rem; height: 2.05rem; border: 1px solid #ffbdce; background: #8d2549; color: #fff; font-weight: 750; padding: 0; }
.hotspot[aria-pressed="true"] { color: #271021; background: #ffadc5; }
.modal-notes { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: .05rem .3rem .2rem; }
.modal-notes label { margin-top: 0; }
.modal-notes ul { flex: 1; min-height: 0; overflow: auto; list-style: none; padding: 0; margin-top: .55rem; }
.modal-notes li { padding: .4rem .5rem; border-left: 2px solid transparent; }
.modal-notes .current { border-color: var(--gold); background: #29213d; }
.modal-notes p { color: var(--muted); font-size: .9rem; }

@media (max-width: 790px) {
  .page-width, .topbar-content { width: calc(100% - 24px); }
  .topbar nav { gap: .75rem; }
  .workspace { padding-block: 9px; }
  .mobile-tabs { display: flex; gap: .36rem; margin-bottom: .45rem; }
  .tab { flex: 1; font-size: .9rem; color: var(--muted); border: 1px solid var(--line); background: #1d1830; border-radius: 7px; min-height: 38px; }
  .tab[aria-pressed="true"] { color: var(--gold); border-color: #9f865f; }
  .workspace .workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .guide-pane { display: contents; }
  .guide-top, .guide-scroll { display: none; }
  .workspace[data-active="guide"] .workspace-layout { grid-template-rows: auto minmax(0, 1fr) auto; }
  .workspace[data-active="guide"] .guide-top, .workspace[data-active="guide"] .guide-scroll { display: block; }
  .board-pane, .personal-pane { display: none; grid-row: 1; border: 0; }
  .workspace[data-active="board"] .board-pane, .workspace[data-active="person"] .personal-pane { display: flex; }
  .controls { grid-row: -2; }
  .grid-slots { width: min(100%, 380px); }
  .stats { margin-bottom: .25rem; }
}

@media (max-width: 540px) {
  .topbar-content { gap: .45rem; }
  .brand { letter-spacing: .07em; font-size: .79rem; }
  .brand img { width: 29px; height: 29px; }
  .topbar nav { gap: .5rem; }
  .topbar nav a, .nav-button { font-size: .8rem; }
  .nav-button { padding-inline: .4rem; }
  .landing, .selection { padding-top: 12px; }
  .hero { border-radius: 15px; min-height: 315px; padding: 19px; background-position: 64% center; }
  .hero::before { background: linear-gradient(90deg,#0d0a20eb,#100d21ad 60%,#110f2660),linear-gradient(0deg,#100e21ba,transparent); }
  .hero h1 { white-space: normal; }
  .hero-copy > p:not(.eyebrow) { font-size: .98rem; }
  .entry-options { grid-template-columns: 1fr; gap: 9px; margin-top: 10px; }
  .entry { min-height: 82px; gap: .65rem; padding-block: .65rem; }
  .entry-icon { width: 39px; height: 39px; flex-basis: 39px; }
  .configuration { grid-template-columns: 1fr; }
  .active-pieces { gap: .45rem; }
  .active-pieces .piece { width: calc((100% - .45rem) / 2); }
  .grid-slots { grid-template-columns: repeat(8, 1fr); gap: .25rem; }
  .grid-slot { height: 28px; }
  .credits { margin-top: 10px; padding-block: .6rem; }
  .modal-content { grid-template-columns: 1fr; grid-template-rows: 95px minmax(0,1fr); }
  .hotspots { display: flex; justify-content: space-evenly; gap: .25rem; }
  .diagram-part { flex: 1 1 0; flex-direction: column; gap: .15rem; padding: .2rem; text-align: center; font-size: .73rem; }
  .stats > div { display: block; }
  .stats dt { font-size: .67rem; }
}

@media (max-width: 345px) {
  .topbar { height: auto; }
  .topbar-content { align-items: start; flex-direction: column; padding-block: .2rem .35rem; }
  .topbar nav { flex-wrap: wrap; }
  .hero { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.original-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 834 / 1139;
  overflow: hidden;
  border-radius: 6px;
}
.original-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.original-visual.landscape { aspect-ratio: 1139 / 834; }
.original-visual.landscape img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 73.22%;
  height: 136.57%;
  transform: translate(-50%, -50%) rotate(var(--image-turn));
}
.original-visual.token-visual { aspect-ratio: 1; }
.identity > .original-visual { width: min(100%, 112px); }
.setup-references {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .65rem;
}
.setup-references figure { margin: 0; width: min(100%, 150px); }
.setup-references figure:has(.landscape) { width: min(100%, 202px); }
.setup-references figure:has(.token-visual) { width: 106px; }
.setup-references figcaption { margin-top: .2rem; font-size: .85rem; color: var(--muted); }
.setup-map .piece.has-original { width: min(100%, 128px); }
.active-pieces .piece.has-original { width: min(44%, 124px); }
.active-pieces .piece.has-original:has(.landscape) { width: min(56%, 200px); }
.piece.has-original .piece-art {
  width: 100%;
  height: auto;
  margin: .35rem 0;
  border-radius: 6px;
  background: none;
}
.piece.has-original.is-target { border-color: #5e4d76 !important; box-shadow: none; }
.piece.has-original.is-target .piece-art {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 14px #f7ce7950;
}
.hand-card.has-original { --hand-art-width: clamp(52px, 8vh, 64px); width: 102px; min-width: 102px; }
.hand-card.has-original .original-visual { width: var(--hand-art-width); }
.hand-card.has-original strong { margin-bottom: 0; }
.hand-card.has-original small { padding-right: 1.15rem; }
.hand-card.has-original .zoom {
  top: calc(var(--hand-art-width) * 1.366 - 20px);
  right: auto;
  bottom: auto;
  left: calc(.48rem + var(--hand-art-width) - 29px);
}
.grid-slot .original-visual { width: min(100%, 21px); }
.marker .original-visual { width: 100%; }
.active-pieces .marker-list { gap: .16rem; }
.active-pieces .marker { width: 1.1rem; height: 1.1rem; }
.stats dt:has(.original-visual), .character-support .text-button:has(.original-visual) {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.stats dt .original-visual, .character-support .original-visual { flex: 0 0 14px; width: 14px; }

dialog.has-photo { width: min(790px, calc(100% - 24px)); height: min(540px, calc(100dvh - 24px)); }
.photo-diagram { display: grid; place-items: center; container-type: size; min-height: 0; }
.annotated-photo { position: relative; width: min(calc(100% - 5rem), 65cqh); }
.annotated-photo.wide-photo { width: min(calc(100% - 5rem), 114cqh); }
.annotated-photo.token-photo { width: min(calc(100% - 5rem), 70cqh, 165px); }
.annotated-photo .hotspot {
  position: absolute;
  top: var(--point-y);
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px #190c21a0;
}
.annotated-photo [data-rail="left"] { right: calc(100% + .4rem); }
.annotated-photo [data-rail="right"] { left: calc(100% + .4rem); }
.annotated-photo .hotspot::after { content: ""; position: absolute; width: .4rem; top: 50%; border-top: 1px solid #ffbdce; pointer-events: none; }
.annotated-photo [data-rail="left"]::after { left: 100%; }
.annotated-photo [data-rail="right"]::after { right: 100%; }

@media (min-width: 791px) {
  .tutorial-workspace .workspace-layout:has(.hand-card.has-original) {
    grid-template-rows: minmax(0, 1fr) clamp(176px, 31vh, 246px);
  }
}

@media (min-width: 791px) and (max-height: 760px) {
  .tutorial-workspace { width: min(1440px, calc(100% - 24px)); padding-block: 8px; }
  .tutorial-workspace .tutorial-attributes { margin-bottom: 6px; }
  .tutorial-workspace .workspace-layout {
    grid-template-columns: clamp(250px, 28vw, 345px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) min(108px, 22dvh);
    gap: 8px;
  }
  .tutorial-workspace .workspace-layout:has(.hand-card.has-original) {
    grid-template-rows: minmax(0, 1fr) clamp(142px, 24dvh, 155px);
  }
  .tutorial-workspace .guide-top { padding: .48rem .7rem; }
  .tutorial-workspace .round-phases { margin-block: .2rem; }
  .tutorial-workspace .guide-scroll { padding: .65rem .7rem; }
  .tutorial-workspace .guide-scroll h1 { font-size: clamp(1.55rem, 2.4vw, 1.9rem); margin-bottom: .6rem; }
  .tutorial-workspace .controls { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .3rem; padding: .4rem; }
  .tutorial-workspace .controls .primary, .tutorial-workspace .controls .secondary { min-height: 44px; height: auto; padding: .3rem; }
  .tutorial-workspace .controls .primary:only-child, .tutorial-workspace .save-error { grid-column: 1 / -1; }
  .tutorial-workspace .board-pane { padding: .45rem .65rem; }
  .tutorial-workspace .pane-heading { margin-bottom: .32rem; gap: .35rem; }
  .tutorial-workspace .pane-heading .eyebrow { display: none; }
  .tutorial-workspace .pane-heading h2 { font-size: clamp(1.25rem, 2.15vw, 1.7rem); }
  .tutorial-workspace .table-map { margin-bottom: .35rem; }
  .tutorial-workspace .table-map > div { padding: .18rem .35rem; line-height: 1.24; }
  .tutorial-workspace .table-surface { padding: .28rem .5rem; }
  .tutorial-workspace .active-pieces { gap: .5rem; }
  .tutorial-workspace .active-pieces .piece { min-height: 0; }
  .tutorial-workspace .active-pieces .piece.has-original:not(:has(.landscape)) { width: min(44%, 142px); }
  .tutorial-workspace .active-pieces :is(.piece-body, .piece-play) { padding-bottom: .35rem; }
  .tutorial-workspace .active-pieces :is(.marker-list, .cube-list) { margin-bottom: .3rem; }
  .tutorial-workspace .active-pieces .piece.has-original .original-visual:not(.landscape) {
    width: min(100%, clamp(60px, 12dvh, 88px));
    margin-inline: auto;
  }
  .tutorial-workspace .active-pieces .piece.has-original .landscape {
    width: min(100%, clamp(110px, 24dvh, 172px));
    margin-inline: auto;
  }
  .tutorial-workspace .grid-strip { padding-top: .3rem; gap: .25rem .55rem; }
  .tutorial-workspace .grid-slots { flex: 1 1 270px; width: auto; max-width: 465px; }
  .tutorial-workspace .personal-pane { padding-block: .28rem .12rem; }
  .tutorial-workspace .personal-heading, .tutorial-workspace .hand-header { line-height: 1.25; }
  .tutorial-workspace .stats { margin-top: .2rem; }
  .tutorial-workspace .hand-card.has-original { --hand-art-width: 39px; width: 132px; min-width: 132px; }
  .tutorial-workspace .hand-card.has-original :is(.piece-body, .piece-play) {
    display: grid;
    grid-template-columns: var(--hand-art-width) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: .15rem .35rem;
    align-content: start;
    padding: .3rem;
  }
  .tutorial-workspace .hand-card.has-original .piece-art { grid-row: span 2; margin: 0; align-self: start; }
  .tutorial-workspace .hand-card.has-original small { padding-right: 0; }
  .tutorial-workspace .hand-card.has-original .zoom {
    top: calc(.3rem + var(--hand-art-width) * 1.366 - 26px);
    left: calc(.3rem + var(--hand-art-width) - 29px);
  }
}

@media (max-width: 790px) and (max-height: 700px) {
  .tutorial-workspace .board-pane { padding: .5rem; }
  .tutorial-workspace .pane-heading .eyebrow { display: none; }
  .tutorial-workspace .table-view { flex: none; overflow: visible; }
  .tutorial-workspace .table-surface { padding: .38rem .5rem; }
  .tutorial-workspace .active-pieces .piece.has-original .original-visual:not(.landscape) {
    width: min(100%, 80px);
    margin-inline: auto;
  }
  .tutorial-workspace .controls { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .3rem; padding: .4rem; }
  .tutorial-workspace .controls .primary, .tutorial-workspace .controls .secondary { min-height: 44px; height: auto; padding: .3rem; }
  .tutorial-workspace .save-error { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .tutorial-attributes { flex-direction: column; align-items: start; gap: .22rem; margin-bottom: .42rem; }
  .tutorial-attributes > .text-button { font-size: .78rem; }
  .tutorial-attributes dl { width: 100%; gap: .2rem; }
  .tutorial-attributes dl > div { padding: .16rem .24rem; font-size: clamp(.69rem, 3.2vw, .81rem); flex-wrap: wrap; gap: 0 .24rem; }
  .table-map { gap: .25rem; }
  .table-map > div { padding: .22rem .32rem; font-size: .76rem; }
  .table-map button, .map-here { font-size: .72rem; }
  .active-pieces .piece.has-original { width: min(calc((100% - .45rem) / 2), 128px); }
  .active-pieces .piece.has-original:has(.landscape) { width: 58%; }
  .setup-map .piece.has-original { width: min(46%, 115px); }
  .grid-slot .original-visual { width: min(100%, 24px); }
  dialog.has-photo { height: min(620px, calc(100dvh - 24px)); }
  dialog.has-photo .modal-content { grid-template-rows: minmax(0, 1.35fr) minmax(0, 1fr); }
}
