:root {
  --ink: #0A0A0B; --ink-2: #121214; --ink-3: #1A1A1D;
  --ivory: #F2ECDF; --ivory-2: rgba(242,236,223,.72); --ivory-3: rgba(242,236,223,.58);
  --line: rgba(242,236,223,.12); --line-2: rgba(242,236,223,.22);
  --champagne: #CDB083; --champagne-2: #E4D1A8;
  --kufi: "Reem Kufi", "Geeza Pro", serif; --kufi-name: "Noto Kufi Arabic", "Geeza Pro", sans-serif;
  --text: "IBM Plex Sans Arabic", "SF Arabic", system-ui, sans-serif;
  --roman: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --hiero: "Noto Sans Egyptian Hieroglyphs", "Segoe UI Historic", sans-serif;
  --translit: "Noto Sans", "Gentium Plus", "Charis SIL", "Times New Roman", serif;
  --ar: 0.5625;
  color-scheme: dark;
}
/* the light page: paper and dark ink, lighter shadows, the primary button dark on the light page */
html[data-mode=light] {
  --ink: #F6F3ED; --ink-2: #FFFFFF; --ink-3: #EEE9DF;
  --ivory: #23201B; --ivory-2: rgba(35,32,27,.74); --ivory-3: rgba(35,32,27,.64);
  --line: rgba(35,32,27,.1); --line-2: rgba(35,32,27,.2);
  --champagne: #A6895A; --champagne-2: #7A6240;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--ivory); font: 400 16px/1.7 var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--champagne-2); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.g { font-family: var(--hiero); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px 120px; }

/* the page: the story and controls on one side, the card on the other */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: 72px; padding-top: 56px; align-items: start; }
.grid > * { grid-column: 1; min-width: 0; }
.grid > .stage { grid-column: 2; grid-row: 1 / span 10; position: sticky; top: 24px; }
.grid.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 600px); column-gap: 56px; }

.eyebrow { font: 500 13px var(--text); color: var(--champagne); letter-spacing: .02em; margin: 0 0 18px; display: flex; gap: 12px; align-items: center; }
.rn { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; font: 26px/.7 var(--hiero); color: var(--champagne); padding: 2px 0; }
h1 { font: 600 clamp(38px, 5.4vw, 60px)/1.2 var(--kufi); margin: 0 0 18px; letter-spacing: 0; text-wrap: balance; }
.lede { color: var(--ivory-2); font-size: 17px; max-width: 32rem; margin: 0 0 40px; }

.step { border-top: 1px solid var(--line); padding: 26px 0; }
.step-label { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.step-label .t { font: 500 15px var(--text); color: var(--ivory); margin: 0; }
.step-label .meta { font: 400 12px var(--text); letter-spacing: .02em; color: var(--ivory-3); }
.step-label .meta bdi { font-variant-numeric: tabular-nums; }

.name-input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; color: var(--ivory); font: 500 38px/1.4 var(--kufi-name); padding: 6px 0 12px; outline: none; transition: border-color .3s; }
html[lang=en] .name-input { font-family: var(--roman), var(--kufi-name); }
.name-input:focus { border-color: var(--champagne); }
.name-input:focus-visible { outline: none; border-color: var(--champagne-2); box-shadow: 0 1px 0 0 var(--champagne-2); }
.name-input::placeholder { color: var(--ivory-3); }
.help { margin: 10px 0 0; color: var(--ivory-2); font-size: 13px; }
.privacy { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: var(--ivory-2); font-size: 13px; }
.privacy svg { flex: none; width: 14px; height: 14px; color: var(--champagne); }
.no-script { margin: 12px 0 0; max-width: 46ch; color: var(--ivory); font-size: 16px; line-height: 1.6; }
.status { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(205,176,131,.1); color: var(--champagne-2); font-size: 13px; }
.status:empty, .status[hidden] { display: none; }
.font-warn { margin: 10px 0 0; color: #F0B49A; font-size: 13px; }

.seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 9px 16px; min-height: 44px; border-radius: 9px; color: var(--ivory-2); font-size: 14px; cursor: pointer; transition: background .25s, color .25s; }
.seg button .g { font: 22px/1 var(--hiero); }
.seg button[aria-pressed=true] { background: var(--ivory); color: var(--ink); }
.det-hint { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--champagne-2); }
@media (prefers-reduced-motion: no-preference) { .step-det.nudge .seg { animation: detNudge 1.6s ease-out 2; } }
@keyframes detNudge { 0% { box-shadow: 0 0 0 0 rgba(228,209,168,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(228,209,168,0); } }

.looks { display: grid; gap: 20px; }
.look-group-h { margin: 0 0 10px; font: 500 12px var(--text); color: var(--ivory-3); }
html[lang=en] .look-group-h { font: 500 10px "Mona Sans", system-ui; font-stretch: 125%; letter-spacing: .22em; text-transform: uppercase; }
.looks-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.look { border: 0; background: none; padding: 0; cursor: pointer; text-align: center; border-radius: 10px; }
.look canvas { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 38%; border-radius: 10px; outline: 1px solid var(--line); outline-offset: 0; transition: outline-color .25s, transform .25s; background: #111; }
.look span { display: block; margin-top: 7px; font-size: 12px; line-height: 1.35; color: var(--ivory-3); transition: color .25s; }
.look:hover canvas { transform: translateY(-2px); }
.look[aria-pressed=true] canvas { outline: 1.5px solid var(--champagne); outline-offset: 3px; }
.look[aria-pressed=true] span { color: var(--ivory); }
.frames { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.frm { border: 0; background: none; padding: 0; cursor: pointer; text-align: center; border-radius: 10px; }
.frm canvas { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; outline: 1px solid var(--line); transition: outline-color .25s, transform .25s; background: #111; }
.frm span { display: block; margin-top: 7px; font-size: 12px; line-height: 1.35; color: var(--ivory-3); transition: color .25s; }
.frm:hover canvas { transform: translateY(-2px); }
.frm[aria-pressed=true] canvas { outline: 1.5px solid var(--champagne); outline-offset: 3px; }
.frm[aria-pressed=true] span { color: var(--ivory); }
.frame-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(205,176,131,.1); color: var(--ivory); font-size: 13px; }
.frame-hint[hidden] { display: none; }
.frame-hint .text-btn { margin: -10px 0; font-weight: 500; }
.look-line { margin: 16px 0 0; color: var(--ivory-2); font-size: 13px; min-height: 1.7em; }
.look-line b { color: var(--ivory); font-weight: 500; }
.text-btn { background: none; border: 0; padding: 10px 4px; margin: -10px -4px; color: var(--champagne-2); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.text-btn:hover { color: var(--ivory); }
.text-btn svg { width: 14px; height: 14px; }

.formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.formats button { display: grid; gap: 1px; text-align: start; border: 1px solid var(--line-2); background: transparent; border-radius: 12px; padding: 10px 12px; min-height: 56px; cursor: pointer; color: var(--ivory-2); transition: background .25s, color .25s, border-color .25s; }
.formats button b { font: 500 14px/1.35 var(--text); }
.formats button small { font: 400 11px var(--text); color: var(--ivory-3); font-variant-numeric: tabular-nums; }
.formats button:hover { border-color: var(--ivory-3); }
.formats button[aria-pressed=true] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.formats button[aria-pressed=true] small { color: rgba(10,10,11,.7); }
.fmt-hint { margin: 14px 0 0; color: var(--ivory-2); font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer; color: var(--ivory-2); font-size: 14px; text-align: start; }
.switch .track { flex: none; position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s; }
.switch .knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory-2); transition: transform .2s, background .2s; }
.switch[aria-checked=true] { color: var(--ivory); }
.switch[aria-checked=true] .track { background: var(--champagne); box-shadow: none; }
.switch[aria-checked=true] .knob { background: var(--ink); transform: translateX(16px); }
html[dir=rtl] .switch[aria-checked=true] .knob { transform: translateX(-16px); }
.switch[aria-disabled=true] { opacity: .45; cursor: default; }

/* the signs in the name: one row of tiles, in the cartouche's own reading order */
.signs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sign-tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 1px; width: 88px; min-height: 124px; padding: 14px 6px 10px; border: 1px solid var(--line); border-radius: 14px; background: transparent; cursor: pointer; transition: border-color .2s, background .2s; }
.sign-tile:hover { border-color: var(--line-2); background: rgba(242,236,223,.03); }
.sign-tile[aria-expanded=true] { border-color: var(--champagne); background: rgba(205,176,131,.09); }
.sign-tile.det { border-style: dashed; }
.sign-tile .no { position: absolute; top: 6px; inset-inline-start: 9px; font: 400 10px var(--text); color: var(--ivory-3); }
.sign-tile .g { font: 38px/1.15 var(--hiero); color: var(--champagne-2); height: 46px; display: flex; align-items: center; }
.signs.mir .g { transform: scaleX(-1); }
.sign-tile .n { font-size: 11.5px; line-height: 1.35; color: var(--ivory-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.sign-tile .s { font: 600 15px/1.4 var(--text); color: var(--ivory); }
.sign-tile .tr { font: italic 400 12px/1.3 var(--translit); color: var(--ivory-3); min-height: 1.3em; }
.why { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 6px; }
.why li { position: relative; padding-inline-start: 18px; color: var(--ivory-2); font-size: 13px; }
.why li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--champagne); opacity: .7; }

/* the card */
.card-wrap { position: relative; width: min(100%, calc((100svh - 230px) * var(--ar))); margin-inline: auto; }
.card { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); border-radius: 18px; box-shadow: 0 40px 90px rgba(0,0,0,.65), 0 0 0 1px var(--line); background: #000; transition: opacity .3s; touch-action: manipulation; }
.card.bare { background: repeating-conic-gradient(#1a1a1d 0 25%, #121214 0 50%) 0 0 / 20px 20px; }
.card.round { border-radius: 50%; }
.card.dim { opacity: .35; }
.card.can-tap { cursor: pointer; }
.ring { position: absolute; border: 2px solid var(--champagne-2); border-radius: 12px; box-shadow: 0 0 0 4px rgba(10,10,11,.35), 0 0 24px rgba(228,209,168,.45); pointer-events: none; opacity: 0; transform: scale(.85); transition: opacity .24s, transform .24s; }
.ring.on { opacity: 1; transform: none; }
.tip { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); max-width: calc(100% - 28px); padding: 8px 14px; border-radius: 999px; background: rgba(10,10,11,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--line-2); color: var(--ivory); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s; }
.tip.on { opacity: 1; transform: translate(-50%, 0); }
.actions { position: relative; z-index: 1; display: grid; grid-template-columns: .9fr 1.1fr 1.3fr; gap: 10px; margin-top: 18px; }
.btn { height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--ivory); font: 500 15px var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .25s, border-color .25s, transform .15s, opacity .2s; text-decoration: none; }
.btn:hover { border-color: var(--ivory-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ivory); color: var(--ink); border-color: var(--ivory); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[aria-busy=true] { opacity: .7; cursor: progress; }
.btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; transform: none; }
.replay { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 12px 16px; min-height: 44px; background: none; border: 0; color: var(--ivory-3); font-size: 13px; cursor: pointer; }
.replay svg { width: 14px; height: 14px; }
html[dir=rtl] .replay svg { transform: scaleX(-1); }
.replay:hover { color: var(--ivory); }

/* the struck word in the hero: a hand-drawn gold stroke, drawn in once */
.strike { position: relative; display: inline-block; margin-inline: .14em; color: inherit; text-decoration: none; border-radius: 4px; }
html[dir=rtl] .strike svg { transform: scaleX(-1); }
.strike svg { position: absolute; left: -6%; width: 112%; top: 22%; height: 62%; overflow: visible; pointer-events: none; }
.strike path { fill: none; stroke: var(--champagne); stroke-width: 2.2px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) { .strike path { stroke-dashoffset: 100; animation: strikeIn .75s cubic-bezier(.6,.05,.3,1) .7s forwards; } }
@keyframes strikeIn { to { stroke-dashoffset: 0; } }
.strike:hover path, .strike:focus-visible path { stroke: var(--champagne-2); stroke-width: 2.8px; }
.mv.glow { box-shadow: inset 0 0 0 1.5px var(--champagne), 0 0 0 6px rgba(205,176,131,.18); }
@media (prefers-reduced-motion: no-preference) { .mv.glow { animation: mvGlow 2.6s ease-out forwards; } }
@keyframes mvGlow { 0% { box-shadow: inset 0 0 0 1.5px var(--champagne), 0 0 0 12px rgba(205,176,131,.28); } 100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 rgba(205,176,131,0); } }
.mv-n { font: 500 10.5px/1 var(--text); color: var(--ivory-3); text-decoration: none; border: 1px solid var(--line-2); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; }
.mv-n:hover { color: var(--ivory); border-color: var(--ivory-3); }
.src-link { margin: -10px 4px; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.vdlg.sdlg { width: min(720px, calc(100vw - 32px)); max-height: calc(100svh - 40px); }
.sdlg h2 { margin: 0; font: 600 19px var(--kufi); outline: none; }
html[lang=en] .sdlg h2 { font: 400 22px var(--roman); }
.src-intro { margin: 0 0 12px; color: var(--ivory-2); font-size: 13.5px; }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.src-list li { padding: 12px 12px; border-radius: 12px; outline: none; }
.src-list li.glow { background: rgba(205,176,131,.12); }
.src-list h3 { margin: 0 0 4px; font: 600 14.5px/1.5 var(--text); color: var(--ivory); }
.src-links { margin: 0 0 4px; font-size: 12.5px; }
.src-links a { color: var(--champagne-2); direction: ltr; unicode-bidi: isolate; }
.src-q { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ivory-2); text-align: start; }
.src-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ivory-3); }
.src-notes p { margin: 0 0 6px; }

/* myths & marvels: cards; a myth turns to its truth on tap */
.marvels .gallery-head { margin-top: 64px; }
.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 24px; }
.mv { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 16px; border-radius: 18px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.mv .orn { position: absolute; top: 14px; inset-inline-end: 16px; font: 30px/1 var(--hiero); color: var(--champagne); opacity: .55; }
.mv .kick { font-size: 12px; color: var(--champagne-2); font-weight: 500; letter-spacing: .02em; }
.mv h3 { margin: 0; padding-inline-end: 36px; font: 600 16.5px/1.55 var(--text); color: var(--ivory); }
html[lang=en] .mv h3 { font: 400 19px/1.35 var(--roman); }
.mv p { margin: 0; color: var(--ivory-2); font-size: 14px; line-height: 1.7; }
.mv .flip { align-self: flex-start; margin-top: 2px; }
.mv .truth[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .mv .truth { animation: mvIn .45s ease-out; } }
@keyframes mvIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mv .flip[hidden] { display: none; }
.mv.myth h3 { transition: opacity .4s, color .4s; }
.mv.myth.open h3 { opacity: .55; text-decoration: line-through 1px; text-decoration-color: var(--champagne); }
.mv-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--ivory-3); }
.mv-foot a { color: var(--ivory-2); }
.mv-foot .text-btn { margin: -10px -4px; font-size: 12px; }
.mv-disc { margin: 18px 0 0; font-size: 12.5px; color: var(--ivory-3); }

/* the stories library: chips, a search, a die */
.mv-tools { display: grid; gap: 12px; margin-top: 22px; }
.mv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mv-chips button { border: 1px solid var(--line-2); background: transparent; color: var(--ivory-2); border-radius: 999px; padding: 7px 14px; min-height: 40px; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .25s, color .25s, border-color .25s; }
.mv-chips button:hover { border-color: var(--ivory-3); }
.mv-chips button[aria-pressed=true] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.mv-find { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mv-search { flex: 1 1 220px; max-width: 360px; min-width: 0; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--ivory); font: inherit; font-size: 14px; }
.mv-search:focus { outline: none; border-color: var(--champagne); }
.mv-die { margin: 0; }
.mv-count { margin: 14px 0 0; font-size: 12.5px; color: var(--ivory-3); min-height: 1.4em; }
.mv-grid { margin-top: 12px; }
.src-cat { margin: 18px 0 4px; font: 500 12px var(--text); letter-spacing: .04em; color: var(--champagne-2); }
.src-med { margin: 4px 0 0; font-size: 11.5px; color: var(--ivory-3); }
@media (max-width: 900px) { .mv-chips.rail { flex-wrap: nowrap; } .mv-chips button { flex: none; scroll-snap-align: start; } }

/* free, said calmly */
.free-note { color: var(--champagne-2); font-weight: 500; white-space: nowrap; }
.free-line { margin: 10px 0 0; color: var(--ivory-3); font-size: 12.5px; }
.act-free { text-align: center; margin: 12px 0 0; }
@media (max-width: 900px) { .act-free { margin-top: 2px; } }
.die { width: 16px; height: 16px; }
@media (prefers-reduced-motion: no-preference) { .die.roll { animation: dieRoll .7s cubic-bezier(.3,1.4,.5,1) 1; } }
@keyframes dieRoll { 0% { transform: rotate(0) scale(1); } 45% { transform: rotate(250deg) scale(.82); } 100% { transform: rotate(360deg) scale(1); } }
.faq { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--line); max-width: 46rem; }
.faq h2 { font: 600 24px var(--kufi); margin: 0 0 10px; }
html[lang=en] .faq h2 { font: 400 26px var(--roman); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-weight: 500; color: var(--ivory); }
.faq details p { margin: 0 0 14px; color: var(--ivory-2); font-size: 14.5px; }
.faq .faq-src { margin-top: -6px; font-size: 12px; color: var(--ivory-3); }
.faq .faq-src a { color: var(--ivory-2); }

/* the mark: locked until SHETA opens it */
.mark-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ivory-3); }
.mark-state svg { width: 13px; height: 13px; }
.mark-state .g { font: 15px/1 var(--hiero); color: #D9A84A; }
.mark-state.on { color: #C9993A; font-weight: 500; }
.switch.locked .track { opacity: .55; }
.udlg { width: min(400px, calc(100vw - 32px)); padding: 22px 22px 20px; }
.udlg .v-head { margin-bottom: 4px; }
.u-ankh { font: 30px/1 var(--hiero); color: #D9A84A; }
.udlg h2 { margin: 0 0 6px; font: 600 20px/1.35 var(--kufi); }
html[lang=en] .udlg h2 { font: 400 23px/1.3 var(--roman); }
.u-line { margin: 0; color: var(--ivory-2); font-size: 14.5px; line-height: 1.65; }
.u-acts { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 18px; }
.u-acts .btn { height: 48px; padding: 0 12px; }
.u-how { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(205,176,131,.1); color: var(--ivory); font-size: 13.5px; line-height: 1.6; }
.u-how[hidden] { display: none; }
@media (min-width: 901px) { .toast.gold { top: 28px; bottom: auto; transform: translate(-50%, -12px); } .toast.gold.on { transform: translate(-50%, 0); } }   /* desktop: top centre, clear of the actions */
.toast.gold { background: linear-gradient(135deg, #F3DFA6, #D9A84A 55%, #B98A2E); color: #2A1C05; display: flex; align-items: center; gap: 10px; }
.toast .glint { font: 22px/1 var(--hiero); display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .toast.gold.on .glint { animation: glint 1.6s ease-out 1; } }
@keyframes glint { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; filter: drop-shadow(0 0 0 #fff8); } 40% { transform: scale(1.18) rotate(4deg); opacity: 1; filter: drop-shadow(0 0 8px #fff); } 100% { transform: none; filter: drop-shadow(0 0 0 #fff0); } }

/* the video: filmed on the device, then watched, shared or saved */
.vdlg { border: 0; padding: 20px; border-radius: 22px; background: var(--ink-2); color: var(--ivory); width: min(440px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow: auto; box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 0 1px var(--line); }
.vdlg::backdrop { background: rgba(0,0,0,.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.v-head { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 12px; }
.v-head h2 { margin: 0; font: 600 17px var(--kufi); }
html[lang=en] .v-head h2 { font: 400 19px var(--roman); }
.v-stage { display: grid; place-items: center; }
.v-stage canvas, .v-stage video { display: block; max-width: 100%; max-height: 56svh; width: auto; height: auto; border-radius: 12px; background: #000; }
.v-busy { margin-top: 14px; text-align: center; color: var(--ivory-2); font-size: 14px; }
.v-busy p { margin: 0 0 10px; }
.v-busy[hidden] { display: none; }
.v-bar { height: 3px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.v-bar i { display: block; height: 100%; width: 0; background: var(--champagne); transition: width .2s linear; }
.v-done { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 14px; }
.v-done[hidden] { display: none; }
.vdlg .switch { margin-top: 10px; }
.v-film { margin-top: 12px; }
.v-film button { min-height: 40px; padding: 6px 16px; }
.v-note { margin: 4px 0 0; font-size: 12px; color: var(--ivory-3); }

/* learn: one sign, its name, sound and story */
.learn { position: absolute; top: 0; inset-inline-end: calc(100% + 24px); width: 330px; z-index: 6; padding: 22px 22px 18px; border-radius: 18px; background: var(--ink-2); box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 1px var(--line-2); }
.learn[hidden] { display: none; }
.learn-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.learn-g { overflow: hidden; font: 50px/1 var(--hiero); color: var(--champagne-2); width: 76px; height: 76px; display: grid; place-items: center; border-radius: 14px; background: rgba(205,176,131,.08); }
.learn-g canvas { width: 76px; height: 76px; display: block; }
.learn h3 { margin: 0; font: 600 19px/1.35 var(--kufi); outline: none; }
html[lang=en] .learn h3 { font: 400 21px/1.3 var(--roman); }
.learn-pos { margin: 2px 0 0; color: var(--ivory-3); font-size: 12px; }
.learn-x { align-self: start; width: 44px; height: 44px; margin: -10px; border: 0; background: none; border-radius: 50%; color: var(--ivory-2); cursor: pointer; display: grid; place-items: center; }
.learn-x:hover { color: var(--ivory); background: rgba(242,236,223,.06); }
.learn-x svg { width: 18px; height: 18px; }
.learn dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 18px 0 0; padding: 14px 0; border-block: 1px solid var(--line); font-size: 14px; }
.learn dt { color: var(--ivory-3); }
.learn dd { margin: 0; color: var(--ivory); font-weight: 500; }
.learn dd .tr { font: italic 400 16px var(--translit); }
.learn-fact { margin: 14px 0 0; color: var(--ivory); font-size: 14.5px; line-height: 1.75; }
.learn-note { margin: 12px 0 0; color: var(--ivory-3); font-size: 12px; line-height: 1.6; }
.learn-nav { display: flex; justify-content: space-between; margin-top: 12px; }
.learn-nav button { background: none; border: 0; padding: 10px 6px; margin: 0 -6px -8px; min-height: 44px; color: var(--champagne-2); font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.learn-nav button[disabled] { visibility: hidden; }
.learn-nav svg { width: 14px; height: 14px; }
html[dir=rtl] .learn-nav svg { transform: scaleX(-1); }

/* facts, examples, the game */
.facts-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--line); }
.facts-band h3 { font: 500 17px/1.4 var(--kufi); margin: 0 0 6px; }
.facts-band p { margin: 0; color: var(--ivory-2); font-size: 14px; }
.facts-band .g { font-size: 1.45em; line-height: 1; vertical-align: -.12em; color: var(--champagne-2); }
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 20px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 64px; padding-top: 34px; }
.gallery-head h2 { font: 600 34px var(--kufi); margin: 0; }
.gallery-head p { margin: 0; font-size: 13px; color: var(--ivory-3); }
.gallery-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-top: 26px; }
.gallery-wide:empty { display: none; }
.gallery { columns: 4 200px; column-gap: 18px; margin-top: 26px; }
.ex { break-inside: avoid; display: block; width: 100%; margin: 0 0 18px; padding: 0; border: 0; background: none; cursor: pointer; text-align: start; border-radius: 12px; }
.gallery-wide .ex { margin: 0; }
.ex canvas { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); transition: transform .3s; background: var(--ink-2); }
.ex.round canvas { border-radius: 50%; }
.ex.bare canvas { background: repeating-conic-gradient(#1a1a1d 0 25%, #121214 0 50%) 0 0 / 22px 22px; }
.ex:hover canvas { transform: translateY(-3px); }
.ex span { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--ivory-3); }
.ex span em { font-style: normal; color: var(--champagne); }
/* on the light page the small gold note takes the deeper gold, to stay readable (5.2:1) */
html[data-mode=light] .ex span em { color: var(--champagne-2); }
html[data-mode=light] .mark-state.on { color: var(--champagne-2); }
.ex[hidden] { display: none; }
.more-wrap { display: flex; justify-content: center; margin-top: 10px; }
.more-wrap .btn { padding: 0 28px; }
.more-wrap[hidden] { display: none; }

/* the site's frame, as on every SHATATiON page */
@font-face { font-family: "Mona Sans"; src: url("/assets/fonts/mona-sans-latin.woff2") format("woff2"); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.home { display: block; width: 34px; color: var(--ivory); }
.home svg { display: block; width: 100%; height: auto; }
.bar-links { display: flex; gap: 26px; align-items: center; }
.bar-link { font: 500 11px "Mona Sans", system-ui; font-stretch: 125%; letter-spacing: .26em; text-transform: uppercase; text-decoration: none; color: var(--ivory-2); background: none; border: 0; padding: 12px 0; cursor: pointer; }
.bar-link:hover { color: var(--ivory); }
.lang { font-family: var(--text); letter-spacing: .02em; text-transform: none; font-size: 13px; }
.mode { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -10px; padding: 0; border-radius: 50%; font: 17px/1 system-ui, sans-serif; letter-spacing: 0; }
.mode:hover { background: var(--line); }
.cta-sheta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-top: 64px; padding: 26px; border-radius: 20px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.cta-sheta img { border-radius: 16px; }
.cta-sheta h3 { margin: 0 0 4px; font: 600 22px var(--kufi); }
.cta-sheta p { margin: 0; color: var(--ivory-2); font-size: 15px; }
.cta-act { display: grid; gap: 6px; justify-items: center; }
.cta-sheta .btn { padding: 0 24px; }
.cta-act small { color: var(--ivory-3); font-size: 12px; }
.sig { display: grid; gap: 40px; margin-top: 90px; padding-top: 60px; border-top: 1px solid var(--line); direction: ltr; text-align: left; }
.signature { margin: 0; font: 500 clamp(22px, 3vw, 34px) "Mona Sans", system-ui; font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; }
.signature .nm { text-transform: none; }
.signature .end { display: inline-block; width: .2em; height: .2em; margin-left: .12em; border-radius: 50%; background: var(--amber, #D99A1A); }
/* The signature as the brand draws it (SHATATiON-Brand/signature): "A", the drawn name at .78 em, "app", the point at
   .5 em, centred on one line, .45 em apart; the words light italic at 75 %, normal width, never typeset as the name */
.signature { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .45em; letter-spacing: 0; text-transform: none; line-height: 1; }
.signature .sig-w { font-weight: 300; font-style: italic; font-stretch: 100%; opacity: .75; }
.signature .end { display: block; flex: none; width: .5em; height: .5em; margin: 0; border-radius: 50%; }
.sig-row { display: flex; flex-wrap: wrap; gap: 12px 36px; font-size: 14px; color: var(--ivory-3); }
html[dir=rtl] .sig-row, html[dir=rtl] .sig-base { direction: rtl; }
.sig-row a { color: var(--ivory-2); text-decoration: none; border-bottom: 1px solid var(--line); padding: 4px 0; }
.sig-base { display: flex; flex-wrap: wrap; gap: 10px 32px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ivory-3); }
.sig-base p { margin: 0; }
.sig-base .house { display: contents; }      /* the house line's links sit in the row with the copyright (tools/house-line.mjs) */
.sig-base a { color: var(--ivory-2); text-decoration: none; border-bottom: 1px solid var(--line); }

/* overlays: toast, the save sheet */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; transform: translate(-50%, 12px); width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: var(--ivory); color: var(--ink); font-size: 14px; font-weight: 500; box-shadow: 0 20px 50px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(5,5,6,.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet[hidden] { display: none; }
.sheet-in { display: grid; gap: 14px; justify-items: center; max-width: 520px; width: 100%; max-height: 100%; text-align: center; }
.sheet img { display: block; max-width: 100%; max-height: 62svh; border-radius: 14px; box-shadow: 0 0 0 1px var(--line-2); -webkit-touch-callout: default; user-select: auto; }
.sheet p { margin: 0; color: var(--ivory); font-size: 15px; }
.sheet small { color: var(--ivory-3); font-size: 13px; }
.sheet .row { display: flex; gap: 10px; }
.sheet .btn { padding: 0 22px; height: 46px; }

html[lang=en] body { font-family: "Mona Sans", system-ui, sans-serif; }
html[lang=en] h1, html[lang=en] .facts-band h3, html[lang=en] .gallery-head h2, html[lang=en] .cta-sheta h3 { font-family: var(--roman); font-weight: 400; letter-spacing: .01em; }
html[lang=en] .eyebrow, html[lang=en] .step-label .t, html[lang=en] .btn, html[lang=en] .seg button, html[lang=en] .formats button b, html[lang=en] .sign-tile .s { font-family: "Mona Sans", system-ui; }
html[lang=en] .step-label .meta, html[lang=en] .formats button small { font-family: "Mona Sans", system-ui; }

@media (max-width: 1100px) { .facts-band { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) and (min-width: 901px) { .looks-row { grid-template-columns: repeat(5, minmax(0, 1fr)); } .learn { width: 300px; } }
@media (max-width: 900px) { .cta-sheta { grid-template-columns: auto 1fr; } .cta-act { grid-column: 1 / -1; justify-items: stretch; text-align: center; } .sig { padding-bottom: 80px; } }

/* phones: the title, the name, then the card; looks and formats sit right under it */
@media (max-width: 900px) {
  .grid, .grid.wide { grid-template-columns: minmax(0, 1fr); padding-top: 26px; }
  .grid > *, .grid > .stage { grid-column: 1; grid-row: auto; }
  .intro { order: 1; } .lede { order: 2; } .step-name { order: 3; } .stage { order: 4; } .step-look { order: 5; } .step-frame { order: 6; } .step-format { order: 7; } .step-det { order: 8; } .step-signs { order: 9; }
  .stage, .grid > .stage { position: relative; top: auto; margin: 4px 0 22px; }
  .eyebrow { margin-bottom: 12px; }
  h1 { font-size: 30px; line-height: 1.25; margin-bottom: 4px; }
  .lede { margin: 10px 0 8px; font-size: 15px; line-height: 1.6; }
  .step { padding: 20px 0; }
  .step-name { border-top: 0; padding: 12px 0 14px; }
  .step-name .step-label { flex-direction: row; align-items: baseline; margin-bottom: 4px; }
  .name-input { font-size: 30px; padding: 2px 0 8px; }
  .step-label { flex-direction: column; align-items: flex-start; gap: 2px; }
  .card-wrap { width: min(100%, calc(min(50svh, 440px) * var(--ar))); }
  .bar { padding: 14px 0; }
  .help, .privacy { font-size: 12.5px; }
  .help { margin-top: 8px; }
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(10,10,11,.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); transition: transform .25s; }
  body.typing .actions { transform: translateY(110%); }
  .btn { height: 48px; font-size: 14px; }
  .rail { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: -20px; padding: 4px 20px 8px; scroll-padding-inline: 20px; }
  .rail::-webkit-scrollbar { display: none; }
  .looks.rail { gap: 22px; }
  .look-group { flex: none; }
  .looks-row { display: flex; gap: 10px; }
  .look { flex: none; width: 66px; scroll-snap-align: start; }
  .look span { font-size: 11.5px; }
  .formats.rail { display: flex; gap: 8px; }
  .formats button { flex: none; scroll-snap-align: start; min-width: 118px; }
  .frames.rail { display: flex; gap: 10px; }
  .frm { flex: none; width: 66px; scroll-snap-align: start; }
  .frm span { font-size: 11.5px; }
  .actions { grid-template-columns: .85fr 1.1fr 1.2fr; gap: 8px; }
  .actions .btn { padding: 0 6px; gap: 6px; }
  .learn { position: fixed; top: auto; left: 0; right: 0; bottom: 0; inset-inline-end: auto; width: auto; max-height: 72svh; overflow: auto; z-index: 25; border-radius: 22px 22px 0 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.6), 0 0 0 1px var(--line-2); }
  .sign-tile { width: calc((100% - 24px) / 4); min-width: 72px; }
  .facts-band { margin-top: 40px; }
  .gallery { columns: 2 150px; column-gap: 12px; }
  .ex { margin-bottom: 14px; }
  .gallery-wide { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .gallery-head h2 { font-size: 28px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) { .facts-band { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .replay { display: none; }
  .look:hover canvas, .ex:hover canvas { transform: none; }
}

/* light page: the few colours that are not variables */
html[data-mode=light] .eyebrow, html[data-mode=light] .rn { color: var(--champagne-2); }
html[data-mode=light] .card { box-shadow: 0 30px 70px rgba(70,50,20,.14), 0 0 0 1px var(--line); background: #F3EEE5; }
html[data-mode=light] .card.bare, html[data-mode=light] .ex.bare canvas, html[data-mode=light] .frm.bare canvas { background: repeating-conic-gradient(#E6E0D4 0 25%, #F6F3ED 0 50%) 0 0 / 20px 20px; }
html[data-mode=light] .look canvas, html[data-mode=light] .frm canvas { background: #EEE9DF; }
html[data-mode=light] .btn.primary:hover { background: #000; }
html[data-mode=light] .formats button[aria-pressed=true] small { color: rgba(246,243,237,.75); }
html[data-mode=light] .sign-tile:hover { background: rgba(35,32,27,.03); }
html[data-mode=light] .learn { box-shadow: 0 30px 70px rgba(70,50,20,.18), 0 0 0 1px var(--line-2); }
html[data-mode=light] .learn-x:hover { background: rgba(35,32,27,.06); }
html[data-mode=light] .tip { background: rgba(255,255,255,.9); }
html[data-mode=light] .toast { box-shadow: 0 20px 50px rgba(70,50,20,.25); }
html[data-mode=light] .sheet { background: rgba(246,243,237,.94); }
html[data-mode=light] .font-warn { color: #A3301F; }
html[data-mode=light] .ring { box-shadow: 0 0 0 4px rgba(246,243,237,.6), 0 0 24px rgba(166,137,90,.45); border-color: var(--champagne-2); }
html[data-mode=light] .vdlg { box-shadow: 0 40px 100px rgba(70,50,20,.25), 0 0 0 1px var(--line); }
html[data-mode=light] .vdlg::backdrop { background: rgba(246,243,237,.7); }
@media (max-width: 900px) { html[data-mode=light] .actions { background: rgba(246,243,237,.9); } html[data-mode=light] .learn { box-shadow: 0 -20px 60px rgba(70,50,20,.18), 0 0 0 1px var(--line-2); } }

body.poster { background: #000; } body.poster .wrap { padding: 0; max-width: none; }
body.poster .bar, body.poster .grid > :not(.stage), body.poster .actions, body.poster .replay, body.poster .cta-sheta, body.poster .sig,
body.poster .vdlg, body.poster .marvels, body.poster .faq, body.poster .gallery, body.poster .gallery-wide, body.poster .gallery-head, body.poster .more-wrap, body.poster .facts-band, body.poster .learn, body.poster .tip, body.poster .ring { display: none; }
body.poster .grid { display: block; padding: 0; }
body.poster .stage { max-width: none; margin: 0; position: static; }
body.poster .card-wrap { width: auto; position: static; }
body.poster .card { position: fixed; left: 0; top: 0; width: auto; height: auto; aspect-ratio: auto; max-width: none; border-radius: 0; box-shadow: none; opacity: 1; }
body.chk .card { background: repeating-conic-gradient(#bbb 0 25%, #fff 0 50%) 0 0 / 24px 24px; }

/* ---- scenes: a small heading in the frames rail; a scene the name outgrows rests; formats a scene does not come in */
.frm-group { grid-column: 1 / -1; padding-top: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--champagne); }
html[lang=ar] .frm-group { letter-spacing: 0; font-size: 13px; }
@media (max-width: 900px) { .frames.rail .frm-group { flex: none; align-self: center; padding: 0 2px 0 14px; border-inline-start: 1px solid var(--line-2); } }
.frm.nofit { opacity: .4; cursor: not-allowed; }
.formats button.off { opacity: .4; cursor: not-allowed; }
.step-look.resting .looks { opacity: .45; pointer-events: none; }
.scene-note { color: var(--ivory-3); }
.pendants-h { margin: 14px 0 8px; font-size: 13px; color: var(--ivory-3); }
.pendants { margin-bottom: 6px; }
.pendants .frm[hidden], .pendants-h[hidden], .pendants[hidden] { display: none; }
.webp-btn { justify-self: start; margin-top: 4px; }

/* ---------- the library: two shelves; the pieces (where they are now, how sure the story is) ---------- */
.mv-mode { margin-top: 18px; display: inline-flex; }
.mv-chips button .dot, .piece .where .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 7px; vertical-align: .05em; background: var(--st, var(--champagne)); }
.mv-chips button small { font-size: .9em; font-variant-numeric: tabular-nums; }
.mv-chips button:disabled { opacity: .5; }
.st-in_egypt { --st: #5FA97B; } .st-abroad { --st: #D5A04E; } .st-returned { --st: #4FB3B0; } .st-lost { --st: #8E8A84; } .st-disputed { --st: #C46A4A; }
.piece .where { margin: 0; padding-inline-end: 36px; font-size: 12px; font-weight: 500; color: var(--ivory-2); }
.piece .where .now { font-weight: 400; color: var(--ivory-3); }
.piece .pname { font-size: 12.5px; color: var(--ivory-3); }
.piece .badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.trust { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; line-height: 1.5; color: var(--ivory-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.trust.documented { color: var(--ivory-2); }
.trust.scholars_theory { color: var(--champagne); box-shadow: inset 0 0 0 1px var(--champagne-2); }
.trust.folk_tale { color: #E3A35A; box-shadow: inset 0 0 0 1px #E3A35A; }
html[data-mode=light] .trust.folk_tale { color: #9A5414; box-shadow: inset 0 0 0 1px #9A5414; }
html[data-mode=light] .trust.scholars_theory { color: var(--champagne-2); }
.piece.folk { box-shadow: inset 0 0 0 1px rgba(227,163,90,.45); }
.piece .folk-note { font-size: 12.5px; font-style: italic; color: var(--ivory-3); }
.piece details { border-top: 1px solid var(--line); padding-top: 8px; }
.piece summary { cursor: pointer; font-size: 13px; color: var(--ivory-2); }
.piece details h4 { margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: var(--ivory); }
.piece details p { font-size: 13.5px; }
.piece dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 12.5px; }
.piece dt { color: var(--ivory-3); } .piece dd { margin: 0; color: var(--ivory-2); }

/* The family: a strip of its own under its heading, sideways as it grows; on a phone its tiles join the frames' rail */
.fam { grid-column: 1 / -1; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 4px; }
.fam .frm { flex: 0 0 calc((100% - 48px) / 5); scroll-snap-align: start; }
@media (max-width: 900px) { .frames.rail .fam { display: contents; } .frames.rail .fam .frm { flex: none; width: 66px; } }
.label-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.label-seg[hidden] { display: none; }
.label-h { font-size: 13px; color: var(--ivory-3); margin-inline-end: 4px; }
.label-seg button { border: 1px solid var(--line-2); background: transparent; color: var(--ivory-2); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; cursor: pointer; }
.label-seg button[aria-pressed=true] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.label-seg button[aria-disabled=true] { opacity: .45; }

/* The pieces' place picker, and the full story behind its button (a content note before it) */
.mv-place { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--ivory-3); }
.mv-place[hidden] { display: none; }
.mv-place select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--ivory); border-radius: 999px; padding: 8px 34px 8px 14px; min-height: 40px; font: inherit; font-size: 13px; cursor: pointer; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
html[dir=rtl] .mv-place select { padding: 8px 14px 8px 34px; background-position: 13px 55%, 18px 55%; }
.mv-place select option, .mv-place select optgroup { color: #111; background: #fff; }
.mv-place select:disabled { opacity: .5; }
.mv .cnote { margin-top: 10px; font-size: 13px; color: var(--ivory-3); font-style: italic; }
html[lang=ar] .mv .cnote { font-style: normal; }
.mv .full-btn { margin-top: 2px; }
.mv .full { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.mv .full p + p { margin-top: 10px; }
.mv .full:focus { outline: none; }

/* The pieces' two collections sit after the statuses, set apart by a hairline; stolen and disputed cards say when they were last checked */
.mv-chips button.grp { border-style: dashed; }
.mv-chips [data-cat="g:mysteries"] { margin-inline-start: 10px; }
.mv .checked { margin-top: 10px; font-size: 12px; color: var(--ivory-3); }

/* The name field reads as a field: a framed box, and on a first visit an empty field asking for a name, a gentle glow,
   and a "Sample" tag on the card that leads back to it. Surprise me also sits right under the card, where eyes are. */
.name-input { border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 16px 12px; background: rgba(255,255,255,.03); }
.name-input:focus, .name-input:focus-visible { border-color: var(--champagne-2); box-shadow: 0 0 0 3px rgba(205,176,131,.18); }
.name-input::placeholder { color: var(--ivory-3); opacity: .75; }
@media (prefers-reduced-motion: no-preference) {
  .name-input.invite { animation: nameInvite 1.4s ease-out 2; }
  @keyframes nameInvite { 0% { box-shadow: 0 0 0 0 rgba(205,176,131,.55); } 100% { box-shadow: 0 0 0 14px rgba(205,176,131,0); } }
}
/* Surprise me under the card: gold leaf, the scarab (Khepri, who becomes), a light that crosses it now and then, and the
   scarab rolling when pressed. No die, no glow ring. */
.surprise-big { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px auto 0; min-height: 48px; padding: 0 26px;
  border: 0; border-radius: 12px; background: linear-gradient(180deg, #E9CD92 0%, #C9A660 100%); color: #20170A; font-size: 15px; font-weight: 600; letter-spacing: .02em; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,250,235,.6), inset 0 -1px 0 rgba(90,60,15,.35), 0 10px 24px -14px rgba(150,110,40,.6); transition: transform .15s; }
.surprise-big:active { transform: translateY(1px); }
.surprise-big .scarab, .text-btn .scarab { display: inline-block; font: 24px/1 var(--hiero); }
.text-btn .scarab { font-size: 19px; color: var(--champagne); }
.surprise-big .shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%); transform: translateX(-120%); }
@media (prefers-reduced-motion: no-preference) {
  .surprise-big .shine { animation: surpriseShine 6s ease-in-out 1.5s 3; }
  @keyframes surpriseShine { 0%, 72% { transform: translateX(-120%); } 92%, 100% { transform: translateX(120%); } }
  .scarab.roll { animation: scarabRoll .9s cubic-bezier(.3,.7,.2,1); }
  @keyframes scarabRoll { 0% { transform: rotate(0); } 60% { transform: rotate(380deg) scale(1.15); } 100% { transform: rotate(360deg); } }
}
body.poster .surprise-big { display: none; }

/* An example turning into another: a band of warm light passes over the card, the old card fades, the new one is carved */
.ex { position: relative; }
.ex .sheen { position: absolute; inset: 0 0 auto 0; aspect-ratio: auto; height: var(--sheen-h, 0); border-radius: 12px; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,236,190,.0) 40%, rgba(255,236,190,.42) 50%, rgba(255,236,190,0) 60%, transparent 65%) no-repeat; background-size: 250% 100%; background-position: 130% 0; mix-blend-mode: screen; }
.ex canvas { transition: transform .3s, opacity .5s ease; }
.ex span { transition: opacity .5s ease; }
.ex.turning canvas, .ex.turning span { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ex.turning .sheen, .ex.turned .sheen { animation: exSheen 1.6s cubic-bezier(.4,0,.2,1) both; }
  @keyframes exSheen { 0% { opacity: 0; background-position: 130% 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; background-position: -30% 0; } }
}
html[data-mode=light] .ex .sheen { mix-blend-mode: soft-light; }
