/* Realmtable v3 — title screen, user panel, character forge, avatars, immersive table. */

:root {
  --gl: #E8C877;
  --gd: #B8862B;
  --glass: rgba(16, 11, 8, .78);
  --glass2: rgba(28, 20, 14, .86);
  --glass-b: rgba(232, 200, 119, .24);
  --tl: #F3E6C8;
  --ml: #BFA98A;
  --okc: #9FD3A5;
  --badc: #F0907E;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ===================================================================== avatars */

svg.av { display: block; overflow: visible; width: 100%; height: 100%; }
svg.av * { transform-box: view-box; }
.av-body { animation: av-breathe 3.4s ease-in-out infinite; }
.av-head { animation: av-nod 6.8s ease-in-out infinite; }
.av-orb, .av-flame { animation: av-glow 1.8s ease-in-out infinite; }
.av-tail { animation: av-tail 2.6s ease-in-out infinite; transform-origin: 58px 88px; }
.av-eyes { animation: av-blink 5.2s infinite; transform-origin: 50px 37px; }
@keyframes av-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.025); } }
@keyframes av-nod { 0%, 40%, 100% { transform: rotate(0); } 55% { transform: rotate(-3deg); } 75% { transform: rotate(2deg); } }
@keyframes av-glow { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes av-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(9deg); } }
@keyframes av-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* walking (class set by the map while a token moves) */
.walking svg.av .av-leg-l { animation: av-step .32s ease-in-out infinite alternate; }
.walking svg.av .av-leg-r { animation: av-step .32s ease-in-out infinite alternate-reverse; }
.walking svg.av .av-arm-back { animation: av-swing .32s ease-in-out infinite alternate; }
.walking svg.av .av-fig { animation: av-bob .16s ease-in-out infinite alternate; }
@keyframes av-step { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes av-swing { from { transform: rotate(14deg); } to { transform: rotate(-14deg); } }
@keyframes av-bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* one-shot actions (playAnim) */
svg.av.a-attack .av-arm-front { animation: av-slash .65s var(--ease-out); }
svg.av.a-attack .av-fig { animation: av-lunge .65s var(--ease-out); }
@keyframes av-slash { 0% { transform: rotate(0); } 30% { transform: rotate(-75deg); } 55% { transform: rotate(70deg); } 100% { transform: rotate(0); } }
@keyframes av-lunge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-3px) rotate(-3deg); } 55% { transform: translateX(7px) rotate(4deg); } }

svg.av.a-shoot .av-arm-front { animation: av-draw .75s var(--ease-out); }
svg.av.a-shoot .av-string { animation: av-string .75s var(--ease-out); }
svg.av.a-shoot .av-fig { animation: av-recoil .75s var(--ease-out); }
@keyframes av-draw { 0% { transform: rotate(0); } 25%, 55% { transform: rotate(-68deg); } 65% { transform: rotate(-78deg); } 100% { transform: rotate(0); } }
@keyframes av-string { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-6px); } 60% { transform: translateX(1px); } }
@keyframes av-recoil { 0%, 55%, 100% { transform: translateX(0); } 65% { transform: translateX(-4px); } }

svg.av.a-cast .av-arm-front, svg.av.a-cast .av-arm-back { animation: av-raise 1s var(--ease-out); }
svg.av.a-cast .av-aura { animation: av-aura 1s ease-out; }
svg.av.a-cast .av-sparks { animation: av-sparks 1s ease-out; }
svg.av.a-cast .av-fig { animation: av-rise 1s var(--ease-out); }
@keyframes av-raise { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(-150deg); } }
@keyframes av-aura { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: .95; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes av-sparks { 0% { opacity: 0; transform: translateY(8px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes av-rise { 0%, 100% { transform: translateY(0); } 40%, 60% { transform: translateY(-5px); } }
svg.av.a-cast .av-aura, svg.av.a-heal .av-aura, svg.av.a-crit .av-aura { transform-origin: 50px 70px; }

svg.av.a-hurt .av-fig { animation: av-hurt .5s ease-out; }
@keyframes av-hurt { 0% { transform: translateX(0); filter: none; } 15% { transform: translateX(-6px) rotate(-6deg); filter: sepia(1) saturate(6) hue-rotate(-30deg) brightness(.95); } 35% { transform: translateX(5px) rotate(3deg); } 55% { transform: translateX(-3px); } 100% { transform: translateX(0); filter: none; } }

svg.av.a-heal .av-sparks { animation: av-sparks 1.1s ease-out 2; }
svg.av.a-heal .av-aura { animation: av-aura 1.1s ease-out; filter: hue-rotate(80deg) saturate(1.6); }
svg.av.a-heal .av-fig { animation: av-glowup 1.1s ease-out; }
@keyframes av-glowup { 0%, 100% { filter: none; } 40% { filter: brightness(1.35) drop-shadow(0 0 6px #9FD3A5); } }

svg.av.a-crit .av-fig { animation: av-crit 1.3s var(--ease-spring); }
svg.av.a-crit .av-arm-front { animation: av-slash .7s var(--ease-out) .25s; }
svg.av.a-crit .av-aura { animation: av-aura 1.3s ease-out; filter: hue-rotate(-160deg) saturate(2); }
@keyframes av-crit { 0% { transform: translateY(0) scale(1); filter: none; } 25% { transform: translateY(-14px) scale(1.12); filter: drop-shadow(0 0 8px #E8C877) brightness(1.3); } 60% { transform: translateY(0) scale(1.05); } 100% { transform: none; filter: none; } }

svg.av.a-fumble .av-fig { animation: av-fumble 1.1s ease-in-out; }
@keyframes av-fumble { 0% { transform: rotate(0); } 25% { transform: rotate(-14deg) translateX(-3px); } 50% { transform: rotate(10deg) translateY(2px); } 75% { transform: rotate(-6deg); } 100% { transform: rotate(0); } }

svg.av.a-cheer .av-arm-front, svg.av.a-cheer .av-arm-back { animation: av-raise .9s var(--ease-out); }
svg.av.a-cheer .av-fig { animation: av-jump .9s var(--ease-spring); }
@keyframes av-jump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-16px); } 60% { transform: translateY(0) scale(1.04, .96); } }

svg.av.a-block .av-arm-back { animation: av-block .6s var(--ease-out); }
@keyframes av-block { 0%, 100% { transform: rotate(0) translateX(0); } 30%, 70% { transform: rotate(-35deg) translateX(-2px); } }

svg.av.a-die .av-fig { animation: av-die .9s ease-in forwards; }
@keyframes av-die { to { transform: rotate(-88deg) translate(-6px, -4px); } }

/* persistent states on the token wrapper */
.down svg.av .av-fig { transform: rotate(-88deg) translate(-6px, -4px); filter: grayscale(.6) brightness(.8); animation: none; }
.down svg.av .av-body, .down svg.av .av-head { animation: none; }
.down svg.av .av-eyes { opacity: 0; }
.down svg.av .av-eyes-shut { opacity: 1; }
.down svg.av .av-zz { opacity: 1; animation: av-zz 2.4s ease-in-out infinite; }
@keyframes av-zz { 0%, 100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(-4px); opacity: 1; } }
.raging svg.av .av-fig { filter: drop-shadow(0 0 4px #E0442E); }
.invisible-tok svg.av { opacity: .35; }
.dead svg.av { filter: grayscale(1) brightness(.55); }
.dead svg.av .av-fig { transform: rotate(-88deg) translate(-6px, -4px); }
.facing-left svg.av .av-flip { transform: scaleX(-1); transform-origin: 50px 0; }

@media (prefers-reduced-motion: reduce) {
  svg.av *, .walking svg.av * { animation: none !important; }
}

/* ===================================================================== title screen */

body.mode-title { background: #000; overflow: hidden; }
.title-screen { position: fixed; inset: 0; overflow: hidden; color: var(--tl); font-family: var(--ui); user-select: none; }
.ts-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ts-grain { position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: 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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(5) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }
.ts-letterbox { position: absolute; left: 0; right: 0; height: 9vh; background: #000; z-index: 3; transition: transform 1.4s var(--ease-out); }
.ts-letterbox.top { top: 0; } .ts-letterbox.bottom { bottom: 0; }
.awake .ts-letterbox.top { transform: translateY(-100%); } .awake .ts-letterbox.bottom { transform: translateY(100%); }

.ts-corner { position: absolute; top: 14px; right: 14px; z-index: 6; display: flex; gap: 8px; }
.ts-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-b); background: rgba(0, 0, 0, .35); color: var(--gl); display: grid; place-items: center; backdrop-filter: blur(6px); }
.ts-icon svg { width: 20px; height: 20px; }
.ts-icon:hover { background: rgba(0, 0, 0, .55); border-color: var(--gl); }

.ts-center { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6vh 16px; gap: 2vh; }
.ts-logo { text-align: center; transition: transform 1.1s var(--ease-out), margin 1.1s var(--ease-out); transform-origin: 50% 0; animation: logoIn 2.4s var(--ease-out) both; }
@keyframes logoIn { from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px); } }
.ts-emblem { width: clamp(84px, 11vw, 132px); height: auto; filter: drop-shadow(0 0 22px rgba(232, 200, 119, .35)) drop-shadow(0 6px 10px #000); animation: emblem 7s ease-in-out infinite; }
.ts-emblem .ts-ring { transform-origin: 60px 60px; animation: spin 40s linear infinite; }
@keyframes emblem { 50% { transform: translateY(-6px); filter: drop-shadow(0 0 34px rgba(232, 200, 119, .55)) drop-shadow(0 6px 10px #000); } }
@keyframes spin { to { transform: rotate(360deg); } }
.ts-word { margin: 4px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(54px, 10.5vw, 132px); line-height: .95; letter-spacing: .02em; }
.ts-shine { position: relative; display: inline-block; color: transparent; background: linear-gradient(180deg, #FFF6DA 0%, #F2D58C 38%, #B07C24 52%, #E8C877 70%, #FFF1C4 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 0 #3A2610) drop-shadow(0 8px 18px rgba(0, 0, 0, .8)); }
.ts-shine::after { content: attr(data-text); position: absolute; inset: 0; color: transparent; background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%) -200% 0 / 200% 100% no-repeat; -webkit-background-clip: text; background-clip: text; animation: shine 6s ease-in-out 2s infinite; }
@keyframes shine { 0% { background-position: -200% 0; } 35%, 100% { background-position: 200% 0; } }
.ts-tag { margin: 10px 0 0; display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--num); font-weight: 500; letter-spacing: .38em; text-transform: uppercase; font-size: clamp(11px, 1.3vw, 15px); color: #E9D3A0; text-shadow: 0 2px 6px #000; }
.ts-tag i { width: clamp(30px, 6vw, 80px); height: 1px; background: linear-gradient(90deg, transparent, var(--gl)); }
.ts-tag i:last-child { transform: scaleX(-1); }

.ts-press { margin-top: 5vh; padding: 12px 26px; background: none; border: 0; color: var(--tl); font-family: var(--num); font-weight: 700; font-size: clamp(13px, 1.5vw, 17px); letter-spacing: .32em; text-transform: uppercase; text-shadow: 0 0 14px rgba(232, 200, 119, .65), 0 2px 4px #000; animation: press 2.4s ease-in-out infinite; }
.ts-press::before, .ts-press::after { content: '◆'; margin: 0 14px; color: var(--gl); font-size: .7em; vertical-align: middle; }
@keyframes press { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.awake .ts-press { display: none; }
.awake .ts-logo { transform: scale(.62); margin-bottom: -7vh; }
@media (max-height: 760px) { .awake .ts-logo { transform: scale(.5); margin-bottom: -11vh; } .awake .ts-emblem { display: none; } }

.ts-panel { width: min(430px, 94vw); display: none; position: relative; }
.awake .ts-panel { display: block; }
.ts-panel.in { animation: panelIn .7s var(--ease-out) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.ts-form { position: relative; padding: 22px 26px 18px; background: linear-gradient(180deg, rgba(26, 18, 12, .82), rgba(12, 8, 6, .88)); border: 1px solid rgba(232, 200, 119, .32); border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 240, 200, .08), inset 0 0 60px rgba(120, 60, 20, .12); backdrop-filter: blur(12px) saturate(1.2); }
.ts-form::before, .ts-form::after { content: ''; position: absolute; width: 26px; height: 26px; border: 2px solid var(--gl); pointer-events: none; }
.ts-form::before { top: -5px; left: -5px; border-right: 0; border-bottom: 0; }
.ts-form::after { bottom: -5px; right: -5px; border-left: 0; border-top: 0; }
.ts-form.shake { animation: tsShake .45s ease; }
@keyframes tsShake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.ts-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -4px 0 16px; border-bottom: 1px solid rgba(232, 200, 119, .18); }
.ts-tabs button { position: relative; padding: 10px 0 12px; background: none; border: 0; color: var(--ml); font-family: var(--num); font-weight: 700; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.ts-tabs button.on { color: var(--gl); }
.ts-tabs button.on::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gl), transparent); box-shadow: 0 0 10px var(--gl); }
.ts-h { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--gl); }
.ts-p { margin: 0 0 14px; color: #D7C6A4; font-size: 15px; }
.ts-field { position: relative; display: block; margin: 0 0 12px; }
.ts-field input { width: 100%; height: 54px; padding: 18px 44px 4px 46px; border: 1px solid rgba(232, 200, 119, .22); border-radius: 4px; background: rgba(0, 0, 0, .38); color: var(--tl); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; user-select: text; }
.ts-field input:focus { border-color: var(--gl); background: rgba(0, 0, 0, .5); box-shadow: 0 0 0 3px rgba(232, 200, 119, .14), 0 0 18px rgba(232, 200, 119, .14); }
.ts-ficon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ml); pointer-events: none; transition: color .2s; }
.ts-field input:focus ~ .ts-ficon, .ts-field:focus-within .ts-ficon { color: var(--gl); }
.ts-ficon svg { width: 20px; height: 20px; }
.ts-flabel { position: absolute; left: 46px; top: 50%; transform: translateY(-50%); color: var(--ml); font-size: 15px; pointer-events: none; transition: all .18s var(--ease-out); }
.ts-field input:focus + .ts-flabel, .ts-field input:not(:placeholder-shown) + .ts-flabel { top: 15px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gl); }
.ts-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--ml); display: grid; place-items: center; }
.ts-eye svg { width: 20px; height: 20px; }
.ts-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 10px; flex-wrap: wrap; }
.ts-check { display: inline-flex; align-items: center; gap: 9px; color: #D7C6A4; font-size: 14px; cursor: pointer; }
.ts-check input { position: absolute; opacity: 0; }
.ts-check span { width: 18px; height: 18px; border: 1px solid var(--gl); border-radius: 3px; display: grid; place-items: center; background: rgba(0, 0, 0, .4); }
.ts-check input:checked + span::after { content: ''; width: 10px; height: 10px; background: var(--gl); border-radius: 1px; box-shadow: 0 0 8px var(--gl); }
.ts-check input:focus-visible + span { outline: 2px solid var(--gl); outline-offset: 2px; }
.ts-link { background: none; border: 0; padding: 4px 0; color: var(--gl); font-size: 14px; text-decoration: underline; text-decoration-color: rgba(232, 200, 119, .4); text-underline-offset: 3px; }
.ts-link:hover { text-decoration-color: var(--gl); }
.ts-err { min-height: 0; color: var(--badc); font-size: 14px; font-weight: 500; }
.ts-err:not(:empty) { margin: 2px 0 10px; padding: 8px 10px; border-left: 3px solid var(--badc); background: rgba(142, 27, 16, .22); }
.ts-cta { position: relative; overflow: hidden; width: 100%; height: 56px; margin: 4px 0 4px; border: 1px solid #F2D58C; border-radius: 4px; color: #FFF3DC; font-family: var(--display); font-size: 22px; letter-spacing: .06em;
  background: linear-gradient(180deg, #B23A22 0%, #8E1B10 48%, #6A140B 100%); box-shadow: 0 8px 24px rgba(142, 27, 16, .45), inset 0 1px 0 rgba(255, 220, 170, .4), inset 0 -2px 0 rgba(0, 0, 0, .3); text-shadow: 0 2px 2px rgba(0, 0, 0, .5); transition: transform .12s, filter .2s, box-shadow .2s; }
.ts-cta::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 235, 200, .35), transparent); transform: skewX(-20deg); animation: cta 4.5s ease-in-out infinite; }
@keyframes cta { 0%, 60% { left: -60%; } 85%, 100% { left: 130%; } }
.ts-cta:hover { filter: brightness(1.12); box-shadow: 0 10px 34px rgba(200, 60, 30, .55), inset 0 1px 0 rgba(255, 220, 170, .5); }
.ts-cta:active { transform: translateY(1px) scale(.995); }
.ts-cta.busy span { opacity: 0; }
.ts-cta.busy::after { content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid rgba(255, 243, 220, .3); border-top-color: #FFF3DC; border-radius: 50%; animation: spin .7s linear infinite; }
.ts-small { margin: 10px 0 0; text-align: center; color: var(--ml); font-size: 14px; }
.ts-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: -6px 0 12px; }
.ts-meter i { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); transition: background .3s; }
.ts-meter[data-s="1"] i:nth-child(-n+1) { background: #C0392B; }
.ts-meter[data-s="2"] i:nth-child(-n+2) { background: #D98A2B; }
.ts-meter[data-s="3"] i:nth-child(-n+3) { background: #C9B23E; }
.ts-meter[data-s="4"] i { background: #5DAE6A; }
.ts-role { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.ts-role legend { margin-bottom: 6px; color: var(--ml); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.ts-role label { position: relative; cursor: pointer; }
.ts-role input { position: absolute; opacity: 0; }
.ts-role span { display: block; height: 100%; padding: 9px 8px; text-align: center; border: 1px solid rgba(232, 200, 119, .2); border-radius: 4px; background: rgba(0, 0, 0, .3); transition: .2s; }
.ts-role b { display: block; font-family: var(--num); color: var(--tl); font-size: 15px; }
.ts-role small { color: var(--ml); font-size: 12px; line-height: 1.2; display: block; }
.ts-role input:checked + span { border-color: var(--gl); background: rgba(142, 27, 16, .35); box-shadow: 0 0 14px rgba(232, 200, 119, .2), inset 0 0 0 1px var(--gl); }
.ts-role input:focus-visible + span { outline: 2px solid var(--gl); }
.ts-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 4px 0 14px; }
.ts-code input { height: 60px; text-align: center; font-family: var(--num); font-weight: 700; font-size: 28px; border: 1px solid rgba(232, 200, 119, .3); border-radius: 4px; background: rgba(0, 0, 0, .45); color: var(--gl); outline: none; user-select: text; }
.ts-code input:focus { border-color: var(--gl); box-shadow: 0 0 0 3px rgba(232, 200, 119, .18); }

.ts-news { position: absolute; z-index: 4; right: 24px; bottom: 64px; width: 300px; padding: 16px 18px; background: rgba(10, 7, 5, .55); border: 1px solid rgba(232, 200, 119, .18); border-radius: 6px; backdrop-filter: blur(8px); opacity: 0; transform: translateX(20px); transition: 1s var(--ease-out) .5s; }
.awake .ts-news { opacity: 1; transform: none; }
.ts-news-h { font-family: var(--num); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; color: var(--gl); margin-bottom: 8px; }
.ts-news article { padding: 8px 0; border-top: 1px solid rgba(232, 200, 119, .12); }
.ts-news b { color: var(--tl); font-size: 14px; }
.ts-news p { margin: 4px 0 0; color: #CDBB98; font-size: 13px; line-height: 1.4; }
.ts-foot { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px; color: #A99577; font-size: 12.5px; text-shadow: 0 1px 3px #000; }
.ts-status b { color: var(--tl); }
.ts-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5DAE6A; box-shadow: 0 0 8px #5DAE6A; margin-right: 4px; animation: press 2s infinite; }
.ts-fade { position: absolute; inset: 0; z-index: 9; background: #000; opacity: 0; pointer-events: none; transition: opacity .85s ease; }
.leaving .ts-fade { opacity: 1; }
@media (max-width: 1100px) { .ts-news { display: none; } }
@media (max-width: 600px) {
  .ts-form { padding: 18px 16px 14px; }
  .ts-role { grid-template-columns: 1fr; }
  .ts-role span { display: flex; gap: 8px; align-items: baseline; text-align: left; }
  .ts-foot { justify-content: center; text-align: center; font-size: 11.5px; }
  .awake .ts-logo { transform: scale(.55); margin-bottom: -9vh; }
}
@media (prefers-reduced-motion: reduce) { .ts-grain, .ts-shine::after, .ts-cta::before, .ts-emblem, .ts-press { animation: none !important; } }

/* ===================================================================== shared dark UI */

body.mode-panel, body.mode-load, body.mode-boot { background: #0B0806; color: var(--tl); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-sigil { width: 56px; height: 56px; border: 2px solid rgba(232, 200, 119, .25); border-top-color: var(--gl); border-radius: 50%; animation: spin 1s linear infinite; }
.boot-err { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--tl); padding: 24px; }
.boot-err h1 { font-family: var(--display); font-weight: 400; color: var(--gl); font-size: 48px; margin: 0; }
.muted-l { color: var(--ml); }
.warn-l { color: var(--badc); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5DAE6A; box-shadow: 0 0 0 0 rgba(93, 174, 106, .7); animation: livePulse 1.8s infinite; vertical-align: middle; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(93, 174, 106, .6); } 70% { box-shadow: 0 0 0 8px rgba(93, 174, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(93, 174, 106, 0); } }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .35); color: var(--gl); font-family: var(--num); font-weight: 700; font-size: 13px; }
.pill.gold { background: var(--gl); color: #1E140A; }
.empty-note { padding: 18px; text-align: center; color: var(--ml); border: 1px dashed rgba(232, 200, 119, .18); border-radius: 8px; }
.empty-note.small { padding: 12px; font-size: 14px; }

.hall .btn, .g-dialog .btn, .forge .btn, .gbar .btn, .alert-card .btn, .hero-pick-page .btn, .drawer .btn.ghost.light {
  border-radius: 6px; border: 1px solid rgba(232, 200, 119, .32); background: rgba(255, 240, 210, .05); color: var(--tl); font-family: var(--ui); }
.hall .btn:hover, .g-dialog .btn:hover, .forge .btn:hover { background: rgba(255, 240, 210, .1); border-color: var(--gl); color: #fff; filter: none; }
.hall .btn.gold, .g-dialog .btn.gold, .forge .btn.gold, .alert-card .btn.gold, .btn.gold.lux { background: linear-gradient(180deg, #F2D58C, #C99A3E 60%, #A87A26); border-color: #FFE7A8; color: #22160A; box-shadow: 0 6px 18px rgba(232, 200, 119, .18), inset 0 1px 0 rgba(255, 255, 255, .5); }
.hall .btn.gold:hover, .g-dialog .btn.gold:hover, .forge .btn.gold:hover { filter: brightness(1.08); color: #22160A; }
.hall .btn.ghost.light, .g-dialog .btn.ghost.light, .forge .btn.ghost.light { background: transparent; color: #E6D5B2; }
.hall .btn.danger, .g-dialog .btn.danger { background: linear-gradient(180deg, #A42A1A, #7A1A0F); border-color: #D96A50; color: #FFF0E0; }
.hall .btn.good, .g-dialog .btn.good { background: linear-gradient(180deg, #3E8A4A, #2A6233); border-color: #8FD49B; color: #F2FFF2; }
.hall .btn.ember, .g-dialog .btn.ember { background: linear-gradient(180deg, #D86A28, #A2461A); border-color: #FFB27A; color: #FFF5E8; }
.hall .btn.big, .forge .btn.big { min-height: 50px; padding: 0 22px; font-size: 16px; }
.btn .ico { flex: none; }
.danger-t { color: var(--badc) !important; }
.seg.dark button { background: rgba(0, 0, 0, .35); color: #E6D5B2; border: 1px solid rgba(232, 200, 119, .25); border-radius: 5px; font-family: var(--num); }
.seg.dark button.on { background: linear-gradient(180deg, #A42A1A, #7A1A0F); color: #FFF3DC; border-color: var(--gl); }

/* glass dialogs */
.g-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 3, 2, .66); backdrop-filter: blur(6px); animation: gIn .22s ease both; }
.g-back.out { animation: gOut .2s ease both; }
@keyframes gIn { from { opacity: 0; } }
@keyframes gOut { to { opacity: 0; } }
.g-dialog { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px 26px 20px; color: #E6D5B2; border-radius: 10px; border: 1px solid rgba(232, 200, 119, .3);
  background: linear-gradient(180deg, rgba(30, 21, 14, .97), rgba(16, 11, 8, .98)); box-shadow: 0 40px 100px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 240, 200, .07); animation: gPop .32s var(--ease-out) both; }
.g-dialog.wide { width: min(820px, 100%); }
.g-dialog.small { width: min(420px, 100%); }
@keyframes gPop { from { transform: translateY(18px) scale(.97); opacity: 0; } }
.g-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(232, 200, 119, .2); background: rgba(0, 0, 0, .3); color: var(--ml); display: grid; place-items: center; z-index: 2; }
.g-x:hover { color: var(--gl); border-color: var(--gl); }
.g-title { display: flex; align-items: center; gap: 10px; margin: 0 40px 8px 0; font-family: var(--display); font-weight: 400; font-size: 27px; color: var(--gl); line-height: 1.1; }
.g-sub { margin: 18px 0 8px; font-family: var(--num); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gl); }
.g-text { color: #D7C6A4; margin: 0 0 14px; }
.g-err { color: var(--badc); }
.g-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.g-form { display: block; }
.g-field { display: block; margin: 0 0 14px; }
.g-field > span { display: block; margin-bottom: 6px; color: var(--ml); font-size: 13px; letter-spacing: .04em; }
.g-field > span b { color: var(--gl); }
.g-field input:not([type=range]):not([type=radio]):not([type=checkbox]), .g-field textarea, .g-field select, .g-input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 6px; border: 1px solid rgba(232, 200, 119, .22); background: rgba(0, 0, 0, .38); color: var(--tl); font-size: 15px; outline: none; }
.g-field input:focus, .g-field textarea:focus { border-color: var(--gl); box-shadow: 0 0 0 3px rgba(232, 200, 119, .12); }
.g-field input:disabled { opacity: .6; }
.g-field textarea { resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--gl); }
.g-check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; color: #D7C6A4; cursor: pointer; line-height: 1.35; }
.g-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #C99A3E; flex: none; }
.g-field.slider span { display: flex; justify-content: space-between; }

.adv-pick, .pick-hero { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.adv-pick label, .pick-hero label { position: relative; cursor: pointer; }
.adv-pick input, .pick-hero input { position: absolute; opacity: 0; }
.adv-pick span { display: block; height: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .2); background: rgba(0, 0, 0, .3); }
.adv-pick b { display: block; color: var(--tl); font-family: var(--num); font-size: 16px; }
.adv-pick small { color: var(--ml); }
.adv-pick input:checked + span, .pick-hero input:checked + span { border-color: var(--gl); background: rgba(142, 27, 16, .3); box-shadow: inset 0 0 0 1px var(--gl), 0 0 16px rgba(232, 200, 119, .15); }
.pick-hero { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.pick-hero label > span, .pick-hero > button, .pick-hero .ph-new { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; padding: 8px 6px 10px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .18); background: rgba(0, 0, 0, .3); color: var(--tl); text-align: center; text-decoration: none; }
.pick-hero > button.on { border-color: var(--gl); background: rgba(142, 27, 16, .3); box-shadow: inset 0 0 0 1px var(--gl); }
.pick-hero b { font-size: 14px; } .pick-hero small { color: var(--ml); font-size: 12px; }
.ph-av { width: 70px; height: 90px; display: block; }
.ph-none, .ph-new { justify-content: center; color: var(--ml) !important; min-height: 130px; }
.pick-hero.small .ph-av { width: 56px; height: 72px; }
.cover-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cover-pick button { aspect-ratio: 4 / 3; border-radius: 6px; border: 2px solid transparent; background: center / cover; opacity: .7; transition: .2s; }
.cover-pick button.on { border-color: var(--gl); opacity: 1; box-shadow: 0 0 14px rgba(232, 200, 119, .35); }
.cover-pick.small { grid-template-columns: repeat(6, 1fr); }
.join-code { display: flex; gap: 8px; margin-bottom: 14px; }
.join-code input { flex: 1; min-width: 0; height: 58px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .45); color: var(--gl); font-family: var(--num); font-weight: 700; font-size: 28px; letter-spacing: .3em; text-transform: uppercase; text-align: center; outline: none; }
.join-code .btn { min-height: 58px; }
.jf-card { position: relative; min-height: 110px; margin-bottom: 14px; padding: 16px; display: flex; align-items: flex-end; border-radius: 8px; overflow: hidden; background: linear-gradient(0deg, rgba(10, 6, 4, .92), rgba(10, 6, 4, .25)), var(--cover) center / cover; border: 1px solid rgba(232, 200, 119, .25); }
.jf-card b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--gl); }
.jf-card small { color: #D7C6A4; }
.jf-card p { margin: 6px 0 0; color: #D7C6A4; font-size: 14px; }

/* alert cards */
#alertCards { position: fixed; z-index: 85; top: 70px; right: 16px; width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.alert-card { pointer-events: auto; position: relative; display: flex; gap: 12px; padding: 14px 40px 14px 14px; border-radius: 10px; color: #E6D5B2; border: 1px solid rgba(232, 200, 119, .35);
  background: linear-gradient(180deg, rgba(36, 25, 16, .97), rgba(18, 12, 8, .97)); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: acIn .45s var(--ease-spring) both; }
.alert-card.out { animation: acOut .35s ease both; }
@keyframes acIn { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes acOut { to { opacity: 0; transform: translateX(40px); } }
.alert-card.k-summon, .alert-card.k-session, .alert-card.k-turn { border-color: var(--gl); box-shadow: 0 0 0 1px rgba(232, 200, 119, .3), 0 20px 50px rgba(0, 0, 0, .6), 0 0 30px rgba(232, 200, 119, .2); }
.ac-ico { font-size: 26px; line-height: 1; }
.alert-card .ac-body b { display: block; color: var(--tl); }
.alert-card .ac-body p { margin: 2px 0 8px; font-size: 14px; color: #D7C6A4; }
.alert-card .ac-body p:last-child { margin-bottom: 0; }
.ac-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: none; color: var(--ml); font-size: 20px; }

/* enter screen */
.enter-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--tl); background: radial-gradient(ellipse at center, #22160E, #070504); }
.es-dice { color: var(--gl); animation: esRoll 1.2s var(--ease-out) infinite; filter: drop-shadow(0 0 20px rgba(232, 200, 119, .4)); }
@keyframes esRoll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }
.es-txt { font-family: var(--story); font-style: italic; font-size: 20px; }
.es-txt b { font-family: var(--num); font-style: normal; color: var(--gl); letter-spacing: .1em; }
.es-bar { width: 220px; height: 3px; background: rgba(232, 200, 119, .15); border-radius: 3px; overflow: hidden; }
.es-bar i { display: block; width: 40%; height: 100%; background: var(--gl); animation: esBar 1.1s ease-in-out infinite; }
@keyframes esBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ===================================================================== the hall (panel) */

.hall { min-height: 100vh; display: grid; grid-template-columns: 264px 1fr; color: #E6D5B2; }
.hall-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 75% -10%, rgba(142, 27, 16, .28), transparent 60%), radial-gradient(ellipse 60% 50% at 0% 110%, rgba(70, 45, 110, .28), transparent 60%), radial-gradient(ellipse at 50% 50%, #17100B, #090605 80%); }
.hall-bg::after { content: ''; position: absolute; inset: 0; opacity: .05; background-image: 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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hall-nav { position: sticky; top: 0; z-index: 3; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: linear-gradient(180deg, rgba(20, 14, 10, .92), rgba(12, 8, 6, .95)); border-right: 1px solid rgba(232, 200, 119, .12); }
.hall-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; text-decoration: none; color: var(--gl); font-family: var(--display); font-size: 25px; }
.hall-brand:hover { color: #FFF1C4; }
.hb-emblem { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: radial-gradient(circle at 35% 30%, #A42A1A, #4A0E08); border: 1px solid var(--gl); color: #FFF1C4; box-shadow: 0 0 16px rgba(232, 200, 119, .2); }
.hall-user { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border-radius: 10px; background: rgba(255, 240, 210, .04); border: 1px solid rgba(232, 200, 119, .1); }
.hu-av { flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 30%, #3A2A1C, #140E09); border: 2px solid var(--gl); display: grid; place-items: center; color: var(--gl); font-family: var(--display); font-size: 22px; }
.hu-av svg.av { transform: scale(1.05) translateY(4%); }
.hu-txt { min-width: 0; }
.hu-txt b { display: block; color: var(--tl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hu-txt small { color: var(--ml); font-size: 12.5px; }
.hall-links { display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: #CDBB98; text-decoration: none; font-size: 15px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255, 240, 210, .06); color: var(--tl); }
.nav-item.on { background: linear-gradient(90deg, rgba(232, 200, 119, .16), rgba(232, 200, 119, .02)); color: var(--gl); }
.nav-item.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gl); box-shadow: 0 0 10px var(--gl); }
.nav-item.forge-link { color: #F2D58C; }
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #B23A22; color: #fff; font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.nbadge:empty { display: none; }
.hall-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid rgba(232, 200, 119, .1); }
.hall-main { position: relative; z-index: 1; min-width: 0; }
.hall-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 32px; background: linear-gradient(180deg, rgba(11, 8, 6, .92), rgba(11, 8, 6, .6)); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(232, 200, 119, .08); }
.ht-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--tl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-right { margin-left: auto; display: flex; gap: 8px; }
.ht-btn, .gb-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(232, 200, 119, .2); background: rgba(255, 240, 210, .04); color: #E6D5B2; display: grid; place-items: center; text-decoration: none; flex: none; }
.ht-btn:hover, .gb-btn:hover { border-color: var(--gl); color: var(--gl); }
[data-bell][data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #B23A22; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #0B0806; }
.ht-menu { display: none; }
.hall-page { padding: 26px 32px 60px; max-width: 1400px; }
.page-in { animation: pageIn .45s var(--ease-out) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.hall-loading { display: flex; gap: 8px; justify-content: center; padding: 60px 0; }
.hall-loading.small { padding: 18px 0; }
.hall-loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--gl); animation: dots 1s ease-in-out infinite; }
.hall-loading i:nth-child(2) { animation-delay: .15s; } .hall-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-6px); } }
.hall-tabs { display: none; }
.kicker.gold { color: var(--gl); }
.card { position: relative; padding: 18px 20px; border-radius: 12px; background: linear-gradient(180deg, rgba(30, 21, 14, .78), rgba(18, 12, 9, .78)); border: 1px solid rgba(232, 200, 119, .13); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.card h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-family: var(--num); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--gl); }
.card h3 small { margin-left: auto; font-family: var(--ui); text-transform: none; letter-spacing: 0; color: var(--ml); font-weight: 500; }
.card .muted-l a { color: var(--gl); }
.page-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-intro p { margin: 0; color: #D7C6A4; max-width: 720px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--ml); text-decoration: none; }
.back-link:hover { color: var(--gl); }

/* home */
.hero-banner { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 300px; padding: 30px 32px; border-radius: 16px; overflow: hidden; margin-bottom: 18px; border: 1px solid rgba(232, 200, 119, .2); box-shadow: 0 30px 60px rgba(0, 0, 0, .5); background: var(--cover) center 30% / cover; isolation: isolate; }
.hero-banner::before { content: ''; position: absolute; inset: -20px; z-index: -2; background: inherit; filter: saturate(1.1); animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.18) translate(-2%, -2%); } }
.hb-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 5, 3, .92) 0%, rgba(8, 5, 3, .6) 50%, rgba(8, 5, 3, .25) 100%), linear-gradient(0deg, rgba(8, 5, 3, .8), transparent 60%); }
.hb-text { max-width: 640px; }
.hb-text h2 { margin: 4px 0 6px; font-family: var(--display); font-weight: 400; font-size: clamp(38px, 5vw, 60px); line-height: 1; color: #FFF1C4; text-shadow: 0 4px 20px rgba(0, 0, 0, .7); }
.hb-text p { margin: 0 0 18px; font-size: 17px; color: #E6D5B2; }
.hb-text p b { color: var(--tl); }
.hb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hb-party { flex: none; }
.ps-card { padding: 14px 16px; border-radius: 10px; background: rgba(10, 6, 4, .6); border: 1px solid rgba(232, 200, 119, .25); backdrop-filter: blur(6px); min-width: 220px; }
.ps-name { font-family: var(--display); font-size: 22px; color: var(--gl); }
.ps-meta, .ps-next { color: #D7C6A4; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.push-ask { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; border-radius: 12px; border: 1px solid rgba(232, 200, 119, .35); background: linear-gradient(90deg, rgba(142, 27, 16, .3), rgba(30, 21, 14, .6)); color: var(--gl); }
.push-ask b { color: var(--tl); } .push-ask p { margin: 2px 0 0; color: #D7C6A4; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 12px; background: linear-gradient(160deg, rgba(40, 28, 18, .8), rgba(18, 12, 9, .8)); border: 1px solid rgba(232, 200, 119, .12); color: var(--gl); }
.tile b { font-family: var(--num); font-size: 32px; line-height: 1.1; color: #FFF1C4; margin-top: 6px; }
.tile b small { font-size: 15px; color: var(--ml); margin-left: 4px; }
.tile > span { color: var(--ml); font-size: 13px; letter-spacing: .04em; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.card.wide { grid-column: 1 / -1; }
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 240, 210, .04); color: #D7C6A4; }
.todo li > .ico { color: var(--gl); flex: none; }
.todo li span { flex: 1; min-width: 0; } .todo li b { color: var(--tl); }
.first-steps { list-style: none; margin: 0; padding: 0; counter-reset: fs; display: flex; flex-direction: column; gap: 8px; }
.first-steps li { counter-increment: fs; display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: rgba(255, 240, 210, .04); }
.first-steps li::before { content: counter(fs); grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--gl); color: var(--gl); font-family: var(--num); font-weight: 700; }
.first-steps li.done::before { background: var(--gl); color: #1E140A; content: '✓'; }
.first-steps b { color: var(--tl); } .first-steps span { grid-column: 2; color: var(--ml); font-size: 13.5px; }
.first-steps li > :last-child:not(span):not(b) { grid-row: 1 / 3; grid-column: 3; }
.first-steps li.done .ico { color: #5DAE6A; }
.chart-wrap { height: 170px; } .chart-wrap.tall { height: 210px; }
.bar-chart { width: 100%; height: 100%; display: block; }
.hero-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hs-item { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; text-decoration: none; color: var(--tl); background: rgba(255, 240, 210, .03); border: 1px solid transparent; transition: .2s; }
.hs-item:hover { border-color: rgba(232, 200, 119, .3); background: rgba(255, 240, 210, .07); transform: translateY(-2px); }
.hs-av { width: 72px; height: 94px; display: grid; place-items: center; color: var(--gl); }
.hs-item b { font-size: 13.5px; text-align: center; line-height: 1.2; } .hs-item small { color: var(--ml); font-size: 12px; }

/* tables */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.tcard { position: relative; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, rgba(30, 21, 14, .9), rgba(16, 11, 8, .92)); border: 1px solid rgba(232, 200, 119, .15); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s; }
.tcard:hover { transform: translateY(-3px); border-color: rgba(232, 200, 119, .4); box-shadow: 0 24px 50px rgba(0, 0, 0, .5), 0 0 30px rgba(232, 200, 119, .08); }
.tcard.active { border-color: var(--gl); }
.tc-cover { position: relative; display: block; height: 150px; background: linear-gradient(0deg, rgba(16, 11, 8, 1) 0%, rgba(16, 11, 8, 0) 60%), var(--cover) center / cover; }
.tc-role { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em; background: rgba(10, 6, 4, .75); border: 1px solid rgba(232, 200, 119, .4); color: var(--gl); }
.tc-role.gm { background: linear-gradient(180deg, #F2D58C, #B8862B); color: #22160A; border-color: #FFE7A8; }
.tc-live { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(10, 6, 4, .75); color: #BFE8C5; font-size: 12px; font-weight: 700; }
.tc-ribbon { position: absolute; right: -36px; bottom: 18px; transform: rotate(-35deg); padding: 3px 40px; background: #B23A22; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; display: none; }
.tc-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 4px 16px 16px; }
.tc-body h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 25px; color: #FFF1C4; line-height: 1.1; }
.tc-meta, .tc-next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ml); font-size: 13.5px; }
.tc-meta .code { font-family: var(--num); font-weight: 700; letter-spacing: .12em; color: var(--gl); }
.tc-next { color: #E6D5B2; }
.tc-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.flag.gold { background: rgba(232, 200, 119, .18); color: var(--gl); border: 1px solid rgba(232, 200, 119, .4); }
.flag.red { background: rgba(178, 58, 34, .25); color: #FFB2A0; border: 1px solid rgba(240, 144, 126, .5); }
.tc-hero { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(255, 240, 210, .04); }
.tch-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gl); background: #1E140C; flex: none; }
.tc-hero b { display: block; color: var(--tl); font-size: 14px; } .tc-hero small { color: var(--ml); font-size: 12px; }
.tc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.tc-actions .btn { flex: 1; }
.tcard.empty { align-items: center; justify-content: center; gap: 6px; min-height: 330px; border-style: dashed; background: rgba(255, 240, 210, .02); color: var(--ml); }
.tcard.empty span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed rgba(232, 200, 119, .35); color: var(--gl); }
.tcard.empty b { color: var(--tl); font-family: var(--num); font-size: 17px; }

/* one table */
.td-head { position: relative; min-height: 260px; padding: 28px 30px; display: flex; align-items: flex-end; border-radius: 16px; overflow: hidden; margin-bottom: 18px; border: 1px solid rgba(232, 200, 119, .2); background: var(--cover) center / cover; isolation: isolate; }
.td-head-in { max-width: 760px; }
.td-head h2 { margin: 4px 0 8px; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.5vw, 54px); line-height: 1; color: #FFF1C4; text-shadow: 0 4px 18px #000; }
.td-head p { color: #E6D5B2; margin: 0 0 14px; }
.code-badge { padding: 8px 14px; border-radius: 8px; border: 1px dashed var(--gl); color: var(--gl); font-family: var(--num); font-weight: 700; font-size: 20px; letter-spacing: .25em; background: rgba(10, 6, 4, .6); }
.td-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.warn-card { margin-bottom: 18px; border-color: rgba(240, 144, 126, .5); background: linear-gradient(180deg, rgba(90, 20, 12, .5), rgba(30, 14, 10, .8)); }
.warn-card h3 { color: #FFB2A0; }
.vote-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.vote { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); color: var(--ml); font-size: 13px; }
.vote.yes { background: rgba(93, 174, 106, .2); color: #BFE8C5; } .vote.no { background: rgba(178, 58, 34, .3); color: #FFB2A0; }
.members-list, .req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.members-list li, .req-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 240, 210, .035); }
.ml-av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ring, var(--gl)); background: #1E140C; display: grid; place-items: center; color: var(--gl); }
.members-list li.on .ml-av { box-shadow: 0 0 0 2px rgba(93, 174, 106, .5); }
.ml-txt, .rq-txt { flex: 1; min-width: 0; }
.ml-txt b, .rq-txt b { display: block; color: var(--tl); }
.ml-txt small, .rq-txt small { color: var(--ml); font-size: 13px; }
.ml-state { color: var(--ml); font-size: 12.5px; white-space: nowrap; }
.rq-av { flex: none; width: 52px; height: 68px; display: grid; place-items: center; color: var(--ml); }
.rq-txt q { display: block; margin-top: 4px; color: #E6D5B2; font-style: italic; font-size: 14px; }
.rq-btns { display: flex; flex-direction: column; gap: 6px; }
.my-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mh-av { width: 80px; height: 104px; }
.my-hero b { display: block; font-family: var(--display); font-size: 24px; color: #FFF1C4; } .my-hero small { color: var(--ml); }
.danger-zone { border-color: rgba(240, 144, 126, .25); }
.danger-zone h3 { color: #F0B4A4; }

/* heroes */
.hcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.hcard { position: relative; display: flex; flex-direction: column; padding: 0; border-radius: 14px; overflow: hidden; text-align: left; text-decoration: none; color: var(--tl); border: 1px solid rgba(232, 200, 119, .15); background: linear-gradient(180deg, rgba(30, 21, 14, .9), rgba(14, 10, 7, .95)); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); transition: transform .25s var(--ease-out), border-color .2s; }
.hcard:hover { transform: translateY(-4px); border-color: var(--ring, var(--gl)); }
.hc-stage { position: relative; height: 210px; display: grid; place-items: center; color: var(--gl); background: radial-gradient(ellipse 60% 50% at 50% 85%, color-mix(in srgb, var(--ring, #B8862B) 45%, transparent), transparent 70%), radial-gradient(ellipse at 50% 0%, rgba(255, 240, 200, .08), transparent 60%); }
.hc-stage::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 16px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .6), transparent 70%); }
.hc-av { position: relative; z-index: 1; width: 150px; height: 196px; transition: transform .3s var(--ease-out); }
.hcard:hover .hc-av { transform: scale(1.06); }
.hc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.hc-body b { font-family: var(--display); font-weight: 400; font-size: 23px; color: #FFF1C4; line-height: 1.1; }
.hc-body small { color: var(--ml); }
.hc-stats { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--ml); } .hc-stats b { font-family: var(--num); font-size: 15px; color: var(--tl); }
.hc-where { font-size: 12.5px; color: var(--gl); display: flex; align-items: center; gap: 5px; } .hc-where .free { color: #9FD3A5; }
.hcard.new { border-style: dashed; background: rgba(255, 240, 210, .02); }
.hcard.new .hc-stage { color: var(--gl); }
.hero-dialog { padding: 0; overflow: hidden; }
.hero-sheet { display: grid; grid-template-columns: 300px 1fr; min-height: 420px; }
.hs-left { display: grid; place-items: center; background: radial-gradient(ellipse 70% 40% at 50% 85%, color-mix(in srgb, var(--ring) 55%, transparent), transparent 70%), radial-gradient(ellipse at 50% 20%, rgba(255, 240, 200, .1), transparent 60%), #120C08; border-right: 1px solid rgba(232, 200, 119, .15); }
.hs-big { width: 240px; height: 320px; }
.hs-right { padding: 24px 26px 20px; }
.hs-motto { margin: -4px 0 12px; font-family: var(--story); font-style: italic; color: #E6D5B2; }
.hs-vitals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.hs-vitals div, .hs-abil div { padding: 8px 4px; border-radius: 8px; background: rgba(255, 240, 210, .05); text-align: center; }
.hs-vitals b { display: block; font-family: var(--num); font-size: 22px; color: #FFF1C4; } .hs-vitals span { font-size: 11px; color: var(--ml); text-transform: uppercase; letter-spacing: .06em; }
.hs-abil { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.hs-abil span { display: block; font-size: 11px; color: var(--gl); font-weight: 800; letter-spacing: .08em; } .hs-abil b { display: block; font-family: var(--num); font-size: 20px; color: var(--tl); } .hs-abil i { font-style: normal; color: var(--ml); font-size: 12px; }
.hs-attacks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hs-attacks span { padding: 4px 10px; border-radius: 99px; background: rgba(142, 27, 16, .3); border: 1px solid rgba(232, 200, 119, .2); font-size: 13px; color: var(--tl); } .hs-attacks small { color: var(--ml); }
.hs-traits { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 14px; }
.hs-traits dt { color: var(--gl); font-weight: 700; } .hs-traits dd { margin: 0; color: #D7C6A4; }

/* reports */
.luck { margin: 4px 0 16px; }
.luck-bar { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #7A1A0F, #8C6B3F 50%, #3E8A4A); }
.luck-bar i { position: absolute; top: -6px; width: 4px; height: 24px; margin-left: -2px; border-radius: 2px; background: #FFF1C4; box-shadow: 0 0 10px #FFF1C4; }
.luck-bar span { position: absolute; top: -3px; width: 1px; height: 18px; background: rgba(255, 255, 255, .4); }
.luck-lbl { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ml); }
.dice-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dice-stats div { text-align: center; padding: 10px 4px; border-radius: 8px; background: rgba(255, 240, 210, .04); }
.dice-stats b { display: block; font-family: var(--num); font-size: 22px; color: #FFF1C4; } .dice-stats span { font-size: 11.5px; color: var(--ml); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; color: #D7C6A4; font-size: 14px; }
.hbars li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hbars small { color: var(--gl); }
.hbars i { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .06); position: relative; overflow: hidden; }
.hbars i::after { content: ''; position: absolute; inset: 0; width: var(--w); border-radius: 5px; background: linear-gradient(90deg, #8A5E1C, #E8C877); animation: grow 1s var(--ease-out) both; }
@keyframes grow { from { width: 0; } }
.hbars b { font-family: var(--num); color: var(--tl); }
.tbl-wrap { overflow-x: auto; }
table.sess { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sess th { text-align: left; padding: 8px 10px; color: var(--gl); font-family: var(--num); font-weight: 700; letter-spacing: .06em; border-bottom: 1px solid rgba(232, 200, 119, .2); }
table.sess td { padding: 8px 10px; color: #D7C6A4; border-bottom: 1px solid rgba(232, 200, 119, .06); }

/* notifications */
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255, 240, 210, .03); border: 1px solid transparent; }
.notif-list li.new { background: rgba(232, 200, 119, .07); border-color: rgba(232, 200, 119, .2); }
.notif-list li.new .nl-body b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--gl); vertical-align: middle; }
.nl-ico { font-size: 24px; flex: none; width: 34px; text-align: center; }
.nl-body { flex: 1; min-width: 0; } .nl-body b { color: var(--tl); } .nl-body p { margin: 2px 0; color: #D7C6A4; font-size: 14px; } .nl-body small { color: var(--ml); font-size: 12px; }
.notif-list.compact li { padding: 9px 10px; } .notif-list.compact .nl-body p { font-size: 13px; }
.bell-list { max-height: 60vh; overflow: auto; }

/* responsive hall */
@media (max-width: 960px) {
  .hall { grid-template-columns: 1fr; }
  .hall-nav { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .3s var(--ease-out); box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .hall.nav-open .hall-nav { transform: none; }
  .hall.nav-open .hall-bg { z-index: 2; background-color: rgba(0, 0, 0, .55); pointer-events: auto; }
  .ht-menu { display: grid; }
  .hall-top { padding: 0 14px; height: 58px; }
  .ht-title { font-size: 23px; }
  .hall-page { padding: 16px 14px 96px; }
  .hall-tabs { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(12, 8, 6, .96); border-top: 1px solid rgba(232, 200, 119, .15); backdrop-filter: blur(10px); }
  .hall-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--ml); text-decoration: none; font-size: 11px; }
  .hall-tabs a.on { color: var(--gl); }
  .hall-tabs .nbadge { position: absolute; top: 0; left: 55%; margin: 0; }
  .hero-banner { flex-direction: column; align-items: stretch; min-height: 0; padding: 22px 18px; }
  .hero-sheet { grid-template-columns: 1fr; }
  .hs-left { padding: 16px 0 0; border-right: 0; } .hs-big { width: 180px; height: 230px; }
  .home-grid, .td-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile { padding: 12px; } .tile b { font-size: 25px; }
  .dice-stats { grid-template-columns: repeat(3, 1fr); }
  .cover-pick { grid-template-columns: repeat(4, 1fr); }
  .rq-btns { flex-direction: row; }
  .req-list li { flex-wrap: wrap; }
}
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, 1fr); } .hs-vitals { grid-template-columns: repeat(3, 1fr); } .hs-abil { grid-template-columns: repeat(3, 1fr); } }

/* ===================================================================== hero forge */

.p-forge { max-width: none; padding: 18px 24px 40px; }
.forge { --hero: #B8862B; color: #E6D5B2; }
.fg-steps { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 16px; padding-bottom: 10px; }
.fg-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--ml); font-size: 13px; }
.fg-step i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-size: 15px; border: 1px solid rgba(232, 200, 119, .3); background: #140E0A; transition: .25s; }
.fg-step.done i { background: rgba(232, 200, 119, .18); color: var(--gl); }
.fg-step.on i { background: radial-gradient(circle at 40% 35%, #C7472C, #6A140B); border-color: var(--gl); color: #FFF3DC; box-shadow: 0 0 0 4px rgba(232, 200, 119, .14), 0 0 20px rgba(232, 200, 119, .35); transform: scale(1.12); }
.fg-step.on span { color: var(--gl); }
.fg-progress { position: absolute; left: 7%; right: 7%; top: 19px; height: 2px; background: rgba(232, 200, 119, .14); }
.fg-progress b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8A5E1C, var(--gl)); box-shadow: 0 0 10px var(--gl); transition: width .5s var(--ease-out); }
.fg-main { display: grid; grid-template-columns: minmax(300px, 40%) 1fr; gap: 18px; align-items: start; }
.fg-stage { position: sticky; top: 84px; height: min(640px, calc(100vh - 120px)); min-height: 440px; border-radius: 16px; overflow: hidden; border: 1px solid rgba(232, 200, 119, .18);
  background: radial-gradient(ellipse 60% 22% at 50% 82%, color-mix(in srgb, var(--hero) 40%, transparent), transparent 70%), radial-gradient(ellipse 50% 70% at 50% 10%, rgba(255, 236, 190, .14), transparent 70%), linear-gradient(180deg, #1A120C, #0A0705); }
.fg-light { position: absolute; left: 50%; top: -10%; width: 70%; height: 100%; transform: translateX(-50%); background: conic-gradient(from 160deg at 50% 0%, transparent 0deg, rgba(255, 232, 180, .14) 20deg, rgba(255, 232, 180, .2) 40deg, transparent 60deg); filter: blur(10px); pointer-events: none; animation: lightSway 9s ease-in-out infinite; }
@keyframes lightSway { 50% { transform: translateX(-50%) rotate(2deg); } }
.fg-motes { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(255, 220, 150, .7) 1px, transparent 1.5px), radial-gradient(circle, rgba(255, 220, 150, .5) 1px, transparent 1.5px); background-size: 90px 120px, 140px 170px; background-position: 0 0, 40px 60px; animation: motes 24s linear infinite; opacity: .5; }
@keyframes motes { to { background-position: 0 -240px, 40px -280px; } }
.fg-hero { position: absolute; left: 50%; bottom: 17%; width: min(66%, 340px); aspect-ratio: 100 / 134; transform: translateX(-50%); z-index: 2; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.fg-pedestal { position: absolute; left: 50%; bottom: 12%; width: 52%; height: 46px; transform: translateX(-50%); border-radius: 50%; z-index: 1; background: radial-gradient(ellipse at 50% 40%, #4A3524, #1A110B 70%); border: 1px solid rgba(232, 200, 119, .35); box-shadow: 0 0 40px color-mix(in srgb, var(--hero) 50%, transparent), inset 0 4px 10px rgba(255, 230, 180, .15); }
.fg-nameplate { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); z-index: 2; text-align: center; width: 90%; }
.fg-nameplate b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2.4vw, 32px); color: #FFF1C4; text-shadow: 0 2px 12px #000; line-height: 1.1; }
.fg-nameplate span { color: var(--gl); font-family: var(--num); letter-spacing: .08em; font-size: 14px; }
.fg-quick { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.fg-qbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .4); color: var(--gl); display: grid; place-items: center; }
.fg-qbtn:hover { background: rgba(142, 27, 16, .5); border-color: var(--gl); }
.fg-derived { position: absolute; top: 12px; left: 12px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.fg-derived div { width: 58px; padding: 5px 0; border-radius: 8px; text-align: center; background: rgba(0, 0, 0, .45); border: 1px solid rgba(232, 200, 119, .2); }
.fg-derived b { display: block; font-family: var(--num); font-size: 19px; color: #FFF1C4; line-height: 1.1; }
.fg-derived span { font-size: 10.5px; color: var(--ml); letter-spacing: .08em; text-transform: uppercase; }
.fg-spark { position: absolute; z-index: 4; left: var(--x); bottom: 20%; width: 6px; height: 6px; border-radius: 50%; background: #FFE7A8; box-shadow: 0 0 10px #FFE7A8; animation: spark 1.8s var(--ease-out) var(--d) both; }
@keyframes spark { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(calc(-1 * var(--h) * 4)) scale(.2); opacity: 0; } }

.fg-panel { min-width: 0; }
.fg-pane { padding: 20px 22px 16px; border-radius: 16px; border: 1px solid rgba(232, 200, 119, .16); background: linear-gradient(180deg, rgba(30, 21, 14, .88), rgba(16, 11, 8, .9)); box-shadow: 0 20px 50px rgba(0, 0, 0, .4); animation: paneR .4s var(--ease-out) both; }
.fg-pane.from-l { animation-name: paneL; }
@keyframes paneR { from { opacity: 0; transform: translateX(24px); } }
@keyframes paneL { from { opacity: 0; transform: translateX(-24px); } }
.fg-head h2 { margin: 2px 0 14px; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 2.8vw, 36px); color: #FFF1C4; line-height: 1.1; }
.fg-nav { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(232, 200, 119, .1); }
.fg-group { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; color: var(--gl); font-family: var(--num); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.fg-group .ts-link { text-transform: none; letter-spacing: 0; font-family: var(--ui); font-weight: 500; }
.fg-cards { display: grid; gap: 8px; margin-bottom: 14px; }
.fg-cards.race { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.fg-cards.cls { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.fg-cards.bg { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.fg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; border-radius: 10px; border: 1px solid rgba(232, 200, 119, .14); background: rgba(0, 0, 0, .28); color: var(--tl); transition: transform .18s var(--ease-out), border-color .2s, background .2s; }
.fg-card:hover { transform: translateY(-2px); border-color: rgba(232, 200, 119, .45); background: rgba(255, 240, 210, .05); }
.fg-card.on { border-color: var(--gl); background: linear-gradient(180deg, rgba(142, 27, 16, .45), rgba(60, 14, 8, .4)); box-shadow: inset 0 0 0 1px var(--gl), 0 0 18px rgba(232, 200, 119, .2); }
.fg-card b { font-family: var(--num); font-size: 15px; }
.fg-card small { color: var(--ml); font-size: 11.5px; text-align: center; line-height: 1.25; }
.fg-card.on small { color: #EBD9B3; }
.fc-av { display: block; width: 66px; height: 66px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #3A2A1C, #120C08); border: 1px solid rgba(232, 200, 119, .25); }
.fg-cards.cls .fc-av { width: 74px; height: 96px; border-radius: 10px; background: radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--cc) 35%, transparent), transparent 70%); border: 0; }
.fg-card.text { align-items: flex-start; text-align: left; padding: 12px 14px; }
.fg-card.text small { text-align: left; font-size: 13px; }
.fg-card.text em { font-style: normal; margin-top: 4px; font-size: 12px; color: var(--gl); }
.fg-detail { padding: 14px 16px; border-radius: 12px; background: rgba(255, 240, 210, .035); border: 1px solid rgba(232, 200, 119, .1); }
.fg-detail h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--gl); }
.fg-flavor { margin: 0 0 10px; font-family: var(--story); font-style: italic; font-size: 17px; color: #E6D5B2; }
.fg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-l { padding: 3px 10px; border-radius: 99px; background: rgba(232, 200, 119, .1); border: 1px solid rgba(232, 200, 119, .25); font-size: 12.5px; color: #EBD9B3; }
.role-tag { padding: 2px 10px; border-radius: 99px; background: rgba(142, 27, 16, .5); border: 1px solid rgba(240, 144, 126, .4); font-family: var(--ui); font-size: 12px; color: #FFD7C8; letter-spacing: .04em; }
.fg-choose { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: #D7C6A4; font-size: 14px; }
.pill-btn { min-width: 52px; height: 34px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .3); color: var(--tl); font-family: var(--num); font-weight: 700; }
.pill-btn.on { background: var(--gl); color: #1E140A; border-color: #FFE7A8; }
.fg-level { display: grid; grid-template-columns: auto 1fr 40px; gap: 12px; align-items: center; margin-top: 14px; color: #D7C6A4; }
.fg-level b { font-family: var(--num); font-size: 22px; color: var(--gl); text-align: center; }
.fg-tip { color: #CDBB98; font-size: 14px; margin: 10px 0; }
.fg-tip b { color: var(--tl); } .fg-tip b.bad { color: var(--badc); } .fg-tip.center { text-align: center; }
.fg-rollbox { text-align: center; padding: 6px 0 10px; }
.fg-rollbox p { color: #D7C6A4; }
.fg-bigroll { display: inline-flex; align-items: center; gap: 14px; padding: 16px 30px; border-radius: 14px; border: 1px solid #FFE7A8; background: radial-gradient(circle at 30% 30%, #C7472C, #6A140B); color: #FFF3DC; font-family: var(--display); font-size: 26px; box-shadow: 0 10px 30px rgba(142, 27, 16, .5), 0 0 0 6px rgba(232, 200, 119, .1); animation: bigroll 2.2s ease-in-out infinite; }
.fg-bigroll:hover { filter: brightness(1.1); }
@keyframes bigroll { 50% { box-shadow: 0 10px 30px rgba(142, 27, 16, .5), 0 0 0 12px rgba(232, 200, 119, .05); } }
.fg-abils { display: flex; flex-direction: column; gap: 6px; transition: opacity .3s; }
.fg-abils.veiled { opacity: .5; }
.fg-abil { display: grid; grid-template-columns: 112px 112px 34px 74px 1fr; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid transparent; transition: background .2s, border-color .2s; }
.fg-abil.prim { border-color: rgba(232, 200, 119, .25); }
.fg-abil.picked { border-color: var(--gl); background: rgba(232, 200, 119, .1); }
.fg-abil.great { animation: great .8s ease; } .fg-abil.awful { animation: awful .6s ease; }
@keyframes great { 30% { background: rgba(232, 200, 119, .3); box-shadow: 0 0 20px rgba(232, 200, 119, .4); } }
@keyframes awful { 20% { transform: translateX(-4px); background: rgba(142, 27, 16, .3); } 60% { transform: translateX(3px); } }
.fa-name b { display: block; font-family: var(--num); font-size: 17px; color: var(--tl); } .fa-name small { color: var(--ml); font-size: 12px; }
.fa-score { display: flex; align-items: center; justify-content: center; gap: 6px; }
.fa-score button:not(.fa-swap) { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .3); color: var(--gl); font-size: 18px; line-height: 1; }
.fa-score > b { width: 34px; text-align: center; font-family: var(--num); font-size: 22px; color: var(--tl); }
.fa-swap { width: 100%; min-height: 42px; border-radius: 8px; border: 1px dashed rgba(232, 200, 119, .35); background: rgba(0, 0, 0, .3); color: var(--tl); }
.fa-swap:hover { border-style: solid; border-color: var(--gl); }
.fa-val { font-family: var(--num); font-size: 22px; }
.fa-bonus { color: #9FD3A5; font-family: var(--num); font-weight: 700; text-align: center; }
.fa-final { text-align: center; } .fa-final b { font-family: var(--num); font-size: 24px; color: #FFF1C4; } .fa-final i { font-style: normal; display: block; font-size: 13px; color: var(--gl); margin-top: -4px; }
.fa-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.fa-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8A5E1C, var(--gl)); transition: width .5s var(--ease-out); }
.mini-dice { display: inline-flex; gap: 3px; }
.d6 { width: 20px; height: 20px; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-family: var(--num); font-size: 13px; font-weight: 700; background: #F3E6C8; color: #2B1D12; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.d6.spin { animation: d6spin .25s linear infinite; background: #E8C877; }
.d6.drop { opacity: .35; text-decoration: line-through; }
@keyframes d6spin { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-4px); } 100% { transform: rotate(360deg) translateY(0); } }
.fg-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill { padding: 7px 12px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .22); background: rgba(0, 0, 0, .28); color: #E6D5B2; font-size: 14px; }
.skill.on { background: linear-gradient(180deg, #A42A1A, #7A1A0F); color: #FFF3DC; border-color: var(--gl); }
.fg-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid rgba(232, 200, 119, .14); overflow-x: auto; }
.fg-tabs button { padding: 10px 14px; border: 0; background: none; color: var(--ml); font-family: var(--num); font-weight: 700; letter-spacing: .08em; border-bottom: 2px solid transparent; white-space: nowrap; }
.fg-tabs button.on { color: var(--gl); border-bottom-color: var(--gl); }
.fg-look h4 { margin: 12px 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ml); }
.fg-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .5); box-shadow: 0 0 0 1px rgba(232, 200, 119, .25); transition: transform .15s; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px #120C08, 0 0 0 4px var(--gl); transform: scale(1.08); }
.sw.none { background: repeating-linear-gradient(45deg, #2A1E14, #2A1E14 4px, #3A2A1C 4px, #3A2A1C 8px); color: var(--ml); font-size: 16px; }
.sw.ring { background: radial-gradient(circle, transparent 42%, var(--c) 44%, var(--c) 70%, transparent 72%); }
.fg-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-b { padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .2); background: rgba(0, 0, 0, .28); color: #E6D5B2; font-size: 14px; }
.opt-b.on { border-color: var(--gl); background: rgba(232, 200, 119, .16); color: var(--gl); }
.fg-look + .row { margin-top: 14px; }
.fg-name span, .fg-traits label > span, .fg-two label > span, .fg-notes span { display: block; margin-bottom: 6px; color: var(--ml); font-size: 13px; letter-spacing: .04em; }
.fg-name-row { display: flex; gap: 8px; margin-bottom: 14px; }
.fg-name-row input { flex: 1; min-width: 0; height: 58px; padding: 0 16px; border-radius: 10px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .4); color: #FFF1C4; font-family: var(--display); font-size: 28px; outline: none; }
.fg-name-row input:focus { border-color: var(--gl); box-shadow: 0 0 0 3px rgba(232, 200, 119, .14); }
.fg-die { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(142, 27, 16, .35); color: var(--gl); display: grid; place-items: center; transition: transform .3s var(--ease-spring); }
.fg-die:hover { transform: rotate(-20deg) scale(1.08); background: rgba(142, 27, 16, .6); }
.fg-die.big { width: 58px; height: 58px; }
.fg-align { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.fg-align button { padding: 8px 4px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .18); background: rgba(0, 0, 0, .28); color: #E6D5B2; }
.fg-align b { display: block; font-family: var(--num); font-size: 16px; color: var(--tl); } .fg-align small { color: var(--ml); font-size: 11.5px; }
.fg-align button.on { border-color: var(--gl); background: rgba(232, 200, 119, .14); } .fg-align button.on small { color: var(--gl); }
.fg-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.fg-tr { display: flex; gap: 6px; align-items: flex-start; }
.fg-tr textarea, .fg-tr input, .fg-two input, .fg-notes textarea { flex: 1; min-width: 0; width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(232, 200, 119, .2); background: rgba(0, 0, 0, .35); color: var(--tl); font-size: 14px; outline: none; resize: vertical; }
.fg-tr input, .fg-two input { height: 42px; }
.fg-tr textarea:focus, .fg-tr input:focus, .fg-two input:focus, .fg-notes textarea:focus { border-color: var(--gl); }
.fg-two { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 10px; }
.fg-notes { display: block; }
.fg-reveal { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.fg-card3d { position: relative; width: 300px; height: 440px; perspective: 1200px; }
.fg-card3d > div { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; transition: transform 1s var(--ease-out); }
.fc3-back { display: grid; place-items: center; color: var(--gl); background: radial-gradient(circle at 50% 40%, #6A140B, #240806); border: 2px solid var(--gl); box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 0 0 8px rgba(232, 200, 119, .12); animation: cardWobble 1.3s ease-in-out; }
@keyframes cardWobble { 20% { transform: rotate(-3deg) scale(1.02); } 40% { transform: rotate(3deg) scale(1.04); } 60% { transform: rotate(-2deg) scale(1.05); } 80% { transform: rotate(1deg) scale(1.06); } }
.fc3-front { transform: rotateY(180deg); display: flex; flex-direction: column; padding: 12px; overflow: hidden; border: 2px solid var(--gl); background: radial-gradient(ellipse 70% 40% at 50% 45%, color-mix(in srgb, var(--ring) 45%, transparent), transparent 70%), linear-gradient(180deg, #2A1C12, #120C08); box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(232, 200, 119, .25), inset 0 0 0 6px rgba(232, 200, 119, .1); }
.fg-card3d.flip .fc3-back { transform: rotateY(-180deg); }
.fg-card3d.flip .fc3-front { transform: rotateY(0); }
.fc3-art { flex: 1; min-height: 0; display: flex; justify-content: center; }
.fc3-art svg.av { width: auto; height: 100%; }
.fc3-title { text-align: center; } .fc3-title b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: #FFF1C4; line-height: 1.1; } .fc3-title span { color: var(--gl); font-size: 13px; }
.fc3-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin: 8px 0 6px; }
.fc3-stats div { text-align: center; padding: 3px 0; border-radius: 6px; background: rgba(0, 0, 0, .35); } .fc3-stats span { display: block; font-size: 9.5px; color: var(--gl); font-weight: 800; } .fc3-stats b { display: block; font-family: var(--num); color: var(--tl); font-size: 16px; line-height: 1.1; } .fc3-stats i { font-style: normal; font-size: 10.5px; color: var(--ml); }
.fc3-vit { display: flex; justify-content: space-around; font-size: 13px; color: var(--ml); } .fc3-vit b { color: var(--tl); font-family: var(--num); }
.fc3-motto { margin-top: 6px; text-align: center; font-family: var(--story); font-style: italic; font-size: 13.5px; color: #E6D5B2; }
.fg-final-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 960px) {
  .p-forge { padding: 10px 10px 96px; }
  .fg-main { grid-template-columns: 1fr; }
  .fg-stage { position: relative; top: 0; height: 330px; min-height: 0; }
  .fg-hero { width: 46%; bottom: 20%; max-width: 190px; }
  .fg-steps span { display: none; }
  .fg-step i { width: 32px; height: 32px; font-size: 13px; }
  .fg-progress { top: 16px; }
  .fg-abil { grid-template-columns: 80px 90px 28px 56px; }
  .fa-bar { display: none; }
  .fg-traits, .fg-two { grid-template-columns: 1fr; }
  .fg-pane { padding: 16px 14px 12px; }
  .fg-card3d { width: 270px; height: 400px; }
}
.tile b, .hs-vitals b, .hs-abil b, .dice-stats b, .fg-derived b, .fa-final b, .fa-val, .fa-score > b, .fc3-stats b, .hc-stats b, .code-badge, .join-code input, .ts-code input, .hbars b, .fg-level b, .tc-meta .code { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }

/* ===================================================================== game shell */

body.mode-game { --gbar: 56px; background: #0B0806; }
.gbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: var(--gbar); padding: 0 12px; color: #EADBB6;
  background: linear-gradient(180deg, rgba(22, 15, 10, .98), rgba(14, 10, 7, .96)); border-bottom: 1px solid rgba(232, 200, 119, .18); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.gb-back { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .25); color: var(--gl); text-decoration: none; font-weight: 700; font-size: 14px; flex: none; }
.gb-back:hover { background: rgba(232, 200, 119, .1); color: #FFF1C4; }
.gb-title { display: flex; flex-direction: column; min-width: 0; max-width: 240px; line-height: 1.15; }
.gb-title b { font-family: var(--display); font-weight: 400; font-size: 19px; color: #FFF1C4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-title small { color: var(--ml); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-nav { flex: 1 1 auto; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.gb-nav::-webkit-scrollbar { display: none; }
.gb-nav a { white-space: nowrap; padding: 17px 11px 15px !important; font-size: 14px; }
.gb-right { display: flex; align-items: center; gap: 8px; flex: none; }
.gb-btn { width: 38px; height: 38px; }
.gb-btn#topMute { color: #9FD3A5; }
.gb-btn#topMute.muted { color: var(--badc); }
.gb-btn#topMute.speaking { box-shadow: 0 0 0 3px rgba(93, 174, 106, .6); }
body.mode-game .view { padding: 14px 18px 28px; }
body.mode-game .view-table { padding: 0; }

/* ---------- table view */
.tv { --drawer: 390px; display: grid; grid-template-columns: minmax(0, 1fr) var(--drawer); height: calc(100vh - var(--gbar)); height: calc(100dvh - var(--gbar)); transition: grid-template-columns .3s var(--ease-out); }
.tv.drawer-closed { grid-template-columns: minmax(0, 1fr) 0px; }
.tv.drawer-closed .drawer { opacity: 0; pointer-events: none; }
.tv-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tv .map-wrap { flex: 1 1 auto; height: auto; min-height: 0; border: 0; outline: 0; box-shadow: none; background: radial-gradient(ellipse at center, #1A130D, #070504); }
.map-wrap.map-in .map-img { animation: mapIn 1.1s var(--ease-out); }
@keyframes mapIn { from { opacity: 0; filter: blur(8px) brightness(.4); } }
.map-vignette { position: absolute; inset: 0; z-index: 6; pointer-events: none; box-shadow: inset 0 0 120px rgba(0, 0, 0, .65); }
.weather-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }
.map-wrap[data-weather="storm"] .map-img { filter: brightness(.78) saturate(.85); }
.map-wrap[data-weather="rain"] .map-img { filter: brightness(.9) saturate(.9); }
.map-wrap[data-weather="fog"] .map-img { filter: brightness(.9) contrast(.9); }
.map-wrap[data-weather="snow"] .map-img { filter: brightness(1.04) saturate(.75); }
.map-wrap[data-weather="ash"] .map-img { filter: sepia(.35) brightness(.85); }
.map-img { transition: filter 1.5s; }
.tv .tool-rail, .tv .zoom-rail { background: rgba(16, 11, 8, .82); border: 1px solid rgba(232, 200, 119, .22); border-radius: 12px; backdrop-filter: blur(6px); padding: 4px; }
.tv .tool-rail { top: 70px; }
.tv .zoom-rail { top: auto; bottom: 14px; right: 12px; }
.tv .tool-rail button, .tv .zoom-rail button { width: 42px; height: 42px; border-radius: 9px; }
.tv .tool-rail button.on { background: linear-gradient(180deg, #A42A1A, #7A1A0F); border-color: var(--gl); }
.tv .fog-pop { left: 66px; top: 70px; background: rgba(16, 11, 8, .92); border-color: rgba(232, 200, 119, .3); border-radius: 10px; color: #EADBB6; }
.tv .map-caption { left: 12px; bottom: 12px; border-radius: 99px; border-color: rgba(232, 200, 119, .2); background: rgba(10, 7, 5, .7); }
.tv .siege-hud-wrap { top: 70px; }
.tv .trap-card-wrap { top: 70px; right: 66px; }

/* overlays */
.tv .init-strip { position: absolute; z-index: 9; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 140px); display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; padding: 6px 10px; border-radius: 14px;
  background: rgba(14, 10, 7, .82); border: 1px solid rgba(232, 200, 119, .25); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); backdrop-filter: blur(8px); color: #EADBB6; }
.tv .init-strip.active { border-color: rgba(240, 144, 126, .55); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 24px rgba(178, 58, 34, .25); }
.tv .init-title { flex-direction: row; align-items: center; gap: 6px; font-family: var(--num); font-weight: 700; font-size: 14px; color: var(--gl); white-space: nowrap; }
.tv .init-title small { color: var(--ml); font-style: italic; }
.tv .init-list { flex: 0 1 auto; min-height: 0; padding: 2px; gap: 6px; align-items: center; }
.tv .init-item { min-width: 0; }
.tv .init-face { width: 40px; height: 40px; border-width: 2px; background: #1E140C; color: #F0D9A8; }
.tv .init-item.now .init-face { width: 50px; height: 50px; box-shadow: 0 0 0 2px #120C08, 0 0 0 4px var(--gl), 0 0 18px rgba(232, 200, 119, .5); }
.tv .init-item.ko .init-face { filter: grayscale(1) brightness(.6); }
.tv .init-val { font-size: 12px; color: var(--ml); }
.tv .init-item.now .init-val { color: var(--gl); }
.tv .init-x { opacity: 0; background: #2B1D12; color: var(--tl); border-color: rgba(232, 200, 119, .3); }
.tv .init-actions { flex-wrap: nowrap; }
.tv .init-actions .btn { min-height: 34px; padding: 0 11px; white-space: nowrap; }
.tv .init-strip.empty { padding: 5px 8px; }
.tk-portrait, .init-face .tk-portrait { display: block; width: 100%; height: 100%; background: radial-gradient(circle at 50% 35%, #4A3524, #160F0A); }
.tk-portrait svg.av { width: 100%; height: 100%; }
.pulse-btn { animation: pulseBtn 1.6s ease-in-out infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 4px rgba(232, 200, 119, .35); } }

.tv .narration { position: absolute; z-index: 9; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(680px, calc(100% - 220px)); padding: 0; background: none; border: 0; outline: 0; box-shadow: none; }
.narr-card { position: relative; padding: 14px 44px 14px 20px; border-radius: 10px; background: var(--parch) url(../assets/img/parchment.jpg) center / cover; color: var(--ink); border: 2px solid #4A3220; box-shadow: inset 0 0 30px rgba(90, 58, 24, .45), 0 18px 40px rgba(0, 0, 0, .6); max-height: 34vh; overflow: auto; }
.narr-card .read { margin: 2px 0 0; font-family: var(--story); font-size: 18px; line-height: 1.45; }
.narr-x { position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); font-size: 18px; line-height: 1; }
.narration.min { width: auto; }
.narr-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .4); background: rgba(14, 10, 7, .85); color: var(--gl); font-weight: 700; }
.tv .narration.fresh .narr-card { animation: narrIn .8s var(--ease-spring), glow 2.4s ease-out; }
@keyframes narrIn { from { transform: translateY(30px) scale(.96); opacity: 0; } }

.chat-ticker { position: absolute; z-index: 9; left: 12px; bottom: 50px; width: min(340px, 50%); display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.tick { padding: 7px 12px; border-radius: 10px; background: rgba(12, 8, 6, .82); border: 1px solid rgba(232, 200, 119, .2); color: #EADBB6; font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: tickIn .35s var(--ease-out) both; backdrop-filter: blur(6px); }
.tick.out { animation: tickOut .5s ease both; }
@keyframes tickIn { from { opacity: 0; transform: translateX(-16px); } }
@keyframes tickOut { to { opacity: 0; transform: translateY(6px); } }

.emote-wrap { position: absolute; z-index: 9; right: 66px; bottom: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.emote-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(232, 200, 119, .35); background: rgba(14, 10, 7, .85); font-size: 24px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); transition: transform .2s var(--ease-spring); }
.emote-btn:hover { transform: scale(1.1) rotate(-8deg); }
.emote-pop { display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; padding: 8px; border-radius: 14px; background: rgba(14, 10, 7, .92); border: 1px solid rgba(232, 200, 119, .3); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); animation: gPop .25s var(--ease-out); }
.emote-pop button { width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; font-size: 24px; transition: transform .15s; }
.emote-pop button:hover { background: rgba(232, 200, 119, .14); transform: scale(1.18); }
.float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.emote-bubble { position: absolute; transform: translate(-50%, -100%) scale(calc(1 / var(--zoom, 1))); transform-origin: 50% 100%; display: flex; flex-direction: column; align-items: center; animation: bubble 2.6s var(--ease-out) both; }
.emote-bubble span { font-size: 34px; line-height: 1; padding: 6px 8px; border-radius: 16px; background: rgba(255, 248, 230, .95); box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
.emote-bubble small { margin-top: 2px; padding: 0 6px; border-radius: 6px; background: rgba(12, 8, 6, .8); color: #F3E6C8; font-size: 11px; font-weight: 700; }
@keyframes bubble { 0% { opacity: 0; translate: 0 10px; scale: .4; } 12% { opacity: 1; translate: 0 0; scale: 1.1; } 20% { scale: 1; } 80% { opacity: 1; translate: 0 -6px; } 100% { opacity: 0; translate: 0 -16px; } }
.float-num { position: absolute; transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1))); font-family: var(--display); font-size: 34px; font-weight: 400; letter-spacing: .02em; -webkit-text-stroke: 1px #1A0E08; text-shadow: 0 3px 0 #1A0E08, 0 0 14px rgba(0, 0, 0, .7); animation: floatUp 1.6s var(--ease-out) both; white-space: nowrap; }
.float-num.dmg { color: #FF6A4A; }
.float-num.heal { color: #8FF0A0; }
@keyframes floatUp { 0% { opacity: 0; translate: 0 10px; scale: .5; } 15% { opacity: 1; translate: 0 -8px; scale: 1.3; } 30% { scale: 1; } 100% { opacity: 0; translate: 0 -60px; } }

.banner-wrap { position: absolute; z-index: 12; inset: 0; pointer-events: none; display: grid; place-items: center; }
.turn-banner { grid-area: 1 / 1; text-align: center; padding: 18px 60px; color: #FFF1C4; background: linear-gradient(90deg, transparent, rgba(12, 8, 6, .88) 20%, rgba(12, 8, 6, .88) 80%, transparent); animation: bannerIn .6s var(--ease-spring) both; }
.turn-banner b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: 1; color: var(--gl); text-shadow: 0 0 30px rgba(232, 200, 119, .6), 0 4px 0 #2A1608; }
.turn-banner b.small { font-size: clamp(22px, 3vw, 32px); }
.turn-banner small { display: block; font-family: var(--num); letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: #E6D5B2; }
.turn-banner span { display: block; margin-top: 4px; font-family: var(--story); font-style: italic; font-size: 18px; color: #E6D5B2; }
.turn-banner.combat b { color: #FF8A6A; text-shadow: 0 0 30px rgba(255, 90, 50, .6), 0 4px 0 #2A0A04; }
.turn-banner.combat.end b { color: var(--gl); }
.turn-banner.other { padding: 8px 40px; }
.turn-banner.out { animation: bannerOut .6s ease both; }
@keyframes bannerIn { from { opacity: 0; transform: scale(1.4); letter-spacing: .3em; } }
@keyframes bannerOut { to { opacity: 0; transform: scale(.9) translateY(-20px); } }

/* hotbar */
.tv .hotbar { position: relative; z-index: 5; flex: none; gap: 8px 14px; padding: 8px 14px; max-height: 38vh; overflow-y: auto; background: linear-gradient(180deg, #1C140D, #120C08); color: #EADBB6; border-top: 1px solid rgba(232, 200, 119, .2); }
.tv .hot-empty { color: #CDBB98; }
.tv .hot-empty a { color: var(--gl); }
.tv .hot-name { color: #FFF1C4; }
.tv .hotbar .muted { color: var(--ml); }
.tv .hotbar .medal { width: 48px; height: 48px; border-width: 3px; background: #1E140C; }
.tv .hotbar .medal .tk-portrait svg.av { transform: none; }
.tv .hotbar .stat b, .tv .hotbar .stat b small { color: #FFF1C4; }
.tv .hotbar .stat span { color: var(--ml); }
.tv .hotbar .stat { background: rgba(255, 240, 210, .05); border-color: rgba(232, 200, 119, .2); }
.tv .hotbar .tag.gold { background: var(--gl); color: #1E140A; border-color: #FFE7A8; }
.hot-target { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 99px; background: rgba(178, 58, 34, .25); border: 1px solid rgba(240, 144, 126, .45); color: #FFD7C8; font-size: 14px; }
.hot-target b { color: #fff; }
.hot-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .3); color: #FFD7C8; font-size: 16px; line-height: 1; }

/* drawer */
.drawer { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: linear-gradient(180deg, #1A120C, #0F0A07); border-left: 1px solid rgba(232, 200, 119, .18); transition: opacity .25s; }
.dr-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; flex: none; border-bottom: 1px solid rgba(232, 200, 119, .15); background: rgba(0, 0, 0, .25); }
.dr-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; border: 0; background: none; color: var(--ml); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.dr-tabs button:hover { color: var(--tl); }
.dr-tabs button.on { color: var(--gl); background: linear-gradient(180deg, rgba(232, 200, 119, .1), transparent); }
.dr-tabs button.on::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; background: var(--gl); box-shadow: 0 0 8px var(--gl); }
.dr-badge { position: absolute; top: 4px; left: 56%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #B23A22; color: #fff; font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; animation: badgePop .4s var(--ease-spring); }
.dr-badge:empty { display: none; }
@keyframes badgePop { from { transform: scale(0); } }
.dr-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px; }
.dr-pane { display: none; }
.dr-pane.on { display: block; animation: pageIn .3s var(--ease-out); }
.dr-pane[data-pane="chat"].on { display: flex; flex-direction: column; min-height: 100%; }
.dr-pane[data-pane="chat"] .log-list { max-height: none; flex: 1 1 auto; min-height: 200px; }
.log.chat.mine { background: #EFE0BC; }
.log.chat.mention { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); background: #F6E7B8; }
.log .at { font-style: normal; font-weight: 700; color: var(--blood); }
.at-sugg { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 8px; }
.at-sugg:empty { display: none; }
.at-sugg button { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--rule); background: var(--paper2); font-size: 13px; font-weight: 700; }
.voice-note { margin: 8px 0 0; }
.vq { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; margin-right: 5px; vertical-align: middle; }
.vq b { width: 3px; background: rgba(0, 0, 0, .2); border-radius: 1px; }
.vq b:nth-child(1) { height: 4px; } .vq b:nth-child(2) { height: 7px; } .vq b:nth-child(3) { height: 10px; }
.vq.q1 b:nth-child(1) { background: #C0392B; }
.vq.q2 b:nth-child(-n+2) { background: #B8862B; }
.vq.q3 b { background: #3E7D45; }
.ptt-btn small { opacity: .7; font-weight: 500; }
.tv-mobile-tabs { display: none; }

/* ---------- miniature tokens */
.token { left: 0; top: 0; transition: transform .6s cubic-bezier(.35, .1, .25, 1), opacity .3s; will-change: transform; }
.token.dragging { transition: none; }
.token.leaving { opacity: 0; }
.token.avtok { border-radius: 0; }
.tk-av { position: absolute; left: -22%; width: 144%; bottom: -16%; aspect-ratio: 100 / 134; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); transition: filter .2s; }
.tk-av svg.av { width: 100%; height: 100%; }
.tk-shadow { position: absolute; left: 10%; right: 10%; bottom: -6%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .5), transparent 70%); }
.token.avtok.sel .tk-av { filter: drop-shadow(0 0 2px #FFF1C4) drop-shadow(0 0 6px var(--gl)) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.token.avtok.speaking .tk-av { filter: drop-shadow(0 0 3px #8FF0A0) drop-shadow(0 0 10px rgba(111, 207, 142, .9)); }
.token.avtok.turn::before { inset: auto; left: 2%; right: 2%; bottom: -14%; height: 40%; border-radius: 50%; border: 2px solid var(--gl); box-shadow: 0 0 14px var(--gl), inset 0 0 10px rgba(232, 200, 119, .5); animation: turnRing 1.6s ease-in-out infinite; }
@keyframes turnRing { 50% { transform: scale(1.1); opacity: .6; } }
.token.avtok .tk-hp { bottom: -18%; left: 14%; right: 14%; }
.token.avtok .tk-name { margin-top: 18%; }
.token.avtok.hidden-tk .tk-av { opacity: .5; }
.token.facing-left .tk-av svg.av .av-flip { transform: scaleX(-1); transform-origin: 50px 0; }
.token.walking .tk-av svg.av .av-leg-l { animation: av-step .3s ease-in-out infinite alternate; }
.token.walking .tk-av svg.av .av-leg-r { animation: av-step .3s ease-in-out infinite alternate-reverse; }
.token.walking .tk-av svg.av .av-arm-back { animation: av-swing .3s ease-in-out infinite alternate; }
.token.walking .tk-av svg.av .av-fig { animation: av-bob .15s ease-in-out infinite alternate; }
.token.down .tk-av svg.av .av-fig, .token.c-unconscious .tk-av svg.av .av-fig, .token.c-prone .tk-av svg.av .av-fig { transform: rotate(-80deg) translate(-8px, -2px); animation: none; }
.token.down .tk-av svg.av .av-eyes { opacity: 0; } .token.down .tk-av svg.av .av-eyes-shut { opacity: 1; }
.token.down .tk-av svg.av .av-zz { opacity: 1; animation: av-zz 2.4s ease-in-out infinite; }
.token.down .tk-av { filter: grayscale(.5) brightness(.8) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.token.c-poisoned .tk-av { filter: sepia(.6) hue-rotate(50deg) saturate(1.6) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.token.c-invisible .tk-av { opacity: .35; }
.token.c-paralyzed .tk-av svg.av *, .token.c-petrified .tk-av svg.av *, .token.c-stunned .tk-av svg.av * { animation-play-state: paused !important; }
.token.c-petrified .tk-av { filter: grayscale(1) brightness(1.1) drop-shadow(0 4px 3px rgba(0, 0, 0, .55)); }
.token.c-frightened .tk-av { animation: tremble .12s linear infinite; }
@keyframes tremble { 50% { translate: 1px 0; } }
.token.c-restrained .tk-av svg.av .av-body { animation: none; }
.tk-insp { position: absolute; top: -8px; left: -8px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: radial-gradient(circle, #FFF1C4, #C99A3E); color: #4A2A08; font-style: normal; font-size: 13px; line-height: 1; box-shadow: 0 0 10px #E8C877; animation: inspGlow 2s ease-in-out infinite; z-index: 3; }
.token.insp .tk-insp { display: grid; }
.token.avtok .tk-insp { top: -70%; left: 70%; }
@keyframes inspGlow { 50% { box-shadow: 0 0 18px #FFE7A8; transform: scale(1.12); } }
.tk-target { position: absolute; inset: -18%; display: none; border-radius: 50%; border: 2px dashed #FF6A4A; animation: spin 6s linear infinite; pointer-events: none; }
.tk-target::before, .tk-target::after { content: ''; position: absolute; left: 50%; top: -6px; width: 2px; height: 12px; margin-left: -1px; background: #FF6A4A; box-shadow: 0 calc(var(--px, 40px) * 1.36) 0 #FF6A4A; }
.token.targeted .tk-target { display: block; }
.token.avtok .tk-target { inset: auto -14% -26% -14%; height: 56%; }
.token.dead .tk-face { filter: grayscale(1) brightness(.5); transform: rotate(-12deg) scale(.92); transition: .6s; }
.tk-face.m-attack { animation: mAttack .6s var(--ease-out); }
.tk-face.m-cast { animation: mCast .8s ease-out; }
.tk-face.m-hurt { animation: mHurt .5s ease-out; }
.tk-face.m-heal { animation: mHeal .9s ease-out; }
.tk-face.m-block { animation: mBlock .5s ease-out; }
@keyframes mAttack { 30% { transform: scale(1.18) translateY(-10%); box-shadow: 0 0 0 3px #FF6A4A, 0 8px 18px rgba(0, 0, 0, .7); } 55% { transform: scale(1.06) translateY(4%); } }
@keyframes mCast { 40% { box-shadow: 0 0 0 3px #B57CFF, 0 0 26px 6px rgba(181, 124, 255, .7); transform: scale(1.1); } }
@keyframes mHurt { 15% { transform: translateX(-12%) rotate(-8deg); filter: sepia(1) saturate(6) hue-rotate(-30deg); } 35% { transform: translateX(10%) rotate(5deg); } 60% { transform: translateX(-5%); filter: none; } }
@keyframes mHeal { 40% { box-shadow: 0 0 0 3px #8FF0A0, 0 0 26px 6px rgba(111, 207, 142, .7); } }
@keyframes mBlock { 30% { transform: scale(.92); box-shadow: 0 0 0 4px #9CC4FF; } }

/* in-game hero page */
.hero-pick-page { padding: 10px 0; color: #EADBB6; }
.hp-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; color: var(--gl); }
.hp-head p { margin: 4px 0 18px; color: #D7C6A4; }
body.mode-game .view-character .forge { max-width: 1400px; margin: 0 auto; }
body.mode-game .view-character .fg-stage { top: 70px; }
.sheet-av { width: 120px; height: 160px; flex: none; border-radius: 12px; background: radial-gradient(ellipse 70% 30% at 50% 88%, color-mix(in srgb, var(--ring) 45%, transparent), transparent 70%); }
.sheet-motto { font-family: var(--story); font-style: italic; color: var(--ink2); margin-top: 2px; }
.char-av { width: 64px; height: 84px; flex: none; }

/* mobile table */
@media (max-width: 900px) {
  body.mode-game { --gbar: 52px; }
  .gbar { gap: 8px; padding: 0 8px; }
  .gb-back span, .gb-title small, #gbFull { display: none; }
  .gb-title { max-width: 120px; }
  .gb-title b { font-size: 16px; }
  .gb-nav { justify-content: flex-start; }
  .gb-nav a { padding: 15px 8px 13px !important; font-size: 13px; }
  .gb-right { gap: 6px; } .gb-btn { width: 36px; height: 36px; }
  .tv { grid-template-columns: 1fr; height: calc(100dvh - var(--gbar)); }
  .tv.drawer-closed { grid-template-columns: 1fr; }
  .tv .drawer { position: fixed; z-index: 45; left: 0; right: 0; bottom: 56px; height: 66vh; border-left: 0; border-top: 1px solid rgba(232, 200, 119, .3); border-radius: 16px 16px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); transform: translateY(110%); transition: transform .35s var(--ease-out); opacity: 1; pointer-events: auto; }
  .tv.sheet-open .drawer { transform: none; }
  .tv .dr-tabs { display: none; }
  .tv-mobile-tabs { position: fixed; z-index: 46; left: 0; right: 0; bottom: 0; height: 56px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); background: rgba(12, 8, 6, .97); border-top: 1px solid rgba(232, 200, 119, .18); }
  .tv-mobile-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; background: none; color: var(--ml); font-size: 11px; font-weight: 700; }
  .tv-mobile-tabs button.on { color: var(--gl); }
  .tv-stage { padding-bottom: 56px; }
  .tv .hotbar { max-height: 30vh; padding: 6px 10px; }
  .tv .init-strip { top: 6px; max-width: calc(100% - 16px); padding: 4px 8px; }
  .tv .init-actions .btn { min-height: 30px; padding: 0 8px; font-size: 12px; }
  .tv .init-face { width: 34px; height: 34px; } .tv .init-item.now .init-face { width: 42px; height: 42px; }
  .tv .tool-rail { top: 64px; left: 6px; } .tv .tool-rail button, .tv .zoom-rail button { width: 38px; height: 38px; }
  .tv .zoom-rail { right: 6px; bottom: 10px; } .tv .zoom-rail .dr-toggle { display: none; }
  .tv .narration { width: calc(100% - 120px); bottom: 10px; }
  .narr-card .read { font-size: 16px; }
  .emote-wrap { right: 52px; bottom: 10px; }
  .chat-ticker { bottom: 60px; width: 60%; }
  .tv .fog-pop { left: 52px; top: 64px; }
  .tv .map-caption { display: none; }
}
@media (prefers-reduced-motion: reduce) { .token { transition: none; } .turn-banner, .float-num, .emote-bubble { animation-duration: .01s !important; } }
body.reduce-motion .weather-canvas { display: none; }
body.reduce-motion svg.av * { animation: none !important; }
body.mode-game .roll-banner { bottom: 96px; }
@media (max-width: 900px) { body.mode-game .roll-banner { bottom: 150px; max-width: calc(100vw - 20px); } }
.tv .init-strip .btn.ghost, .tv .hotbar .btn.ghost { color: #EADBB6; border-color: rgba(232, 200, 119, .35); background: rgba(255, 240, 210, .04); }
.tv .init-strip .btn.ghost:hover, .tv .hotbar .btn.ghost:hover { background: rgba(255, 240, 210, .1); }
.tv .hotbar .btn.ghost.danger-t { color: #F0907E !important; }
.tv .hotbar .hp-adjust input { background: rgba(0, 0, 0, .35); color: var(--tl); border-color: rgba(232, 200, 119, .3); }
.chat-ticker { left: auto; right: 66px; top: 76px; bottom: auto; align-items: flex-end; }
.tick { max-width: 100%; }
@media (max-width: 900px) { .chat-ticker { right: 50px; top: 64px; width: 62%; } .narr-card { max-height: 24vh; } .tv .narration { bottom: 8px; } }
@media (max-width: 900px) { body.mode-game .roll-banner { left: 10px; right: 10px; transform: translateY(30px); max-width: none; } body.mode-game .roll-banner.show { transform: none; } }

/* ===================================================================== collectible cards */

.tcg { --w: 220px; --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; position: relative; width: var(--w); aspect-ratio: 5 / 7; flex: none; font-size: calc(var(--w) * .056); color: var(--text); border-radius: calc(var(--w) * .05);
  background: linear-gradient(170deg, var(--bg1), var(--bg2)); box-shadow: 0 calc(var(--w) * .05) calc(var(--w) * .12) rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .6);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s var(--ease-out), box-shadow .25s; isolation: isolate; overflow: hidden; user-select: none; }
.tcg.glowing { box-shadow: 0 calc(var(--w) * .05) calc(var(--w) * .12) rgba(0, 0, 0, .55), 0 0 calc(var(--w) * .09) color-mix(in srgb, var(--glow) 55%, transparent), 0 0 0 1px rgba(0, 0, 0, .6); }
.tcg.paper { background: url(../assets/img/parchment.jpg) center / cover, linear-gradient(170deg, var(--bg1), var(--bg2)); background-blend-mode: multiply; }
.tcg-in { position: absolute; inset: calc(var(--w) * .035); display: flex; flex-direction: column; gap: calc(var(--w) * .022); padding: calc(var(--w) * .03); border-radius: calc(var(--w) * .035); border: 2px solid var(--frame); z-index: 1; }
.tcg.b-double .tcg-in { border: 5px double var(--frame); }
.tcg.b-ornate .tcg-in { border: 3px solid var(--frame); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .45), inset 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent); }
.tcg.b-ornate .tcg-in::before, .tcg.b-ornate .tcg-in::after { content: ''; position: absolute; width: 22%; height: 15%; pointer-events: none; border: 3px solid var(--accent); }
.tcg.b-ornate .tcg-in::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; border-top-left-radius: 40% 60%; }
.tcg.b-ornate .tcg-in::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; border-bottom-right-radius: 40% 60%; }
.tcg.b-runic .tcg-in { border: 2px solid var(--frame); outline: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -6px; box-shadow: inset 0 0 calc(var(--w) * .06) color-mix(in srgb, var(--glow) 40%, transparent); }
.tcg-head { display: flex; align-items: center; gap: .4em; padding: .25em .45em; border-radius: .35em; background: linear-gradient(180deg, color-mix(in srgb, var(--frame) 55%, #000), color-mix(in srgb, var(--frame) 25%, #000)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.tcg.paper .tcg-head { background: linear-gradient(180deg, color-mix(in srgb, var(--frame) 30%, #fff), color-mix(in srgb, var(--frame) 15%, #fff)); }
.tcg-name { flex: 1; min-width: 0; font-size: 1.12em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent); }
.tcg.paper .tcg-name { color: var(--text); }
.tcg.f-display .tcg-name { font-family: var(--display); } .tcg.f-story .tcg-name { font-family: var(--story); font-style: italic; } .tcg.f-ui .tcg-name { font-family: var(--ui); font-weight: 800; }
.tcg-cost { flex: none; padding: .05em .45em; border-radius: 99px; background: rgba(0, 0, 0, .45); color: #FFE7A8; font-family: var(--num); font-weight: 700; font-size: .85em; font-variant-numeric: lining-nums; }
.tcg-art { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--glow, var(--frame)) 30%, transparent), rgba(0, 0, 0, .55)); border: 2px solid color-mix(in srgb, var(--frame) 80%, #000); }
.tcg.a-arch .tcg-art { border-radius: 45% 45% .3em .3em / 30% 30% .3em .3em; }
.tcg.a-square .tcg-art { border-radius: .3em; }
.tcg.a-circle .tcg-art { width: 82%; flex: none; aspect-ratio: 1; align-self: center; border-radius: 50%; }
.tcg-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcg-ph { font-size: 3.2em; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.tcg-type { display: flex; align-items: center; justify-content: space-between; gap: .3em; padding: .15em .45em; font-family: var(--num); font-weight: 700; font-size: .78em; letter-spacing: .04em; color: var(--accent); background: rgba(0, 0, 0, .3); border-radius: .3em; }
.tcg.paper .tcg-type { background: rgba(255, 255, 255, .3); color: var(--text); }
.tcg-gem { width: .95em; height: .95em; transform: rotate(45deg); border: 1px solid rgba(0, 0, 0, .6); box-shadow: 0 0 .5em currentColor; flex: none; }
.tcg.r-common .tcg-gem { background: #B9B3A6; color: #B9B3A6; } .tcg.r-uncommon .tcg-gem { background: #5DBE6A; color: #5DBE6A; } .tcg.r-rare .tcg-gem { background: #4F9EEB; color: #4F9EEB; }
.tcg.r-veryrare .tcg-gem { background: #A77BEF; color: #A77BEF; } .tcg.r-legendary .tcg-gem { background: #F2A33A; color: #F2A33A; } .tcg.r-artifact .tcg-gem { background: #E04A3A; color: #E04A3A; }
.tcg-text { flex: 0 0 auto; min-height: 22%; max-height: 32%; overflow: hidden; padding: .35em .5em; border-radius: .3em; background: rgba(0, 0, 0, .28); font-size: .8em; line-height: 1.3; }
.tcg.paper .tcg-text { background: rgba(255, 255, 255, .35); }
.tcg-text p { margin: 0 0 .3em; } .tcg-effect { font-weight: 700; } .tcg-flavor { font-family: var(--story); font-style: italic; opacity: .85; }
.tcg-stats { display: flex; justify-content: space-around; gap: .3em; }
.tcg-stats span { flex: 1; text-align: center; padding: .1em 0; border-radius: .3em; background: rgba(0, 0, 0, .35); font-size: .78em; font-variant-numeric: lining-nums; }
.tcg-stats b { display: block; font-size: .78em; color: var(--accent); letter-spacing: .06em; }
.tcg-pattern { position: absolute; inset: 0; z-index: 0; opacity: .35; pointer-events: none; }
.tcg.p-filigree .tcg-pattern { background: radial-gradient(circle at 0 0, transparent 9px, color-mix(in srgb, var(--accent) 35%, transparent) 10px, transparent 11px) 0 0 / 22px 22px, radial-gradient(circle at 100% 100%, transparent 9px, color-mix(in srgb, var(--accent) 35%, transparent) 10px, transparent 11px) 0 0 / 22px 22px; }
.tcg.p-runes .tcg-pattern { background: repeating-linear-gradient(60deg, transparent 0 12px, color-mix(in srgb, var(--accent) 30%, transparent) 12px 13px), repeating-linear-gradient(-60deg, transparent 0 12px, color-mix(in srgb, var(--accent) 22%, transparent) 12px 13px); }
.tcg.p-stars .tcg-pattern { background: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent), radial-gradient(1px 1px at 85% 65%, #fff, transparent), radial-gradient(1px 1px at 10% 70%, #fff, transparent); background-size: 60px 60px; opacity: .55; }
.tcg.p-flames .tcg-pattern { background: radial-gradient(ellipse 80% 40% at 50% 110%, color-mix(in srgb, var(--glow) 80%, transparent), transparent 70%), repeating-linear-gradient(80deg, transparent 0 9px, rgba(255, 120, 40, .15) 9px 11px); opacity: .7; }
.tcg.p-frost .tcg-pattern { background: repeating-linear-gradient(135deg, transparent 0 16px, rgba(255, 255, 255, .18) 16px 17px), repeating-linear-gradient(45deg, transparent 0 22px, rgba(255, 255, 255, .12) 22px 23px); opacity: .6; }
.tcg-foil { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge; transition: opacity .3s; }
.tcg.foil .tcg-foil { opacity: .55; background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .35) 35%, rgba(120, 220, 255, .35) 45%, rgba(255, 240, 140, .4) 55%, transparent 70%) var(--mx) var(--my) / 220% 220%; animation: foilShift 6s linear infinite; }
@keyframes foilShift { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
.tcg:hover .tcg-foil { opacity: .75; }
.tcg-owned { position: absolute; z-index: 3; top: -2px; right: -2px; padding: .15em .55em; border-radius: 0 0 0 .6em; background: var(--accent); color: #1E140A; font-family: var(--num); font-weight: 800; font-size: .9em; }
.tcg.r-legendary.foil, .tcg.r-artifact { animation: legend 3.5s ease-in-out infinite; }
@keyframes legend { 50% { box-shadow: 0 calc(var(--w) * .05) calc(var(--w) * .12) rgba(0, 0, 0, .55), 0 0 calc(var(--w) * .14) color-mix(in srgb, var(--glow) 70%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tcg, .tcg-foil { animation: none !important; transition: none; } }

/* shop & collection */
.shop-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.gold-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: linear-gradient(180deg, rgba(232, 200, 119, .2), rgba(232, 200, 119, .06)); border: 1px solid rgba(232, 200, 119, .45); color: #FFF1C4; font-family: var(--num); font-weight: 700; font-size: 20px; font-variant-numeric: lining-nums; }
.gold-pill small { font-family: var(--ui); font-size: 13px; color: var(--ml); font-weight: 500; }
.gold-pill.bump { animation: goldBump .6s var(--ease-spring); }
@keyframes goldBump { 40% { transform: scale(1.15); box-shadow: 0 0 24px rgba(232, 200, 119, .5); } }
.daily-btn { animation: pulseBtn 2s ease-in-out infinite; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.shop-filters button { padding: 7px 13px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .25); background: rgba(0, 0, 0, .3); color: #E6D5B2; font-size: 13.5px; }
.shop-filters button.on { background: var(--gl); color: #1E140A; border-color: #FFE7A8; font-weight: 700; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 16px; justify-items: center; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.shop-item .tcg { cursor: pointer; }
.shop-item .tcg:hover { box-shadow: 0 18px 40px rgba(0, 0, 0, .65), 0 0 30px color-mix(in srgb, var(--glow, var(--frame)) 45%, transparent); }
.shop-meta { display: flex; align-items: center; gap: 8px; color: var(--ml); font-size: 13px; }
.shop-meta .left { color: #FFB2A0; font-weight: 700; }
.shop-item .btn { min-width: 150px; }
.shop-closed { padding: 30px; text-align: center; }
.buy-dlg { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.buy-dlg .tcg { --w: 260px; }
.buy-dlg.flying .tcg { animation: cardFly 1s var(--ease-out) forwards; }
@keyframes cardFly { 40% { transform: scale(1.08) rotateY(180deg); } 100% { transform: translateY(-40px) scale(.4) rotateY(360deg); opacity: 0; } }
.coin-burst { position: fixed; z-index: 99; pointer-events: none; font-size: 26px; animation: coin 1s var(--ease-out) forwards; }
@keyframes coin { to { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; } }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 12px; justify-items: center; }
.coll-grid .tcg { --w: 170px; cursor: pointer; }
.coll-cap { margin-top: 6px; text-align: center; font-size: 12.5px; color: var(--ml); }
.coll-cap b { color: #9FD3A5; font-weight: 700; }
.announce { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; margin-bottom: 16px; border-radius: 12px; border: 1px solid rgba(232, 200, 119, .4); background: linear-gradient(90deg, rgba(232, 200, 119, .14), rgba(30, 21, 14, .5)); }
.announce b { display: block; color: #FFF1C4; font-size: 16px; }
.announce p { margin: 2px 0 0; color: #E6D5B2; white-space: pre-line; }
.pending-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: #E6D5B2; background: radial-gradient(ellipse at center, #22160E, #070504); }
.pending-screen h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 46px); color: var(--gl); }
.pending-screen p { max-width: 520px; margin: 0; font-size: 16px; }
.pending-seal { font-size: 64px; animation: emblem 5s ease-in-out infinite; }
.sheet-gear { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.sheet-gear .tcg { --w: 120px; }
.nav-item.admin-link { color: #9CD8FF; }
@media (max-width: 600px) { .buy-dlg { grid-template-columns: 1fr; justify-items: center; } .shop-grid { grid-template-columns: repeat(2, 1fr); } .shop-grid .tcg { --w: 160px; } .coll-grid .tcg { --w: 150px; } }
.gold-pill.sm { padding: 5px 12px; font-size: 16px; text-decoration: none; }
@media (max-width: 600px) { .gold-pill.sm { font-size: 14px; padding: 4px 9px; } }
/* voice route */
.voice-route { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; color: var(--ml, #A99577); }
.voice-route select { min-height: 36px; padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(0, 0, 0, .35); color: inherit; font: inherit; }

/* ---------- 2.5D table: the map is a board on a wooden table, seen through an orbiting camera;
   miniatures stand on it and always turn to face you */
.viewport { perspective: var(--persp, 1000px); perspective-origin: 50% 50%; background: #050302; }
.viewport.orbiting { cursor: move; }
.stage { transform-origin: 0 0; will-change: transform; }
.t3d .stage, .t3d .token-layer, .t3d .float-layer { transform-style: preserve-3d; }
/* the table under the board: walnut planks lit by a lamp above the middle of the board */
.table-top { position: absolute; left: calc(var(--room, 1200px) * -1); top: calc(var(--room, 1200px) * -1); right: calc(var(--room, 1200px) * -1); bottom: calc(var(--room, 1200px) * -1); pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 196, 120, .10) 0%, rgba(0, 0, 0, 0) 38%, rgba(5, 3, 2, .72) 70%, #050302 92%), url(../assets/img/table-wood.jpg) 0 0 / 640px 640px repeat;
  transform: translateZ(calc(var(--thick, 20px) * -1)); }
.board-shadow { position: absolute; inset: 0; pointer-events: none; transform: translateZ(calc(var(--thick, 20px) * -1 + 1px)); box-shadow: 0 0 calc(var(--thick) * 2.5) calc(var(--thick) * 1.2) rgba(0, 0, 0, .78), 0 calc(var(--thick) * 1.5) calc(var(--thick) * 3) rgba(0, 0, 0, .55); }
/* the board's frame and its four thick sides */
.board-frame { position: absolute; left: calc(var(--frame) * -1); top: calc(var(--frame) * -1); right: calc(var(--frame) * -1); bottom: calc(var(--frame) * -1); pointer-events: none;
  background: linear-gradient(135deg, #4A2E18, #2A190D 45%, #3B2412); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 0 calc(var(--frame) - 4px) rgba(0, 0, 0, .08), inset 0 0 calc(var(--frame) * .9) rgba(0, 0, 0, .55); border-radius: 4px; }
.board-frame::after { content: ''; position: absolute; inset: calc(var(--frame) - 3px); border: 2px solid rgba(214, 170, 92, .55); border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .65); }
.board-side { position: absolute; pointer-events: none; background: linear-gradient(180deg, #3A2312, #1C1008); backface-visibility: hidden; }
.board-side.s { left: calc(var(--frame) * -1); right: calc(var(--frame) * -1); top: calc(100% + var(--frame)); height: var(--thick); transform-origin: 50% 0; transform: rotateX(-90deg); }
.board-side.n { left: calc(var(--frame) * -1); right: calc(var(--frame) * -1); bottom: calc(100% + var(--frame)); height: var(--thick); transform-origin: 50% 100%; transform: rotateX(90deg); }
.board-side.e { top: calc(var(--frame) * -1); bottom: calc(var(--frame) * -1); left: calc(100% + var(--frame)); width: var(--thick); transform-origin: 0 50%; transform: rotateY(90deg); background: linear-gradient(90deg, #321E0F, #170D06); }
.board-side.w { top: calc(var(--frame) * -1); bottom: calc(var(--frame) * -1); right: calc(100% + var(--frame)); width: var(--thick); transform-origin: 100% 50%; transform: rotateY(-90deg); background: linear-gradient(270deg, #321E0F, #170D06); }
.map-wrap:not(.t3d) .board-side { display: none; }
.t3d .map-img { box-shadow: 0 0 0 1px rgba(0, 0, 0, .7); }
.map-haze { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .45s; background: linear-gradient(180deg, rgba(5, 3, 2, .9) 0%, rgba(5, 3, 2, .45) 10%, rgba(5, 3, 2, .08) 24%, rgba(5, 3, 2, 0) 34%); }
.map-wrap.t3d .map-haze { opacity: 1; }
/* miniatures: placed with --x/--y; in 3D they stand on their square and turn to the camera */
.token { transform: translate3d(var(--x, 0), var(--y, 0), 0) translate(-50%, -50%); }
.t3d .token { transform: translate3d(var(--x, 0), var(--y, 0), 0) translate(-50%, -100%) rotateZ(calc(var(--yaw, 0deg) * -1)) rotateX(calc(var(--pitch, 0deg) * -1)); }
.t3d .token.lift { transform: translate3d(var(--x, 0), var(--y, 0), 0) translate(-50%, -100%) rotateZ(calc(var(--yaw, 0deg) * -1)) rotateX(calc(var(--pitch, 0deg) * -1)) translateY(-12px) translateZ(10px); }
.tk-base { transform: translate3d(var(--x, 0), var(--y, 0), 0) translate(-50%, -50%); }
.cam-moving .token, .cam-moving .tk-base { transition: opacity .3s !important; }
/* camera buttons: turn left, compass (face north), turn right, look from above, lower angle */
.cam-pad { position: absolute; right: 12px; top: 12px; z-index: 8; display: flex; gap: 2px; padding: 4px; background: rgba(16, 11, 8, .82); border: 1px solid rgba(232, 200, 119, .22); border-radius: 12px; backdrop-filter: blur(6px); }
.cam-pad button { width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: #EADBB6; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cam-pad button:hover { background: #3A2818; }
.cam-pad .cam-compass svg { transform: rotate(var(--yaw, 0deg)); transition: transform .1s linear; }
.map-wrap:not(.t3d) .cam-pad [data-cam="up"], .map-wrap:not(.t3d) .cam-pad [data-cam="down"] { opacity: .35; }
.cam-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: min(92%, 720px); padding: 9px 16px; border-radius: 999px; background: rgba(12, 8, 6, .86); border: 1px solid rgba(232, 200, 119, .3); color: #EADBB6; font: 600 13px/1.3 var(--ui, sans-serif); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); cursor: pointer; animation: hintIn .5s var(--ease-out, ease-out) both; transition: opacity .4s, transform .4s; }
.cam-hint b { color: var(--gl, #E8C877); margin-inline-end: 4px; font-weight: 700; }
.cam-hint.out { opacity: 0; transform: translateX(-50%) translateY(10px); }
@keyframes hintIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }
.base-layer { position: absolute; inset: 0; pointer-events: none; display: none; }
.t3d .base-layer { display: block; }
.tk-base { position: absolute; left: 0; top: 0; transition: transform .6s cubic-bezier(.35, .1, .25, 1); }
.tk-base::before { content: ''; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, rgba(0, 0, 0, .6) 25%, rgba(0, 0, 0, .3) 55%, transparent 72%); }
.tk-base i { position: absolute; inset: 10%; border-radius: 50%; border: 3px solid var(--ring); background: radial-gradient(circle, rgba(0, 0, 0, .15), rgba(0, 0, 0, .35)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 8px rgba(0, 0, 0, .55); opacity: .9; }
.tk-base.sel i { border-color: #FFF1C4; box-shadow: 0 0 12px #E8C877, 0 0 0 1px rgba(0, 0, 0, .7); }
.tk-base.turn i { border-color: var(--gl); box-shadow: 0 0 18px var(--gl), inset 0 0 10px rgba(232, 200, 119, .5); animation: turnRing 1.6s ease-in-out infinite; }
.tk-base.speaking i { border-color: #8FF0A0; box-shadow: 0 0 16px rgba(111, 207, 142, .95); }
.tk-base.targeted::after { content: ''; position: absolute; inset: -4%; border-radius: 50%; border: 2px dashed #FF6A4A; animation: spin 6s linear infinite; }
.tk-base.down i, .tk-base.hidden-tk i { opacity: .4; border-style: dashed; }
.token.fogged, .tk-base.fogged { display: none !important; }
.t3d .tk-shadow, .t3d .token.turn::before, .t3d .tk-target { display: none !important; }
.t3d .token .tk-face { box-shadow: 0 8px 12px rgba(0, 0, 0, .5); }
.t3d .token.dragging { filter: drop-shadow(0 18px 10px rgba(0, 0, 0, .45)); }
.t3d .emote-bubble { transform: translate(-50%, -100%) rotateZ(calc(var(--yaw, 0deg) * -1)) rotateX(calc(var(--pitch, 0deg) * -1)) translateY(calc(var(--g, 40px) * -1.75)) scale(calc(1 / var(--zoom, 1))); }
.t3d .float-num { transform-origin: 50% 100%; transform: translate(-50%, -100%) rotateZ(calc(var(--yaw, 0deg) * -1)) rotateX(calc(var(--pitch, 0deg) * -1)) translateY(calc(var(--g, 40px) * -1.5)) scale(calc(1 / var(--zoom, 1))); }
.zoom-rail .z3d { font: 800 13px var(--num, sans-serif); letter-spacing: .04em; color: #A99577; }
.zoom-rail .z3d.on { color: var(--gl); }
/* overlays never block the map on phones */
.trap-card-wrap:empty, .siege-hud-wrap:empty, .chat-ticker:empty, .narration:empty, .map-caption:empty { display: none; }
.trap-card-wrap, .chat-ticker { pointer-events: none; }
.trap-card-wrap > *, .chat-ticker > * { pointer-events: auto; }
.start-mark { position: absolute; transform: translate(-50%, -50%); width: var(--g); height: var(--g); pointer-events: none; }
.start-mark i { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(232, 200, 119, .85); background: rgba(232, 200, 119, .12); }
.start-mark span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; padding: 0 6px; border-radius: 6px; background: rgba(12, 8, 6, .8); color: #E8C877; font: 700 10px var(--num, sans-serif); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.gm-move { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule, rgba(0,0,0,.15)); }
.gm-move .small { margin: 2px 0 8px; }
/* filters inside a 3D scene get clipped on some GPUs: the base ring shows selection instead */
.t3d .token.avtok .tk-av, .t3d .token.avtok.sel .tk-av, .t3d .token.avtok.speaking .tk-av { filter: none; }
.t3d .token.down .tk-av, .t3d .token.c-poisoned .tk-av, .t3d .token.c-petrified .tk-av { filter: grayscale(.6); }

/* 2.5D miniatures: a tall box with the figure at the bottom and its name and hit points on top
   (content outside a 3D-transformed box gets clipped on some phones) */
.t3d .token { transform-origin: 50% 100%; height: calc(var(--px) * 1.75) !important; border-radius: 0; }
.t3d .token.avtok { height: calc(var(--px) * 2.05) !important; }
.t3d .token.avtok .tk-av { bottom: calc(var(--px) * -.19); }
.t3d .token.avtok .av-base { display: none; }
.t3d .token .tk-face { inset: auto 0 0 0; height: var(--px); }
.t3d .token .tk-hp { top: calc(var(--px) * .26); bottom: auto; left: 12%; right: 12%; height: 5px; }
.t3d .token .tk-name { top: 0; bottom: auto; margin: 0; font-size: 10px; line-height: 1.3; }
.t3d .token .tk-conds { top: calc(var(--px) * .55); right: -4px; }
.t3d .token .tk-insp { top: calc(var(--px) * .5); left: -6px; }
.t3d .token.avtok .tk-insp { top: calc(var(--px) * .5); left: 70%; }
/* sheet: spells and expertise */
.sp-slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.sp-slots span { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 8px; border: 1px solid var(--rule, rgba(0,0,0,.2)); border-radius: 6px; }
.sp-slots small { font-size: 11px; opacity: .75; } .sp-slots b { font-size: 18px; }
.sp-group h4 { margin: 8px 0 4px; font-family: var(--num, serif); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.sp-line { padding: 3px 0; border-bottom: 1px dashed var(--rule, rgba(0,0,0,.12)); }
.line.expert i { background: var(--gold, #B8862B); box-shadow: 0 0 0 2px rgba(184,134,43,.35); }
.xp-mark { color: var(--gold, #B8862B); }
/* ---------- Hero Forge: detailed choices */
.fg-detail + .fg-detail, .fg-detail + .fg-tip, .fg-tip + .fg-detail { margin-top: 12px; }
.fg-group small { text-transform: none; letter-spacing: 0; font-family: var(--ui); font-weight: 500; color: var(--ml); }
.fg-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 10px; }
.fg-sub, .fg-styles button, .fg-kit, .fg-anc button, .spell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(232, 200, 119, .14); background: rgba(0, 0, 0, .28); color: var(--tl); text-align: start; transition: border-color .2s, background .2s, transform .15s var(--ease-out); }
.fg-sub:hover, .fg-styles button:hover, .fg-kit:hover, .fg-anc button:hover, .spell:hover { border-color: rgba(232, 200, 119, .45); transform: translateY(-1px); }
.fg-sub.on, .fg-styles button.on, .fg-kit.on, .fg-anc button.on, .spell.on { border-color: var(--gl); background: linear-gradient(180deg, rgba(142, 27, 16, .45), rgba(60, 14, 8, .4)); box-shadow: inset 0 0 0 1px var(--gl); }
.fg-sub b, .fg-styles b, .fg-kit b, .fg-anc b, .spell b { font-family: var(--num); font-size: 14.5px; }
.fg-sub small, .fg-styles small, .fg-kit small, .spell small { color: var(--ml); font-size: 12.5px; line-height: 1.35; }
.fg-sub.on small, .fg-styles .on small, .fg-kit.on small, .spell.on small { color: #EBD9B3; }
.fg-sub em, .fg-kit em { font-style: normal; font-size: 12px; color: var(--gl); }
.fg-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
.fg-kits { display: grid; gap: 8px; }
.fk-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.fk-stats i { font-style: normal; font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(232, 200, 119, .14); color: #F3E6C8; }
.fg-anc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 10px; }
.fg-anc button { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.fg-anc i { width: 16px; height: 16px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 10px var(--dc); }
.fg-anc small { width: 100%; color: var(--ml); font-size: 11.5px; }
.fg-asi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fg-asi > div { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); }
.fg-asi button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid rgba(232, 200, 119, .3); background: rgba(255, 240, 210, .06); color: var(--tl); font-size: 16px; }
.fg-asi span { min-width: 26px; text-align: center; font-weight: 800; color: var(--gl); }
.fg-asi small { grid-column: 1 / -1; color: var(--ml); font-size: 11.5px; }
.fg-spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-bottom: 8px; }
@media (max-width: 600px) { .fg-asi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- language picker */
.lang-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 30%, #2A1A10, #0B0705 70%); transition: opacity .45s; }
.lang-screen.out { opacity: 0; pointer-events: none; }
.ls-card { width: min(560px, 100%); text-align: center; }
.ls-sigil { font-size: 54px; filter: drop-shadow(0 0 18px rgba(232, 160, 80, .6)); animation: lsFloat 3s ease-in-out infinite; }
@keyframes lsFloat { 50% { transform: translateY(-6px); } }
.ls-card h1 { margin: 6px 0 4px; font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--gl); }
.ls-sub { margin: 0 0 20px; color: #A99577; font-size: 13px; line-height: 1.7; }
.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lang-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border-radius: 12px; border: 1px solid rgba(232, 200, 119, .25); background: rgba(0, 0, 0, .35); color: #F3E6C8; transition: transform .15s var(--ease-out), border-color .2s, background .2s; }
.lang-btn b { font-size: 19px; font-weight: 700; font-family: system-ui, 'Vazirmatn', 'Noto Sans', sans-serif; }
.lang-btn small { color: #A99577; font-size: 12px; }
.lang-btn:hover { transform: translateY(-2px); border-color: var(--gl); }
.lang-btn.on { border-color: var(--gl); background: linear-gradient(180deg, rgba(142, 27, 16, .5), rgba(60, 14, 8, .45)); box-shadow: inset 0 0 0 1px var(--gl); }
.lang-card { margin-bottom: 16px; }
.lang-card .lang-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
@media (max-width: 640px) { .lang-card .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ts-lang-code { font: 800 13px var(--num, sans-serif); letter-spacing: .04em; }

/* ---------- welcome */
/* ---------- the welcome: the first screen of the game, over the moonlit castle */
.welcome-screen { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; background: #07050a; opacity: 0; transition: opacity .7s ease; }
.welcome-screen.in { opacity: 1; } .welcome-screen.out { opacity: 0; pointer-events: none; }
.ws-scene { position: fixed; inset: 0; width: 100%; height: 100%; }
.ws-shade { position: fixed; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(8, 5, 4, .55), rgba(8, 5, 4, .15) 70%), linear-gradient(180deg, rgba(6, 4, 8, .35), rgba(6, 4, 8, 0) 30%, rgba(6, 4, 3, .75)); pointer-events: none; }
.ws-embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ws-embers i { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: #FFB347; box-shadow: 0 0 8px #FF7A1A; animation: wsEmber 7s linear infinite; opacity: 0; }
.ws-embers i:nth-child(odd) { animation-duration: 9s; } .ws-embers i:nth-child(3n) { animation-delay: 2s; } .ws-embers i:nth-child(4n) { animation-delay: 4s; }
.ws-embers i:nth-child(1) { left: 6%; } .ws-embers i:nth-child(2) { left: 12%; } .ws-embers i:nth-child(3) { left: 19%; } .ws-embers i:nth-child(4) { left: 25%; } .ws-embers i:nth-child(5) { left: 31%; } .ws-embers i:nth-child(6) { left: 37%; }
.ws-embers i:nth-child(7) { left: 43%; } .ws-embers i:nth-child(8) { left: 49%; } .ws-embers i:nth-child(9) { left: 55%; } .ws-embers i:nth-child(10) { left: 61%; } .ws-embers i:nth-child(11) { left: 67%; } .ws-embers i:nth-child(12) { left: 73%; }
.ws-embers i:nth-child(13) { left: 79%; } .ws-embers i:nth-child(14) { left: 85%; } .ws-embers i:nth-child(15) { left: 91%; } .ws-embers i:nth-child(16) { left: 96%; } .ws-embers i:nth-child(17) { left: 3%; } .ws-embers i:nth-child(18) { left: 58%; }
.ws-corner { position: fixed; top: 14px; inset-inline-end: 14px; z-index: 3; }
.ws-card { position: relative; z-index: 2; width: min(880px, 100%); text-align: center; transform: translateY(18px); opacity: 0; transition: transform .9s var(--ease-out), opacity .9s ease .1s; }
.welcome-screen.in .ws-card { transform: none; opacity: 1; }
.ws-emblem { display: inline-block; width: 92px; height: 92px; filter: drop-shadow(0 0 26px rgba(255, 150, 60, .45)); animation: lsFloat 4s ease-in-out infinite; }
.ws-emblem .ts-emblem { width: 100%; height: 100%; }
.ws-card h1 { margin: 10px auto 4px; max-width: 16em; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6.4vw, 66px); line-height: 1.08; letter-spacing: .01em; }
.ws-card h1 span { color: transparent; background: linear-gradient(180deg, #FFF6DA 0%, #F2D58C 38%, #B07C24 55%, #E8C877 72%, #FFF1C4 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .85)) drop-shadow(0 0 30px rgba(232, 160, 80, .35)); }
.ws-lead { margin: 6px auto 0; max-width: 30em; font-size: clamp(18px, 2.4vw, 25px); line-height: 1.45; color: #F7EAD0; text-shadow: 0 2px 10px rgba(0, 0, 0, .9); }
.ws-rule { display: flex; align-items: center; gap: 14px; max-width: 620px; margin: 26px auto 16px; color: #CDB98F; font-size: 14px; letter-spacing: .04em; }
.ws-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 200, 119, .6), transparent); }
.ws-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ws-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 20px 18px; border-radius: 18px; border: 1px solid rgba(232, 200, 119, .35); color: #F3E6C8; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 14, 10, .82), rgba(10, 6, 5, .9)); box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 240, 210, .08); backdrop-filter: blur(6px);
  transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s; }
.ws-choice::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 200, 119, .22), transparent 70%); }
.ws-choice.vet { background: linear-gradient(180deg, rgba(110, 22, 12, .78), rgba(36, 8, 5, .9)); }
.ws-choice:hover, .ws-choice:focus-visible { transform: translateY(-5px); border-color: #F2D58C; box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 40px rgba(232, 200, 119, .22); outline: none; }
.ws-choice:hover::before, .ws-choice:focus-visible::before { opacity: 1; }
.ws-choice.chosen { transform: scale(1.03); border-color: #FFF1C4; }
.wc-art { display: block; width: 150px; height: 112px; }
.wc-art svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6)); }
.ws-choice:hover .wa-swords { transform-origin: 80px 62px; animation: waClash .6s var(--ease-out); }
.wa-die { animation: waFloat 3s ease-in-out infinite; }
.wa-glow { animation: waGlow 3s ease-in-out infinite; transform-origin: 80px 44px; }
@keyframes waClash { 40% { transform: scale(1.08) rotate(-3deg); } }
@keyframes waFloat { 50% { transform: translate(80px, 34px) rotate(12deg); } 0%, 100% { transform: translate(80px, 40px); } }
@keyframes waGlow { 50% { opacity: .55; transform: scale(1.12); } }
.ws-choice b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3vw, 31px); line-height: 1.1; color: #FFE6A8; text-shadow: 0 2px 0 rgba(0, 0, 0, .7); }
.ws-choice small { max-width: 22em; color: #E2D2B0; font-size: 15px; line-height: 1.45; }
.wc-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(232, 200, 119, .3); color: #F2D58C; font-size: 13px; font-weight: 700; }
.wc-go svg { width: 16px; height: 16px; transition: transform .2s; }
html[dir="rtl"] .wc-go svg { transform: scaleX(-1); }
.ws-choice:hover .wc-go svg { transform: translateX(3px); } html[dir="rtl"] .ws-choice:hover .wc-go svg { transform: scaleX(-1) translateX(3px); }
.ws-skip { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: #A8977C; font-size: 13px; cursor: pointer; text-shadow: 0 1px 4px #000; }
@keyframes wsEmber { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(-105vh) translateX(30px); opacity: 0; } }
@media (max-width: 640px) { .ws-choices { grid-template-columns: 1fr; gap: 12px; } .wc-art { width: 112px; height: 84px; } .ws-choice { padding: 14px 16px; } .ws-emblem { width: 70px; height: 70px; } .ws-rule { margin: 18px auto 12px; } }
@media (prefers-reduced-motion: reduce) { .ws-emblem, .wa-die, .wa-glow, .ws-embers i { animation: none !important; } }
/* the Academy for visitors without an account */
.guest-shell { min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #2A1C12, #0E0906 60%); }
.guest-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(12, 8, 6, .9); border-bottom: 1px solid rgba(232, 200, 119, .2); backdrop-filter: blur(8px); }
.guest-top .grow { flex: 1; }
.guest-page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
@media (max-width: 520px) { .guest-top .brand span { display: none; } }
/* "your seat at the table" */
.qt-choices { display: grid; gap: 10px; margin-top: 12px; }
.qt-choice { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: start; padding: 14px; border-radius: 14px; border: 1px solid var(--glass-b, rgba(232, 200, 119, .3)); background: rgba(0, 0, 0, .25); color: inherit; cursor: pointer; transition: border-color .2s, transform .2s; }
.qt-choice:hover { border-color: var(--gl); transform: translateY(-2px); }
.qt-choice span { grid-row: span 2; font-size: 34px; line-height: 48px; text-align: center; }
.qt-choice b { font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--gl, #E8C877); }
.qt-choice small { opacity: .85; line-height: 1.4; }

/* ---------- academy */
.academy { max-width: 1100px; }
.ac-hero { display: flex; align-items: center; gap: 20px; padding: 22px 24px; margin-bottom: 18px; border-radius: 16px; background: linear-gradient(120deg, rgba(110, 30, 14, .55), rgba(20, 13, 9, .8)); border: 1px solid rgba(232, 200, 119, .25); }
.ac-hero-txt { flex: 1; min-width: 0; }
.ac-hero h2 { margin: 4px 0 8px; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 4vw, 34px); color: #FFE6A8; line-height: 1.1; }
.ac-hero p { margin: 0 0 12px; color: #E6D5B2; }
.ac-hero-art { position: relative; font-size: 64px; } .ac-hero-art b { position: absolute; right: -12px; bottom: -8px; font-size: 32px; }
.ac-prog { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .4); overflow: hidden; margin-bottom: 4px; }
.ac-prog i { display: block; height: 100%; background: linear-gradient(90deg, #C99A3E, #FFE6A8); border-radius: 99px; transition: width .6s; }
.ac-hero small { color: #A99577; }
.ac-h { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-family: var(--num); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--gl); }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ac-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid rgba(232, 200, 119, .14); background: linear-gradient(180deg, rgba(30, 21, 14, .8), rgba(18, 12, 9, .8)); color: #E6D5B2; text-decoration: none; transition: transform .18s var(--ease-out), border-color .2s; }
.ac-card:hover { transform: translateY(-3px); border-color: rgba(232, 200, 119, .5); }
.ac-card b { font-family: var(--num); font-size: 16px; color: #FFF1C4; }
.ac-card small { color: #A99577; font-size: 12.5px; }
.ac-card em { font-style: normal; font-size: 12px; color: var(--gl); }
.ac-card.done { border-color: rgba(93, 174, 106, .45); }
.ac-check { position: absolute; top: 10px; inset-inline-end: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #3E8A4A; color: #fff; }
.ac-ico { font-size: 30px; line-height: 1; } .ac-ico.big { font-size: 46px; }
.ac-grad { margin-bottom: 8px; border-color: rgba(93, 174, 106, .5); }
.ac-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--gl); text-decoration: none; font-weight: 700; }
.ac-lesson header, .ac-tutv header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ac-lesson header small, .ac-tutv header small { color: #A99577; }
.ac-lesson h2, .ac-tutv h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 4vw, 32px); color: #FFE6A8; }
.ac-body { padding: 18px 22px; border-radius: 14px; background: rgba(18, 12, 9, .78); border: 1px solid rgba(232, 200, 119, .12); font-size: 17px; line-height: 1.65; color: #E6D5B2; }
.ac-body p { margin: 0 0 14px; } .ac-body b { color: #FFF1C4; }
.ac-tip { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: rgba(232, 200, 119, .1); border-inline-start: 3px solid var(--gl); color: #F3E6C8; font-size: 15.5px; line-height: 1.55; }
.ac-example { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: rgba(62, 125, 69, .14); border-inline-start: 3px solid #5DAE6A; }
.ac-example b { display: block; color: #9FD3A5; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.ac-formula { margin: 10px 0 16px; padding: 14px; border-radius: 12px; text-align: center; font: 700 20px var(--num); color: #FFE6A8; background: rgba(0, 0, 0, .35); border: 1px dashed rgba(232, 200, 119, .4); }
.ac-loop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 16px; }
.ac-loop span { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(232, 200, 119, .25); font-weight: 700; color: #F3E6C8; }
.ac-loop span b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gl); color: #2B1D12; font-size: 12px; }
.ac-loop i { font-style: normal; color: var(--gl); }
.rtl .ac-loop i { transform: scaleX(-1); }
.ac-abils, .ac-turn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.ac-turn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-abils div, .ac-turn div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(232, 200, 119, .12); }
.ac-abils b { font: 800 14px var(--num); color: var(--gl); letter-spacing: .06em; } .ac-abils span { font-weight: 700; color: #F3E6C8; font-size: 15px; } .ac-abils small, .ac-turn span { color: #A99577; font-size: 13.5px; line-height: 1.4; }
.ac-turn b { color: #FFF1C4; font-size: 15px; }
.ac-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
/* tutorials */
.ac-stage { display: flex; flex-direction: column; gap: 12px; }
.ac-scene { padding: 16px; border-radius: 14px; background: radial-gradient(ellipse at 50% 20%, rgba(232, 200, 119, .08), rgba(0, 0, 0, .35)), rgba(18, 12, 9, .8); border: 1px solid rgba(232, 200, 119, .14); }
.ac-narr { min-height: 70px; }
.ac-say { padding: 14px 16px; border-radius: 12px; background: rgba(30, 21, 14, .9); border: 1px solid rgba(232, 200, 119, .18); font-size: 16.5px; line-height: 1.6; color: #E6D5B2; animation: acIn .35s var(--ease-out); }
.ac-say p { margin: 0 0 8px; } .ac-say p:last-child { margin: 0; } .ac-say b { color: #FFF1C4; }
.ac-say.good { border-color: rgba(93, 174, 106, .6); box-shadow: inset 4px 0 0 #5DAE6A; }
.ac-say.bad { border-color: rgba(240, 144, 126, .5); box-shadow: inset 4px 0 0 #D9604A; }
.rtl .ac-say.good { box-shadow: inset -4px 0 0 #5DAE6A; } .rtl .ac-say.bad { box-shadow: inset -4px 0 0 #D9604A; }
@keyframes acIn { from { opacity: 0; transform: translateY(6px); } }
.ac-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-acts .btn small { opacity: .75; font-weight: 500; }
.ac-math { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font: 700 20px var(--num); color: #F3E6C8; direction: ltr; }
.ac-math i { font-style: normal; color: #A99577; } .ac-math b { font-size: 28px; color: #FFE6A8; }
.ac-die { position: relative; display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 10px; background: linear-gradient(160deg, #A0301F, #5A140B); color: #FFF1C4; font-size: 22px; box-shadow: inset 0 0 0 2px rgba(255, 220, 160, .35), 0 4px 10px rgba(0, 0, 0, .4); }
.ac-die small { position: absolute; top: 2px; inset-inline-start: 4px; font-size: 9px; opacity: .7; }
.ac-die.crit { background: linear-gradient(160deg, #E8C877, #9A6A1C); color: #2B1D12; } .ac-die.fumble { background: linear-gradient(160deg, #444, #1A1A1A); }
.ac-die.drop { opacity: .35; filter: grayscale(1); }
.ac-wall { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ac-big { font-size: 56px; line-height: 1; }
.ac-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ac-badges span { padding: 4px 12px; border-radius: 99px; background: rgba(0, 0, 0, .4); border: 1px solid rgba(232, 200, 119, .25); color: #CDBB98; }
.ac-badges b { color: #FFE6A8; }
.ac-scene-ico { font-size: 40px; }
.ac-q { color: var(--gl); font-weight: 700; }
.ac-small { font-size: 14px; color: #A99577; }
.ac-scorebar { display: flex; gap: 14px; justify-content: center; font-weight: 700; color: #CDBB98; }
.ac-done { padding: 16px; border-radius: 14px; text-align: center; background: linear-gradient(180deg, rgba(62, 125, 69, .25), rgba(18, 12, 9, .8)); border: 1px solid rgba(93, 174, 106, .5); }
.ac-done b { display: block; margin-bottom: 10px; font-size: 20px; color: #BFE8C5; }
.ac-done .row { justify-content: center; }
.ac-grid-wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; direction: ltr; }
.ac-gridmap { display: grid; grid-template-columns: repeat(var(--w), minmax(0, 1fr)); gap: 2px; width: min(100%, 620px); padding: 6px; border-radius: 10px; background: #2B2015; }
.ac-gridmap .cell { position: relative; aspect-ratio: 1; border: 0; border-radius: 4px; background: #5B4A33; display: grid; place-items: center; padding: 0; color: #2B1D12; }
.ac-gridmap .cell.rubble { background: repeating-linear-gradient(45deg, #6E5A3E 0 6px, #4B3D2A 6px 12px); }
.ac-gridmap .cell.reach { background: #8A7A4E; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 230, 168, .6); }
.ac-gridmap .cell.reach.rubble { background: repeating-linear-gradient(45deg, #A08A58 0 6px, #7A6640 6px 12px); }
.ac-gridmap .cell.reach:hover { background: #B8A266; }
.ac-gridmap .cell small { font-size: 11px; font-weight: 800; color: #2B1D12; opacity: .7; }
.ac-tok { width: 88%; height: 88%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; }
.ac-tok.hero { background: #2F6A9A; box-shadow: 0 0 0 2px #FFE6A8; } .ac-tok.hero svg { width: 100%; height: 100%; }
.ac-tok.gob { background: #3E5A2A; font-size: 22px; box-shadow: 0 0 0 2px #A0301F; }
.ac-legend { display: flex; gap: 14px; font-size: 13px; color: #A99577; }
.ac-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-inline-end: 5px; }
.lg-reach { background: #8A7A4E; box-shadow: inset 0 0 0 2px rgba(255, 230, 168, .6); } .lg-rubble { background: repeating-linear-gradient(45deg, #6E5A3E 0 4px, #4B3D2A 4px 8px); }
.ac-duel { display: flex; align-items: center; justify-content: center; gap: 20px; direction: ltr; }
.ac-fighter { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 170px; text-align: center; transition: filter .4s, opacity .4s; }
.ac-fighter svg { width: 110px; height: 140px; } .ac-fighter.enemy .ac-big { font-size: 90px; height: 140px; display: grid; place-items: center; }
.ac-fighter.down { filter: grayscale(1); opacity: .55; }
.ac-fighter b { color: #FFF1C4; } .ac-fighter small { color: #A99577; }
.ac-hp { width: 100%; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .5); overflow: hidden; } .ac-hp i { display: block; height: 100%; background: linear-gradient(90deg, #8E1B10, #3E7D45); transition: width .5s; }
.ac-vs { font: 400 34px var(--display); color: var(--gl); }
.ac-log { margin: 0; padding: 10px 14px 10px 30px; max-height: 150px; overflow-y: auto; border-radius: 10px; background: rgba(0, 0, 0, .3); color: #CDBB98; font-size: 14px; }
.ac-cone { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; direction: ltr; }
.ac-caster svg { width: 110px; height: 140px; }
.ac-foes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ac-foe { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 120px; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, .3); transition: filter .4s, opacity .4s; }
.ac-foe .ac-big { font-size: 40px; } .ac-foe b { color: #FFF1C4; font-size: 14px; } .ac-foe small { color: #A99577; }
.ac-foe.down { filter: grayscale(1); opacity: .5; }
.ac-foe em { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.ac-foe em.sv { background: rgba(93, 174, 106, .25); color: #BFE8C5; } .ac-foe em.fl { background: rgba(178, 58, 34, .3); color: #FFB2A0; }
@media (max-width: 640px) { .ac-abils, .ac-turn { grid-template-columns: 1fr 1fr; } .ac-hero-art { display: none; } .ac-body { font-size: 16px; padding: 14px; } .ac-fighter { width: 130px; } .ac-fighter svg { width: 84px; height: 110px; } }

/* ===================================================================== languages (v3.2)
   Persian and Arabic: Vazirmatn (loaded only for these languages) with system fallbacks.
   Latin glyphs keep the game fonts; letters of other scripts fall back along the list. */
html[lang="fa"], html[lang="ar"] {
  --display: 'Fell SC', 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --story: 'Fell', 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --ui: 'Alegreya Sans', 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --num: 'Alegreya SC', 'Vazirmatn', Tahoma, sans-serif;
}
/* joined scripts break with letter-spacing, capitals do not exist, and faux italics look broken */
html[dir="rtl"] body, html[dir="rtl"] body * { letter-spacing: 0 !important; }
html[dir="rtl"] body { font-synthesis: weight; line-height: 1.6; }
html[dir="rtl"] i, html[dir="rtl"] em { font-style: normal; }
html[lang="zh"] body * { letter-spacing: 0; font-synthesis: weight; }
html[lang="zh"] i, html[lang="zh"] em { font-style: normal; }
html[lang="ru"] .kicker, html[lang="de"] .kicker { letter-spacing: .06em; }

/* numbers, dice and codes always read left to right */
.room-code, .input.code, .dice-layer, .die, .roll-total, .init-val, .tk-hp, .ac-math, .ac-dice, .code-box, input[type="email"], input[type="password"] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="password"] { text-align: right; }

/* the map and its 3D stage keep left-to-right geometry; only labels follow the language */
html[dir="rtl"] .viewport, html[dir="rtl"] .stage { direction: ltr; }
html[dir="rtl"] .viewport .tk-name, html[dir="rtl"] .viewport .bubble, html[dir="rtl"] .viewport .float { direction: rtl; unicode-bidi: plaintext; }

/* user-written text (names, chat, notes) follows its own direction */
.chat-text, .msg-text, .note-text, [data-noi18n] { unicode-bidi: plaintext; }
@media (max-width: 900px) { .cam-pad { top: auto; right: 6px; bottom: 186px; flex-direction: column; padding: 3px; } .cam-pad button { width: 38px; height: 34px; } .cam-hint { bottom: auto; top: 62px; max-width: calc(100% - 130px); font-size: 12px; border-radius: 14px; padding: 8px 12px; } }
@media (max-width: 900px) and (max-height: 560px) { .cam-pad { bottom: auto; top: 8px; flex-direction: row; right: 60px; } }
/* voice: your microphone level, server problems, the voice check */
.mic-meter { height: 5px; margin-top: 5px; border-radius: 3px; background: rgba(0, 0, 0, .18); overflow: hidden; }
.mic-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3E7D45, #8FD06A 70%, #E8C877); transition: width .1s linear; }
.voice-note { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: rgba(184, 134, 43, .14); color: inherit; }
.voice-note.bad { background: rgba(160, 48, 31, .16); color: #8E1B10; }
.vc-btn { margin-top: 8px; }
.vc-steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.vc-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.vc-steps li b { display: block; font-size: 14px; }
.vc-steps li small { display: block; margin-top: 2px; opacity: .85; line-height: 1.4; }
.vc-ico { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .08); font-style: normal; font-weight: 800; }
.vc-steps li.ok .vc-ico { background: #3E7D45; color: #fff; }
.vc-steps li.bad .vc-ico { background: #A0301F; color: #fff; }
.vc-steps li.warn .vc-ico { background: #B8862B; color: #fff; }
.vc-steps li.run .vc-ico { background: #2F6A9A; color: #fff; animation: vcRun 1s ease-in-out infinite; }
@keyframes vcRun { 50% { opacity: .45; } }
.vc-meter { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-size: 13px; }
.vc-meter i { flex: 1; height: 10px; border-radius: 6px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.vc-meter b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3E7D45, #8FD06A 70%, #E8C877); transition: width .08s linear; }
.vc-devs { margin-bottom: 10px; }
.vc-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vc-foot .vc-sum { flex: 1; margin: 0; min-width: 200px; }
.skill small { margin-inline-start: 4px; font-size: 10px; opacity: .6; letter-spacing: .04em; }
.skill.cls { border-color: rgba(232, 200, 119, .75); box-shadow: inset 0 0 0 1px rgba(232, 200, 119, .25); }
/* the finished sheet in the Hero Forge */
.fg-rules { margin-top: 18px; border: 1px solid rgba(232, 200, 119, .22); border-radius: 14px; background: rgba(0, 0, 0, .22); text-align: start; }
.fg-rules summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--gl, #E8C877); }
.rs-grid { display: grid; gap: 0; padding: 0 14px 12px; }
.rs-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(232, 200, 119, .1); font-size: 14px; }
.rs-row > span { color: #A99577; }
.rs-row > b { font-weight: 600; color: #F3E6C8; line-height: 1.5; }
.rs-row small { color: #A99577; font-weight: 400; }
.rs-saves { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-saves i { font-style: normal; padding: 1px 8px; border-radius: 99px; border: 1px solid rgba(232, 200, 119, .18); color: #A99577; }
.rs-saves i.on { color: #FFF1C4; border-color: var(--gl, #E8C877); background: rgba(232, 200, 119, .12); }
@media (max-width: 560px) { .rs-row { grid-template-columns: 1fr; gap: 2px; } }

/* "Rejoin voice chat" after the page came back (a reload, a phone call) */
.voice-rejoin { position: fixed; z-index: 70; left: 50%; top: calc(124px + env(safe-area-inset-top, 0px)); white-space: nowrap; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  background: linear-gradient(#8f2a1b, #6d1c11); border: 1px solid #E8C877; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.55); animation: hintIn .35s ease-out both; }
.voice-rejoin button { background: none; border: 0; color: #FFF1C4; font: inherit; cursor: pointer; }
.voice-rejoin .vr-go { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 16px; font-weight: 700; }
.voice-rejoin .vr-x { padding: 8px 14px 8px 8px; font-size: 20px; line-height: 1; opacity: .8; }
.rtl .voice-rejoin .vr-go { padding: 10px 16px 10px 6px; }
.rtl .voice-rejoin .vr-x { padding: 8px 8px 8px 14px; }

/* 3.3.2 — phones and tablets: lighter table screen, no blur over the moving map, clearer party cards */
.m-sheet { margin-top: 6px; }
@media (pointer: coarse) {
  .tv *, .gbar, .tick, .tv .tool-rail, .tv .zoom-rail { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .tv .tool-rail, .tv .zoom-rail, .tv .cam-pad { background-color: rgba(16, 11, 8, .94) !important; }
  .board-shadow { box-shadow: 0 10px 24px rgba(0, 0, 0, .6) !important; }
  .board-side { filter: none !important; }
}
.members .member { padding: 8px 0; border-bottom: 1px solid rgba(90, 60, 30, .18); }
.members .member:last-child { border-bottom: 0; }
.members .member.off { opacity: .6; }
