body{background:radial-gradient(ellipse at top,#2a1a3a,#0c0812 75%)}
body.night{background:radial-gradient(ellipse at top,#121a33,#04050b 75%)}
main{max-width:1100px}
#lobby{max-width:760px}
.row{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.4rem}
.muted{color:#7a5a3a;font-size:.9rem;margin:.3rem 0}
.small{font-size:.9rem}
.btn.small{min-height:36px;font-size:.9rem;padding:.25em .7em}
.field{display:block;margin:.5rem 0;font-variant:small-caps}
.field input,.field select,.inline input,textarea{display:block;width:100%;font:1.05rem Georgia,serif;padding:.55em .7em;border-radius:6px;border:2px solid #8a5a2a;background:#fff8e3;color:var(--ink);margin-top:.2rem;min-height:46px}
fieldset.field{border:1px solid #c9a46a;border-radius:6px}
.radio{display:flex;gap:.5rem;align-items:flex-start;font-variant:normal;margin:.35rem 0;line-height:1.3}
.radio input{width:22px;height:22px;flex:none;margin-top:.1rem}
.timers{display:flex;gap:.5rem;flex-wrap:wrap}.timers label{flex:1;min-width:90px;font-variant:small-caps}
.timers input{width:100%;font:1rem Georgia,serif;padding:.4em;border-radius:6px;border:2px solid #8a5a2a;background:#fff8e3;min-height:44px}
.inline{display:flex;gap:.4rem;margin-top:.6rem}.inline input{flex:1;min-width:0;margin:0}
.stack{display:flex;flex-direction:column;gap:.4rem}
.games{display:flex;flex-direction:column;gap:.4rem}
.game{display:grid;grid-template-columns:1fr auto;gap:.2rem .6rem;align-items:center;background:#fff8e3;border:1px solid #c9a46a;border-radius:6px;padding:.5rem .6rem}
.game .meta{font-size:.85rem;color:#6b4a2a}
.game .t{font-weight:bold}
.tag{display:inline-block;font-size:.72rem;border-radius:99px;padding:.05em .55em;background:#2a1f5c;color:#f4e4bc;margin-left:.3em;vertical-align:middle}
.tag.open{background:#2f6b3a}.tag.playing{background:#8a2a1a}.tag.over{background:#666}
.conn{position:fixed;top:.5rem;right:.5rem;z-index:60;background:#8a2a1a;color:#fff3d0;border-radius:99px;padding:.3em .8em;font-size:.85rem;box-shadow:0 2px 8px #000a}
.conn.ok{background:#2f6b3a}
.topbar .code{font-size:.95rem}.topbar .code b{letter-spacing:.15em;font-size:1.15rem}
.phase{font-variant:small-caps;font-size:1.15rem;font-weight:bold}
.clock{font-variant-numeric:tabular-nums;font-size:1.1rem}
.paused{background:#8a2a1a;color:#fff3d0;padding:.4em .6em;border-radius:6px;margin:.4rem 0 0}
.cols{display:grid;grid-template-columns:1fr;gap:0 .8rem}
@media (min-width:900px){.cols{grid-template-columns:1fr 1fr}}
.role{display:flex;gap:.7rem;align-items:center}
.role .ic{font-size:2.8rem;line-height:1;width:64px;text-align:center}.role .ic img{width:64px}
.role .nm{font-size:1.3rem;font-weight:bold}
.team-de{color:#2f5a2f}.team-order{color:#8a2a1a}.team-neutral{color:#5a4a8a}
.targets{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.5rem;margin-top:.5rem}
.target{min-height:56px;font:1rem Georgia,serif;border-radius:8px;border:2px solid #8a5a2a;background:#fff8e3;color:var(--ink);cursor:pointer;padding:.4em;touch-action:manipulation;text-align:center}
.target.on{background:#2a1f5c;color:#fff3d0;border-color:#ffd27a;box-shadow:0 0 0 3px #ffd27a}
.target small{display:block;font-size:.75rem;opacity:.8}
.players{display:flex;flex-direction:column;gap:.3rem}
.pl{display:flex;align-items:center;gap:.5rem;padding:.35rem .4rem;border-radius:6px;background:#fff8e3;border:1px solid #e0c99a;min-height:44px}
.pl.dead{opacity:.6;text-decoration:line-through}.pl.dead .rr{text-decoration:none}
.pl .dot{width:10px;height:10px;border-radius:50%;background:#999;flex:none}.pl .dot.on{background:#2f9b3a}
.pl .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl .rr{font-size:.8rem;color:#6b4a2a}
.pl .vt{font-size:.8rem;background:#8a2a1a;color:#fff;border-radius:99px;padding:0 .5em}
.pl.won{box-shadow:inset 0 0 0 2px #e8b74a}
.log{max-height:46vh;overflow-y:auto;display:flex;flex-direction:column;gap:.35rem;padding-right:.2rem}
.log p{margin:0}
.log .narration{font-style:italic;font-size:1.05rem;border-left:3px solid #8a5a2a;padding-left:.5rem}
.log .narration.gm{border-left-color:#2a1f5c}
.log .system{font-size:.85rem;color:#6b4a2a}
.log .ghost{color:#4a5a8a;font-style:italic}
.chat p b{color:#8a2a1a}.chat .de b{color:#2f5a2f}.chat .de{background:#e8f0e0;border-radius:4px;padding:0 .3em}
.chips{display:flex;flex-wrap:wrap;gap:.35rem;margin:.3rem 0}
.chip{font:.88rem Georgia,serif;text-align:left;border-radius:8px;border:1px solid #8a5a2a;background:#fff8e3;padding:.45em .6em;cursor:pointer;min-height:40px;color:var(--ink)}
.gmtable{width:100%;border-collapse:collapse;font-size:.92rem}
.gmtable td,.gmtable th{border-bottom:1px solid #e0c99a;padding:.3em .25em;text-align:left;vertical-align:top}
.gmtable .dead{opacity:.55;text-decoration:line-through}
.preview{background:#fff8e3;border:1px dashed #8a5a2a;border-radius:6px;padding:.4rem .5rem;margin:.5rem 0}
.override{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.override select{font:1rem Georgia,serif;min-height:44px;border-radius:6px;border:2px solid #8a5a2a;background:#fff8e3;flex:1}
.winner{font-size:1.15rem;text-align:center}
h3{font-variant:small-caps;margin:.8rem 0 .2rem}
[hidden]{display:none!important}

.k-header{background:var(--bg-day) repeat-x center bottom/auto 100%;padding-bottom:1rem;border-bottom:3px solid #3b2412}
body.night .k-header{background-image:var(--bg-night)}
.k-header h1{margin:.3em 0 .1em}
.k-header .sign{height:clamp(110px,26vw,170px);display:block;margin:0 auto;filter:drop-shadow(0 6px 10px #000a)}
.k-header p{background:#0008;display:inline-block;padding:.1em .6em;border-radius:6px}
.k-header .back{background:#0008;padding:.2em .5em;border-radius:6px}
img.art{display:inline-block;vertical-align:middle}
.role .ic img{width:72px;height:72px}
img.tok{width:26px;height:26px;margin-right:.1em}
.tk img{width:22px;height:22px}
img.inl{width:30px;height:30px}
.crest{text-align:center;font-size:3rem}.crest img{width:120px;height:120px}.crest.small img{width:72px;height:72px}

.hand{display:flex;gap:.6rem;justify-content:center;flex-wrap:wrap;margin:.3rem 0 .4rem}
.card{position:relative;container-type:inline-size;width:min(44vw,190px);aspect-ratio:276/384;border:0;padding:0;background:transparent center/100% 100% no-repeat;cursor:pointer;touch-action:manipulation;font-family:Georgia,serif;border-radius:10px;transition:transform .2s,filter .2s,box-shadow .2s;-webkit-tap-highlight-color:transparent}
.card .ct{position:absolute;left:7.6%;width:84.8%;top:5.5%;height:7.8%;display:flex;align-items:center;justify-content:center;color:#f4e4bc;font-weight:bold;font-size:7cqw;font-variant:small-caps;white-space:nowrap;overflow:hidden;text-shadow:0 1px 0 #000}
.card .cx{position:absolute;left:9.8%;width:80.4%;top:64.1%;height:29.7%;display:flex;align-items:center;justify-content:center;text-align:center;color:#3b2412;font-size:6.2cqw;line-height:1.18;overflow:hidden}
.card .cs{position:absolute;left:8%;right:8%;top:44%;background:#140c08e0;color:#f4e4bc;border:1px solid #e8b74a;border-radius:6px;padding:.3em .2em;font-size:7cqw;text-align:center}
.card .cn{position:absolute;left:6%;right:6%;bottom:-.2rem;transform:translateY(100%);font-size:.78rem;color:#6b4a2a;text-align:center}
.card.locked{filter:grayscale(.85) brightness(.75);cursor:not-allowed;margin-bottom:1.1rem}
.card.played,.card.spent{filter:brightness(.8);cursor:default}
.card.ready{box-shadow:0 0 0 2px #e8b74a88,0 6px 16px #0008}
.card.sel{transform:translateY(-8px);box-shadow:0 0 0 3px #ffd27a,0 0 18px #ffd27a,0 10px 20px #000a}
.cardtext{background:#fff8e3;border-left:3px solid #8a5a2a;padding:.4rem .6rem;border-radius:4px}
@media (prefers-reduced-motion:reduce){.card{transition:none}}
/* item cards: the spell and save frames match the role frame's boxes */
.card.item.save .ct{color:#4a300c;text-shadow:0 1px 0 #fff8}
.card.item.spell .cx{color:#1e2a12}
#itemPanel .hand{flex-wrap:wrap}
.gmitems summary{cursor:pointer;font-weight:bold;margin:.5rem 0}
.sheet{position:fixed;inset:auto 0 0 0;z-index:50;background:#000a;display:flex;justify-content:center;padding:0;height:100%;align-items:flex-end}
.sheet .sheetin{background:#fff8e3;color:#2b1a0c;width:min(100%,560px);border-radius:16px 16px 0 0;padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));box-shadow:0 -8px 30px #000a;max-height:92vh;overflow:auto;animation:sheetUp .2s ease-out}
.sheet .hand{justify-content:center}
.sheet .clock{text-align:center;font-weight:bold}
@keyframes sheetUp{from{transform:translateY(40%)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.sheet .sheetin{animation:none}}
