/* The look: a printed broadsheet from the witch-trial years. Soot-black stock, bone ink, one red.
   Flat fills, square corners, ruled frames, hard offset shadows; a blackletter for titles, a book face for the
   rest, and Fell type (a real 17th-century face) for anything read as story. No gold, no glow, no gradients. */
:root {
  --soot: #15120f;        /* the stock: panels */
  --soot-2: #201b16;      /* raised: buttons, rows */
  --ink: #e9e1cf;         /* bone ink: text */
  --dim: #9d9483;
  --rule: rgba(233, 225, 207, .42); /* printed rules and frames */
  --red: #a3271c;         /* the one colour */
  --red-hi: #d2442f;
  --gold: #e9e1cf;        /* (old name: highlights are now plain bold ink) */
  --blood: #a3271c;
  --panel: #15120f;
  --edge: rgba(233, 225, 207, .42);
  --good: #9fb9cc;
  --evil: #e0503a;
  --fool: #c9a54a;
  --display: 'Grenze Gotisch', 'UnifrakturMaguntia', Georgia, serif;
  --ui: 'Alegreya', Georgia, serif;
  --text: 'IM Fell English', Georgia, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070605; color: var(--ink); font-family: var(--ui); }
#app, #app canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
button { font-family: var(--ui); font-weight: 700; font-size: .95rem; color: var(--ink); background: var(--soot-2); border: 1px solid var(--rule); border-radius: 0; padding: 7px 14px; cursor: pointer; transition: background .08s, color .08s; }
button:hover:not(:disabled) { background: var(--ink); color: var(--soot); }
button:active:not(:disabled) { transform: translate(1px, 1px); }
button:disabled { opacity: .4; cursor: default; }
button.big { font-size: 1.1rem; padding: 11px 18px; background: var(--red); border-color: #000; color: #f3ead6; box-shadow: 3px 3px 0 #000; }
button.big:hover:not(:disabled) { background: var(--red-hi); color: #fff6e6; }
input { font-family: var(--ui); font-size: 1rem; color: var(--ink); background: #0b0908; border: 1px solid var(--rule); border-radius: 0; padding: 9px 11px; outline: none; }
input:focus { border-color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 600; color: var(--ink); margin: 0; letter-spacing: .01em; }
h3 { font-family: var(--ui); font-weight: 800; color: var(--red-hi); margin: 0; letter-spacing: 0; }
.lbl { font-family: var(--ui); font-size: .8rem; font-style: italic; color: var(--dim); }
.panel { background: var(--soot) var(--grain); border: 1px solid var(--rule); outline: 1px solid rgba(233, 225, 207, .14); outline-offset: 3px; border-radius: 0; box-shadow: 8px 8px 0 rgba(0, 0, 0, .55); }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }

/* Shared form bits */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-family: var(--ui); font-size: .72rem; letter-spacing: .02em; color: var(--dim); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; letter-spacing: .3em; text-align: center; font-family: var(--ui); font-weight: 700; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-style: italic; font-size: .9rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--edge); opacity: .6; }

/* Lobby */
.lobby-panel { width: min(1240px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.lobby-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
#lobbyCode { font-family: var(--ui); font-weight: 900; font-size: 2.6rem; letter-spacing: .3em; color: var(--ink); }
.lobby-cols { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: 26px; }
.lobby-cols > div { min-width: 0; }
.lobby-cols > div + div { padding-left: 26px; border-left: 1px solid rgba(125,98,51,.28); }
@media (max-width: 1100px) { .lobby-cols { grid-template-columns: 1fr 1fr; } .lobby-cols > div:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; padding-top: 4px; border-top: 1px solid rgba(125,98,51,.28); } }
@media (max-width: 640px) { .lobby-cols { grid-template-columns: 1fr; } .lobby-cols > div + div { padding-left: 0; border-left: 0; } }
.lobby-chat { margin-top: 16px; }
.lobby-cols h3 { font-size: .95rem; margin-bottom: 8px; }
#lobbyPlayers { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#lobbyPlayers li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255,255,255,.04); border-radius: 2px; font-size: 1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#lobbyPlayers li .crown { color: var(--gold); margin-left: auto; font-size: .8rem; }
.sw { width: 16px; height: 16px; border-radius: 50% 50% 40% 40%; flex: none; }
#colorPick { display: flex; flex-wrap: wrap; gap: 8px; }
#colorPick button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
#colorPick button.mine { border-color: var(--ink); }
#colorPick button.taken { opacity: .2; cursor: not-allowed; }
#settings { display: flex; flex-direction: column; gap: 6px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(125,98,51,.25); font-size: .98rem; }
.set small { color: var(--dim); font-style: italic; }
.set .ctl { display: flex; align-items: center; gap: 6px; }
.set .ctl button { padding: 2px 9px; font-size: .9rem; }
.set .val { min-width: 34px; text-align: center; font-family: var(--ui); font-weight: 700; }
.toggle { min-width: 58px; }
.toggle.on { background: #1a3412; }
.lobby-chat { display: flex; flex-direction: column; gap: 6px; }
.log { overflow-y: auto; font-size: .95rem; line-height: 1.3; padding: 6px 8px; background: rgba(0,0,0,.3); border-radius: 2px; }
#lobbyLog { height: 130px; }
.log .m { margin: 2px 0; word-wrap: break-word; }
.log .m b { font-family: var(--ui); font-size: .85rem; }
.log .m.dead { opacity: .7; font-style: italic; }
.log .m.sys { color: var(--dim); font-style: italic; }
.lobby-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#lobbyNote { color: var(--dim); font-style: italic; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button, #hud .panel, #hud canvas { pointer-events: auto; }
#topbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; }
#roleBadge { font-family: var(--ui); font-weight: 900; padding: 6px 14px; border-radius: 2px; background: var(--panel); border: 1px solid var(--edge); letter-spacing: .02em; white-space: nowrap; }
#roleBadge.evil { color: var(--evil); border-color: #6a1a14; }
#roleBadge.good { color: var(--good); }
#roleBadge.fool { color: var(--fool); }
#taskBarWrap { background: var(--panel); border: 1px solid var(--edge); border-radius: 2px; padding: 4px 10px 6px; min-width: 220px; }
#taskBar { height: 10px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; margin-top: 3px; }
#taskFill { height: 100%; width: 0; background: linear-gradient(90deg, #d9b45a, #fff1b8); transition: width .5s; }
#taskPanel { position: absolute; top: 12px; left: 12px; width: 240px; padding: 10px 12px; }
#taskPanel h3 { font-size: .9rem; margin-bottom: 6px; }
#taskList { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
#taskList li { padding: 2px 0; }
#taskList li small { color: var(--dim); font-style: italic; }
#taskList li.done { color: #7fb06a; text-decoration: line-through; opacity: .7; }
#roleNote { margin-top: 8px; font-size: .85rem; color: var(--dim); font-style: italic; line-height: 1.3; }
#roleNote:empty { display: none; }
#minimap { position: absolute; top: 12px; right: 12px; width: 200px; height: 200px; border-radius: 2px; border: 1px solid var(--edge); background: rgba(10,8,6,.8); }
#sabBanner { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 2px; font-family: var(--ui); font-weight: 700; color: #ffd9d4; background: rgba(110,10,10,.85); border: 1px solid #ff5a4f; animation: pulse 1s infinite alternate; text-align: center; white-space: nowrap; }
@keyframes pulse { from { } to { } }
#prompt { position: absolute; bottom: 132px; left: 50%; transform: translateX(-50%); font-family: var(--ui); font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 0 rgba(0,0,0,.85); white-space: nowrap; }
#actions { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 10px; align-items: end; }
.act { position: relative; width: 82px; height: 82px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; gap: 1px; background: #1d120b; font-size: .7rem; }
.act .ic { font-size: 1.6rem; line-height: 1; font-family: serif; }
.act kbd { position: absolute; top: -4px; left: -4px; background: #000; border: 1px solid var(--edge); border-radius: 2px; padding: 0 5px; font-family: var(--ui); font-size: .7rem; }
.act .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; border-radius: 50%; background: rgba(0,0,0,.55); }
.act .cd:empty { display: none; }
.act.ready { border-color: var(--gold); }
#btnKill.ready { border-color: var(--evil); }
#btnKill { background: #250807; }
#sabMenu { position: absolute; right: 16px; bottom: 112px; width: 300px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
#sabMenu h3 { font-size: .95rem; }
#sabMenu button { text-align: left; display: flex; flex-direction: column; gap: 2px; background: #200606; }
#sabMenu button small { font-family: var(--text); font-weight: 400; font-size: .82rem; color: var(--dim); letter-spacing: 0; }
#doorBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#doorBtns button { font-size: .75rem; padding: 6px; text-align: center; }
#hint { position: absolute; left: 12px; bottom: 12px; color: var(--dim); font-size: .85rem; text-shadow: 0 1px 0 rgba(0,0,0,.85); }
@media (max-width: 760px) { #taskPanel { width: 180px; font-size: .85rem; } #minimap { width: 130px; height: 130px; } #topbar { top: auto; bottom: 110px; left: 12px; transform: none; flex-direction: column; align-items: start; } }

/* Minigames */
#minigame { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); padding: 16px; }
.mg-panel { width: min(520px, 100%); padding: 16px 18px 20px; }
.mg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mg-head h2 { font-size: 1.2rem; }
.mg-head button { padding: 4px 10px; }
#mgBody { position: relative; user-select: none; }
#mgBody p { margin: 0 0 12px; font-style: italic; color: var(--dim); }
.hold-bar { height: 26px; background: rgba(0,0,0,.6); border: 1px solid var(--edge); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.hold-fill { height: 100%; width: 0; background: linear-gradient(90deg, #8a5a1f, #ffcf6b); }
.hold-btn { width: 100%; padding: 16px; font-size: 1.1rem; }
.seq-target { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.seq-target span { width: 52px; height: 58px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; border: 1px solid var(--edge); border-radius: 2px; background: rgba(0,0,0,.4); transition: background .15s; }
.seq-target span.ok { background: rgba(217,180,90,.35); border-color: var(--gold); }
.seq-target.bad { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.seq-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seq-keys button { font-size: 1.8rem; padding: 10px 0 4px; display: flex; flex-direction: column; align-items: center; font-family: serif; }
.seq-keys button small { font-family: var(--ui); font-size: .7rem; color: var(--dim); }
.clicks-area { position: relative; height: 280px; border: 1px solid var(--edge); border-radius: 2px; background: radial-gradient(ellipse at center, #3a2a1a, #140d08); overflow: hidden; }
.clicks-area .tg { position: absolute; font-size: 2.1rem; cursor: pointer; transform: translate(-50%, -50%); transition: transform .1s; line-height: 1; }
.clicks-area .tg:hover { transform: translate(-50%, -50%) scale(1.2); }
.clicks-area .tg.lit { color: #ffe2a0; filter: drop-shadow(0 0 8px rgba(255,170,60,.9)); }
.timing-bar { position: relative; height: 46px; background: rgba(0,0,0,.6); border: 1px solid var(--edge); border-radius: 2px; overflow: hidden; margin-bottom: 14px; cursor: pointer; }
.timing-zone { position: absolute; top: 0; bottom: 0; background: #a8771c; opacity: .8; }
.timing-needle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #fff; }
.timing-bar.miss { animation: shake .3s; border-color: var(--evil); }
.pips { display: flex; gap: 8px; justify-content: center; }
.pips span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--edge); background: rgba(0,0,0,.4); }
.pips span.on { background: var(--gold); }
.mg-done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--ui); font-weight: 900; font-size: 2.2rem; color: var(--gold); background: rgba(16,12,9,.85); border-radius: 2px; text-shadow: 0 1px 0 rgba(0,0,0,.85); }

/* Meeting */
#meeting { position: fixed; inset: 0; z-index: 16; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(40,10,5,.6), rgba(0,0,0,.9)); padding: 16px; }
.mt-panel { width: min(980px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 16px 18px; gap: 12px; }
.mt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mt-head h2 { font-size: 1.25rem; }
#mtTimer { font-family: var(--ui); font-weight: 700; white-space: nowrap; color: var(--ink); }
.mt-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; min-height: 0; flex: 1; }
@media (max-width: 720px) { .mt-main { grid-template-columns: 1fr; } }
#mtCards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; align-content: start; overflow-y: auto; }
.card { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 2px; background: rgba(255,255,255,.05); border: 1px solid rgba(125,98,51,.5); cursor: default; min-height: 56px; }
.card.can { cursor: pointer; }
.card.can:hover { background: rgba(255,255,255,.1); }
.card.sel { border-color: var(--gold); background: rgba(217,180,90,.12); }
.card.dead { opacity: .45; }
.card .hood { width: 34px; height: 38px; border-radius: 50% 50% 30% 30%; flex: none; position: relative; }
.card .hood::after { content: ''; position: absolute; left: 7px; right: 7px; top: 9px; height: 16px; background: #0b0806; border-radius: 50%; }
.card .nm { font-family: var(--ui); font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.card .tags { font-size: .8rem; color: var(--dim); font-style: italic; }
.card .tags .ally { color: var(--evil); font-style: normal; }
.card .tags .dark { color: var(--evil); }
.card .tags .clear { color: var(--good); }
.card .voted { position: absolute; top: -6px; right: -6px; background: var(--gold); color: #000; border-radius: 2px; padding: 0 6px; font-size: .7rem; font-family: var(--ui); font-weight: 900; }
.card .confirm { margin-left: auto; padding: 5px 9px; font-size: .75rem; background: #3e0d0d; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; }
.mt-chat { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
#chatLog { flex: 1; min-height: 180px; max-height: 50vh; }
.mt-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#mtNote { margin-left: auto; color: var(--dim); font-style: italic; }

/* Overlays */
#reveal, #eject, #over { z-index: 30; flex-direction: column; text-align: center; gap: 12px; }
#reveal { background: radial-gradient(ellipse at center, rgba(0,0,0,.55), rgba(0,0,0,.95)); animation: fadein .6s; }
#reveal .you { font-family: var(--ui); color: var(--dim); letter-spacing: .02em; }
#reveal .role { font-family: var(--ui); font-weight: 900; font-size: clamp(2.6rem, 10vw, 5rem); letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0,0,0,.85); }
#reveal .role.evil { color: var(--evil); } #reveal .role.good { color: var(--good); } #reveal .role.fool { color: var(--fool); }
#reveal .desc { max-width: 560px; font-size: 1.15rem; line-height: 1.4; }
#reveal .allies { color: var(--evil); font-family: var(--ui); }
#eject { background: linear-gradient(to top, rgba(160,40,0,.75), rgba(0,0,0,.92) 55%); animation: fadein .6s; }
#eject .big { font-family: var(--ui); font-weight: 900; font-size: clamp(1.6rem, 5vw, 2.6rem); max-width: 860px; }
#eject .small { font-size: 1.3rem; font-style: italic; color: #ffd4a8; }
.pyre { font-size: 3.4rem; animation: flicker .25s infinite alternate; }
@keyframes flicker { from { transform: scale(1) translateY(0); filter: brightness(1); } to { transform: scale(1.06) translateY(-3px); filter: brightness(1.3); } }
#over { background: rgba(0,0,0,.88); animation: fadein .8s; overflow-y: auto; }
#over h1 { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 900; }
#over h1.good { color: var(--good); } #over h1.evil { color: var(--evil); } #over h1.fool { color: var(--fool); }
#over .reason { font-size: 1.2rem; font-style: italic; max-width: 640px; }
#over ul { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; width: min(760px, 100%); }
#over li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,.05); border-radius: 2px; text-align: left; }
#over li .r { margin-left: auto; font-family: var(--ui); font-size: .8rem; }
#over li .r.evil { color: var(--evil); } #over li .r.good { color: var(--good); } #over li .r.fool { color: var(--fool); }
#over li.dead { opacity: .55; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 25; background: radial-gradient(ellipse at center, rgba(140,0,0,0), rgba(140,0,0,.85)); opacity: 0; transition: opacity .6s; }
#flash.on { opacity: 1; transition: none; }
#toasts { position: fixed; top: 110px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(560px, 92vw); }
.toast { background: var(--panel); border: 1px solid var(--edge); border-radius: 2px; padding: 8px 14px; font-size: 1.02rem; text-align: center; animation: fadein .3s; }
.toast.evil { border-color: #8a1a14; color: #ffc9c4; }
.toast.good { border-color: #3a5a8a; color: #d6e8ff; }
#btnItem { background: #0d1320; }
#btnItem.ready { border-color: #8fc0ff; }

/* How-to button */
.how { background: #15110a; font-size: .9rem; }

/* Codex */
#codex { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.codex-panel { width: min(900px, 100%); height: min(680px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 16px 18px; gap: 10px; background: linear-gradient(rgba(30,22,14,.97), rgba(16,12,9,.97)); }
.codex-head { display: flex; justify-content: space-between; align-items: center; }
.codex-head h2 { font-size: 1.3rem; }
.codex-x { padding: 4px 10px; }
.codex-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--edge); padding-bottom: 8px; }
.codex-tabs button { font-size: .78rem; padding: 6px 10px; background: transparent; border-color: transparent; }
.codex-tabs button.on { background: #2a170e; border-color: var(--edge); color: var(--gold); }
.codex-body { flex: 1; overflow-y: auto; padding-right: 6px; font-size: 1.04rem; line-height: 1.45; }
.codex-body h3 { font-size: 1rem; margin: 14px 0 6px; }
.codex-body .lead { font-size: 1.12rem; margin-top: 4px; }
.codex-body .dim, .dim { color: var(--dim); font-style: italic; }
.codex-body kbd { font-family: var(--ui); font-size: .8rem; background: #000; border: 1px solid var(--edge); border-radius: 2px; padding: 0 5px; }
.codex-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--edge); padding-top: 8px; }
.codex-page { color: var(--dim); font-family: var(--ui); font-size: .8rem; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
@media (max-width: 640px) { .sides { grid-template-columns: 1fr; } }
.side { border: 1px solid var(--edge); border-radius: 2px; padding: 10px 12px; background: rgba(255,255,255,.03); }
.side.good h3 { color: var(--good); } .side.evil h3 { color: var(--evil); }
.side h3 { margin-top: 0; }
.side ul { margin: 4px 0 0; padding-left: 18px; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.flow i { color: var(--dim); font-style: normal; font-size: 1.4rem; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 10px 4px; background: rgba(0,0,0,.35); }
.flow-step span { font-size: 1.8rem; }
.flow-step.on { border-color: var(--gold); background: rgba(217,180,90,.15); color: var(--gold); }
.flow-desc { min-height: 64px; padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(217,180,90,.06); border-radius: 2px; margin-bottom: 10px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 10px; }
.role-card { position: relative; height: 250px; perspective: 900px; cursor: pointer; outline: none; }
.role-card .face { position: absolute; inset: 0; border-radius: 2px; border: 1px solid var(--edge); backface-visibility: hidden; transition: transform .5s; padding: 12px; overflow: hidden; }
.role-card .front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.08), rgba(0,0,0,.4)); }
.role-card .back { transform: rotateY(180deg); background: rgba(10,8,6,.95); font-size: .86rem; line-height: 1.3; overflow-y: auto; }
.role-card .back p { margin: 6px 0; } .role-card .back ul { margin: 4px 0; padding-left: 16px; color: var(--dim); }
.role-card.flip .front { transform: rotateY(180deg); } .role-card.flip .back { transform: rotateY(360deg); }
.role-card:hover .front, .role-card:focus .front { border-color: var(--gold); }
.role-card .ri { font-size: 2.8rem; } .role-card .rn { font-family: var(--ui); font-weight: 900; font-size: 1.2rem; }
.role-card .rt { font-size: .8rem; letter-spacing: .02em; font-family: var(--ui); }
.role-card.good .rt, .role-card.good .back b { color: var(--good); } .role-card.evil .rt, .role-card.evil .back b { color: var(--evil); } .role-card.fool .rt, .role-card.fool .back b { color: var(--fool); }
.relics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 640px) { .relics { grid-template-columns: 1fr; } }
.relic { border: 1px solid var(--edge); border-radius: 2px; padding: 10px 12px; background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 8px; }
.relic-top { display: flex; gap: 10px; align-items: start; font-size: .92rem; }
.relic-ic { font-size: 2.2rem; }
.relic-sw { display: flex; gap: 6px; } .relic-sw button { flex: 1; font-size: .75rem; padding: 5px; background: rgba(0,0,0,.4); }
.relic-sw button.on { border-color: var(--gold); color: var(--gold); }
.relic-out { min-height: 66px; font-size: .92rem; padding: 8px 10px; background: rgba(0,0,0,.3); border-radius: 2px; }
.try-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0; }
@media (max-width: 640px) { .try-grid { grid-template-columns: 1fr 1fr; } }
.try { display: flex; flex-direction: column; gap: 3px; padding: 12px 8px; text-align: center; }
.try b { color: var(--gold); } .try span { font-family: var(--text); font-weight: 400; font-size: .95rem; letter-spacing: 0; } .try small { color: var(--dim); font-family: var(--text); font-weight: 400; }
.chore-list { columns: 2; font-size: .95rem; margin: 0; padding-left: 18px; }
.sabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
@media (max-width: 720px) { .sabs { grid-template-columns: 1fr; } }
.sabs > div { border: 1px solid #6a1a14; border-radius: 2px; padding: 10px 12px; background: rgba(90,10,10,.15); }
.sabs h3 { margin-top: 0; color: #ff9a8a; }
.keyboard { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.keycap { min-width: 52px; height: 52px; padding: 0 10px; display: flex; align-items: center; justify-content: center; font-family: var(--ui); font-weight: 700; border: 1px solid var(--edge); border-bottom-width: 4px; border-radius: 2px; background: rgba(0,0,0,.4); transition: all .1s; cursor: default; }
.keycap.lit { background: var(--gold); color: #000; transform: translateY(2px); border-bottom-width: 2px; }
.key-desc { min-height: 48px; padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(217,180,90,.06); border-radius: 2px; margin-bottom: 10px; }

/* Cutscene */
#cutscene { position: fixed; inset: 0; z-index: 35; pointer-events: none; }
#cutscene .bar { position: absolute; left: 0; right: 0; height: 13vh; background: #000; }
#cutscene .bar.top { top: 0; animation: barIn .8s ease-out; } #cutscene .bar.bottom { bottom: 0; animation: barIn .8s ease-out; display: flex; align-items: center; justify-content: center; }
@keyframes barIn { from { height: 0; } }
#csCaption { font-family: var(--text); font-size: clamp(1.05rem, 2.6vw, 1.55rem); font-style: italic; text-align: center; max-width: 900px; padding: 0 20px; color: #f3e6c4; text-shadow: 0 1px 0 rgba(0,0,0,.85); transition: opacity .6s; }
#csCaption.out { opacity: 0; }
#csSkip { position: absolute; right: 18px; bottom: calc(13vh + 14px); pointer-events: auto; background: rgba(0,0,0,.55); }
#csSkip small { color: var(--dim); font-size: .7rem; }
body.cine #hud { opacity: 0; }

/* ---------------- Title screen ---------------- */
#menu { justify-content: flex-start; padding: 0; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7,5,3,.94) 0%, rgba(7,5,3,.82) 30%, rgba(7,5,3,.25) 58%, rgba(7,5,3,0) 75%),
    radial-gradient(ellipse at 70% 50%, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%); }
.menu-wrap { position: relative; z-index: 2; width: min(500px, 100%); margin-left: clamp(16px, 7vw, 120px); display: flex; flex-direction: column; gap: 18px; animation: rise .9s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.brand { display: flex; align-items: center; gap: 18px; }
.emblem { width: clamp(64px, 8vw, 92px); height: auto; flex: none; filter: drop-shadow(0 0 18px rgba(255,150,60,.35)); }
.emblem .flame { transform-origin: 50% 70%; animation: flameSway 2.6s ease-in-out infinite; }
@keyframes flameSway { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06, 1.1) rotate(2deg); } }
.brand h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 900; letter-spacing: .02em; line-height: .95;
  background: #8a5320; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.8)) drop-shadow(0 0 24px rgba(217,120,40,.25)); }
.tagline { font-family: var(--ui); font-weight: 500; font-size: clamp(.72rem, 1.3vw, .9rem); letter-spacing: .02em; color: var(--dim); margin-top: 8px; }
.ornament { display: flex; align-items: center; gap: 12px; color: var(--gold); opacity: .7; font-size: .6rem; }
.ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.ornament span:first-child { background: linear-gradient(90deg, var(--edge), transparent); }
.ornament i { font-style: normal; }
#menu .sub { margin: 0; font-size: 1.12rem; font-style: italic; line-height: 1.45; color: #d8c8a4; max-width: 440px; }
.menu-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(rgba(28,20,12,.88), rgba(14,10,7,.92)); }
.menu-card input { width: 100%; padding: 11px 13px; font-size: 1.05rem; background: rgba(0,0,0,.5); }
.menu-card .field input { text-transform: none; letter-spacing: normal; }
#createBtn { width: 100%; padding: 15px 18px; font-size: 1rem; letter-spacing: .02em; border-color: #b4892f;
  background: #5a0f0c; }
#createBtn:hover { }
#joinBtn { padding: 0 22px; letter-spacing: .02em; }
#codeIn { flex: 1; font-size: 1.3rem; padding: 9px; }
.menu-links { display: flex; gap: 10px; }
.link { background: transparent; border-color: transparent; color: var(--dim); padding: 6px 2px; font-size: .9rem; letter-spacing: .02em; }
.link:hover { color: var(--gold); filter: none; }
a.link { font-family: var(--ui); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; border: 1px solid transparent; }
.menu-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px clamp(16px, 7vw, 120px); font-family: var(--ui); font-size: .7rem; letter-spacing: .02em; color: rgba(169,152,120,.75); }
.menu-foot kbd { font-family: var(--ui); border: 1px solid var(--edge); border-radius: 2px; padding: 0 4px; }
.embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #ffb347; animation: ember linear infinite; opacity: 0; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translate(var(--dx), -105vh); opacity: 0; } }
@media (max-width: 720px) {
  #menu { justify-content: center; background: linear-gradient(rgba(7,5,3,.55), rgba(7,5,3,.9)); }
  .menu-wrap { margin: 0 16px; width: calc(100% - 32px); }
  .brand { gap: 12px; }
  .brand h1 { font-size: clamp(1.6rem, 8.4vw, 2.4rem); letter-spacing: .03em; }
  .tagline { letter-spacing: .02em; }
  .emblem { width: 56px; }
  .menu-foot { justify-content: center; text-align: center; padding: 10px 16px; }
}
@media (max-height: 640px) { #menu .sub, .ornament { display: none; } .menu-foot { display: none; } }

/* First person */
#crosshair { display: none; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; }
#crosshair i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(255,240,210,.85); }
#crosshair::before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,240,210,.35); border-radius: 50%; transition: all .15s; }
body.fp.aiming #crosshair { display: block; }
body.target-use #crosshair::before { border-color: var(--gold); inset: 0; }
body.target-kill #crosshair::before { border-color: var(--evil); inset: -2px; }
body.target-kill #crosshair i { background: var(--evil); }
body.fp #prompt { bottom: auto; top: calc(50% + 26px); font-size: .95rem; }
#lookHint { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -150%); font-family: var(--ui); font-size: .8rem; letter-spacing: .02em; padding: 6px 12px; border-radius: 2px; background: rgba(0,0,0,.55); border: 1px solid var(--edge); color: var(--ink); pointer-events: none; }
body.fp.aiming:not(.locked) #lookHint { display: block; }

/* Voice */
#voice { position: fixed; left: 12px; bottom: 36px; z-index: 18; display: flex; gap: 6px; align-items: center; }
#voice button { font-size: .78rem; padding: 7px 11px; background: rgba(16,12,9,.88); }
#voiceBtn.on { border-color: #6fbf73; color: #cfe9cf; }
#voiceBtn.muted { border-color: var(--evil); color: #ffc9c4; }
#voiceBtn.talking { }
#voiceMode { font-size: .7rem !important; color: var(--dim); }
#lobbyPlayers li.speaking, .card.speaking { }
body:has(#lobby:not(.hidden)) #voice { bottom: 16px; }

/* ---------------- Touch / mobile ---------------- */
#stick, #touchTools, #rotateHint { display: none; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch input { -webkit-user-select: text; user-select: text; }
#app canvas { touch-action: none; }
body.touch .act kbd, body.touch #hint, body.touch #lookHint { display: none !important; }
body.touch .act { width: 76px; height: 76px; }
body.touch #actions { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap-reverse; justify-content: flex-end; max-width: 60vw; }
body.touch.ingame #stick { display: block; position: fixed; left: max(90px, calc(env(safe-area-inset-left) + 80px)); bottom: 70px; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid rgba(255,240,210,.22); background: radial-gradient(circle, rgba(0,0,0,.05), rgba(0,0,0,.3)); pointer-events: none; z-index: 6; opacity: .55; transition: opacity .15s; }
body.touch.ingame #stick.active { opacity: 1; margin: -60px 0 0 -60px; }
#stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,240,210,.35); border: 1px solid rgba(255,240,210,.6); }
body.touch.ingame #touchTools { display: flex; flex-direction: column; gap: 6px; position: absolute; right: max(12px, env(safe-area-inset-right)); top: 146px; }
#touchTools button { width: 40px; height: 40px; padding: 0; font-size: 1.1rem; background: rgba(16,12,9,.85); pointer-events: auto; }
body.touch #minimap { width: 128px; height: 128px; right: max(12px, env(safe-area-inset-right)); }
body.touch #taskPanel { width: 200px; font-size: .85rem; padding: 8px 10px; cursor: pointer; left: max(12px, env(safe-area-inset-left)); }
body.touch #taskPanel h3::after { content: ' ▾'; color: var(--dim); }
#taskPanel.collapsed #taskList, #taskPanel.collapsed #roleNote { display: none; }
#taskPanel.collapsed h3 { margin: 0; }
#taskPanel.collapsed h3::after { content: ' ▸'; }
body.touch #voice { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: auto; top: 12px; transform: translateX(calc(-128px - 10px)); }
body.touch:has(#lobby:not(.hidden)) #voice, body.touch:has(#meeting:not(.hidden)) #voice { transform: none; top: auto; bottom: 12px; right: 12px; }
body.touch #voice button { padding: 9px 12px; font-size: .8rem; }
body.touch #prompt { font-size: .9rem; }
@media (orientation: portrait) { body.touch.ingame #rotateHint { display: block; position: absolute; left: 50%; top: 40%; transform: translateX(-50%); padding: 8px 14px; border-radius: 2px; background: rgba(0,0,0,.6); border: 1px solid var(--edge); font-family: var(--ui); font-size: .75rem; letter-spacing: .02em; white-space: nowrap; animation: fadeOut 1s 6s forwards; pointer-events: none; } }
@keyframes fadeOut { to { opacity: 0; } }
/* short landscape phones */
@media (max-height: 520px) {
  body.touch .act { width: 60px; height: 60px; font-size: .58rem; }
  body.touch .act .ic { font-size: 1.25rem; }
  #topbar { top: 6px; transform: translateX(-50%) scale(.8); transform-origin: top center; }
  body.touch #minimap { width: 104px; height: 104px; top: 8px; }
  body.touch.ingame #touchTools { top: 120px; flex-direction: row; }
  body.touch #taskPanel { top: 8px; width: 180px; max-height: calc(100vh - 140px); overflow-y: auto; }
  body.touch.ingame #stick { bottom: 40px; }
  .mt-panel { padding: 10px; } #chatLog { min-height: 90px; }
  .codex-panel { height: calc(100vh - 16px); }
}
@media (max-width: 760px) and (orientation: portrait) { #topbar { top: auto; bottom: 200px; } body.touch #actions { max-width: 70vw; } }
@media (orientation: portrait) {
  body.touch #voice { top: 244px; transform: none; flex-direction: column; align-items: flex-end; }
}
body.touch .lobby-panel { padding-bottom: 64px; }

.over-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Chore waypoints */
#waypoints { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wp { position: absolute; left: 0; top: 0; margin: -14px 0 0 -14px; display: flex; flex-direction: column; align-items: center; gap: 2px; will-change: transform; }
.wp i { width: 16px; height: 16px; border: 2px solid #ffc85a; background: rgba(255,200,90,.28); transform-origin: center; rotate: 45deg; }
.wp.edge i { border-width: 0 0 3px 3px; background: transparent; filter: drop-shadow(0 0 4px rgba(255,200,90,.9)); rotate: 0deg; }
.wp b { font-family: var(--ui); font-size: .68rem; color: #ffe2a0; text-shadow: 0 1px 0 rgba(0,0,0,.85); }
.wp.fix i { border-color: #ff4030; background: rgba(255,64,48,.3); }
.wp.fix.edge i { background: transparent; filter: drop-shadow(0 0 4px rgba(255,64,48,.9)); }
.wp.fix b { color: #ffb3a8; }
.foot-link { font-size: inherit; letter-spacing: inherit; padding: 0 2px; pointer-events: auto; }
.menu-foot { pointer-events: none; }
.menu-foot button { pointer-events: auto; }

/* Developer explore mode */
.explore-panel { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 12px; border: 1px dashed #6a8a5a; border-radius: 2px; background: rgba(60,90,50,.12); font-size: .95rem; }
.explore-panel select { font-family: inherit; font-size: .95rem; color: var(--ink); background: rgba(0,0,0,.5); border: 1px solid var(--edge); border-radius: 2px; padding: 4px 6px; margin-left: 4px; }
#exploreBtn { background: #1a3412; }
#exploreBar { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 4px 6px 4px 12px; border-radius: 2px; background: rgba(30,50,25,.85); border: 1px solid #6a8a5a; font-family: var(--ui); font-size: .75rem; letter-spacing: .02em; pointer-events: auto; }
#exploreBar button { font-size: .7rem; padding: 4px 9px; }
#noclipBtn.on { border-color: #9fe08a; color: #cfe9cf; }
body.explore #minimap { cursor: crosshair; }
#over h1.explore { color: #9fe08a; }

/* Settings */
#settings-modal { position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.settings-panel { width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 16px 18px; gap: 10px; background: linear-gradient(rgba(30,22,14,.97), rgba(16,12,9,.97)); }
.settings-body { overflow-y: auto; padding-right: 6px; }
.settings-body section { margin-bottom: 14px; }
.settings-body h3 { font-size: .95rem; margin: 6px 0 6px; }
.settings-body .set { padding: 6px 0; }
.settings-body input[type=range] { width: min(200px, 40vw); accent-color: var(--gold); padding: 0; border: none; background: none; }
.settings-body select { font-family: inherit; font-size: .95rem; color: var(--ink); background: rgba(0,0,0,.5); border: 1px solid var(--edge); border-radius: 2px; padding: 4px 6px; }
.settings-body .val { min-width: 52px; text-align: right; font-size: .85rem; }
.settings-done { background: #1a3412; }

/* Solitary rites */
.mg-paused { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center;
  font-family: var(--ui); font-weight: 700; font-size: 1.05rem; color: #ffd9b0; background: rgba(16,10,6,.82); border-radius: 2px; border: 1px dashed #8a5a2a; }
#taskList .solo { font-size: .72rem; color: #e8c58a; border: 1px solid rgba(232,197,138,.45); border-radius: 2px; padding: 0 4px; margin-left: 2px; white-space: nowrap; }

/* Open villages (title screen) */
.villages { position: absolute; z-index: 2; right: clamp(16px, 5vw, 90px); top: 50%; transform: translateY(-50%); width: min(340px, 30vw); max-height: min(520px, 70vh);
  display: flex; flex-direction: column; padding: 14px 14px 10px; background: linear-gradient(rgba(28,20,12,.86), rgba(14,10,7,.9)); animation: rise .9s .15s ease-out both; }
.villages-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.villages-head h3 { font-size: .95rem; }
#villagesCount { color: var(--dim); font-size: .8rem; }
#villageList { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#villageList li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 2px; background: rgba(255,255,255,.04); border: 1px solid rgba(125,98,51,.35); }
#villageList li div { display: flex; flex-direction: column; min-width: 0; }
#villageList li b { font-family: var(--ui); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#villageList li small { color: var(--dim); font-size: .82rem; }
#villageList li button { padding: 6px 14px; flex: none; background: #1a3412; }
#villageList li.private { opacity: .6; }
#villageList li.empty { display: block; text-align: center; color: var(--dim); font-style: italic; font-size: .92rem; line-height: 1.4; background: none; border: 1px dashed rgba(125,98,51,.35); }
.chip { font-family: var(--ui); font-size: .62rem; letter-spacing: .02em; padding: 1px 6px; border-radius: 2px; white-space: nowrap; }
.chip.open { color: #cfe9cf; border: 1px solid #4f8a3a; }
.chip.busy { color: #e8c58a; border: 1px solid #8a6a3a; }
.villages-note { font-size: .8rem; margin: 8px 2px 0; }
@media (max-width: 900px) {
  #menu { flex-direction: column; justify-content: flex-start; overflow-y: auto; padding: 24px 0 70px; }
  .villages { position: relative; right: auto; top: auto; transform: none; width: auto; max-height: none; margin: 18px 16px 0; align-self: stretch; }
  .menu-wrap { margin-top: 8px; }
  .menu-foot { position: static; margin-top: 18px; }
}

/* Quality of life */
#wardsPct { float: right; color: var(--ink); letter-spacing: .05em; }
#lobbyCode { cursor: copy; }
#lobbyPlayers li .kick { margin-left: 6px; padding: 0 7px; font-size: .75rem; line-height: 1.4; background: rgba(0,0,0,.4); }
#lobbyPlayers li .crown + .kick { margin-left: 6px; }
#mtTimer.urgent { color: #ffb3a8; animation: pulse 0.6s infinite alternate; border-radius: 2px; padding: 2px 8px; }
#reconnect { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 80; padding: 8px 16px; border-radius: 2px; background: rgba(110,10,10,.92); border: 1px solid #ff5a4f; font-family: var(--ui); font-size: .85rem; }
#reconnect .spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#roster { position: fixed; z-index: 45; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 92vw); max-height: 80vh; overflow-y: auto; padding: 14px 16px; }
#roster h3 { font-size: 1rem; margin-bottom: 8px; }
#roster ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#roster li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 2px; background: rgba(255,255,255,.05); font-size: .95rem; }
#roster li b { font-family: var(--ui); font-size: .85rem; }
#roster li small { flex-basis: 100%; color: var(--dim); font-size: .78rem; }
#roster li.dead { opacity: .5; }
#roster .ally, #roster .dark { color: var(--evil); } #roster .clear { color: var(--good); }
#mtCards { padding-top: 8px; padding-right: 6px; }

/* Sealed letters */
#letterModal { position: fixed; inset: 0; z-index: 58; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.55); animation: fadein .3s; }
.parchment { position: relative; width: min(460px, 100%); padding: 34px 30px 22px; text-align: center; color: #3a2414;
  background: radial-gradient(ellipse at 30% 20%, #f3e4c0, #dcc394 70%, #c9a86e); border-radius: 2px;
  font-family: var(--text); animation: unroll .45s ease-out; }
@keyframes unroll { from { transform: scaleY(.1); opacity: 0; } }
.parchment h2 { color: #5a2a10; font-size: 1.05rem; margin-bottom: 14px; }
#letterBody { font-size: 1.35rem; font-style: italic; line-height: 1.45; margin-bottom: 14px; }
#letterNote { color: #6a4a2a !important; font-size: .9rem; margin-bottom: 14px; }
#letterModal.forged #letterNote { color: #8a1a14 !important; font-weight: bold; font-style: normal; }
.seal { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, #c0302a, #6a0e0a); color: #f3c9a0; font-size: 1.3rem; }
#letterModal.forged .seal { background: radial-gradient(circle at 40% 35%, #3a3a3a, #0a0a0a); color: #ff6a5a; }
.letter-actions { display: flex; gap: 8px; justify-content: center; }
#lettersBtn { margin-top: 8px; width: 100%; font-size: .78rem; padding: 6px; background: #2a170e; }
.log .m.letter { background: rgba(220,195,148,.12); border-left: 3px solid #c0302a; padding: 4px 6px; border-radius: 2px; }
.log .m .wax { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #a02a22; color: #f3c9a0; font-size: .6rem; text-align: center; line-height: 16px; margin-right: 5px; }
/* Ledger of oaths */
.mt-tabs { display: flex; gap: 4px; }
.mt-tabs button { flex: 1; font-size: .75rem; padding: 5px 6px; background: rgba(0,0,0,.35); border-color: transparent; }
.mt-tabs button.on { border-color: var(--edge); background: #2a170e; color: var(--gold); }
#ledger { flex: 1; min-height: 180px; max-height: 50vh; }
.ledger-g { font-family: var(--ui); font-size: .7rem; letter-spacing: .02em; color: var(--dim); margin: 8px 0 4px; border-bottom: 1px solid rgba(125,98,51,.4); }
.oath { padding: 4px 4px 4px 2px; margin: 3px 0; font-size: .92rem; }
.oath .oid { color: var(--dim); font-size: .7rem; margin-right: 4px; }
.oath .sw { display: inline-block; width: 11px; height: 11px; vertical-align: middle; margin-right: 4px; }
.oath b { font-family: var(--ui); font-size: .8rem; }
.oath.false { opacity: .75; } .oath.false i { text-decoration: line-through; }
.otags { margin: 2px 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; }
.otags .ok { color: #8fd08a; } .otags .bad { color: var(--evil); } .otags .warn { color: #e8c58a; }
#oathModal { position: fixed; inset: 0; z-index: 58; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); }
.oath-panel { width: min(420px, 100%); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.oath-panel label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--ui); font-size: .8rem; color: var(--dim); }
.oath-panel select { flex: 1; max-width: 230px; font-family: inherit; font-size: .95rem; color: var(--ink); background: rgba(0,0,0,.5); border: 1px solid var(--edge); border-radius: 2px; padding: 5px 6px; }
#oathPreview { font-size: 1.1rem; font-style: italic; text-align: center; padding: 8px; border: 1px dashed var(--edge); border-radius: 2px; }

/* While the mouse is captured: how to get it back (and reach voice) */
#lockHint { display: none; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-family: var(--ui); font-size: .7rem; letter-spacing: .02em; color: rgba(236,223,192,.7); text-shadow: 0 1px 0 rgba(0,0,0,.85); pointer-events: none; white-space: nowrap; }
body.fp.aiming.locked #lockHint { display: block; }
body.fp.aiming.locked #hint { display: none; }
body.touch #lockHint { display: none !important; }

/* Key bindings */
.keygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .keygrid { grid-template-columns: 1fr; } }
.keybind { min-width: 84px; font-size: .8rem; padding: 5px 10px; background: rgba(0,0,0,.45); border-bottom-width: 3px; }
.keybind.listening { border-color: var(--gold); color: var(--gold); animation: pulse .6s infinite alternate; }
.keys-reset { float: right; font-size: .72rem; }
.keys-help { font-size: .85rem; margin: 0 0 6px; }
.keys-msg { min-height: 1.2em; font-size: .85rem; margin-top: 6px; }

/* Codex: Your Screen page */
.screen-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.screen-list > div { padding: 8px 12px; border-left: 3px solid var(--edge); background: rgba(255,255,255,.03); border-radius: 2px; }
.screen-list .tagx { font-size: .78rem; border: 1px solid rgba(232,197,138,.45); border-radius: 2px; padding: 0 4px; color: #e8c58a; }
.gold { color: var(--gold); } .evilx { color: var(--evil); }
.codex-body ul { margin: 4px 0 8px; padding-left: 20px; }
.codex-tabs { row-gap: 4px; }

/* ---------------- Icons (no emoji) ---------------- */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.act .ic .ico { width: 30px; height: 30px; }
#btnKill .ic { color: #ffb3a8; } #btnItem .ic { color: #a9d2ff; }
#voice button .ico, #soundBtn .ico, #settingsBtn .ico, #lobbySettings .ico, #btnFull .ico { width: 18px; height: 18px; }
#voiceBtn { display: inline-flex; align-items: center; gap: 6px; }
.clicks-area .tg .ico { width: 42px; height: 42px; }
.clicks-area .tg { color: #e8dcc0; }
.seq-target span .ico { width: 30px; height: 30px; }
.seq-keys button .ico { width: 30px; height: 30px; }
.relic-ic .ico { width: 40px; height: 40px; color: var(--gold); }
.role-card .ri .ico { width: 54px; height: 54px; color: var(--gold); }
.role-card.evil .ri .ico { color: var(--evil); } .role-card.good .ri .ico { color: var(--good); } .role-card.fool .ri .ico { color: var(--fool); }
.flow-step span .ico { width: 30px; height: 30px; }
.talk-ico .ico { width: 14px; height: 14px; color: #8fd08a; }
#villageList li b .ico { width: 13px; height: 13px; }
/* the pyre at a burning: drawn flames */
.pyre { position: relative; width: 90px; height: 90px; margin: 0 auto; }
.pyre i { position: absolute; bottom: 0; left: 50%; width: 34px; height: 70px; margin-left: -17px; border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 80%, #fff3c4 0%, #ffb347 35%, #d9481a 70%, rgba(217,72,26,0) 75%); animation: flicker .22s infinite alternate; }
.pyre i:nth-child(2) { width: 24px; height: 52px; margin-left: -34px; animation-delay: .08s; opacity: .9; }
.pyre i:nth-child(3) { width: 24px; height: 48px; margin-left: 8px; animation-delay: .15s; opacity: .9; }
/* the voice bar docked inside the lobby / gathering footer */
#voice.docked { position: static !important; transform: none !important; flex-direction: row !important; margin-right: auto; }
.lobby-foot { justify-content: flex-start; }
.lobby-foot #startBtn { margin-left: auto; }
.mt-foot #voice.docked { margin-right: 0; }
/* lobby: roles as cards, separate from the rules */
.roles-h { margin-top: 16px; }
.role-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.role-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; background: rgba(0,0,0,.35); border: 1px solid rgba(125,98,51,.5); opacity: .6; }
.role-chip.on { opacity: 1; border-color: var(--gold); background: rgba(217,180,90,.1); }
.role-chip:disabled { cursor: default; }
.role-chip .rc-name { font-size: .85rem; }
.role-chip.good .rc-name { color: var(--good); } .role-chip.evil .rc-name { color: var(--evil); } .role-chip.fool .rc-name { color: var(--fool); }
.role-chip .rc-blurb { font-family: var(--text); font-weight: 400; font-size: .8rem; letter-spacing: 0; color: var(--dim); line-height: 1.25; }
.role-chip em { font-family: var(--text); font-weight: 400; font-size: .72rem; color: #e8c58a; letter-spacing: 0; }
.role-chip .rc-state { font-size: .62rem; letter-spacing: .02em; color: var(--dim); margin-top: 2px; }
.role-chip.on .rc-state { color: #8fd08a; }
@media (max-width: 640px) { .role-chips { grid-template-columns: 1fr; } }

/* CPUs in the lobby */
.cpu-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.cpu-row .lbl { margin-right: 4px; }
.cpu-row button { padding: 5px 12px; font-size: .8rem; }
#lobbyPlayers li .pn { overflow: hidden; text-overflow: ellipsis; min-width: 3em; flex: 0 1 auto; }
.menu-links { flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.menu-links .link { white-space: nowrap; }
#lobbyPlayers li .cpu-skill { padding: 0 5px; font-size: .6rem; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; background: rgba(143,192,255,.12); border-color: rgba(143,192,255,.35); color: var(--good); flex: none; }
#lobbyPlayers li .cpu-skill:disabled { opacity: 1; }
.cpu { display: inline-block; font-family: var(--ui); font-size: .66rem; font-weight: 700; letter-spacing: .02em; padding: 0 5px; border-radius: 2px; background: rgba(143,192,255,.14); color: var(--good); vertical-align: middle; }
.role-plan { margin: 10px 0 0; font-size: .92rem; line-height: 1.45; color: var(--dim); }
.role-plan b { color: var(--ink); font-weight: normal; }
.role-plan .small-village { color: var(--gold); font-style: italic; }

/* your GFL account and record */
.acct-line { margin: 4px 0 0; font-size: .92rem; color: var(--dim); }
.acct-line b { color: var(--ink); font-weight: normal; }
.acct-line a, #recordWho a { color: var(--gold); }
#recordModal { z-index: 60; background: rgba(0,0,0,.6); }
.record-panel { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; }
.record-head { display: flex; justify-content: space-between; align-items: center; }
.record-head button { padding: 4px 10px; }
#recordWho { margin: 6px 0 14px; font-size: .92rem; }
.rec-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rec-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--edge); border-radius: 2px; background: rgba(0,0,0,.3); }
.rec-tile b { font-family: var(--ui); font-size: 1.5rem; color: var(--gold); }
.rec-tile span { font-family: var(--ui); font-size: .62rem; letter-spacing: .02em; color: var(--dim); text-align: center; }
.rec-lines { list-style: none; margin: 0; padding: 0; }
.rec-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed rgba(125,98,51,.45); }
.rec-lines li:first-child { border-top: 0; }
.rec-lines b { color: var(--ink); font-weight: normal; text-align: right; }
.record-empty { text-align: center; padding: 24px 0; }
@media (max-width: 480px) { .rec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the wardrobe (shop.js) */
#wardrobeModal { z-index: 60; background: rgba(0,0,0,.6); }
.wardrobe-panel { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; }
.wd-lead { margin: 6px 0 12px; font-size: .92rem; }
.wd-lead b, #wdEmbers b, .rec-embers b, .ember-gain { color: var(--gold); }
.wd-layout { display: flex; gap: 16px; align-items: flex-start; }
#wdPreview { flex: none; width: 210px; height: 290px; border: 1px solid var(--edge); border-radius: 2px; background: radial-gradient(ellipse at 50% 35%, rgba(255,190,110,.16), rgba(0,0,0,.4) 70%); }
.wd-lists { flex: 1; min-width: 0; }
.wd-lists h3 { font-size: .95rem; margin: 0 0 8px; }
.wd-lists h3 + .wd-grid + h3 { margin-top: 14px; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 7px; }
.wd-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; font-family: var(--text); font-weight: normal; font-size: .95rem; letter-spacing: 0; background: rgba(0,0,0,.35); }
.wd-item small { font-family: var(--ui); font-size: .62rem; letter-spacing: .02em; color: var(--dim); }
.wd-item.on { border-color: var(--gold); }
.wd-item.on small { color: var(--gold); }
.wd-item.locked { opacity: .78; }
.wd-item.locked small::before { content: ''; display: inline-block; width: 6px; height: 5px; margin-right: 5px; border: 1.5px solid currentColor; border-radius: 2px; vertical-align: 0; }
.wd-eye { display: inline-block; width: 18px; height: 8px; border-radius: 2px; background: var(--c); margin-bottom: 2px; }
.wd-msg { min-height: 1.3em; margin: 10px 0 0; font-size: .92rem; color: var(--good); }
.wd-msg.bad { color: var(--evil); }
.ember-gain { margin-top: 6px; font-family: var(--ui); font-size: 1.1rem; }
.ember-gain small { color: var(--dim); font-size: .8rem; }
.rec-embers { margin: 12px 0 0; text-align: center; }
.rec-embers a { color: var(--gold); }
@media (max-width: 600px) { .wd-layout { flex-direction: column; align-items: stretch; } #wdPreview { width: 100%; height: 200px; } }

/* modifiers in the lobby */
.mod-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.mod-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; background: rgba(0,0,0,.3); opacity: .7; font-weight: normal; }
.mod-chip.on { opacity: 1; border-color: var(--gold); background: rgba(217,180,90,.08); }
.mod-chip .rc-name { font-family: var(--ui); font-weight: 700; color: var(--gold); font-size: .8rem; }
.mod-chip .rc-blurb { font-family: var(--text); font-size: .82rem; color: var(--ink); letter-spacing: 0; line-height: 1.25; }
.mod-chip .rc-state { font-size: .62rem; letter-spacing: .02em; color: var(--dim); }
.mod-chip.on .rc-state { color: var(--gold); }
.mod-chip:disabled { cursor: default; }
@media (max-width: 640px) { .mod-chips { grid-template-columns: 1fr; } }

/* hiding: a dark, narrowed view and a bar saying where you are */
#hideBar { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 30; padding: 8px 16px; border-radius: 2px; background: rgba(10,7,4,.85); border: 1px solid var(--edge); font-family: var(--ui); font-size: .9rem; letter-spacing: .02em; color: var(--ink); pointer-events: none; }
body.hiding #app::after { content: ''; position: fixed; inset: 0; pointer-events: none; background:
  repeating-linear-gradient(100deg, rgba(40,26,10,.0) 0 18px, rgba(40,26,10,.55) 18px 26px),
  radial-gradient(ellipse at center, transparent 25%, rgba(0,0,0,.85) 75%); }

/* evil whispers */
#whisper { position: fixed; left: 16px; bottom: 150px; z-index: 31; width: min(340px, 70vw); padding: 10px 12px; border-color: #6a1d1d; background: rgba(20,6,6,.88); }
#whisper .lbl { color: #ff8a7a; margin-bottom: 4px; }
#whisperLog { font-size: .92rem; line-height: 1.35; max-height: 9em; overflow: hidden; color: #f1d2c8; font-style: italic; }
#whisperLog b { font-style: normal; }
#whisperIn { display: none; width: 100%; margin-top: 6px; font-size: .92rem; padding: 6px 8px; border-color: #6a1d1d; }
#whisper.typing #whisperIn { display: block; }
#chatLog .m.whisper { color: #f1b4a8; font-style: italic; }
#chatLog .wh-tag { font-family: var(--ui); font-style: normal; font-size: .62rem; letter-spacing: .02em; color: #ff8a7a; border: 1px solid #6a1d1d; border-radius: 2px; padding: 0 4px; }
.card .dots i.anon { background: #8a7f6a; }
a.foot-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; pointer-events: auto; }

/* players with a GFL account: click for their stats (js/profiles.js) */
#lobbyPlayers li.has-acct { cursor: pointer; }
#lobbyPlayers li.has-acct:hover .pn { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
#lobbyPlayers li .acct-tag { flex: none; font-family: var(--ui); font-size: .58rem; letter-spacing: .02em; padding: 0 5px; border-radius: 2px; border: 1px solid var(--edge); color: var(--gold); }
#playerCard { z-index: 60; background: rgba(0,0,0,.6); }
.gp-head { display: flex; flex-direction: column; margin: 4px 0 6px; }
.gp-head b { font-family: var(--ui); font-size: 1.4rem; color: var(--ink); }
.gp-head span { color: var(--dim); font-size: .9rem; }
.gp-sec { margin: 14px 0 6px; font-family: var(--ui); font-size: .72rem; letter-spacing: .02em; color: var(--dim); }
.gp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border: 1px solid var(--edge); border-radius: 2px; background: rgba(0,0,0,.3); }
.gp-tile b { font-family: var(--ui); font-size: 1.25rem; color: var(--gold); }
.gp-tile span { font-family: var(--ui); font-size: .58rem; letter-spacing: .02em; color: var(--dim); text-align: center; }
.gp-note { color: var(--dim); margin: 4px 0; }
.gp-line { color: var(--dim); font-size: .92rem; margin: 8px 0 0; }
@media (max-width: 480px) { .gp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the GFL level (js/level.js) */
.lvl { display: inline-flex; flex-direction: column; gap: 3px; min-width: 80px; vertical-align: middle; margin-right: 10px; }
.lvl b { font-family: var(--ui); font-size: .78rem; letter-spacing: .02em; color: var(--gold); }
.lvl i { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.lvl u { display: block; height: 100%; background: linear-gradient(90deg, #a8822e, var(--gold)); text-decoration: none; }
.acct-line { display: flex; align-items: center; gap: 6px; max-width: 520px; }
.acct-line > span:not(.lvl) { flex: 1; min-width: 0; }
.gp-level { display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; color: var(--dim); font-size: .9rem; }
.lvl-up { margin-top: 6px; color: var(--gold); font-size: 1.15rem; }

/* after a win when you're signed out: "keep this win" (../js/level.js nudge) */
.acct-nudge { display: block; margin: 10px auto 0; max-width: 460px; padding: 8px 14px; border: 1px solid rgba(201,164,92,.5); border-radius: 2px; background: rgba(201,164,92,.08); color: var(--ink, #e8e2d0); font-size: .9rem; line-height: 1.4; text-decoration: none; }
.acct-nudge b { color: var(--gold); font-family: var(--ui); letter-spacing: .04em; }
.acct-nudge:hover { background: rgba(201,164,92,.16); }

/* the map picker in the lobby */
.map-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 14px; }
.map-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 5px; text-align: left; background: rgba(0,0,0,.3); opacity: .72; font-weight: normal; }
.map-card img { width: 100%; aspect-ratio: 1; border-radius: 2px; display: block; border: 1px solid rgba(0,0,0,.6); }
.map-card .mc-name { font-family: var(--ui); font-weight: 700; font-size: .72rem; color: var(--gold); line-height: 1.15; margin-top: 2px; }
.map-card .mc-blurb { font-size: .7rem; line-height: 1.2; color: var(--dim); letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.map-card.on { opacity: 1; border-color: var(--gold); background: rgba(217,180,90,.08); }
.map-card:disabled { cursor: default; }
.map-card:disabled:not(.on) { opacity: .45; }
@media (max-width: 640px) { .map-pick { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- HUD polish */
#hud .panel, #roleBadge, #taskBarWrap { background: rgba(14, 10, 7, .72); }
#taskPanel { width: 262px; padding: 12px 14px; }
#taskPanel h3 { font-size: .86rem; letter-spacing: .02em; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(125,98,51,.35); }
#taskList li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; line-height: 1.25; }
#taskList li > span { flex: 1; min-width: 0; }
#taskList li small { display: block; font-size: .78rem; margin-top: 1px; }
#taskList .tick { flex: none; width: 13px; height: 13px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--gold); position: relative; }
#taskList li.done { text-decoration: none; opacity: .6; color: #9cc48a; }
#taskList li.done > span { text-decoration: line-through; text-decoration-color: rgba(156,196,138,.6); }
#taskList li.done .tick { border-color: #7fb06a; background: #7fb06a; }
#taskList li.done .tick::after { content: ''; position: absolute; left: 3px; top: 0; width: 4px; height: 7px; border: solid #10170c; border-width: 0 2px 2px 0; transform: rotate(45deg); }
#minimap { }
#mapName { position: absolute; top: 218px; right: 12px; width: 200px; text-align: center; font-family: var(--ui); font-size: .7rem; letter-spacing: .02em; color: var(--dim); text-shadow: 0 1px 0 rgba(0,0,0,.85); }
#mapName:empty { display: none; }
#prompt:not(:empty) { padding: 7px 16px; border-radius: 2px; background: rgba(12, 8, 5, .66); border: 1px solid rgba(217,180,90,.45); text-shadow: 0 1px 0 rgba(0,0,0,.85); }
#taskBarWrap { min-width: 240px; }
#taskBar { height: 8px; background: rgba(0,0,0,.55); }
.act { }
@media (max-width: 760px) { #mapName { top: 146px; width: 130px; } #taskPanel { width: 190px; } }

/* ================================================================ the broadsheet: components
   (kept together at the end so the look lives in one place) */

/* title */
.emblem { filter: none; }
.brand h1 { font-family: var(--display); font-weight: 800; background: none; color: var(--ink); filter: none; letter-spacing: 0; line-height: .9;
  text-shadow: 3px 3px 0 #000; }
.tagline { font-family: var(--text); font-style: italic; font-size: clamp(.95rem, 1.5vw, 1.1rem); color: var(--dim); border-top: 2px solid var(--red); padding-top: 6px; display: inline-block; }
.ornament { color: var(--red-hi); opacity: 1; }
.ornament span, .ornament span:first-child { background: var(--rule); }
#menu .sub { font-family: var(--text); color: var(--ink); }
#menu { background: linear-gradient(90deg, rgba(7,6,5,.95) 0%, rgba(7,6,5,.85) 32%, rgba(7,6,5,.2) 62%, rgba(7,6,5,0) 78%); }
.menu-card { background: var(--soot) var(--grain); }
#createBtn { border-color: #000; }
.link { color: var(--dim); background: transparent; border-color: transparent; font-family: var(--ui); }
.link:hover:not(:disabled) { color: var(--ink); background: transparent; text-decoration: underline; text-decoration-color: var(--red-hi); text-underline-offset: 4px; }
.menu-foot { font-family: var(--ui); font-style: italic; letter-spacing: 0; }
.embers i { background: var(--ink); opacity: 0; width: 2px; height: 2px; }
.or { font-family: var(--text); }
.or::before, .or::after { background: var(--rule); opacity: 1; }

/* things that are switched on are printed in reverse: bone ground, black ink */
.toggle.on, .role-chip.on, .mod-chip.on, .map-card.on, .mt-tabs button.on, .seq-keys button.on {
  background: var(--ink); color: var(--soot); border-color: var(--ink); opacity: 1; }
.role-chip.on .rc-name, .mod-chip.on .rc-name, .map-card.on .mc-name { color: var(--soot); }
.role-chip.on .rc-blurb, .mod-chip.on .rc-blurb, .map-card.on .mc-blurb, .role-chip.on .rc-state, .mod-chip.on .rc-state { color: #3b352d; }
.role-chip.on.evil .rc-name { color: var(--red); } .role-chip.on.good .rc-name { color: #2c4a63; } .role-chip.on.fool .rc-name { color: #7a5a10; }
.role-chip, .mod-chip, .map-card { background: var(--soot-2); opacity: .8; }
.role-chip:hover:not(:disabled) .rc-name, .mod-chip:hover:not(:disabled) .rc-name, .map-card:hover:not(:disabled) .mc-name { color: inherit; }
.mod-chip .rc-name, .map-card .mc-name { color: var(--ink); font-family: var(--ui); font-weight: 800; font-size: .86rem; }
.rc-state { font-style: italic; }
.role-chip em { color: var(--red-hi); }
.map-card img { border-radius: 0; border: 1px solid #000; filter: grayscale(.35) contrast(1.05); }
.map-card.on img { filter: none; }
.set { border-bottom: 1px solid rgba(233,225,207,.14); }
.set .val { font-family: var(--ui); font-weight: 800; }
#lobbyCode { font-family: var(--ui); font-weight: 800; letter-spacing: .22em; } /* (codes are typed: plain letters, not blackletter) */
#colorPick button { border-radius: 0; border: 2px solid #000; }
#colorPick button.mine { border-color: var(--ink); outline: 2px solid #000; }
.sw { border-radius: 0; }
#lobbyPlayers li { background: var(--soot-2); border-radius: 0; }
#lobbyPlayers li .crown { color: var(--red-hi); font-style: italic; }
.cpu, .cpu-skill, .acct-tag { border-radius: 0 !important; }
.lobby-cols > div + div { border-left-color: var(--rule); }
.log { background: #0b0908; border: 1px solid rgba(233,225,207,.15); border-radius: 0; font-family: var(--text); }
.log .m b { font-family: var(--ui); }

/* the HUD: small black labels pasted over the night */
#hud .panel, #roleBadge, #taskBarWrap, #prompt:not(:empty) { background: var(--soot) var(--grain); border: 1px solid var(--rule); border-radius: 0; box-shadow: 4px 4px 0 rgba(0,0,0,.55); outline: none; }
#roleBadge { font-family: var(--display); font-weight: 800; font-size: 1.15rem; padding: 4px 14px; }
#roleBadge.evil { color: var(--evil); } #roleBadge.good { color: var(--good); }
#taskPanel h3 { color: var(--red-hi); border-bottom-color: var(--rule); }
#taskList .tick { border-radius: 0; border-color: var(--ink); }
#taskList li.done .tick { background: var(--ink); border-color: var(--ink); }
#taskList li.done .tick::after { border-color: var(--soot); }
#taskList li.done { color: var(--dim); }
#taskBar { border-radius: 0; background: #0b0908; border: 1px solid rgba(233,225,207,.2); }
#taskFill { background: var(--ink); }
#wardsPct { font-weight: 800; }
#minimap { border-radius: 0; border: 1px solid var(--rule); box-shadow: 4px 4px 0 rgba(0,0,0,.55); }
#mapName { font-family: var(--display); font-size: .95rem; color: var(--ink); text-shadow: 0 1px 0 #000; letter-spacing: .02em; }
#prompt:not(:empty) { font-family: var(--ui); font-weight: 800; border-radius: 0; }
.act { border-radius: 0; background: var(--soot); border: 1px solid var(--rule); box-shadow: 4px 4px 0 rgba(0,0,0,.55); width: 74px; height: 74px; font-family: var(--ui); }
.act .cd { border-radius: 0; }
.act kbd { border-radius: 0; background: var(--ink); color: var(--soot); border: 0; font-family: var(--ui); font-weight: 800; }
.act.ready { border-color: var(--ink); background: var(--soot-2); }
#btnKill { background: #2a0d0a; border-color: var(--red); }
#btnKill.ready { background: var(--red); border-color: #000; }
#sabBanner { border-radius: 0; background: var(--red); border-color: #000; color: #f6ecd8; animation: none; box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
#sabMenu button { background: var(--soot-2); }
#sabMenu button:hover:not(:disabled) small { color: #3b352d; }
#crosshair i { background: var(--ink); border-radius: 0; }
#crosshair::before { border-radius: 0; border-color: rgba(233,225,207,.3); }
.wp i { border-color: var(--ink); background: rgba(233,225,207,.18); }
.wp.edge i { filter: none; border-color: var(--ink); }
.wp b { color: var(--ink); font-weight: 800; }
.wp.fix i, .wp.fix.edge i { border-color: var(--red-hi); background: rgba(210,68,47,.25); }
.wp.fix b { color: var(--red-hi); }
#hint, #lockHint { font-family: var(--ui); font-style: italic; }

/* messages */
.toast { background: var(--soot) var(--grain); border: 1px solid var(--rule); border-radius: 0; box-shadow: 4px 4px 0 rgba(0,0,0,.55); font-family: var(--ui); }
.toast.evil { border-color: var(--red-hi); color: #f4d2c8; border-left: 5px solid var(--red-hi); }
.toast.good { border-color: var(--good); color: var(--ink); border-left: 5px solid var(--good); }

/* letters: a printed bill on rough paper, sealed in red */
.parchment { background: #e6dcc4 var(--grain) !important; color: #1b1714 !important; border-radius: 0 !important; border: 1px solid #000; outline: 1px solid #1b1714; outline-offset: -8px; box-shadow: 8px 8px 0 rgba(0,0,0,.6); }
#letterModal .seal { background: var(--red); border-radius: 50%; color: #f3ead6; box-shadow: 2px 2px 0 rgba(0,0,0,.4); }
#letterModal.forged .seal { background: #1b1714; color: var(--red-hi); }
.parchment h2, .parchment h3 { color: #1b1714; }
.parchment button { background: #1b1714; color: #e9e1cf; border-color: #000; }
.parchment button:hover:not(:disabled) { background: var(--red); color: #f6ecd8; }
#letterBody { font-family: var(--text); }

/* the role you're dealt */
.role-card .face { border-radius: 0; border-color: var(--rule); }
.role-card .front { background: var(--soot) var(--grain); }
.role-card .rn { font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.role-card .ri .ico { color: var(--ink); }

/* chores */
.hold-bar, .seq-target span, .clicks-area, .timing-bar { border-radius: 0 !important; }
.hold-fill { background: var(--ink); }
.clicks-area { background: #120f0c var(--grain); }
.seq-target span.ok { background: var(--ink); color: var(--soot); border-color: var(--ink); }

/* the long panels */
.codex-panel, .settings-panel { background: var(--soot) var(--grain); }
.lvl i { border-radius: 0; } .lvl u { background: var(--ink); } .lvl b { font-family: var(--ui); color: var(--ink); }
#wdPreview { border-radius: 0; background: #120f0c var(--grain); }

/* the big moments: set in blackletter, printed flat */
#reveal { background: rgba(7,6,5,.86); }
#reveal .you { font-family: var(--text); font-style: italic; font-size: 1.15rem; }
#reveal .role { font-family: var(--display); font-weight: 800; letter-spacing: 0; text-shadow: 4px 4px 0 #000; }
#reveal .desc { font-family: var(--ui); }
#eject { background: rgba(40,8,4,.88); }
#eject .big { font-family: var(--display); font-weight: 800; }
#eject .small { color: var(--ink); font-family: var(--text); }
#over h1 { font-family: var(--display); font-weight: 800; text-shadow: 4px 4px 0 #000; }
