/* Brumesel at night: sea-slate darkness, fog, bone text. Lamp yellow is kept for light and for whose turn it is. */
:root {
  --abyss: #0c161b; --deep: #13232a; --raise: #1b3038; --line: rgba(174, 187, 184, .2);
  --fog: #aebbb8; --bone: #efe8d8; --lamp: #f2b544; --kelp: #4b9a7f; --rust: #c2553a;
  --ui: "Sofia Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif; --tale: "Spectral", Georgia, serif;
  --glass: rgba(12, 22, 27, .9);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--abyss); color: var(--bone); font: 17px/1.3 var(--ui); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a.button { background: var(--raise); border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; text-decoration: none; color: inherit; display: inline-block; }
button:hover:not(:disabled), a.button:hover { background: #24404a; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .token:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
button.primary { background: var(--bone); color: #17242a; font-weight: 800; }
button.primary:hover:not(:disabled) { background: #fff; }
button.danger { color: #ff9c85; }
button.quiet { background: none; color: var(--fog); text-decoration: underline; }
button.big { font-size: 1.25rem; padding: 12px 26px; }
input, select, textarea { background: var(--abyss); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { resize: vertical; }
h1, h2, h3 { font-family: var(--tale); font-weight: 600; margin: 0; }
h3 { font-size: 1.1rem; margin-top: 18px; }
.muted { color: var(--fog); }
.small { font-size: .9rem; }
.warn { color: var(--lamp); margin: 0; }
.check { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.check input { width: auto; accent-color: var(--lamp); }

/* ---- the table ---- */
#stage { position: fixed; inset: 0; display: grid; place-items: center; container-type: size; }
body.playing #stage { inset: 0 0 128px 0; }
body.playing.has-sheet #stage { inset: 0 0 128px 316px; }
#board { position: relative; aspect-ratio: 3 / 2; width: min(100cqw, 150cqh); }
#board canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#tokens { position: absolute; inset: 0; }
#light, #fx, #vfx, #tokens { pointer-events: none; }
.token { pointer-events: auto; }
/* Things laid on the painted map: chests, doors, trapdoors, fires, furniture. Under the night, so that the dark hides them too. */
#things { position: absolute; inset: 0; }
.thing { position: absolute; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--turn, 0deg)); transition: left .5s ease-in-out, top .5s ease-in-out, opacity .5s ease, filter .2s ease; }
/* a thing under the pointer is lit along its own outline: the glow follows the picture's transparent edge, never a square (the plain button:hover rule must not paint behind it) */
#things .thing:hover, #things .thing:focus-visible { background: none; outline: none;
  filter: brightness(1.18) drop-shadow(0 0 1.5px #f2b544) drop-shadow(0 0 1.5px #f2b544) drop-shadow(0 0 6px rgba(242, 181, 68, .7)); }
.thing img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; transform-origin: 8% 50%; transition: transform .5s ease-in-out;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .55)); }
.thing.doorway::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--depth, 100%); transform: translateY(-50%); border-radius: 3px;
  background: linear-gradient(90deg, #6b6f6c 0 7%, transparent 7% 93%, #6b6f6c 93%), linear-gradient(#15191b, #23292b 50%, #15191b);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .65), inset 0 6px 9px rgba(0, 0, 0, .55), inset 0 -6px 9px rgba(0, 0, 0, .55); }
.thing.doorway img { position: relative; }
.thing.painted img { opacity: 0; }
#things .thing.painted:hover, #things .thing.painted:focus-visible { filter: none; box-shadow: inset 0 0 0 2px rgba(242, 181, 68, .75); border-radius: 10px; }
.thing.arrive { animation: thing-in .7s ease-out; }
.thing.changed { animation: thing-pop .55s ease-out; }
.thing.gone { opacity: 0; pointer-events: none; }
@keyframes thing-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--turn, 0deg)) scale(.5); } }
@keyframes thing-pop { 35% { transform: translate(-50%, -50%) rotate(var(--turn, 0deg)) scale(1.22); filter: brightness(1.5); } }
body.aiming .thing { pointer-events: none; }
#thing-menu { position: fixed; z-index: 45; display: grid; gap: 3px; min-width: 190px; max-width: 280px; padding: 9px; background: var(--deep); border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 14px 34px rgba(0, 0, 0, .7); }
#thing-menu b { font: 600 1.05rem/1.2 var(--tale); padding: 2px 6px 0; }
#thing-menu small { color: var(--fog); padding: 0 6px 6px; }
#thing-menu button { text-align: left; padding: 8px 10px; border-radius: 8px; background: none; }
#thing-menu button:hover { background: var(--raise); }
@media (prefers-reduced-motion: reduce) { .thing, .thing img { transition: none; animation: none; } }
/* A way to another map within the chosen character's reach (a ladder down, a drainpipe up, the drop into an alley): a small arrow on its square */
#climbs { position: absolute; inset: 0; pointer-events: none; }
.climb-chip { position: absolute; aspect-ratio: 1; min-width: 26px; padding: 0; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  display: grid; place-items: center; background: rgba(14, 24, 30, .82); color: #ffe3a3; border: 2px solid #e9b45a; box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 14px rgba(233, 180, 90, .55);
  font: 800 clamp(.8rem, 1.4cqw, 1.2rem)/1 var(--tale, serif); animation: climb-breathe 2.4s ease-in-out infinite; }
.climb-chip.up { border-color: #8fd3ff; color: #d8f0ff; box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 14px rgba(143, 211, 255, .5); }
.climb-chip.drop { border-color: #ff8d6b; color: #ffd2c4; box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 14px rgba(255, 141, 107, .5); }
.climb-chip:hover, .climb-chip:focus-visible { background: rgba(30, 44, 52, .95); outline: none; transform: translate(-50%, -50%) scale(1.12); }
body.aiming .climb-chip { pointer-events: none; opacity: .4; }
@keyframes climb-breathe { 50% { transform: translate(-50%, -50%) scale(1.08); } }
#thing-menu .climb-go { display: grid; gap: 2px; }
#thing-menu .climb-go small { padding: 0; }
#basics .climb-go { display: grid; gap: 2px; text-align: left; }
@media (prefers-reduced-motion: reduce) { .climb-chip { animation: none; } }
#backdrop { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(90% 70% at 50% 40%, #16303a 0%, var(--abyss) 75%); }
#board:not([hidden]) + #backdrop { display: none; }
#backdrop h1 { font-size: clamp(2.4rem, 7vw, 6rem); text-align: center; padding: 0 5vw; text-wrap: balance; }
body.setup #backdrop h1 { opacity: .12; }

.token { position: absolute; width: calc(100% / 24); aspect-ratio: 1; padding: 0; border: 0; background: none; touch-action: none; cursor: default;
  transform: translate(-50%, -50%); transition: left .45s ease-in-out, top .45s ease-in-out; }
.token:hover { background: none; }
.token.mine { cursor: grab; }
.token.drag { transition: none; z-index: 5; cursor: grabbing; }
.token .face { position: absolute; inset: 6%; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--kelp), 0 6px 14px rgba(0, 0, 0, .7); }
.token img { width: 138%; height: 138%; margin: -19%; object-fit: cover; display: block; pointer-events: none; }
.token.foe .face { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--rust), 0 6px 14px rgba(0, 0, 0, .7); }
.token.neutral .face { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--fog), 0 6px 14px rgba(0, 0, 0, .7); }
.token.turn .face { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--lamp), 0 0 22px 4px rgba(242, 181, 68, .55); }
.token .hp { position: absolute; left: 12%; right: 12%; bottom: -8%; height: 5px; border-radius: 3px; background: rgba(12, 22, 27, .85); overflow: hidden; }
.token .hp i { display: block; height: 100%; background: var(--kelp); transition: width .4s; }
.token.hurt .hp i { background: var(--rust); }
.token.down .face { filter: grayscale(1) brightness(.6); }
.token .face { transition: transform .35s ease, opacity .35s ease; }
.token.prone .face { transform: rotate(90deg) scale(.86); }
.token.faint .face { opacity: .45; }
.token.focus .face { outline: 2px dashed var(--lamp); outline-offset: 3px; }
.token .conds { position: absolute; left: 50%; top: calc(104% + 1.25em); transform: translateX(-50%); white-space: nowrap; padding: 0 6px; border-radius: 8px;
  background: rgba(194, 85, 58, .92); color: #fff; font-weight: 600; font-size: clamp(.55rem, .9vw, .78rem); line-height: 1.5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .token .face { transition: none; } }
.token .name { position: absolute; left: 50%; top: 104%; transform: translateX(-50%); white-space: nowrap; font-weight: 600; font-size: clamp(.6rem, 1.05vw, .9rem); text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#effect { position: absolute; transform: translate(-50%, -130%); pointer-events: none; white-space: nowrap; font-weight: 800; color: #ffd9cf;
  background: rgba(120, 38, 22, .88); padding: 1px 10px; border-radius: 99px; z-index: 3; }
/* a planned move: only its owner sees it until they confirm */
#path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#path line { stroke: var(--lamp); stroke-width: .09; stroke-dasharray: .22 .16; stroke-linecap: round; }
.token.ghost { cursor: grab; transition: none; z-index: 4; }
.token.ghost .face { opacity: .62; box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--lamp); }
#plan { position: absolute; z-index: 6; transform: translate(-50%, calc(-100% - 3.2vw)); display: flex; gap: 8px; align-items: center; white-space: nowrap;
  background: var(--glass); border-radius: 12px; padding: 6px 8px 6px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
#plan.below { transform: translate(-50%, 3.2vw); }
#plan b { color: var(--lamp); }
#aim { position: absolute; z-index: 7; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 6px 10px 6px 14px;
  border-radius: 12px; background: var(--glass); border: 1px solid var(--lamp); max-width: 94%; }
#aim b { color: var(--lamp); font-weight: 600; }
#aim button { padding: 4px 12px; white-space: nowrap; }
#aim button:disabled { opacity: .45; }
body.aiming #board { cursor: crosshair; }
body.aiming .token { pointer-events: none; }
#effect.aimed { background: rgba(242, 181, 68, .92); color: #1a1408; }
#plan.over b { color: #ff9c85; }
#plan.dragging { pointer-events: none; }
#plan.dragging button { display: none; }
#plan button { padding: 4px 12px; }

/* ---- what frames the map ---- */
#scene { position: fixed; left: 18px; top: 12px; max-width: 30vw; text-shadow: 0 1px 5px #000, 0 0 16px #000; pointer-events: none; }
#scene.timed { padding-left: 42px; }
#scene-moment { position: absolute; left: 0; top: 0; width: 34px; height: 34px; filter: drop-shadow(0 1px 4px #000); }
#scene-moment svg { width: 100%; height: 100%; display: block; }
#scene b { display: block; font: 600 1.35rem/1.15 var(--tale); }
#scene small { color: var(--fog); }

#topbar { position: fixed; right: 14px; top: 12px; display: flex; gap: 6px; align-items: center; }
#topbar button { background: var(--glass); padding: 5px 12px; }
.conn { font-size: .85rem; padding: 3px 10px; border-radius: 99px; background: var(--glass); white-space: nowrap; }
.conn.on { color: var(--kelp); }
.conn.off { color: #ff9c85; }

#order { position: fixed; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 10px; padding: 8px 16px 10px;
  background: linear-gradient(rgba(12, 22, 27, .94), rgba(12, 22, 27, .74)); border-radius: 0 0 18px 18px; max-width: 60vw; }
#order .slot { display: grid; justify-items: center; gap: 3px; opacity: .72; }
#order .slot img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--kelp); }
#order .slot.foe img { box-shadow: 0 0 0 2px var(--rust); }
#order .slot.now { opacity: 1; }
#order .slot.now img { width: 62px; height: 62px; box-shadow: 0 0 0 3px var(--lamp), 0 0 24px rgba(242, 181, 68, .6); }
#order .slot span { font-size: .8rem; font-weight: 600; white-space: nowrap; max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
#order .slot.now span { color: var(--lamp); font-size: .95rem; }
#order .round { align-self: center; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--line); color: var(--fog); line-height: 1.05; }
#order .round b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--bone); }

#voice { position: fixed; left: 50%; bottom: 142px; transform: translateX(-50%); width: min(900px, 92vw); text-align: center; pointer-events: none; }
#voice .who { display: inline-block; font-weight: 600; color: var(--lamp); margin-bottom: 4px; text-shadow: 0 1px 4px #000; }
#voice p { margin: 0; font: 400 1.55rem/1.42 var(--tale); text-shadow: 0 2px 6px #000, 0 0 22px #000, 0 0 40px rgba(0, 0, 0, .9); text-wrap: balance; }
#voice.top { bottom: auto; top: 118px; }
body.projector #voice.top { bottom: auto; top: 14vh; }
#voice.npc p { font-style: italic; }
#voice.npc .who { color: var(--fog); }
#voice.player .who { color: var(--kelp); }
#voice.player p { font: 400 1.2rem/1.4 var(--ui); color: var(--fog); }
#thinking { position: fixed; left: 50%; bottom: 142px; transform: translateX(-50%); color: var(--fog); font-style: italic; text-shadow: 0 1px 4px #000; }
#thinking::after { content: "…"; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; text-align: left; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
#voice:not([hidden]) ~ #thinking { display: none; }

#sheet { position: fixed; left: 12px; bottom: 12px; width: 292px; max-height: calc(100vh - 78px); overflow-y: auto; background: var(--glass); border-radius: 14px; padding: 14px 16px 10px;
  backdrop-filter: blur(6px); border-left: 4px solid var(--kelp); }
#sheet header { display: flex; gap: 12px; align-items: center; }
#sheet header img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
#sheet h1 { font-size: 1.5rem; line-height: 1; }
#sheet header small { color: var(--fog); }
.vitals { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.vital { background: var(--deep); border-radius: 8px; padding: 5px 8px 6px; }
.vital b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.vital small { color: var(--fog); }
.vital .bar { height: 4px; border-radius: 2px; background: #25383f; margin-top: 5px; overflow: hidden; }
.vital .bar i { display: block; height: 100%; background: var(--kelp); transition: width .4s; }
.vital .bar.low i { background: var(--rust); }
.abils { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 4px; }
.abils button { padding: 3px 0; background: var(--deep); display: grid; line-height: 1.05; }
.abils button small { color: var(--fog); font-size: .72rem; }
.abils button b { font-weight: 800; }
.act { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: none; border-radius: 0; border-top: 1px solid var(--line); padding: 6px 2px; text-align: left; }
.act:hover:not(:disabled) { background: none; color: var(--lamp); }
.act em { font-style: normal; color: var(--fog); font-size: .9rem; }
.act strong { font-weight: 800; font-size: 1.12rem; white-space: nowrap; }
#sheet details { border-top: 1px solid var(--line); padding: 6px 2px; }
#sheet summary { cursor: pointer; color: var(--fog); }
#sheet .pre { white-space: pre-wrap; margin: 6px 0 0; font-size: .92rem; }
#sheet .party-row { display: grid; gap: 3px; padding: 6px 0; border-top: 1px solid var(--line); }
#sheet .party-row:first-of-type { border-top: 0; }
#sheet .party-row > div:first-child { display: flex; justify-content: space-between; }
#sheet .party-row .vital { padding: 0; background: none; }
#sheet .party-row .bar { height: 6px; margin-top: 0; }

#talk { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: grid; justify-items: center; gap: 7px; width: min(760px, 94vw); }
#who { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#who button { border-radius: 99px; padding: 3px 13px; background: var(--glass); }
#who button[aria-checked="true"] { background: var(--kelp); color: #06201d; font-weight: 800; }
.talk-row { display: flex; gap: 10px; align-items: center; width: 100%; justify-content: center; }
#mic { height: 58px; padding: 0 26px 0 20px; border-radius: 99px; background: var(--bone); color: #17242a; font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .6); touch-action: none; user-select: none; white-space: nowrap; }
#mic:hover:not(:disabled) { background: #fff; }
#mic i { width: 14px; height: 14px; border-radius: 50%; background: var(--rust); flex: none; }
#mic.rec, #mic.rec:hover:not(:disabled) { background: var(--rust); color: #fff; }      /* held with a mouse, it is hovered too: still red */
#mic.rec i { background: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }
#text-form { display: flex; gap: 6px; flex: 0 1 300px; }
#text-form input { background: var(--deep); border-color: var(--line); }
#text-form button, #hush { background: var(--glass); }
#mic-status { color: var(--lamp); text-shadow: 0 1px 4px #000; min-height: 1.2em; text-align: center; }

#roll { position: fixed; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; max-width: 330px; pointer-events: none; }
.roll-card { display: flex; align-items: center; gap: 14px; background: var(--glass); border-radius: 14px; padding: 10px 18px 10px 12px;
  border-right: 4px solid var(--rust); backdrop-filter: blur(6px); transition: opacity .6s ease, transform .6s ease; }
.roll-card.pc { border-right-color: var(--kelp); }
.roll-card.leaving { opacity: 0; transform: translateX(14px); }
.roll-card:not(:first-child) { padding-top: 5px; padding-bottom: 5px; opacity: .82; }      /* older rolls: smaller, behind the newest */
.roll-card:not(:first-child) svg { width: 34px; height: 34px; }
.roll-card:not(:first-child) .total { font-size: 1.6rem; }
.roll-card:not(:first-child).leaving { opacity: 0; }
@media (max-height: 999px) {          /* a laptop screen: the newest roll a little smaller, the older one on a single short line */
  #roll svg { width: 46px; height: 46px; }
  #roll .total { font-size: 2rem; }
  .roll-card { padding: 6px 14px 6px 10px; gap: 10px; }
  .roll-card:not(:first-child) { padding-top: 3px; padding-bottom: 3px; }
  .roll-card:not(:first-child) svg, .roll-card:not(:first-child) .roll-face, .roll-card:not(:first-child) .nat-word { display: none; }
  .roll-card:not(:first-child) small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
  .roll-card:not(:first-child) b { display: none; }
  .roll-card:not(:first-child) .total { font-size: 1.25rem; }
}
#roll svg { width: 60px; height: 60px; flex: none; }
#roll small { color: var(--fog); display: block; }
#roll .total { font-weight: 800; font-size: 2.5rem; line-height: 1; color: var(--lamp); margin-left: auto; }

/* ---- panels over the table ---- */
.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(600px, 94vw); max-height: 92vh; overflow-y: auto; display: grid; gap: 14px;
  background: var(--glass); border-radius: 18px; padding: 28px 30px; backdrop-filter: blur(10px); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.panel h1 { font-size: 2rem; line-height: 1.15; }
.panel p { margin: 0; }
#closing { z-index: 30; text-align: center; font: 400 1.25rem/1.45 var(--tale); }
#closing p { margin: 0; }
#campaign-note { margin: -6px 0 0; min-height: 1.3em; }
#campaign-name-box { display: grid; gap: 4px; max-width: 460px; color: var(--fog); font-size: .92rem; }
#campaign-name-box[hidden] { display: none; }
#campaign-name-box input { font: 600 1.15rem/1.2 var(--tale); padding: 9px 12px; }
#journal summary { cursor: pointer; color: var(--lamp); font-weight: 600; }
#journal-body { max-height: 38vh; overflow-y: auto; display: grid; gap: 12px; padding: 10px 2px 2px; }
#journal-body h3 { margin: 0 0 4px; font: 600 1.05rem/1.25 var(--tale); }
#journal-body p { margin: 0 0 4px; font: 400 1rem/1.5 var(--tale); max-width: 70ch; }
#start-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
#party-note { margin: 0; max-width: 62ch; }
#party-note.off { color: var(--lamp); }
.seat { display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.seat-row { display: grid; grid-template-columns: auto 44px 1fr; align-items: center; gap: 10px; }
.seat-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.seat-who { display: grid; line-height: 1.2; min-width: 0; }
.seat-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-row.taken .seat-face { filter: grayscale(1); opacity: .6; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: grid; gap: 8px; }
legend { padding: 0 8px; color: var(--fog); }
.field { display: grid; gap: 3px; color: var(--fog); flex: 1; min-width: 150px; }
.field input, .field select, .field textarea { color: var(--bone); }
.field.narrow { flex: 0 0 132px; min-width: 110px; }
.field.grow { flex: 2; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); background: var(--glass); backdrop-filter: blur(10px); padding: 18px 20px; overflow-y: auto;
  display: grid; gap: 10px; align-content: start; box-shadow: -20px 0 60px rgba(0, 0, 0, .6); z-index: 20; }
.drawer header { display: flex; justify-content: space-between; align-items: center; }
.slider { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; }
.slider input { padding: 0; accent-color: var(--lamp); border: 0; background: none; }
#dice { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
#dice button { padding: 6px 0; }
#log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
#log li { display: grid; gap: 1px; }
#log .who { font-weight: 600; color: var(--fog); font-size: .9rem; display: flex; align-items: center; gap: 7px; }
#log .who .face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1.5px rgba(239, 232, 216, .25); }
#log .gm .who .face { box-shadow: 0 0 0 1.5px rgba(242, 181, 68, .6); }
#log p { margin: 0; font: 400 1.08rem/1.45 var(--tale); }
#log .npc p { font-style: italic; }
#log .npc .who { color: var(--kelp); }
#log .player p { font: 400 1rem/1.35 var(--ui); color: var(--fog); }
#log li.cont { margin-top: -8px; }
#log li.cont .who { display: none; }
#log .speaking p { color: #fff; }
#log .error p { color: #ff9c85; }
#log li.dice { display: flex; gap: 10px; align-items: baseline; color: var(--fog); font-size: .95rem; }
#log li.dice strong { color: var(--lamp); font-size: 1.2rem; }
#log li.dice .die { color: var(--bone); font-weight: 800; }

/* ---- character sheets ---- */
#view-sheets { position: fixed; inset: 0; z-index: 30; background: var(--abyss); display: grid; grid-template-columns: 270px minmax(0, 1fr); }
#sheet-list { border-right: 1px solid var(--line); background: var(--deep); padding: 18px; display: grid; gap: 12px; align-content: start; overflow-y: auto; }
#chars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#chars button { width: 100%; text-align: left; display: grid; grid-template-columns: 40px 1fr; gap: 0 10px; align-items: center; }
#chars button img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; grid-row: span 2; }
#chars button.on { box-shadow: inset 0 0 0 2px var(--lamp); }
#chars small { color: var(--fog); }
#sheet-form, #sheet-empty { padding: 24px clamp(16px, 4vw, 48px); overflow-y: auto; }
#sheet-form { display: grid; gap: 16px; max-width: 1000px; align-content: start; }
.row, .sheet-head { display: flex; flex-wrap: wrap; gap: 12px; }
.sheet-head input[name="nom"] { font: 600 1.6rem var(--tale); }
.portraits { display: flex; flex-wrap: wrap; gap: 10px; }
.portraits button { padding: 0; border-radius: 50%; width: 68px; height: 68px; overflow: hidden; background: none; opacity: .6; }
.portraits button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--lamp); }
.portraits img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abilities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ability { display: grid; gap: 4px; justify-items: center; text-align: center; background: var(--deep); border-radius: 10px; padding: 10px 6px; }
.ability input[type="number"] { text-align: center; font-size: 1.2rem; }
.ability .mod { font: 600 1.6rem var(--tale); color: var(--lamp); }
.ability label { font-size: .85rem; color: var(--fog); display: flex; gap: 4px; align-items: center; }
.ability input[type="checkbox"] { width: auto; accent-color: var(--lamp); }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills button { border-radius: 99px; padding: 3px 12px; }
.skills button[data-level="1"] { background: var(--kelp); color: #06201d; }
.skills button[data-level="2"] { background: var(--lamp); color: #2a1c02; font-weight: 800; }
.attack { display: grid; grid-template-columns: 2fr 90px 2fr auto; gap: 8px; margin-bottom: 6px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots label { display: grid; gap: 2px; font-size: .85rem; color: var(--fog); width: 62px; text-align: center; }
.slots input { text-align: center; }
#item-results, .results { list-style: none; margin: -4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .28); display: grid; gap: 2px; }
#item-results button, .results button { width: 100%; text-align: left; display: grid; gap: 1px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; }
.results { max-height: 320px; overflow-y: auto; }
.item.spell { grid-template-columns: 1fr auto; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--fog); }
#homebrew-form:not([data-genre="sort"]) .for-sort { display: none; }
#item-results button:hover, #item-results button:focus-visible, #item-results li:first-child button,
.results button:hover, .results button:focus-visible { background: rgba(242, 181, 68, .12); }
#item-results small, .results small, .item small, #homebrew-list small { color: var(--fog); font-size: .82rem; }
#item-results li.muted, .results li.muted { padding: 7px 10px; }
.item { display: grid; grid-template-columns: 1fr 76px auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-name { display: grid; gap: 1px; min-width: 0; }
.hint { margin: 0; padding: 8px 10px; border-left: 3px solid var(--lamp); background: rgba(242, 181, 68, .08); border-radius: 0 8px 8px 0; }
button.link { justify-self: start; background: none; border: 0; padding: 0; color: var(--fog); text-decoration: underline; text-underline-offset: 3px; }
#open-homebrew { margin-top: 8px; }
#homebrew { width: min(620px, 94vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 14px; background: var(--abyss, #0c161b); color: var(--bone); padding: 18px 20px; }
#homebrew::backdrop { background: rgba(0, 0, 0, .6); }
#homebrew form { display: grid; gap: 10px; }
#homebrew header { display: flex; justify-content: space-between; align-items: center; }
#homebrew h2 { margin: 0; font: 600 1.3rem/1.2 var(--tale); }
#homebrew .sheet-actions { padding-bottom: 0; }
#homebrew-form:not([data-genre="arme"]) .for-arme:not(.for-armure):not(.for-bouclier) { display: none; }
#homebrew-form[data-genre="objet"] .for-armure, #homebrew-form[data-genre="arme"] .for-armure, #homebrew-form[data-genre="sort"] .for-armure { display: none; }
#homebrew-form[data-genre="bouclier"] .field.for-armure { display: none; }
#homebrew-list { list-style: none; margin: 4px 0 0; padding: 0; }
#homebrew-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
#homebrew-list span { display: grid; gap: 1px; }
.sheet-actions { display: flex; gap: 12px; align-items: center; padding-bottom: 40px; }

/* ---- projector: the table only ---- */
body.projector #topbar, body.projector #sheet, body.projector #talk, body.projector #start-panel, body.projector #thinking { display: none !important; }
body.projector #voice { bottom: 5vh; }
body.projector #roll { bottom: auto; top: 14px; }
body.has-sheet #voice, body.has-sheet #thinking, body.has-sheet #talk { left: calc(50% + 158px); }
body.has-sheet #talk { width: min(760px, calc(100vw - 340px)); }
body.projector #voice p { font-size: 2.3vw; }

@media (max-width: 900px) {
  body.playing.has-sheet #stage { inset: 0 0 128px 0; }
  body.has-sheet #voice, body.has-sheet #thinking, body.has-sheet #talk { left: 50%; }
  body.has-sheet #talk { width: 94vw; }
  #roll { right: 8px; bottom: auto; top: 96px; }
  .roll-card { padding: 6px 12px 6px 8px; }
  #roll svg { width: 40px; height: 40px; }
  #voice, #thinking { bottom: 150px; }
  #voice p { font-size: 1.12rem; }
  #voice.top { bottom: auto; top: 178px; }
  #open-homebrew { display: none; }   /* the link inside the equipment section is enough on a phone */
  .item { grid-template-columns: 1fr 64px auto; }
  #scene { max-width: 92vw; top: 48px; left: 12px; }
  #scene small, #order .slot:not(.now) span { display: none; }
  #order { top: 84px; max-width: 96vw; border-radius: 14px; }
  #text-form { flex: 1 1 auto; }
  #mic .mic-label { font-size: 1rem; }
  #hush { display: none; }
  /* sheets on a phone: one scrolling page, the character list shrinks to a strip of portraits */
  #view-sheets { display: block; overflow-y: auto; }
  #sheet-list { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 10px 12px; gap: 8px;
    grid-template-columns: 1fr 1fr; position: sticky; top: 0; z-index: 2; }
  #sheet-list h2, #sheet-list p { display: none; }
  #sheet-list #chars { grid-column: 1 / -1; grid-row: 2; display: flex; overflow-x: auto; gap: 8px; padding: 2px; }
  #chars li { flex: none; }
  #chars button { grid-template-columns: 30px auto; padding: 4px 12px 4px 4px; border-radius: 99px; }
  #chars button img { width: 30px; height: 30px; grid-row: auto; }
  #chars small { display: none; }
  #sheet-form, #sheet-empty { overflow: visible; padding: 16px 12px; }
  .attack { grid-template-columns: 1fr 84px; }
  .attack input:nth-child(3) { grid-column: 1; }
  .field.narrow { flex: 1 1 40%; }
  .sheet-head input[name="nom"] { font-size: 1.3rem; }
  .abilities { grid-template-columns: repeat(3, 1fr); }
  #start-row { flex-direction: column; align-items: stretch; }
  body:not(.projector) #sheet:not([hidden]) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.row > button { align-self: end; }

#start-sheets { justify-self: start; }
#topbar #end-top { color: #ffb8a8; }
@media (max-width: 720px) { #topbar { flex-wrap: wrap; justify-content: flex-end; max-width: 96vw; } }

/* Seat panel reopened during a game: only the choice of character, nothing about starting */
#start-panel.choosing #start-row, #start-panel.choosing #adventure-box, #start-panel.choosing .row, #start-panel.choosing #campaign-note,
#start-panel.choosing #journal, #start-panel.choosing #start-chars { display: none; }
label.check.taken { cursor: default; }
label.check.taken input, label.check.taken strong, label.check.taken small { opacity: .55; }
.seat-take { justify-self: start; margin-top: 4px; padding: 4px 12px; border-radius: 99px; font-size: .85rem; background: none; box-shadow: inset 0 0 0 1px var(--lamp); color: var(--lamp); }
.seat-take:hover { background: var(--raise); }

/* The history stays open on the right of a wide screen, with the time of each line */
#log time { color: var(--fog); font-weight: 400; font-size: .8rem; margin-left: 8px; font-variant-numeric: tabular-nums; opacity: .8; }
#log li.dice time { margin-left: 0; }
@media (min-width: 1101px) {
  body.playing #history, body.playing #history[hidden] { display: grid !important; width: 340px; box-shadow: none; border-left: 1px solid var(--line); z-index: 5; padding: 14px 16px; }
  body.playing #history .close, body.playing #open-history { display: none; }
  body.playing #stage { inset: 0 340px 128px 0; }
  body.playing.has-sheet #stage { inset: 0 340px 128px 316px; }
  body.playing #topbar { right: 354px; }
  body.playing #roll { right: 354px; bottom: auto; top: 58px; }      /* under the top buttons: never over the talk bar */
  body.playing #voice, body.playing #thinking, body.playing #talk { left: calc(50% - 170px); }
  body.playing #voice { width: min(900px, calc(100vw - 380px)); }
  body.playing #talk { width: min(760px, calc(100vw - 380px)); }
  body.playing.has-sheet #voice, body.playing.has-sheet #thinking, body.playing.has-sheet #talk { left: calc(50% - 12px); }
  body.playing.has-sheet #voice { width: min(900px, calc(100vw - 700px)); }
  body.playing.has-sheet #talk { width: min(760px, calc(100vw - 700px)); }
  body.playing #order { left: calc(50% - 170px); }
  body.playing.has-sheet #order { left: calc(50% - 12px); }
}
#save-game { max-width: 520px; }
#save-form { display: grid; gap: 12px; }

/* Subtitles: the sentence before stays above, paler */
#voice #voice-prev { font-size: 1.15rem; opacity: .6; margin-bottom: 6px; }

/* Dice tray above the talk bar, and the die that tumbles before it settles */
#tray { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
#tray .die { background: var(--glass); padding: 4px 11px; font-weight: 800; border-radius: 8px; min-width: 44px; }
#tray .die:hover { color: var(--lamp); }
#tray .edge { background: none; color: var(--fog); padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; }
#tray .edge.on { color: #06201d; background: var(--lamp); border-color: var(--lamp); font-weight: 800; }
body.playing #stage, body.playing.has-sheet #stage { bottom: 166px; }
body.playing #voice, body.playing #thinking { bottom: 180px; }
.roll-card.rolling svg { animation: tumble .85s cubic-bezier(.2, .7, .3, 1); }
.roll-card.rolling .total { opacity: .35; }
@keyframes tumble { 0% { transform: translate(-90px, -40px) rotate(-540deg) scale(.6); } 60% { transform: translate(6px, 4px) rotate(20deg) scale(1.08); } 100% { transform: none; } }
.attack-row { display: grid; grid-template-columns: 1fr auto; align-items: stretch; border-top: 1px solid var(--line); }
.attack-row .act { border-top: 0; }
.attack-row .dmg { background: none; color: var(--fog); font-size: .9rem; padding: 4px 0 4px 10px; white-space: nowrap; }
.attack-row .dmg:hover { color: var(--lamp); }

/* The GM asked for a roll: the player's screen offers the right die */
#ask { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
#ask .ask-who { color: var(--lamp); font-weight: 800; }
#ask button.big { padding: 9px 22px; font-size: 1.12rem; box-shadow: 0 0 0 0 rgba(242, 181, 68, .7); animation: call 1.6s ease-out infinite; }
@keyframes call { to { box-shadow: 0 0 0 14px rgba(242, 181, 68, 0); } }
body.playing:has(#ask:not([hidden])) #voice, body.playing:has(#ask:not([hidden])) #thinking { bottom: 232px; }
#voice.top #voice-prev { display: none; }      /* at the top of the map the text stays short, so it covers no token */
body.playing #voice.top, body.playing:has(#ask:not([hidden])) #voice.top { bottom: auto; }

#sound-wake { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 15; box-shadow: 0 8px 26px rgba(0, 0, 0, .6); animation: call 1.6s ease-out infinite; }

#quick { max-width: 640px; }
#quick-form { display: grid; gap: 12px; }
#save-game, #quick { width: min(640px, 94vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 14px; background: var(--abyss, #0c161b); color: var(--bone); padding: 18px 20px; }
#save-game::backdrop, #quick::backdrop { background: rgba(0, 0, 0, .6); }
#save-game h2, #quick h2 { margin: 0; font: 600 1.3rem/1.2 var(--tale); }

/* The token this screen aims at */
.token.target .face { box-shadow: 0 0 0 3px var(--lamp), 0 0 18px rgba(242, 181, 68, .8); }
.token.target .name { color: var(--lamp); }
.token:not(.mine) { cursor: pointer; }
#tray .aimed { background: var(--lamp); color: #06201d; font-weight: 800; border-radius: 99px; padding: 4px 12px; }

/* Spell slots left, on the play sheet */
.slots-left { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 8px; }
.slot-level { display: inline-flex; align-items: center; gap: 4px; }
.slot-level small { color: var(--fog); margin-right: 2px; }
.slot-level i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--lamp); box-sizing: border-box; }
.slot-level i.full { background: var(--lamp); box-shadow: 0 0 8px rgba(242, 181, 68, .6); }
.slot-level b { margin-left: 3px; font-weight: 800; }
#tray .your-turn { color: var(--lamp); font-weight: 800; }
#tray .end-turn { padding: 5px 14px; border-radius: 99px; }

/* The talk area grows with the speaker chips, the roll request and the dice: the map and the subtitles always sit above it */
body.playing #stage, body.playing.has-sheet #stage { bottom: calc(var(--talk, 150px) + 22px); }
body.playing #voice, body.playing #thinking, body.playing:has(#ask:not([hidden])) #voice, body.playing:has(#ask:not([hidden])) #thinking { bottom: calc(var(--talk, 150px) + 34px); }

/* Names of neighbours no longer run into each other: a name is cut to its square, shown whole for one's own token, the target, the turn and under the pointer */
.token .name { max-width: 118%; overflow: hidden; text-overflow: ellipsis; }
.token.mine .name, .token.target .name, .token.turn .name, .token:hover .name { max-width: none; overflow: visible; z-index: 3; }
.token:hover { z-index: 4; }

/* ---- Play sheet: icons and sections, less text ---- */
.ico { flex: none; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--deep); color: var(--fog); }
.ico.none { display: none; }
.ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sword, .ico.bow { color: #e9e2d0; }
.ico.burst { color: #ff9c85; background: none; width: 16px; height: 16px; }
.ico.flame { color: #ff8a4c; } .ico.snow { color: #9fd8ff; } .ico.bolt { color: #ffd84a; } .ico.heart { color: #6fd29c; } .ico.drop { color: #b6e04a; }
.ico.skull { color: #c9a3ff; } .ico.sun { color: #ffe9a3; } .ico.star { color: var(--lamp); } .ico.eye { color: #d59cff; } .ico.shield { color: #7fc7b4; }
.ico.speed { color: var(--lamp); } .ico.dice { color: var(--fog); }
#sheet .act { align-items: center; gap: 8px; }
#sheet .act .what { flex: 1; min-width: 0; display: grid; text-align: left; line-height: 1.15; }
#sheet .act .label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet .act em { font-style: normal; color: var(--fog); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet h2.sec { display: flex; align-items: center; gap: 7px; margin: 12px 0 2px; font: 600 .78rem/1 var(--ui); color: var(--fog); letter-spacing: .02em; }
#sheet h2.sec .ico { width: 18px; height: 18px; background: none; }
#sheet summary { display: flex; align-items: center; gap: 7px; list-style: none; }
#sheet summary::-webkit-details-marker { display: none; }
#sheet summary::after { content: "▸"; margin-left: auto; color: var(--fog); }
#sheet details[open] > summary::after { content: "▾"; }
#sheet summary small { color: var(--fog); font-size: .78rem; }
#sheet summary .ico { width: 18px; height: 18px; background: none; }
#sheet .slots-left.level { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
#sheet .slots-left.level > small { color: var(--bone); font-weight: 600; }
#sheet .spellbook .act { border-top: 0; padding: 4px 2px; }
#sheet .skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#sheet .skills-grid .act { border-top: 0; padding: 3px 2px; }
#sheet .attack-row .dmg { display: inline-flex; align-items: center; gap: 4px; }

/* ---- The fight can be followed: slower walks with a trail, blows, wounds, whose turn ---- */
.token { transition: left .9s ease-in-out, top .9s ease-in-out, opacity .8s ease, transform .8s ease; }
.token.gone { opacity: 0; transform: translate(-50%, -50%) scale(.4); pointer-events: none; }
#trails { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#trails line, #trails polyline, #trails path { fill: none; stroke-width: .16; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .3 .3; animation: trail linear forwards; }
#trails .friend { stroke: var(--kelp); } #trails .foe { stroke: var(--rust); }
#trails .leap { stroke-width: .1; stroke-dasharray: .22 .16; opacity: .85; }
@keyframes trail { 0% { opacity: 0; } 15% { opacity: .9; } 70% { opacity: .7; } 100% { opacity: 0; } }
.fx { position: absolute; pointer-events: none; }
.fx.arrive { inset: -10%; border-radius: 50%; border: 3px solid var(--bone); animation: ring .9s ease-out forwards; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.fx.flash { inset: 2%; border-radius: 50%; animation: flash .7s ease-out forwards; }
.fx.flash.hurt { background: rgba(255, 60, 40, .75); } .fx.flash.heal { background: rgba(90, 220, 150, .65); }
@keyframes flash { from { opacity: 1; transform: scale(1.25); } to { opacity: 0; transform: scale(1); } }
.fx.float { left: 50%; top: -10%; transform: translateX(-50%); font-weight: 800; font-size: clamp(1.1rem, 2.2vw, 2rem); text-shadow: 0 2px 4px #000, 0 0 12px #000; white-space: nowrap; animation: rise 1.9s ease-out forwards; z-index: 6; }
.fx.float.hurt { color: #ff6a50; } .fx.float.heal { color: #7be3a6; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -20%) scale(1.25); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.fx.slash { inset: -20%; background: linear-gradient(135deg, transparent 44%, #fff 49%, #ffd9cf 51%, transparent 56%); animation: slash .65s ease-out forwards; z-index: 6; }
@keyframes slash { 0% { opacity: 0; clip-path: inset(0 100% 100% 0); } 25% { opacity: 1; } 60% { clip-path: inset(0); opacity: 1; } 100% { opacity: 0; clip-path: inset(0); } }
.token:has(.fx.slash) .face { animation: shake .5s ease-in-out; }
@keyframes shake { 20% { transform: translateX(-9%); } 40% { transform: translateX(8%); } 60% { transform: translateX(-6%); } 80% { transform: translateX(4%); } }
#turn-banner { position: fixed; left: 50%; top: 142px; transform: translate(-50%, -50%); z-index: 12; pointer-events: none; text-align: center; padding: 10px 34px 12px; border-radius: 14px;
  background: linear-gradient(90deg, transparent, rgba(8, 16, 20, .88) 18%, rgba(8, 16, 20, .88) 82%, transparent); }
#turn-banner b { display: block; font: 600 clamp(1.3rem, 2.3vw, 2rem)/1.1 var(--tale); color: var(--lamp); text-shadow: 0 2px 10px #000; }
#turn-banner small { color: var(--fog); font-size: 1rem; }
#turn-banner.show { animation: announce 2.2s ease forwards; }
@keyframes announce { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
@media (min-width: 1101px) { body.playing #turn-banner { left: calc(50% - 170px); } body.playing.has-sheet #turn-banner { left: calc(50% - 12px); } }
@media (prefers-reduced-motion: reduce) { .fx, #turn-banner.show, #trails line, #trails polyline, #trails path { animation-duration: .01s !important; } }

/* ---- Bottom bar: dice on the left, speech in the middle, the fight on the right; subtitles stay inside the map ---- */
#voice { padding: 8px 18px 10px; border-radius: 14px; background: radial-gradient(ellipse at center, rgba(6, 12, 16, .72), rgba(6, 12, 16, .5) 70%, rgba(6, 12, 16, 0)); }
#tray { gap: 4px; }
#tray .die { background: none; padding: 2px 3px 0; min-width: 0; display: grid; justify-items: center; gap: 0; border-radius: 8px; line-height: 1; }
#tray .die svg { width: 34px; height: 34px; }
#tray .die polygon { fill: var(--deep); stroke: var(--bone); stroke-width: 2; stroke-linejoin: round; }
#tray .die text { fill: var(--bone); font-weight: 800; font-family: var(--ui); }
#tray .die small { color: var(--fog); font-size: .72rem; }
#tray .die:hover polygon { stroke: var(--lamp); fill: #1a2d33; } #tray .die:hover text { fill: var(--lamp); }
#tray .die:active svg { transform: rotate(-18deg) scale(.92); }
#turn-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
#turn-box .aimed { background: var(--lamp); color: #06201d; font-weight: 800; border-radius: 99px; padding: 4px 12px; }
#turn-box .end-turn { display: grid; padding: 8px 22px 9px; border-radius: 12px; line-height: 1.1; box-shadow: 0 0 0 0 rgba(242, 181, 68, .6); animation: call 2s ease-out infinite; }
#turn-box .end-turn small { font-weight: 600; opacity: .75; } #turn-box .end-turn b { font-size: 1.25rem; font-weight: 800; }
#turn-box .others-turn { display: grid; text-align: center; line-height: 1.1; color: var(--fog); } #turn-box .others-turn b { color: var(--bone); font-size: 1.05rem; }
#hush { color: #ffb8a8; white-space: nowrap; }
@media (min-width: 1101px) {
  body.playing #talk, body.playing.has-sheet #talk { left: 12px; right: 352px; width: auto; transform: none; bottom: 10px; padding: 10px 16px; border-radius: 14px; background: var(--glass);
    grid-template-columns: minmax(250px, auto) minmax(0, 1fr) minmax(170px, auto); grid-template-areas: "who who who" "ask ask ask" "dice talk turn" "note note note"; align-items: center; justify-items: stretch; gap: 8px 18px; }
  body.playing.has-sheet #talk { left: 328px; }
  body.playing #who { grid-area: who; } body.playing #ask { grid-area: ask; } body.playing #mic-status { grid-area: note; min-height: 0; }
  body.playing #tray { grid-area: dice; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; align-items: center; }
  body.playing #tray .edge { justify-self: start; }
  body.playing .talk-row { grid-area: talk; }
  body.playing #turn-box { grid-area: turn; flex-direction: column; align-items: stretch; text-align: center; }
  body.playing #text-form { flex: 1 1 200px; }
}
/* bar, second pass: bigger dice on two tidy rows, room for the text field, the voice cut-off floats over the map's corner */
#tray .die svg { width: 40px; height: 40px; }
#tray .die { padding: 2px 2px 0; }
@media (min-width: 1101px) {
  body.playing #talk, body.playing.has-sheet #talk { grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto); gap: 8px 14px; }
  body.playing #tray { display: flex; flex-wrap: wrap; width: 196px; gap: 2px 4px; justify-content: flex-start; }
  body.playing #tray .edge { margin-left: 4px; align-self: center; font-size: .85rem; padding: 3px 9px; }
  body.playing .talk-row { gap: 8px; }
  body.playing #text-form { flex: 1 1 180px; min-width: 150px; }
  body.playing #text-form input { min-width: 0; width: 100%; }
  body.playing #mic { padding: 0 20px 0 16px; font-size: 1.05rem; }
  body.playing #hush { position: absolute; right: 10px; top: -44px; background: var(--glass); padding: 6px 14px; border-radius: 99px; }
}
@media (max-width: 900px) { #voice { padding: 0; background: none; } }      /* on a phone the text sits under the map: no scrim needed */

/* My turn: the edge of the map, the sheet and the bar light up */
body.my-turn #board { box-shadow: 0 0 0 3px var(--lamp), 0 0 46px rgba(242, 181, 68, .5); animation: myturn 2.4s ease-in-out infinite; border-radius: 4px; }
@keyframes myturn { 50% { box-shadow: 0 0 0 3px var(--lamp), 0 0 16px rgba(242, 181, 68, .25); } }
body.my-turn #sheet { border-left-color: var(--lamp); box-shadow: -6px 0 22px -8px rgba(242, 181, 68, .6); }
body.my-turn #talk { box-shadow: inset 0 3px 0 var(--lamp); }
body.my-turn .token.mine.turn .face { animation: mytoken 1.6s ease-in-out infinite; }
@keyframes mytoken { 50% { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 5px var(--lamp), 0 0 30px 8px rgba(242, 181, 68, .8); } }

/* Purse on the play sheet */
.purse-line { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.purse-line .ico { color: #f2c94c; background: none; width: 18px; height: 18px; }
.purse-line b { font-weight: 800; } .purse-line .po b { color: #f2c94c; } .purse-line .pa b { color: #cfd8dc; } .purse-line .pc b { color: #d08b5b; }
.purse-line small { margin-left: auto; color: var(--fog); }

/* ---- Before acting: reach, line of sight, the squares a walk can reach, where a shove ends ---- */
#preview, #preview-top { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#preview { overflow: hidden; }
#preview .reach { fill: rgba(242, 181, 68, .07); stroke: var(--lamp); stroke-width: .07; }
#preview .reach.long { fill: none; stroke-dasharray: .25 .2; opacity: .7; }
#preview .sight { stroke-width: .09; stroke-linecap: round; }
#preview .sight.ok, #preview-top text.ok { stroke: #6fd29c; fill: #9af0c0; }
#preview .sight.warn, #preview-top text.warn { stroke: var(--lamp); fill: var(--lamp); }
#preview .sight.no, #preview-top text.no { stroke: #ff6a50; fill: #ff9c85; }
#preview .sight.no { stroke-dasharray: .22 .18; }
#preview-top text { font: 800 .3px var(--ui); text-anchor: middle; stroke: none; }
#preview-top text.ok, #preview-top text.warn, #preview-top text.no { stroke: none; }
#preview-top text.halo { stroke: #06101480; stroke-width: .11; fill: #061014; stroke-linejoin: round; paint-order: stroke; stroke: #061014; }
#preview .step { fill: rgba(75, 154, 127, .22); stroke: rgba(111, 210, 156, .5); stroke-width: .03; }
#preview .step.far { fill: rgba(194, 85, 58, .12); stroke: rgba(194, 85, 58, .35); }
#preview .way { fill: none; stroke: var(--bone); stroke-width: .11; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .01 .26; }
#preview .shove { stroke: var(--lamp); stroke-width: .1; stroke-dasharray: .2 .14; }
/* a jump: the arc in the air (over the tokens), its shadow on the ground, where it lands; red when it cannot be done */
#preview .leap-shadow { stroke: rgba(4, 10, 14, .55); stroke-width: .16; stroke-linecap: round; stroke-dasharray: .08 .2; }
#preview .leap-land { fill: rgba(110, 196, 255, .18); stroke: #8fd3ff; stroke-width: .06; }
#preview .leap-land.no { fill: rgba(194, 85, 58, .16); stroke: #ff6a50; stroke-dasharray: .14 .1; }
#preview-top path.leap { fill: none; stroke: #8fd3ff; stroke-width: .11; stroke-linecap: round; stroke-dasharray: .3 .12; filter: drop-shadow(0 0 .08px #061014); }
#preview-top path.leap.no { stroke: #ff6a50; }
#preview-top text.leap { fill: #b7e4ff; }
#plan.leap b { color: #b7e4ff; }
#plan.leap.over b { color: #ff9c85; }
#plan-ok:disabled { opacity: .45; cursor: not-allowed; }
body.leaping #board { cursor: crosshair; }
@media (max-width: 700px) { #plan { white-space: normal; width: min(92vw, 340px); } #plan b { flex: 1; } }          /* a phone: the panel's words wrap instead of running off the map */
#preview .shove-end { fill: rgba(242, 181, 68, .25); stroke: var(--lamp); stroke-width: .07; }
#sheet .verdict { font-size: .74rem; font-weight: 600; }
#sheet .verdict.ok { color: #9af0c0; } #sheet .verdict.warn { color: var(--lamp); } #sheet .verdict.no { color: #ff9c85; }

/* Progression path */
.path-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 0; }
#sheet header .path-open { margin-left: auto; padding: 6px; border-radius: 50%; background: var(--deep); line-height: 0; }
#sheet header .path-open .ico { background: none; color: var(--lamp); }
#way { width: min(1080px, 96vw); height: 92vh; max-height: 92vh; border: 1px solid var(--line); border-radius: 14px; background: var(--abyss); color: var(--bone); padding: 0; overflow: hidden; }
#way[open] { display: grid; grid-template-rows: auto auto 1fr; }
#way::backdrop { background: rgba(0, 0, 0, .66); }
#way > header { display: flex; gap: 14px; align-items: center; padding: 16px 22px 10px; }
#way > header img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
#way > header > div { flex: 1; min-width: 0; }
#way h2 { font: 600 1.5rem/1.15 var(--tale); }
#way-sub { margin: 2px 0 0; }
#way-note { margin: 0; padding: 0 22px 12px; border-bottom: 1px solid var(--line); }
#way-levels { list-style: none; margin: 0; padding: 18px 22px 40px; overflow-y: auto; }
.lvl { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding-bottom: 20px; }
.lvl::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; border-left: 2px dashed var(--line); }
.lvl.past::before { border-left: 2px solid var(--kelp); }
.lvl:last-child::before { display: none; }
.lvl .node { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid rgba(174, 187, 184, .45); border-radius: 50%; background: var(--abyss); font: 600 1.15rem/1 var(--tale); color: var(--fog); }
.lvl.choice .node { border-radius: 9px; transform: rotate(45deg) scale(.86); }
.lvl.choice .node b { transform: rotate(-45deg); }
.lvl.past .node { background: var(--kelp); border-color: var(--kelp); color: #08130f; }
.lvl.now .node { background: var(--lamp); border-color: var(--lamp); color: #1c1403; box-shadow: 0 0 0 5px rgba(242, 181, 68, .18), 0 0 26px rgba(242, 181, 68, .5); }
.lvl .gains { min-width: 0; display: grid; gap: 8px; align-content: start; padding-top: 3px; }
.lvl .here { margin: 0; font-weight: 700; color: var(--lamp); }
.lvl .here.soon { color: var(--bone); }
.lvl.past .gains { opacity: .72; }
.lvl.next .feat strong, .lvl.next .lane strong { color: #d9d3c4; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.feat { display: grid; gap: 2px; align-content: start; padding: 8px 12px; background: var(--deep); border-radius: 8px; }
.feat strong { font-weight: 700; }
.feat span, .lane p span { color: var(--fog); font-size: .92rem; line-height: 1.25; }
.feat.pick { background: rgba(242, 181, 68, .08); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .5); }
.feat.pick strong { color: var(--lamp); }
.lanes { display: grid; grid-template-columns: repeat(var(--lanes, 4), minmax(0, 1fr)); gap: 8px; }
.lane { display: grid; gap: 6px; align-content: start; padding: 8px 12px 10px; border-radius: 8px; border-top: 3px solid rgba(174, 187, 184, .35); background: rgba(27, 48, 56, .55); }
.lane h4 { margin: 0; font: 600 1.02rem/1.2 var(--tale); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lane h4 small { font: 700 .78rem/1 var(--ui); color: var(--lamp); }
.lane p { margin: 0; display: grid; gap: 1px; }
.lane.mine { border-top-color: var(--lamp); background: var(--deep); }
.lane.unknown { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.lane button { justify-self: start; margin-top: 2px; }
.chips { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--fog); font-size: .92rem; }
.chips b { color: var(--bone); }
.chips .fresh b, .chips .fresh { color: var(--lamp); }
@media (max-width: 760px) {
  #way { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; border: 0; }
  #way > header { padding: 12px 14px 8px; flex-wrap: wrap; }
  #way-note { padding: 0 14px 10px; }
  #way-levels { padding: 14px 14px 40px; }
  .lvl { grid-template-columns: 36px 1fr; gap: 10px; }
  .lvl::before { left: 17px; top: 36px; }
  .lvl .node { width: 36px; height: 36px; font-size: 1rem; }
  .lanes { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr; }
}

/* Level up */
.lvl .here.soon { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lvl .here.soon button { font-weight: 800; }
#sheet .levelup-call { display: flex; gap: 10px; align-items: center; width: 100%; margin: 10px 0 2px; padding: 9px 12px; text-align: left; background: var(--lamp); color: #1c1403; border-radius: 10px; }
#sheet .levelup-call:hover { background: #ffc85c; }
#sheet .levelup-call .ico { background: rgba(28, 20, 3, .14); color: #1c1403; }
#sheet .levelup-call span { display: grid; line-height: 1.15; }
#sheet .levelup-call small { font-size: .8rem; opacity: .8; }
#levelup { width: min(860px, 96vw); height: min(92vh, 900px); max-height: 92vh; border: 1px solid var(--line); border-radius: 14px; background: var(--abyss); color: var(--bone); padding: 0; overflow: hidden; }
#levelup::backdrop { background: rgba(0, 0, 0, .66); }
#levelup-form { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
#levelup-form > header { display: flex; gap: 14px; align-items: center; padding: 16px 22px 12px; border-bottom: 1px solid var(--line); }
#levelup-form > header img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--lamp); }
#levelup-form > header > div { flex: 1; min-width: 0; }
#levelup h2 { font: 600 1.5rem/1.15 var(--tale); }
#levelup-sub { margin: 2px 0 0; }
#levelup-body { overflow-y: auto; padding: 6px 22px 18px; }
#levelup .step { padding: 14px 0 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
#levelup .step:last-child { border-bottom: 0; }
#levelup .step h3 { margin: 0; font: 600 1.15rem/1.2 var(--tale); }
#levelup .step p { margin: 0; }
#levelup .step .row { display: flex; gap: 10px; flex-wrap: wrap; }
#levelup .hp-pick[aria-pressed="true"] { background: var(--lamp); color: #1c1403; font-weight: 800; opacity: 1; }
#levelup .hp-pick:disabled[aria-pressed="false"] { opacity: .4; }
#levelup #hp-gain b { color: var(--lamp); }
#levelup .lanes.pickable .lane { text-align: left; cursor: pointer; font: inherit; color: inherit; }
#levelup .lanes.pickable .lane:hover { background: var(--deep); }
#levelup .lanes.pickable .lane.mine { box-shadow: inset 0 0 0 2px var(--lamp); }
#levelup .asi-mode { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 8px; background: rgba(27, 48, 56, .55); }
#levelup .asi-mode.on { background: var(--deep); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .5); }
#levelup .asi-mode select, #levelup .asi-mode input:not([type=radio]) { width: auto; min-width: 190px; flex: 1; }
#levelup .asi-mode p { flex-basis: 100%; }
#levelup .spell-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding: 2px; }
#levelup .spell-pick { display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px 10px; }
#levelup .spell-pick span { display: grid; line-height: 1.15; min-width: 0; }
#levelup .spell-pick small { color: var(--fog); font-size: .8rem; }
#levelup .spell-pick[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--lamp); background: var(--deep); }
#levelup-form > footer { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--deep); }
#levelup-status { flex: 1; }
@media (max-width: 760px) {
  #levelup { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; border: 0; }
  #levelup-form > header, #levelup-form > footer { padding-left: 14px; padding-right: 14px; }
  #levelup-body { padding: 4px 14px 14px; }
}

/* Sheet in pages */
#sheet-tabs { position: sticky; top: -24px; z-index: 3; display: flex; gap: 2px; margin: 0 -8px; padding: 8px 8px 0; background: var(--abyss); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#sheet-tabs button { position: relative; flex: none; background: none; border-radius: 8px 8px 0 0; padding: 9px 16px 10px; color: var(--fog); font-weight: 600; border-bottom: 3px solid transparent; }
#sheet-tabs button:hover { background: var(--deep); color: var(--bone); }
#sheet-tabs button[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--lamp); }
#sheet-tabs button.noted::after { content: ""; position: absolute; top: 8px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); }
.tab-page { display: grid; gap: 16px; align-content: start; min-width: 0; }
#sheet-form .sheet-actions { position: sticky; bottom: -24px; z-index: 3; margin: 0 -8px; padding: 12px 8px 24px; background: var(--abyss); border-top: 1px solid var(--line); }
.feature-cards { display: grid; gap: 10px; }
.feature-cards .feat strong { display: flex; gap: 8px; align-items: center; }
.feature-cards .feat small { color: var(--fog); font-size: .78rem; }
.feature-cards .feat .ico { width: 20px; height: 20px; }
#sheet .res-line { margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .86rem; color: var(--fog); }
#sheet .res-line b { color: var(--bone); }
#sheet .feat-line { margin: 0; border-top: 1px solid var(--line); }
#sheet .feat-line summary, #sheet .feat-line.plain { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-weight: 600; font-size: .95rem; cursor: pointer; list-style: none; }
#sheet .feat-line.plain { cursor: default; }
#sheet .feat-line summary::-webkit-details-marker { display: none; }
#sheet .feat-line .ico { width: 18px; height: 18px; background: none; }
#sheet .feat-line > p { margin: 0 0 8px 26px; color: var(--fog); font-size: .88rem; line-height: 1.25; }
#sheet .feat-line[open] summary { color: var(--lamp); }
#sheet .feat-line summary > span:not(.ico) { flex: 1; min-width: 0; }
#sheet .feat-line .cost { flex: none; padding: 1px 8px 2px; border-radius: 9px; font: 700 .74rem/1.3 var(--ui); letter-spacing: .02em; color: #10191d; background: var(--fog); }
#sheet .feat-line .cost.action { background: #f2b544; }
#sheet .feat-line .cost.bonus { background: #f08a4b; }
#sheet .feat-line .cost.reaction { background: #b08cf0; }
#sheet .feat-line .cost.free { background: #7fc7ab; }
#sheet .feat-line .cost.passive { background: none; color: var(--fog); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
#sheet .feat-line .feat-use { margin: 0 0 10px 26px; padding: 6px 14px; background: var(--bone); color: #17242a; font-weight: 800; font-size: .9rem; }
#sheet .feat-line .feat-use:hover:not(:disabled) { background: #fff; }
#sheet .feat-line .feat-use:disabled { background: var(--raise); color: var(--fog); font-weight: 600; }
@media (max-width: 900px) {
  #sheet-tabs { top: 0; margin: 0 -12px; padding: 6px 12px 0; flex-wrap: nowrap; overflow-x: auto; }
  #sheet-form .sheet-actions { bottom: 0; margin: 0 -12px; padding: 10px 12px; }
}
#preview-top { z-index: 6; }
.feature-cards .feat.auto { background: rgba(27, 48, 56, .55); }
.feature-cards .card-tools { display: flex; gap: 4px; margin: 2px 0 -4px -8px; }
.feature-cards .card-tools button { padding: 2px 8px; font-size: .86rem; }
#feature-own { align-items: end; }

/* Illustrated card */
#look { width: min(880px, 94vw); max-height: 92vh; border: 1px solid var(--line); border-radius: 16px; background: var(--abyss); color: var(--bone); padding: 0; overflow: hidden; }
#look[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
#look::backdrop { background: rgba(0, 0, 0, .78); }
#look-art { margin: 0; background: #060d10; display: grid; place-items: center; min-height: 320px; }
#look-art img { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; display: block; }
#look-art.drawn .ico { width: 120px; height: 120px; background: var(--deep); }
#look-art.drawn .ico svg { width: 64px; height: 64px; }
#look-text { padding: 26px 26px 22px; display: grid; gap: 12px; align-content: start; overflow-y: auto; }
#look-text h2 { font: 600 2rem/1.1 var(--tale); }
#look-text p { margin: 0; line-height: 1.35; }
#look-facts { display: flex; flex-wrap: wrap; gap: 8px; }
#look-facts:empty { display: none; }
#look-facts span { display: grid; padding: 8px 12px; background: var(--deep); border-radius: 8px; min-width: 84px; }
#look-facts small { color: var(--fog); font-size: .8rem; }
#look-facts b { font-size: 1.15rem; }
#look-close { justify-self: start; margin-top: 6px; }
#sheet header .face-open { padding: 0; background: none; border-radius: 50%; line-height: 0; cursor: zoom-in; }
#sheet .item-open { width: 100%; background: none; border-radius: 0; text-align: left; cursor: zoom-in; }
#sheet .item-open:hover { background: var(--deep); }
.token { -webkit-touch-callout: none; }
@media (max-width: 700px) {
  #look[open] { grid-template-columns: 1fr; overflow-y: auto; }
  #look-art { min-height: 0; }
  #look-art img { max-height: 46vh; }
  #look-text { padding: 16px; }
}
#reveal { position: fixed; z-index: 20; top: 86px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; padding: 14px 14px 12px; background: var(--glass); border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, .7); cursor: zoom-in; }
#reveal img { width: min(300px, 38vh); aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
#reveal span { font: 600 1.5rem/1.1 var(--tale); }
#reveal.in { animation: reveal-in 4.2s ease both; }
@keyframes reveal-in { 0% { opacity: 0; transform: translateX(-50%) scale(.86); } 8%, 86% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(1); } }
@media (prefers-reduced-motion: reduce) { #reveal.in { animation: none; } }

/* Figurines in relief (web/figs.js): the 3D layer sits under the flat tokens, whose round picture steps aside */
#figs { pointer-events: none; }
body.figs #tokens .token .face { opacity: 0; }
body.figs #tokens .token.mine .face, body.figs #tokens .token.target .face { opacity: 0; }

/* An attack or a spell chosen on the sheet waits here for its confirmation */
.act.armed { box-shadow: inset 0 0 0 2px var(--lamp); background: rgba(242, 181, 68, .12); }
#turn-box .confirm { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 8px 12px; border-radius: 12px; background: rgba(242, 181, 68, .1); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .45); }
#turn-box .confirm b { font-size: 1.05rem; }
#turn-box .confirm .confirm-row { display: flex; gap: 8px; margin-top: 2px; }
#turn-box .confirm .confirm-go { font-weight: 800; padding: 7px 18px; }

/* Shots and spells crossing the map (vfx in app.js) */
#vfx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 7; }
.roll-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--abyss), 0 0 0 3px var(--rust); margin-right: -4px; }
.roll-card.pc .roll-face { box-shadow: 0 0 0 2px var(--abyss), 0 0 0 3px var(--kelp); }
.roll-card:not(:first-child) .roll-face { width: 30px; height: 30px; }

/* Natural 20 and natural 1 (flourish in app.js) */
.roll-card.nat20 { border-right-color: var(--lamp); box-shadow: 0 0 0 1px rgba(242, 181, 68, .55), 0 0 22px rgba(242, 181, 68, .45); }
.roll-card.nat1 { border-right-color: #e0452c; box-shadow: 0 0 0 1px rgba(224, 69, 44, .6), 0 0 18px rgba(224, 69, 44, .35); }
.roll-card.nat20 .total, .roll-card.nat20 .nat-word { color: #ffd77a; }
.roll-card.nat1 .total, .roll-card.nat1 .nat-word { color: #ff8a70; }
.nat-word { display: block; font-style: normal; font-weight: 800; letter-spacing: .02em; }
.roll-card.nat20 svg { animation: nat-pulse .9s ease-out 2; }
.roll-card.nat1 { animation: nat-shake .5s linear; }
.nat-veil { position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: 0; animation: nat-veil 1.5s ease-out; }
.nat-veil.nat20 { background: radial-gradient(ellipse at center, rgba(255, 215, 122, .28) 0%, transparent 38%, rgba(242, 181, 68, .5) 100%); }
.nat-veil.nat1 { background: radial-gradient(ellipse at center, transparent 30%, rgba(160, 30, 14, .7) 100%); }
.nat-stamp { position: fixed; left: 50%; top: 44%; z-index: 61; pointer-events: none; display: grid; justify-items: center; text-align: center; transform: translate(-50%, -50%);
  font-family: var(--tale); color: #ffd77a; text-shadow: 0 2px 0 #3a2706, 0 0 34px rgba(242, 181, 68, .9); animation: nat-in20 1.85s cubic-bezier(.2, 1.4, .3, 1) forwards; }
.nat-stamp b { font-size: clamp(120px, 26vh, 260px); line-height: .85; font-weight: 800; }
.nat-stamp span { font-size: clamp(26px, 5vh, 52px); font-weight: 600; font-style: italic; }
.nat-stamp small { font-family: var(--ui); font-size: 1.15rem; color: var(--bone); text-shadow: 0 1px 6px #000; margin-top: 4px; }
.nat-stamp.nat1 { color: #ff7358; text-shadow: 0 2px 0 #2c0803, 0 0 28px rgba(224, 69, 44, .8); animation: nat-in1 1.85s cubic-bezier(.5, 0, .8, .4) forwards; }
.nat-stamp i { position: absolute; left: 50%; top: 38%; width: 5px; height: 22px; margin: -11px 0 0 -2px; border-radius: 3px; background: linear-gradient(#fff, #f2b544); opacity: 0;
  transform: rotate(var(--a)) translateY(-40px); animation: nat-spark .9s ease-out .12s; }
@keyframes nat-veil { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes nat-in20 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(.94); } 22% { transform: translate(-50%, -50%) scale(1.04); }
  30%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.08); } }
@keyframes nat-in1 { 0% { opacity: 0; transform: translate(-50%, -110%) rotate(-8deg); } 16% { opacity: 1; transform: translate(-50%, -48%) rotate(5deg); } 22% { transform: translate(-50%, -52%) rotate(-3deg); }
  30%, 68% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, 30%) rotate(-16deg); } }
@keyframes nat-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-40px) scaleY(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scaleY(.3); } }
@keyframes nat-pulse { 0% { filter: drop-shadow(0 0 0 rgba(242, 181, 68, 0)); } 40% { filter: drop-shadow(0 0 12px rgba(242, 181, 68, 1)); } 100% { filter: drop-shadow(0 0 0 rgba(242, 181, 68, 0)); } }
@keyframes nat-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* The turn, second pass. Throwing an attack is confirmed over the map (#act-dock), in the colour of the lamp; the end of the turn stays in the bar,
   quiet, and cannot be pressed while something is about to be thrown. Above it, what the character has left this turn. */
#act-dock { position: fixed; left: 50%; bottom: calc(var(--talk, 150px) + 60px); transform: translateX(-50%); z-index: 30; width: max-content; max-width: min(620px, 94vw); }
#act-dock .confirm { display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 20px; border-radius: 16px; background: rgba(9, 17, 21, .94);
  box-shadow: 0 0 0 1.5px rgba(242, 181, 68, .75), 0 10px 34px rgba(0, 0, 0, .65); backdrop-filter: blur(6px); animation: dock-in .18s ease-out; }
#act-dock .confirm-what { display: grid; gap: 1px; min-width: 0; }
#act-dock .confirm-what b { font-size: 1.2rem; }
#act-dock .confirm-what small { font-weight: 600; }
#act-dock .verdict.ok { color: #9af0c0; } #act-dock .verdict.warn { color: var(--lamp); } #act-dock .verdict.no { color: #ff9c85; }
#act-dock .confirm-row { display: flex; align-items: center; gap: 6px; flex: none; }
#act-dock .confirm-go { background: var(--lamp); color: #1a1408; padding: 12px 30px; border-radius: 12px; font-size: 1.3rem; line-height: 1; box-shadow: 0 0 0 0 rgba(242, 181, 68, .6); animation: call 2s ease-out infinite; }
#act-dock .confirm-go b { font-weight: 800; }
#act-dock .confirm-go:hover { background: #ffc85c; }
#act-dock .confirm-no { background: none; color: var(--fog); padding: 10px 12px; }
#act-dock .confirm-no:hover { background: var(--raise); color: var(--bone); }
@keyframes dock-in { from { opacity: 0; transform: translateY(8px); } }
body.docked #voice:not(.top) { bottom: calc(var(--talk, 150px) + 152px) !important; }
@media (max-width: 700px) { #act-dock .confirm { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; padding: 10px 12px; } #act-dock .confirm-row { justify-content: center; } }

#turn-box .economy { display: grid; gap: 5px; justify-items: center; }
#turn-box .eco-who { color: var(--lamp); font-weight: 700; }
#turn-box .eco-row { display: flex; gap: 4px; justify-content: center; }
#turn-box .eco { display: grid; justify-items: center; gap: 1px; background: none; padding: 3px 7px 2px; border-radius: 10px; min-width: 56px; line-height: 1.1; }
#turn-box .eco:hover:not(:disabled) { background: var(--raise); }
#turn-box .eco svg { width: 26px; height: 26px; stroke: var(--lamp); stroke-width: 2; fill: var(--lamp); stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(242, 181, 68, .55)); }
#turn-box .eco.bonus svg { stroke: #f08a4b; fill: #f08a4b; filter: drop-shadow(0 0 5px rgba(240, 138, 75, .55)); }
#turn-box .eco.reaction svg { stroke: #b08cf0; fill: none; stroke-width: 2.6; filter: drop-shadow(0 0 5px rgba(176, 140, 240, .55)); }
#turn-box .eco.reaction svg .tip { fill: #b08cf0; stroke-width: 1; }
#turn-box .eco span { font-size: .8rem; font-weight: 700; color: var(--bone); }
#turn-box .eco.part svg { fill: none; }      /* the Attack action under way: the ring stays lit, attacks are left */
#turn-box .eco.part span { color: var(--lamp); }
#turn-box .eco.spent svg { fill: none; stroke: var(--fog); opacity: .45; filter: none; stroke-dasharray: 3 3; }
#turn-box .eco.spent svg .tip { fill: none; }
#turn-box .eco.spent span { color: var(--fog); opacity: .6; text-decoration: line-through; }
#turn-box .eco-move { display: flex; align-items: center; gap: 8px; }
#turn-box .eco-move .steps { display: flex; gap: 3px; }
#turn-box .eco-move .steps i { width: 11px; height: 7px; border-radius: 2px; background: none; box-shadow: inset 0 0 0 1px rgba(174, 187, 184, .45); }
#turn-box .eco-move .steps i.lit { background: var(--kelp); box-shadow: none; }
#turn-box .eco-move b { font-size: .92rem; min-width: 3.2em; text-align: left; }
#turn-box .eco-move.spent b { color: var(--fog); }
#turn-box .end-turn { display: block; padding: 7px 16px; border-radius: 10px; background: none; color: var(--bone); font-weight: 700; font-size: 1rem; box-shadow: inset 0 0 0 1px rgba(239, 232, 216, .4); animation: none; margin-top: 2px; }
#turn-box .end-turn:hover:not(:disabled) { background: var(--raise); }
#turn-box .end-turn.due { background: var(--bone); color: #17242a; box-shadow: none; }
#turn-box .end-turn.due:hover { background: #fff; }
#turn-box .end-turn:disabled { opacity: .3; }

/* Dice thrown by hand over the map (dice3d.js) */
#dice3d { position: fixed; z-index: 55; pointer-events: none; }          /* above every panel of the screen; placed over the map by dice3d.place() */
#dice3d.grab { pointer-events: auto; cursor: grab; touch-action: none; background: radial-gradient(ellipse at center, rgba(6, 12, 16, .5), rgba(6, 12, 16, .18) 55%, transparent 80%); }
#dice3d.grab:active { cursor: grabbing; }
#dice-hint { position: fixed; transform: translateX(-50%); z-index: 56; pointer-events: none; padding: 5px 14px; border-radius: 99px; background: rgba(9, 17, 21, .85);
  color: var(--bone); font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 1px rgba(242, 181, 68, .5); }

/* Third pass on the play screen: who plays here sits on top of the sheet, the target is shown on the map, whose turn it is is said over the map */
#who button { display: inline-flex; align-items: center; gap: 7px; }
#who button img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
#who button.now { box-shadow: inset 0 0 0 2px var(--lamp); }
/* on top of the sheet: one face per character with its whole name under it; the one being played is ringed, the one whose turn it is wears the lamp */
#who.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 2px; margin: -4px -8px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#who.tabs button { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 6px 2px 5px; border-radius: 10px; background: none; box-shadow: none; color: var(--fog); min-width: 0; }
#who.tabs button:hover { background: var(--raise); }
#who.tabs button img { width: 46px; height: 46px; filter: grayscale(.7); opacity: .7; box-shadow: 0 0 0 2px var(--line); transition: filter .15s, opacity .15s; }
#who.tabs button span { font-size: .86rem; line-height: 1.1; font-weight: 600; text-align: center; overflow-wrap: anywhere; max-width: 100%; }
#who.tabs button[aria-checked="true"] { background: rgba(75, 154, 127, .16); color: var(--bone); }
#who.tabs button[aria-checked="true"] span { font-weight: 800; }
#who.tabs button[aria-checked="true"] img { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--kelp); }
#who.tabs button.now { box-shadow: none; color: var(--lamp); }
#who.tabs button.now img { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--abyss), 0 0 0 4px var(--lamp), 0 0 14px rgba(242, 181, 68, .6); }

body.has-target #tokens .token:not(.target):not(.actor) { opacity: .5; filter: grayscale(.55); transition: opacity .2s, filter .2s; }
body.has-target #tokens .token:not(.target):not(.actor):hover { opacity: .9; filter: none; }
body.has-target #tokens .token.target { z-index: 4; }
body.has-target #tokens .token.target .face { box-shadow: 0 0 0 3px var(--lamp), 0 0 0 7px rgba(242, 181, 68, .28), 0 0 26px 6px rgba(242, 181, 68, .85); animation: aimed 1.5s ease-in-out infinite; }
@keyframes aimed { 50% { box-shadow: 0 0 0 3px var(--lamp), 0 0 0 11px rgba(242, 181, 68, .12), 0 0 30px 8px rgba(242, 181, 68, .6); } }

#your-turn { position: fixed; left: 50%; top: 106px; transform: translateX(-50%); z-index: 11; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 4px 20px 4px 5px; border-radius: 99px;
  background: var(--lamp); color: #1a1408; box-shadow: 0 4px 18px rgba(0, 0, 0, .55), 0 0 26px rgba(242, 181, 68, .45); white-space: nowrap; }
#your-turn img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #1a1408; }
#your-turn b { font: 700 1.25rem/1 var(--ui); }
@media (min-width: 1101px) { body.playing #your-turn { left: calc(50% - 170px); } body.playing.has-sheet #your-turn { left: calc(50% - 12px); } }
@media (max-width: 1100px) { #your-turn { top: 96px; } #your-turn b { font-size: 1.05rem; } }
#turn-box .end-turn { padding: 13px 16px; font-size: 1.2rem; font-weight: 800; }

/* squares that cost double to walk (something to climb on, water): hatched while a token is being moved */
#preview .step.slow { stroke-dasharray: .12 .1; fill-opacity: .1; }

/* Réglages, Micro */
#settings .field { display: grid; gap: 4px; margin-bottom: 8px; }
#settings .slider:has(output) { grid-template-columns: 84px 1fr 52px; }
#settings .slider output { text-align: right; color: var(--fog); font-size: .9rem; }
#mic-meter { height: 12px; border-radius: 99px; background: var(--abyss); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; margin: 10px 0 8px; }
#mic-meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--kelp); transition: width .06s linear; }
#mic-meter.quiet i { background: var(--fog); } #mic-meter.loud i { background: var(--rust); }
#settings .mic-row { display: flex; gap: 8px; flex-wrap: wrap; }
#mic-test-result { margin: 8px 0 0; min-height: 2.6em; }
#mic-test-result.ok { color: #9af0c0; } #mic-test-result.warn { color: var(--lamp); }
#mic.rec { box-shadow: 0 0 0 calc(2px + 10px * var(--level, 0)) rgba(194, 85, 58, .45); }      /* the talk button swells with the voice */
#dice-hint { display: grid; justify-items: center; gap: 1px; border-radius: 14px; }
#dice-hint b { color: var(--lamp); font-size: 1.1rem; }

/* The turn has just come to a character of this screen */
#your-turn.turn-flash { animation: turn-pop 1.4s cubic-bezier(.2, 1.5, .3, 1); }
body.turn-flash #sheet { animation: turn-sheet 1.4s ease-out; }
body.turn-flash #board::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 8; border-radius: 4px; animation: turn-wash 1.2s ease-out forwards; }
@keyframes turn-pop { 0% { transform: translateX(-50%) scale(.6); opacity: 0; } 22% { transform: translateX(-50%) scale(1.45); opacity: 1; } 45% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes turn-sheet { 0% { box-shadow: 0 0 0 0 rgba(242, 181, 68, .95); } 30% { box-shadow: 0 0 0 5px rgba(242, 181, 68, .95), 0 0 40px 10px rgba(242, 181, 68, .55); } 100% { box-shadow: 0 0 0 0 rgba(242, 181, 68, 0); } }
@keyframes turn-wash { 0% { background: rgba(242, 181, 68, .32); box-shadow: inset 0 0 0 6px var(--lamp); } 100% { background: rgba(242, 181, 68, 0); box-shadow: inset 0 0 0 0 rgba(242, 181, 68, 0); } }

/* Sheet editor: the chosen portrait shown large, the others only when choosing */
.portrait-now { display: flex; align-items: center; gap: 18px; }
#portrait-big { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--abyss), 0 0 0 5px var(--lamp); }
.portraits:not([hidden]) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.portraits button:hover { opacity: 1; }

/* Sheet editor, Progression: what every level brings */
.progression { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.progression li { display: grid; grid-template-columns: 86px 1fr; gap: 14px; padding: 10px 14px; border-radius: 12px; background: var(--deep); border-left: 4px solid var(--kelp); }
.progression li.later { border-left-color: transparent; opacity: .62; }
.progression li.now { border-left-color: var(--lamp); background: var(--raise); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .5); }
.progression .plvl { display: grid; align-content: start; justify-items: center; line-height: 1.1; }
.progression .plvl b { font: 600 1.9rem/1 var(--tale); }
.progression li.now .plvl b, .progression li.now .plvl small { color: var(--lamp); }
.progression .plvl small { color: var(--fog); font-size: .82rem; }
.progression .what p { margin: 0 0 3px; }
.progression .what strong { margin-right: 8px; }
.progression .what em { font-style: normal; font-size: .8rem; color: #06201d; background: var(--kelp); border-radius: 99px; padding: 0 8px; margin-right: 8px; }
.progression .what span { color: var(--fog); }

/* Sheet editor: the seven ways of living */
#lifestyle-box { margin-top: 6px; }
#lifestyles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lifestyle { display: grid; align-content: start; gap: 5px; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--deep); box-shadow: inset 0 0 0 1px var(--line); line-height: 1.25; }
.lifestyle:hover { background: var(--raise); }
.lifestyle.on { background: var(--raise); box-shadow: inset 0 0 0 2px var(--lamp); }
.lifestyle .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lifestyle .head b { font: 600 1.15rem var(--tale); }
.lifestyle.on .head b { color: var(--lamp); }
.lifestyle .head small { color: var(--lamp); font-weight: 700; text-align: right; }
.lifestyle p { margin: 0; color: var(--bone); font-size: .95rem; }
.lifestyle ul { margin: 0; padding: 0; list-style: none; font-size: .88rem; display: grid; gap: 2px; }
.lifestyle li { padding-left: 16px; position: relative; color: var(--fog); }
.lifestyle .plus li::before { content: "+"; position: absolute; left: 2px; color: #9af0c0; font-weight: 800; }
.lifestyle .minus li::before { content: "−"; position: absolute; left: 2px; color: #ff9c85; font-weight: 800; }
.lifestyle .lasts { color: var(--fog); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 2px; }

/* The GM waits for an answer from a character outside its turn (a reaction) */
#your-turn.asked { background: rgba(9, 17, 21, .94); color: var(--lamp); box-shadow: 0 0 0 2px var(--lamp), 0 4px 18px rgba(0, 0, 0, .55); animation: call 2s ease-out infinite; }
#your-turn.asked img { box-shadow: 0 0 0 2px var(--lamp); }

/* Sheet editor: a portrait made for this character, then its figurine */
.portrait-ways { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.studio:not([hidden]) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.studio p { margin: 0; }
.studio-ask { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.studio-sex { display: grid; gap: 8px; padding-top: 4px; }
.studio-sex label { display: flex; align-items: center; gap: 8px; }
.studio textarea { width: 100%; resize: vertical; }
.studio-out:not([hidden]) { display: flex; gap: 18px; align-items: flex-end; }
#studio-face { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--abyss), 0 0 0 5px var(--lamp); }
#studio-body { height: 260px; border-radius: 12px; }
.studio-go { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#studio-status { color: var(--lamp); min-height: 1.4em; }
@media (max-width: 560px) { .studio-ask { grid-template-columns: 1fr; } .studio-sex { grid-auto-flow: column; justify-content: start; } #studio-face { width: 160px; height: 160px; } #studio-body { height: 190px; } }
.studio-tries:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; }
.studio-tries button { padding: 0; background: none; border-radius: 50%; opacity: .6; line-height: 0; }
.studio-tries button[aria-checked="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--lamp); }
.studio-tries button:hover:not(:disabled) { opacity: 1; }
.studio-tries img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; display: block; }
.studio-tries.bodies button, .studio-tries.bodies img { border-radius: 8px; }
.studio-tries.bodies img { width: 60px; height: 80px; }

/* Clear edges between the zones of the playing screen: the sheet, the map, the bar, and inside the bar the dice, the voice and the turn */
:root { --panel: #12222a; --edge: rgba(174, 187, 184, .34); }
#sheet { background: var(--panel); border: 1px solid var(--edge); border-left: 4px solid var(--kelp); }
body:not(.my-turn) #board { box-shadow: 0 0 0 1px var(--edge); }
@media (min-width: 1101px) {
  body.playing #talk, body.playing.has-sheet #talk { background: var(--panel); border: 1px solid var(--edge); }
  body.playing #tray:not([hidden]) { align-self: stretch; align-content: center; width: 211px; padding-right: 14px; border-right: 1px solid var(--edge); }
  body.playing #turn-box:not([hidden]) { align-self: stretch; align-content: center; padding-left: 14px; border-left: 1px solid var(--edge); }
}

/* A line the voice has not reached yet is not in the history */
#log li.pending { display: none; }

/* A spell with an area: its confirmation sits over the map above the bar, like an attack's, never under the order of the fight */
#aim { position: fixed; top: auto; left: 50%; bottom: calc(var(--talk, 150px) + 60px); transform: translateX(-50%); z-index: 30; width: max-content; max-width: min(620px, 94vw);
  gap: 14px; padding: 10px 12px 10px 20px; border-radius: 16px; background: rgba(9, 17, 21, .94); border: 0; box-shadow: 0 0 0 2px var(--lamp), 0 6px 22px rgba(0, 0, 0, .6); }
#aim b { font-size: 1.1rem; }
#aim #aim-ok { background: var(--lamp); color: #1a1408; padding: 12px 30px; border-radius: 12px; font-size: 1.3rem; font-weight: 800; line-height: 1; }
#aim #aim-ok:hover:not(:disabled) { background: #ffc85c; }
#aim #aim-cancel { background: none; color: var(--fog); padding: 10px 12px; }
body:has(#aim:not([hidden])) #voice:not(.top) { bottom: calc(var(--talk, 150px) + 152px) !important; }
@media (min-width: 1101px) { body.playing #aim { left: calc(50% - 170px); } body.playing.has-sheet #aim { left: calc(50% - 12px); } }
@media (max-width: 700px) { #aim { flex-wrap: wrap; justify-content: center; text-align: center; } }

/* A token is never a button with a face of its own: no dark square under the pointer (seen once the round picture is hidden by a figurine) */
#tokens .token, #tokens .token:hover:not(:disabled), #tokens .token:active { background: none; }

/* Effects of blows and spells, drawn over the tokens and the figurines (web/fx.js) */
#fx { pointer-events: none; z-index: 7; }

/* ---- the map of the world: a painted region, lit only where the party knows it (web/world.js) ---- */
#world { position: fixed; inset: 0; z-index: 18; display: grid; grid-template-rows: auto 1fr; background: #070d10; }
#world > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px 10px; border-bottom: 1px solid var(--line); }
#world-name { font-size: 1.7rem; line-height: 1.1; }
#world-where { margin: 2px 0 0; color: var(--lamp); font: 400 1.05rem/1.2 var(--tale); min-height: 1.2em; }
#world-body { display: grid; grid-template-columns: 1fr min(330px, 30vw); min-height: 0; }
#world-stage { display: grid; place-items: center; padding: 14px; min-width: 0; min-height: 0; container-type: size; }
#world-frame { position: relative; width: min(100cqw, 100cqh * var(--wide, 1.5)); max-height: 100%; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(239, 232, 216, .18), 0 18px 60px rgba(0, 0, 0, .7); background: #05090b; }
#world-fog { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; filter: grayscale(.85) brightness(.3) contrast(.9) blur(5px); transform: scale(1.03); }
#world-art { position: absolute; inset: 0; width: 100%; height: 100%; }
#world-art .road-bed { fill: none; stroke: rgba(7, 13, 16, .6); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
#world-art .road { fill: none; stroke: var(--bone); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 9 8; }
#world-art .road.sentier { stroke-width: 2.4; stroke-dasharray: 2 7; }
#world-art .road.mer { stroke: #9fd0d8; stroke-dasharray: 14 9 3 9; }
#world-art .road.taken { stroke: var(--lamp); stroke-width: 3.6; }
#world-art .off { opacity: .22; }
#world-pins { position: absolute; inset: 0; }
.world-pin { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; padding: 4px; background: none; border-radius: 6px; }
.world-pin:hover:not(:disabled) { background: none; }
.world-pin i { width: 15px; height: 15px; border-radius: 50%; background: var(--bone); border: 3px solid #101c22; box-shadow: 0 0 0 1.5px var(--bone), 0 2px 8px rgba(0, 0, 0, .8); }
.world-pin.ville i, .world-pin.port i { width: 19px; height: 19px; border-radius: 4px; }
.world-pin.ruine i, .world-pin.danger i { border-radius: 2px; transform: rotate(45deg); background: #c9b9a0; }
.world-pin.phare i { background: var(--lamp); box-shadow: 0 0 0 1.5px var(--bone), 0 0 16px 4px rgba(242, 181, 68, .6); }
.world-pin span { position: absolute; top: 100%; white-space: nowrap; font: 600 1.02rem/1 var(--tale); color: var(--bone); text-shadow: 0 0 4px #000, 0 0 9px #000, 0 1px 2px #000; }
.world-pin.here span, .world-pin.picked span { color: var(--lamp); }
.world-pin.picked i { box-shadow: 0 0 0 2px var(--lamp), 0 0 0 6px rgba(242, 181, 68, .25); }
.world-pin.off { opacity: .28; }
.world-days { position: absolute; transform: translate(-50%, -50%); padding: 1px 7px 2px; border-radius: 9px; background: rgba(7, 13, 16, .78); color: var(--fog); font-size: .82rem; white-space: nowrap; pointer-events: none; }
.world-days.off { opacity: .25; }
.world-party { position: absolute; width: 26px; height: 26px; margin: -34px 0 0 -13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--lamp); border: 3px solid #17242a; box-shadow: 0 0 0 2px var(--lamp), 0 6px 14px rgba(0, 0, 0, .7); pointer-events: none;
  transition: left 2.4s ease-in-out, top 2.4s ease-in-out; }
.world-party::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #17242a; }
#world-side { padding: 16px 18px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--deep); display: flex; flex-direction: column; gap: 10px; }
#world-side h3 { margin: 0; }
#world-side p { margin: 0; }
#world-side ul { margin: 4px 0 0; padding-left: 18px; }
.world-place { padding: 12px 14px; border-radius: 10px; background: var(--raise); border-left: 3px solid var(--lamp); margin-bottom: 8px; }
.world-place h3 { font-size: 1.3rem; }
.world-card { text-align: left; display: grid; gap: 3px; padding: 10px 12px; background: #e9dfc6; color: #2a2318; border-radius: 3px 10px 4px 9px; box-shadow: 0 2px 0 #b9ab8a; }
.world-card:hover:not(:disabled) { background: #f4ecd8; }
.world-card b { font: 600 1.12rem/1.15 var(--tale); }
.world-card small { color: #5c5140; }
.world-card p { margin: 4px 0 0; font: italic 400 1rem/1.3 var(--tale); }
.world-card.on { outline: 2px solid var(--lamp); outline-offset: 2px; }
body.world-open #topbar { z-index: 19; }
body.world-open #topbar #open-world { background: var(--bone); color: #17242a; font-weight: 800; }
@media (max-width: 820px) { #world-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } #world-side { border-left: 0; border-top: 1px solid var(--line); max-height: 34vh; } }
@media (prefers-reduced-motion: reduce) { .world-party { transition: none; } }

/* ---- the other actions of a fight: a list that opens above the bar ---- */
#turn-box { position: relative; }
#turn-box .more-open { background: none; box-shadow: inset 0 0 0 1px var(--line); padding: 5px 12px; font-size: .92rem; }
#turn-box .more-open.on { box-shadow: inset 0 0 0 2px var(--lamp); color: var(--lamp); }
#basics { position: absolute; right: 0; bottom: calc(100% + 14px); z-index: 40; width: min(600px, 94vw); display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; padding: 8px; text-align: left;
  background: var(--deep); border-radius: 12px; box-shadow: 0 0 0 1px var(--lamp), 0 18px 50px rgba(0, 0, 0, .7); }
#basics button { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; text-align: left; padding: 7px 10px; background: none; border-radius: 8px; }
#basics button:hover:not(:disabled) { background: var(--raise); }
#basics button b { font-size: 1.02rem; }
#basics button span { grid-column: 1 / -1; color: var(--fog); font-size: .86rem; line-height: 1.2; }
#basics .cost { padding: 1px 8px 2px; border-radius: 9px; font: 700 .72rem/1.3 var(--ui); color: #10191d; background: #f2b544; }
#basics .cost.bonus { background: #f08a4b; }

/* ---- an object one uses: its button next to its name ---- */
#sheet .item-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
#sheet .item-row .item-open { flex: 1; min-width: 0; border-top: 0; text-align: left; }
#sheet .item-use { flex: none; padding: 2px 11px 3px; border-radius: 9px; font: 700 .8rem/1.3 var(--ui); color: #10191d; background: #f2b544; }
#sheet .item-use.bonus { background: #f08a4b; }
#sheet .item-use:hover:not(:disabled) { background: #fff; }
#sheet .item-use:disabled { background: var(--raise); color: var(--fog); }

/* ---- between fights: rests; at zero: the death save ---- */
#sheet .rest-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
#sheet .rest-row .ico { width: 18px; height: 18px; background: none; opacity: .7; }
#sheet .rest-row button { padding: 3px 10px 4px; font-size: .86rem; background: none; box-shadow: inset 0 0 0 1px var(--line); }
#sheet .rest-row button:hover { background: var(--raise); }
#sheet .dying { display: grid; gap: 6px; justify-items: stretch; text-align: center; margin: 8px 0; padding: 10px; border-radius: 10px; box-shadow: inset 0 0 0 2px var(--rust); }
#sheet .dying b { color: #ff9c85; }

/* ---- the games to take up, as cards on the start panel ---- */
#campaign-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; margin-top: 6px; max-height: 44vh; overflow: hidden auto; padding: 3px; }
.camp-card { display: grid; gap: 3px; align-content: start; text-align: left; padding: 12px 14px; background: var(--deep); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.camp-card:hover:not(:disabled) { background: var(--raise); }
.camp-card.on { box-shadow: inset 0 0 0 2px var(--lamp); background: var(--raise); }
.camp-card > b { font: 600 1.2rem/1.2 var(--tale); }
.camp-card.on > b { color: var(--lamp); }
.camp-card > small { color: var(--fog); line-height: 1.25; }
.camp-card > small:nth-of-type(2) { color: var(--bone); }
/* The adventures one can play, as cards: a picture that gives nothing away, a hook, how long, for whom */
#adventure-list { display: grid; gap: 12px; margin-top: 6px; padding: 3px; }
.adv-card { display: grid; grid-template-columns: minmax(150px, 36%) 1fr; text-align: left; padding: 0; overflow: hidden; background: var(--deep); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.adv-card:hover:not(:disabled) { background: var(--raise); }
.adv-card.on { box-shadow: 0 0 0 2px var(--lamp); background: var(--raise); }
.adv-card:disabled { opacity: .42; }
.adv-card img { display: block; width: 100%; height: 100%; min-height: 150px; object-fit: cover; background: var(--abyss); }
@media (max-width: 560px) { .adv-card { grid-template-columns: 1fr; } .adv-card img { height: auto; min-height: 0; aspect-ratio: 16 / 8; } }
.adv-card .adv-text { display: grid; gap: 6px; align-content: start; padding: 12px 15px 14px; }
.adv-card b { font: 600 1.3rem/1.15 var(--tale); }
.adv-card.on b { color: var(--lamp); }
.adv-card em { font: italic 400 1.05rem/1.3 var(--tale); color: var(--bone); }
.adv-card small { color: var(--fog); line-height: 1.4; font-size: .9rem; }
.adv-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); color: var(--bone); font-size: .9rem; }
.adv-facts span { white-space: nowrap; }
.adv-facts span.mood { color: var(--fog); }
.camp-cast { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 7px; padding-top: 8px; border-top: 1px solid var(--line); }
.camp-who { display: flex; align-items: center; gap: 7px; }
.camp-who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px var(--line); }
.camp-who span { display: grid; line-height: 1.1; }
.camp-who small { color: var(--fog); font-size: .78rem; }

/* ---- the figurine of the chosen portrait, on the sheet (web/figview.js) ---- */
#fig-view { margin: 0; display: grid; justify-items: center; gap: 2px; }
#fig-view canvas { width: 150px; height: 200px; display: block; border-radius: 12px; background: radial-gradient(ellipse at 50% 85%, rgba(242, 181, 68, .16), transparent 65%), var(--abyss); box-shadow: inset 0 0 0 1px var(--line); }
#fig-view figcaption { color: var(--fog); font-size: .82rem; }

/* ---- the assistant that helps write a character's story ---- */
.story-open { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 0; }
.story { margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--deep); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; }
#story-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
#story-log li { max-width: 62ch; padding: 9px 13px; border-radius: 12px; }
#story-log li p { margin: 0; }
#story-log li.assistant { background: var(--raise); border-top-left-radius: 3px; justify-self: start; font: 400 1.05rem/1.4 var(--tale); }
#story-log li.joueur { background: #2c4a40; border-top-right-radius: 3px; justify-self: end; }
#story-log blockquote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--lamp); background: var(--abyss); border-radius: 0 8px 8px 0; font: 400 1.05rem/1.5 var(--tale); white-space: pre-wrap; }
#story-picks { display: flex; flex-wrap: wrap; gap: 6px; }
#story-picks button:not(.quiet) { text-align: left; background: none; box-shadow: inset 0 0 0 1px var(--kelp); border-radius: 14px; padding: 5px 12px; font-size: .95rem; }
#story-picks button:not(.quiet):hover { background: #2c4a40; }
.story-say { display: flex; gap: 8px; }
.story-say input { flex: 1; }
#story-status { margin: 0; min-height: 1.2em; }

/* ---- erasing a saved game: a quiet button in the corner of its card ---- */
.camp-slot { position: relative; display: grid; }
.camp-slot .camp-card { padding-right: 84px; }
.camp-erase { position: absolute; top: 9px; right: 10px; z-index: 1; padding: 2px 10px 3px; font-size: .8rem; background: none; color: var(--fog); box-shadow: inset 0 0 0 1px var(--line); }
.camp-erase:hover { color: #ff9c85; background: var(--abyss); box-shadow: inset 0 0 0 1px var(--rust); }

/* ---- with figurines, a name shows only when its token is pointed at, touched or aimed: otherwise it hides the figurine behind it ---- */
body.figs #tokens .token .name { opacity: 0; transition: opacity .15s; pointer-events: none; padding: 1px 7px 2px; border-radius: 8px; background: rgba(7, 13, 16, .82); z-index: 3; }
body.figs #tokens .token:hover .name, body.figs #tokens .token:focus-visible .name, body.figs #tokens .token:active .name, body.figs #tokens .token.target .name { opacity: 1; }

/* ---- what a character can do with its bonus action or its reaction: opened from the mark itself ---- */
#eco-menu { position: absolute; right: 0; bottom: calc(100% + 14px); z-index: 40; width: min(460px, 94vw); max-height: min(60vh, 520px); overflow-y: auto; display: grid; gap: 2px; padding: 8px; text-align: left;
  background: var(--deep); border-radius: 12px; box-shadow: 0 0 0 1px var(--lamp), 0 18px 50px rgba(0, 0, 0, .7); }
#eco-menu .eco-title { margin: 2px 10px 6px; color: var(--fog); font-size: .9rem; }
#eco-menu button { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; text-align: left; padding: 7px 10px; background: none; border-radius: 8px; }
#eco-menu button:hover:not(:disabled) { background: var(--raise); }
#eco-menu button b { font-size: 1.02rem; }
#eco-menu button span { grid-column: 1 / -1; color: var(--fog); font-size: .86rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#eco-menu .cost { padding: 1px 8px 2px; border-radius: 9px; font: 700 .72rem/1.3 var(--ui); color: #10191d; background: #f08a4b; }
#eco-menu .cost.reaction { background: #8fc7d8; }
#eco-menu .eco-fix { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
#eco-menu .eco-fix b { font-size: .92rem; font-weight: 600; color: var(--fog); }

/* ---- temporary hit points: a pale blue number beside the hit points, a pale blue edge on the bars ---- */
.vital .temp-hp { margin-left: 8px; font-size: 1.05rem; font-weight: 800; color: #9fd8ee; }
.vital .temp-set { display: block; padding: 0; background: none; box-shadow: none; color: var(--fog); font: inherit; font-size: .8rem; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.vital .temp-set:hover { color: #9fd8ee; }
.vital .bar.warded { box-shadow: 0 0 0 1.5px #9fd8ee; }
.token.warded .hp { box-shadow: 0 0 0 1.5px #9fd8ee; }

/* ---- choosing new spells at a level: each one says what it does ---- */
#levelup .spell-picks { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); max-height: min(52vh, 520px); }
#levelup .spell-pick { align-items: flex-start; padding: 8px 10px; }
#levelup .spell-pick .spell-what { margin-top: 3px; font-style: normal; font-size: .84rem; line-height: 1.3; color: var(--fog); white-space: normal; }
#levelup .spell-pick[aria-pressed="true"] .spell-what { color: var(--ink, inherit); }
#levelup .spell-pick .spell-what.stats { font-size: .78rem; opacity: .8; }

/* ---- « Capacités » on the bar: maneuvers and features to trigger ---- */
#eco-menu.feats { width: min(560px, 94vw); max-height: min(66vh, 620px); }
#eco-menu .eco-title.sup { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: inherit; }
#eco-menu .eco-title.sup b { flex: 1 1 auto; color: #f2b544; }
#eco-menu .sup-back { display: inline-block; padding: 2px 10px 3px; font-size: .8rem; box-shadow: inset 0 0 0 1px var(--line); border-radius: 9px; }
#eco-menu .cost.free { background: #b9c6c9; }
#eco-menu .cost.action { background: #f2b544; }
#eco-menu button.known { box-shadow: inset 0 0 0 1.5px var(--lamp); }
#eco-menu.feats button span { -webkit-line-clamp: 4; }

/* ---- spells still to choose: a call on the sheet, and the list with what each spell does ---- */
#sheet .spells-owed { display: block; width: 100%; margin: 8px 0 4px; padding: 8px 12px; text-align: left; font-weight: 700; color: #10191d; background: var(--lamp); border-radius: 8px; }
#sheet .spells-owed::after { content: "  ›"; }
#spellpick { width: min(1080px, 96vw); max-height: 92vh; padding: 18px 20px; border: 0; border-radius: 14px; background: var(--abyss); color: inherit; box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0, 0, 0, .7); }
#spellpick::backdrop { background: rgba(4, 10, 13, .72); }
#spellpick header, #spellpick footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#spellpick h2 { margin: 0; }
#spellpick footer { margin-top: 12px; }
#spellpick input[type=search] { width: 100%; margin: 8px 0; }
#spellpick .spell-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px; max-height: min(58vh, 620px); overflow-y: auto; padding: 2px; }
#spellpick .spell-pick { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 8px 10px; }
#spellpick .spell-pick span { display: grid; line-height: 1.15; min-width: 0; }
#spellpick .spell-pick small { color: var(--fog); font-size: .8rem; }
#spellpick .spell-pick .spell-what { margin-top: 3px; font-style: normal; font-size: .84rem; line-height: 1.3; color: var(--fog); white-space: normal; }
#spellpick .spell-pick .spell-what.stats { font-size: .78rem; opacity: .8; }
#spellpick .spell-pick[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--lamp); background: var(--deep); }

/* ---- inventory on the sheet: an icon for each kind of object, a filter by kind, a mark "to sell" ---- */
#sheet .item-row .ico { width: 26px; height: 26px; }
#sheet .item-row .ico svg { width: 17px; height: 17px; }
.ico.armor, .ico.shield { color: #b9c6c9; } .ico.potion { color: #ff8fa8; } .ico.key, .ico.gem { color: #f2b544; } .ico.scroll { color: #e9dcc0; }
.ico.rope, .ico.pack, .ico.cloth, .ico.tool { color: #c9a57a; } .ico.food { color: #b6e04a; } .ico.quiver { color: #e9e2d0; } .ico.wand { color: #c8a8ff; }
#sheet .bag-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
#sheet .bag-chip { padding: 2px 10px 3px; font-size: .82rem; border-radius: 11px; background: var(--deep); color: var(--fog); }
#sheet .bag-chip.on { background: var(--lamp); color: #10191d; font-weight: 700; }
#sheet .item-sell { flex: none; padding: 2px; background: none; border-radius: 50%; opacity: .45; }
#sheet .item-sell .ico { background: none; color: var(--fog); }
#sheet .item-sell:hover { opacity: 1; }
#sheet .item-sell.on { opacity: 1; }
#sheet .item-sell.on .ico { background: #f2b544; color: #10191d; }
#sheet .item-row.selling .item-open span:last-child { color: #f2b544; }
#sheet .bag-sell { display: block; width: 100%; margin: 8px 0 2px; padding: 6px 12px; font-weight: 700; color: #10191d; background: #f2b544; border-radius: 8px; }

/* ---- on the sheet, each spell says what it does under its name ---- */
#sheet .spellbook .act .spell-fx { display: block; margin-top: 2px; font-size: .8rem; line-height: 1.25; color: var(--fog); white-space: normal; text-align: left; }

/* ---- the card of a token: the button that aims at it ---- */
#look #look-aim { margin-right: 8px; }

/* ---- a description beside the thing the pointer is on ---- */
#tip { position: fixed; z-index: 90; width: min(340px, 86vw); padding: 10px 13px 11px; border-radius: 10px; background: var(--deep); box-shadow: 0 0 0 1px var(--lamp), 0 14px 40px rgba(0, 0, 0, .7); pointer-events: none; }
#tip b { display: block; margin-bottom: 4px; font-size: 1.02rem; }
#tip p { margin: 0; font-size: .92rem; line-height: 1.35; }
#tip small { display: block; margin-top: 6px; color: var(--fog); font-size: .8rem; line-height: 1.3; }

/* ---- the big sheet: spells to choose, what each spell does, inventory with icons, filters, sorting and the mark "to sell" ---- */
#sheet-form .spells-owed { display: block; width: 100%; margin: 10px 0 6px; padding: 9px 13px; text-align: left; font-weight: 700; color: #10191d; background: var(--lamp); border-radius: 8px; }
#sheet-form .spells-owed::after { content: "  ›"; }
#sheet-form .item .ico { width: 28px; height: 28px; }
#sheet-form .item .ico svg { width: 18px; height: 18px; }
#sheet-form .item .spell-fx { display: block; margin-top: 2px; color: var(--fog); font-size: .84rem; line-height: 1.3; white-space: normal; }
#sheet-form .item[hidden] { display: none; }
#sheet-form .item.selling .item-name strong { color: #f2b544; }
#sheet-form .item-sell { flex: none; padding: 2px; background: none; border-radius: 50%; opacity: .5; }
#sheet-form .item-sell .ico { background: none; color: var(--fog); }
#sheet-form .item-sell:hover, #sheet-form .item-sell.on { opacity: 1; }
#sheet-form .item-sell.on .ico { background: #f2b544; color: #10191d; }
#gear-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 8px 0; }
#gear-bar[hidden] { display: none; }
#gear-bar .bag-chips { display: flex; flex-wrap: wrap; gap: 5px; }
#gear-bar .bag-chip { padding: 3px 11px 4px; font-size: .86rem; border-radius: 11px; background: var(--deep); color: var(--fog); }
#gear-bar .bag-chip.on { background: var(--lamp); color: #10191d; font-weight: 700; }
#gear-bar .gear-sorts { display: flex; align-items: center; gap: 6px; color: var(--fog); }
#gear-bar .gear-sort { padding: 3px 10px 4px; font-size: .84rem; border-radius: 9px; background: none; box-shadow: inset 0 0 0 1px var(--line); }
#items .item { grid-template-columns: auto 1fr 76px auto auto; }
#spells .item.spell { grid-template-columns: auto 1fr auto; align-items: start; }

/* ---- what the character wears and holds: five places, each chosen from the bag; trained or not is said on every piece ---- */
#sheet h2.sec .worn-ac { margin-left: auto; padding: 1px 9px 2px; border-radius: 9px; background: var(--deep); color: var(--bone); font: 700 .8rem/1.3 var(--ui); }
#sheet .worn { display: grid; gap: 4px; margin: 4px 0 8px; }
#sheet .worn-slot { display: grid; grid-template-columns: 88px auto 1fr auto; gap: 8px; align-items: center; padding: 6px 9px; text-align: left; background: var(--deep); border-radius: 8px; }
#sheet .worn-slot small:first-child { color: var(--fog); font-size: .78rem; }
#sheet .worn-slot b { font-size: .98rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet .worn-slot:not(.full) b { color: var(--fog); font-weight: 400; }
#sheet .worn-slot.on { box-shadow: inset 0 0 0 1.5px var(--lamp); }
#sheet .trained { flex: none; margin-left: 6px; padding: 0 7px 1px; border-radius: 8px; font: 700 .7rem/1.4 var(--ui); white-space: nowrap; }
#sheet .trained.yes { background: rgba(111, 210, 156, .16); color: #7fe0aa; }
#sheet .trained.no { background: rgba(255, 120, 95, .18); color: #ff9c85; }
#sheet .worn-tag { color: var(--lamp); font-size: .78rem; }
#sheet .worn-choices { display: grid; gap: 3px; margin: -2px 0 10px; padding: 8px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--lamp); }
#sheet .worn-choices > small { color: var(--fog); }
#sheet .worn-pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; text-align: left; background: none; border-radius: 6px; }
#sheet .worn-pick:hover { background: var(--deep); }
#sheet .worn-pick b { flex: 1; min-width: 0; }
#sheet .worn-pick.off b { color: var(--fog); font-weight: 600; }
#sheet .worn-pick small:last-child:not(.trained) { color: var(--fog); font-size: .76rem; }
#sheet .worn-notes { margin: 0 0 10px; padding-left: 18px; color: #ffb9a6; font-size: .84rem; line-height: 1.3; }
#sheet .worn-hint { margin: 0 0 6px; }
#sheet .worn-slot { grid-template-columns: 78px auto 1fr; row-gap: 1px; }
#sheet .worn-slot .trained { grid-column: 3; justify-self: start; margin-left: 0; }
#sheet .worn-slot b { white-space: normal; }

/* ---- a sheet by the rules: what is added by hand is the GM's, numbers that the rules give are read, not typed ---- */
.gm-only { display: none !important; }
#sheet-form.by-rules input[readonly], #sheet-form.by-rules textarea[readonly], #sheet-form.by-rules select:disabled { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--bone); cursor: default; opacity: 1; }
#sheet-form.by-rules input[readonly]:focus { outline: none; }
#edit-lock { margin: 6px 0 2px; }

/* ---- the window where a place on the body is filled: a card per piece, with its picture and its numbers ---- */
#equip { width: min(980px, 96vw); max-height: 92vh; padding: 20px 22px; border: 0; border-radius: 14px; background: var(--abyss); color: inherit; box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0, 0, 0, .7); }
#equip::backdrop { background: rgba(4, 10, 13, .74); }
#equip header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
#equip h2 { margin: 0; }
#equip .equip-sub { margin: 14px 0 8px; color: var(--fog); font-size: .9rem; }
#equip .equip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
#equip .equip-card { display: grid; grid-template-rows: auto 1fr; border-radius: 12px; overflow: hidden; background: var(--deep); box-shadow: inset 0 0 0 1px var(--line); }
#equip .equip-card.worn { box-shadow: inset 0 0 0 2px var(--lamp); }
#equip .equip-art { margin: 0; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 40%, #223a43, #0f1c22); display: grid; place-items: center; }
#equip .equip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#equip .equip-art.drawn .ico { width: 84px; height: 84px; background: none; }
#equip .equip-art.drawn .ico svg { width: 60px; height: 60px; stroke-width: 1.4; }
#equip .equip-text { display: grid; gap: 8px; align-content: start; padding: 12px 14px 14px; }
#equip h3 { margin: 0; font-size: 1.2rem; line-height: 1.15; }
#equip .trained { margin-left: 8px; padding: 0 8px 1px; border-radius: 8px; font: 700 .72rem/1.5 var(--ui); white-space: nowrap; vertical-align: middle; }
#equip .trained.yes { background: rgba(111, 210, 156, .16); color: #7fe0aa; }
#equip .trained.no { background: rgba(255, 120, 95, .18); color: #ff9c85; }
#equip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .92rem; }
#equip dt { color: var(--fog); }
#equip dd { margin: 0; font-weight: 600; }
#equip .equip-gain { margin: 0; font-size: .88rem; font-weight: 700; }
#equip .equip-gain.up { color: #7fe0aa; }
#equip .equip-gain.down { color: #ff9c85; font-weight: 600; }
#equip .equip-card button { justify-self: start; margin-top: 2px; }

/* ---- big sheet: where each piece is worn, trained or not ---- */
#items .item { grid-template-columns: auto 1fr auto 76px auto auto; }
#items .item-where { display: flex; align-items: center; gap: 6px; }
#items .item-where select { padding: 3px 6px; font-size: .82rem; max-width: 150px; }
#items .trained { padding: 0 7px 1px; border-radius: 8px; font: 700 .7rem/1.4 var(--ui); white-space: nowrap; }
#items .trained.yes { background: rgba(111, 210, 156, .16); color: #7fe0aa; }
#items .trained.no { background: rgba(255, 120, 95, .18); color: #ff9c85; }
@media (max-width: 700px) { #items .item { grid-template-columns: auto 1fr 60px auto auto; } #items .item-where { grid-column: 2 / -1; grid-row: 2; } }

/* ---- equipment window: what a piece gains or loses against the one in place ---- */
#equip .equip-delta { font-weight: 700; font-size: .86em; white-space: nowrap; }
#equip .equip-delta.up { color: #7fe0aa; }
#equip .equip-delta.down { color: #ff9c85; }

/* ---- what a creature carries shows on its token too (flat tokens; the figurines do the same in relief) ---- */
.token.faint .face { opacity: .32; }
.token.stone .face { filter: grayscale(1) contrast(1.15) brightness(.9); }
.token.spent .face { filter: saturate(.45) brightness(.72); }
.token.blind .face { filter: brightness(.8); }

/* ---- « Ce que je porte »: each place is plainly a button (edge, chevron, lit on hover); an empty place invites to choose ---- */
#sheet .worn-slot { position: relative; padding-right: 26px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .12s, background .12s; }
#sheet .worn-slot:hover, #sheet .worn-slot:focus-visible { box-shadow: inset 0 0 0 1.5px var(--lamp); }
#sheet .worn-slot .worn-go { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--lamp); font-size: 1.15rem; line-height: 1; }
#sheet .worn-slot:not(.full) b { color: var(--lamp); font-weight: 600; }
#sheet .worn-slot:not(.full) .ico.none { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--lamp); background: none; display: grid; place-items: center; }
#sheet .worn-slot:not(.full) .ico.none::before { content: "+"; color: var(--lamp); font: 700 .9rem/1 var(--ui); }

/* ---- play sheet in four panes: the bar stays in view while the pane scrolls ---- */
#sheet .sheet-panes { position: sticky; top: -1px; z-index: 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 8px -4px 6px; padding: 5px 4px; background: var(--deep); box-shadow: 0 8px 10px -8px #000; }
#sheet .sheet-panes button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 2px 5px; border-radius: 8px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); color: var(--fog); font-size: .78rem; font-weight: 600; }
#sheet .sheet-panes button .ico { background: none; width: 18px; height: 18px; color: inherit; }
#sheet .sheet-panes button small { position: absolute; top: 3px; right: 5px; font-size: .66rem; color: var(--fog); font-weight: 400; }
#sheet .sheet-panes button:hover { color: var(--bone); box-shadow: inset 0 0 0 1px var(--fog); }
#sheet .sheet-panes button.on { background: var(--lamp); color: #17242a; box-shadow: none; }
#sheet .sheet-panes button.on small { color: #17242a; }
#sheet .sheet-panes .dot { position: absolute; top: 4px; left: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp); }
#sheet .sheet-panes button.on .dot { background: #17242a; }
#sheet .pane[hidden] { display: none; }
#sheet .spell-levels { margin: 6px 0 2px; }
/* a line of the sheet that throws something answers the pointer like a button */
#sheet .act { border-radius: 6px; padding-left: 4px; padding-right: 4px; transition: background .1s; }
#sheet .act:hover:not(:disabled), #sheet .act:focus-visible { background: rgba(242, 181, 68, .09); }

/* ---- the play sheet hangs from the top: it grows downwards, its head never moves when a pane or a section changes ---- */
@media (min-width: 1101px) { #sheet { top: 66px; bottom: auto; max-height: calc(100vh - 78px); } }
/* the room of the scroll bar is always kept, so the sheet has one width whether its pane scrolls or not; the bar itself is thin and quiet */
#sheet { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(214, 228, 232, .28) transparent; }

/* ---- equipment cards: the edge is drawn over the picture too, so the top of a card never melts into the window ---- */
#equip .equip-card { position: relative; box-shadow: none; }
#equip .equip-card::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(214, 228, 232, .22); pointer-events: none; }
#equip .equip-card.worn { box-shadow: none; }
#equip .equip-card.worn::after { box-shadow: inset 0 0 0 2px var(--lamp); }

/* ---- demonstration pages (?demo=...): the map alone, as large as the screen allows ---- */
body.demo #start-panel, body.demo #closing, body.demo #sheet, body.demo #talk, body.demo #voice, body.demo #thinking, body.demo #act-dock { display: none !important; }
body.demo #tokens .token .hp { display: none; }
body.demo #tokens .token .conds { font-size: .82rem; padding: 2px 9px 3px; }

#demo-label { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 9; margin: 0; padding: 6px 18px 8px; border-radius: 99px; background: rgba(7, 13, 16, .82); color: var(--bone); font: 600 1.25rem/1.2 var(--tale); pointer-events: none; }

/* ---- a body left on the map: drained of colour, under the living, still there to be aimed at ---- */
#tokens .token.dead { z-index: 0; }
#tokens .token.dead .face { filter: grayscale(1) brightness(.5) contrast(1.1); transform: rotate(90deg) scale(.82); box-shadow: 0 0 0 2px #3a4248; }
#tokens .token.dead .hp { display: none; }
#tokens .token.dead .conds { background: #2a3036; color: #c9d2d8; }
#look-body { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
#look-body[hidden] { display: none; }
#look-body button { flex: 1 1 40%; }
#look.body #look-img { filter: grayscale(1) brightness(.72) contrast(1.05); }

/* ---- demonstration of the effects: a button per effect under the map ---- */
#demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 10px 14px 12px; background: rgba(7, 13, 16, .92); box-shadow: 0 -10px 18px -10px #000; }
#demo-bar button { padding: 7px 12px; font-size: .9rem; }

/* a token walking its way square by square (board.walk): its place is set at each frame, only its fading and turning still ease */
#tokens .token.walking { transition: opacity .8s ease, transform .8s ease; }

/* ---- Settings → Music: the pieces of each mood, on or off, and the table's own ---- */
#open-music { justify-self: start; margin-top: 4px; }
#music { width: min(880px, 96vw); max-height: 92vh; border: 1px solid var(--line); border-radius: 14px; background: var(--abyss); color: var(--bone); padding: 18px 20px 26px; overflow-y: auto; }
#music::backdrop { background: rgba(0, 0, 0, .6); }
#music > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: -18px; z-index: 2; background: var(--abyss); padding: 6px 0; }
#music h2 { margin: 0; font: 600 1.4rem/1.2 var(--tale); }
#music > p { margin: 6px 0; max-width: 70ch; }
#music-status:empty { display: none; }
#music-status { color: var(--lamp); }
.mtabs { display: flex; gap: 4px; margin: 10px 0 4px; border-bottom: 1px solid var(--line); }
.mtabs [role=tab] { flex: 1 1 0; min-height: 44px; background: none; border-radius: 8px 8px 0 0; color: var(--fog); font-size: 1.05rem; font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.mtabs [role=tab][aria-selected=true] { color: var(--bone); border-bottom-color: var(--lamp); background: var(--deep); }
.mtabs [role=tab]:hover { color: var(--bone); }
.mlead { margin: 8px 0 4px; max-width: 70ch; }
.mfamily { margin-top: 14px; }
.mfam { font: 700 .8rem/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--lamp); margin: 0 0 6px; }
.mcat { background: var(--deep); border-radius: 10px; margin-bottom: 6px; border: 1px solid transparent; }
.mcat[open] { border-color: var(--line); }
.mcat > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; min-height: 44px; border-radius: 10px; }
.mcat > summary::-webkit-details-marker { display: none; }
.mcat > summary::after { content: "▾"; grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--fog); transition: transform .15s; }
.mcat[open] > summary::after { transform: rotate(180deg); }
.mcat > summary:hover { background: var(--raise); }
.mcat > summary:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.mhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.mname { font: 600 1.1rem/1.2 var(--tale); }
.mcount { color: var(--fog); font-size: .85rem; white-space: nowrap; }
.mwhen { grid-column: 1; color: var(--fog); font-size: .92rem; }
.mbody { padding: 0 12px 12px; }
.mused { margin: 2px 0 10px; color: var(--fog); }
.mused b { color: var(--bone); font-weight: 600; }
.mcat .mpiece { background: var(--abyss); }
.mcat .mpiece.playing { background: var(--raise); }
.mpieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mpiece { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; padding: 8px 10px; background: var(--deep); border-radius: 10px; border-left: 4px solid transparent; }
.mpiece.on { border-left-color: var(--kelp); }
.mpiece:not(.on) .mwhat b, .mpiece:not(.on) .mplay { opacity: .65; }
.mpiece.broken { border-left-color: var(--rust); }
.mpiece.playing { background: var(--raise); }
.mplay { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 1.1rem; }
.mpiece.playing .mplay { background: var(--lamp); color: #17242a; }
.mwhat { display: grid; gap: 3px; min-width: 0; }
.mwhat b { font-size: 1.05rem; overflow-wrap: anywhere; }
.mwhat small { color: var(--fog); font-size: .85rem; }
.mwhat .merr { color: #ff9c85; }
.mtag { justify-self: start; padding: 0 8px 1px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); color: var(--fog); font-size: .75rem; }
.mtag.live { box-shadow: inset 0 0 0 1px var(--lamp); color: var(--lamp); }
.mwhat b + .mtag { margin-top: -1px; }
.mnote { font-size: .9rem; padding: 5px 8px; }
.mnote.kept { border-color: rgba(75, 154, 127, .7); }
.mswitch { display: flex; gap: 6px; align-items: center; color: var(--fog); cursor: pointer; white-space: nowrap; font-size: .92rem; }
.mswitch input { width: 22px; height: 22px; accent-color: var(--kelp); margin: 0; }
.mswitch:has(input:disabled) { cursor: default; }
.mdel { padding: 6px 8px; font-size: .9rem; min-height: 40px; }
.mswitch { min-height: 40px; }
.madd-open { margin-top: 8px; min-height: 40px; }
.madd { display: grid; gap: 8px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.madd .mkind { display: flex; gap: 18px; flex-wrap: wrap; }
.madd .row { display: flex; gap: 8px; flex-wrap: wrap; }
.madd .mhint, .madd .mstatus { margin: 0; }
.madd .mhint:not(.warn) { color: var(--fog); }
.yt-bed { position: fixed; left: -10000px; top: 0; width: 220px; height: 124px; overflow: hidden; pointer-events: none; }
@media (max-width: 640px) {
  #music { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; padding: 12px 14px 24px; }
  #music > header { top: -12px; }
  .mpiece { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .mpiece .mwhat { grid-column: 2; grid-row: 1; }
  .mpiece .mswitch { grid-column: 3; grid-row: 1; }
  .mpiece .mdel { grid-column: 2 / -1; grid-row: 2; justify-self: end; }
  .mbody { padding: 0 8px 10px; }
  .mcat .mpiece { padding: 8px; gap: 6px 8px; }
}

/* The light a character holds up (server: lamp and tient): a torch at its side, or a lantern hanging from its hand. The map's light is
   centred on this flame (board.flameAt); a figurine holds its own in 3D (web/figs.js), so the round token's one is hidden then. */
.token .torch { position: absolute; right: -24%; bottom: 14%; width: 30%; height: 84%; pointer-events: none; rotate: 16deg; transform-origin: 50% 100%; z-index: 1; }
body.figs #tokens .token .torch { display: none; }
.token.prone .torch { rotate: 78deg; }
.token .torch .stick { position: absolute; left: 50%; bottom: 0; width: 28%; height: 72%; translate: -50% 0; border-radius: 2px;
  background: linear-gradient(90deg, #3d2614, #8a5a30 45%, #4a2e17); box-shadow: 0 0 0 1px rgba(10, 6, 3, .75), 0 2px 4px rgba(0, 0, 0, .6); }
.token .torch .stick::before { content: ""; position: absolute; left: -40%; right: -40%; top: -4%; height: 20%; border-radius: 3px;
  background: linear-gradient(180deg, #4a2a14, #1e140c); box-shadow: 0 0 0 1px rgba(10, 6, 3, .8), 0 0 6px 2px rgba(255, 120, 40, .55); }
.token .torch .fire { position: absolute; left: 50%; bottom: 66%; width: 96%; aspect-ratio: 3 / 4.4; translate: -50% 0; transform-origin: 50% 85%;
  border-radius: 50% 50% 50% 50% / 72% 72% 28% 28%; background: radial-gradient(ellipse at 50% 72%, #fffbe6 0 14%, #ffd36a 30%, #ff8a22 55%, #d8401a 78%, rgba(216, 64, 26, .2) 100%);
  box-shadow: 0 0 10px 3px rgba(255, 150, 50, .75), 0 0 26px 10px rgba(255, 120, 40, .35); animation: torch-flicker 1.1s ease-in-out infinite; }
.token .torch .fire::after { content: ""; position: absolute; inset: -160%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 200, 120, .45), rgba(255, 140, 50, .12) 45%, rgba(255, 120, 40, 0) 70%); animation: torch-glow 1.7s ease-in-out infinite; }
.token .torch.lantern { right: -20%; bottom: 0; width: 30%; height: 62%; rotate: 0deg; transform-origin: 50% 0; }
.token .torch.lantern .stick { width: 64%; height: 30%; bottom: auto; top: 0; background: none; border: 2px solid #2e261c; border-bottom: 0; border-radius: 50% 50% 0 0; box-shadow: none; }
.token .torch.lantern .stick::before { display: none; }
.token .torch.lantern .fire { bottom: 6%; width: 100%; aspect-ratio: auto; height: 60%; rotate: 0deg; border-radius: 4px 4px 6px 6px;
  background: radial-gradient(ellipse at 50% 62%, #fffbe6 0 12%, #ffd36a 30%, #f0a040 62%, #8a5a20 100%); border: 2px solid #2e261c; border-top-width: 4px;
  box-shadow: 0 0 10px 4px rgba(255, 170, 70, .65), 0 0 24px 8px rgba(255, 140, 50, .3); animation: lantern-flicker 2.3s ease-in-out infinite; }
.token .torch.lantern .fire::after { inset: -110%; }
@keyframes torch-flicker { 0%, 100% { scale: 1; opacity: 1; } 18% { scale: .9 1.08; opacity: .92; } 34% { scale: 1.06 .94; } 52% { scale: .94 1.12; opacity: .97; } 71% { scale: 1.04 .97; opacity: .9; } 86% { scale: .97 1.06; } }
@keyframes torch-glow { 0%, 100% { opacity: .85; scale: 1; } 30% { opacity: 1; scale: 1.06; } 60% { opacity: .75; scale: .95; } }
@keyframes lantern-flicker { 0%, 100% { filter: brightness(1); } 40% { filter: brightness(1.12); } 70% { filter: brightness(.94); } }
/* A light of the place (a fire, a brazier, a torch on its stand, a lantern): a warm glow breathes over its painted flame. */
.thing .flame { position: absolute; width: 46%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 246, 210, .9) 0, rgba(255, 196, 90, .6) 18%, rgba(255, 130, 40, .25) 42%, rgba(255, 110, 30, 0) 68%); animation: fire-breathe 1.4s ease-in-out infinite; }
.thing .flame.glass { width: 34%; animation-duration: 2.6s; }
@keyframes fire-breathe { 0%, 100% { opacity: .85; scale: 1; } 22% { opacity: 1; scale: 1.09; } 47% { opacity: .78; scale: .94; } 73% { opacity: .95; scale: 1.04; } }
@media (prefers-reduced-motion: reduce) { .token .torch .fire, .token .torch .fire::after, .thing .flame { animation: none; } }
#board.over-fig { cursor: pointer; }

/* The bar under the map keeps one height in play, whatever it shows, so the map never grows or shrinks under the players' eyes:
   a roll asked for and a status line float just above the bar; on a character's turn the turn box packs into the same height
   as the dice (what is left on the left, the two menus on the right, the end of the turn under them). */
@media (min-width: 1101px) {
  body.playing #mic-status { position: absolute; left: 16px; bottom: calc(100% + 12px); max-width: 60%; min-height: 0; text-align: left; pointer-events: none; z-index: 31; }
  body.playing #mic-status:empty { display: none; }
  body.playing #turn-box:has(.end-turn) { display: grid; grid-template-columns: auto minmax(110px, auto); grid-template-areas: "eco more" "eco feats" "done done"; gap: 6px 8px; align-items: center; }
  body.playing #turn-box:has(.end-turn) > .economy { grid-area: eco; }
  body.playing #turn-box:has(.end-turn) > .more-open:not(.feats-open) { grid-area: more; }
  body.playing #turn-box:has(.end-turn) > .feats-open { grid-area: feats; }
  body.playing #turn-box:has(.end-turn) > .end-turn { grid-area: done; padding: 6px 18px 7px; }
  body.playing #turn-box:has(.end-turn) > .more-open { padding: 4px 10px; font-size: .88rem; white-space: nowrap; }
}
@media (min-width: 1101px) {          /* when the turn box takes its room, the text field goes under the talk button rather than shrinking to nothing */
  body.playing .talk-row { flex-wrap: wrap; justify-content: center; align-content: center; }
  body.playing #text-form { flex: 1 1 210px; min-width: 210px; }
}
@media (min-width: 1101px) {          /* a roll asked for sits in the middle of the bar, over the talk button: the dice and the turn box span both rows, the bar keeps its height */
  body.playing #talk, body.playing.has-sheet #talk { grid-template-areas: "who who who" "dice ask turn" "dice talk turn" "note note note"; grid-template-rows: auto auto auto auto; }
  body.playing #tray { min-height: 168px; align-self: center; }
  body.playing #turn-box { align-self: center; }
  body.playing #ask { align-self: end; gap: 2px 10px; flex-wrap: wrap; max-height: 56px; overflow: hidden; }
  body.playing #ask button.big { padding: 5px 14px; font-size: 1rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body.playing .talk-row { align-self: start; }
  body.playing:not(:has(#ask:not([hidden]))) .talk-row { grid-row: 2 / 4; align-self: center; }
}
