/* game.dimhub.app — the table. Tokens from the design canvas: ink, parchment, lamp, sorcery, blood. */
:root {
  --ink: #0F0E13; --ink-2: #121117; --ink-3: #131218;
  --surface: #17161D; --raised: #1F1B26; --hover: #231F29; --line: #2C2A35;
  --text: #EFE9DD; --text-2: #CFC7D6; --muted: #A39DAB; --faint: #6E6878;
  --lamp: #E9A748; --lamp-2: #F3BE6E; --on-lamp: #1A1206;
  --teal: #5CC9B5; --blood: #E25D55;
  --serif: Literata, Georgia, "Times New Roman", serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Unbounded, var(--sans);
  --r: 14px; --r-lg: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="light"] {
  --ink: #F3EEE4; --ink-2: #EFE9DD; --ink-3: #F7F3EB;
  --surface: #FBF8F2; --raised: #F0EADF; --hover: #E8E1D4; --line: #DCD4C6;
  --text: #1A1720; --text-2: #3A3542; --muted: #6B6473; --faint: #8E8697;
  --lamp: #C97A14; --lamp-2: #E0921F; --on-lamp: #1A1206;
  --teal: #1E8F7A; --blood: #C4403A;
}
:root[data-theme="light"] .btn.primary { background: #E9A748; }
:root[data-theme="light"] .veil { background: rgba(243,238,228,.78); }
:root[data-theme="light"] .skull { background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--raised) 6px 12px); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); transition: background .3s, color .3s; font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--lamp); }
a:hover { color: var(--lamp-2); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.input:focus-within { border-color: var(--lamp) !important; }
.input input:focus, .input textarea:focus { outline: none; }
::selection { background: rgba(233, 167, 72, .35); }
.scroll { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.hidden { display: none !important; }
.vis-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- animation ---------- */
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 2px var(--lamp), 0 0 16px 2px rgba(233,167,72,.3); } 50% { box-shadow: 0 0 0 3px var(--lamp-2), 0 0 34px 10px rgba(233,167,72,.55); } }
@keyframes breatheSoft { 0%, 100% { box-shadow: 0 0 0 1px rgba(233,167,72,.5), 0 0 18px 2px rgba(233,167,72,.15); } 50% { box-shadow: 0 0 0 1px var(--lamp-2), 0 0 34px 8px rgba(233,167,72,.35); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6) translateY(8px); } 60% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes roll { 0% { transform: rotate(0deg); } 50% { transform: rotate(200deg) scale(1.15); } 100% { transform: rotate(360deg); } }
@keyframes dots { 0%, 20% { content: ""; } 40% { content: "."; } 60% { content: ".."; } 80%, 100% { content: "..."; } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes sheen { 0% { background-position: -160% 0; } 100% { background-position: 260% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes flicker { 0%, 100% { opacity: .75; transform: scale(1); } 40% { opacity: 1; transform: scale(1.06); } 70% { opacity: .85; transform: scale(.98); } }
@keyframes develop { from { filter: blur(14px) saturate(.4); opacity: .4; } to { filter: none; opacity: 1; } }
@keyframes ink { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.breathe { animation: breathe 2.4s ease-in-out infinite; }
.reveal > * { animation: fadeUp .7s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .2s; } .reveal > *:nth-child(3) { animation-delay: .4s; }
.reveal > *:nth-child(4) { animation-delay: .6s; } .reveal > *:nth-child(5) { animation-delay: .8s; } .reveal > *:nth-child(6) { animation-delay: 1s; }
.pop { animation: pop .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.pop:nth-child(2) { animation-delay: .15s; } .pop:nth-child(3) { animation-delay: .3s; } .pop:nth-child(4) { animation-delay: .45s; }
.roll { animation: roll 1.1s cubic-bezier(.35, .1, .3, 1) infinite; transform-origin: 50% 50%; }
.dots::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: dots 1.3s steps(1) infinite; }
.glow { animation: glow 2.2s ease-in-out infinite; }
.rise > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.rise > *:nth-child(2) { animation-delay: .3s; } .rise > *:nth-child(3) { animation-delay: .55s; } .rise > *:nth-child(4) { animation-delay: .8s; } .rise > *:nth-child(5) { animation-delay: 1.05s; } .rise > *:nth-child(6) { animation-delay: 1.3s; }
.develop { animation: develop 2.2s ease-out both; }
.ink { animation: ink 1.4s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- atoms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; transition: background .2s, border-color .2s, transform .15s, filter .2s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--faint); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lamp); color: var(--on-lamp); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); background: var(--lamp); }
.btn.big { height: 52px; padding: 0 24px; border-radius: var(--r); font-size: 15px; }
.btn.small { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.btn.danger { color: var(--blood); }
.btn.teal { color: var(--teal); }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; color: var(--muted); }
.btn svg { flex: 0 0 auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--raised); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.lamp { background: rgba(233,167,72,.15); color: var(--lamp); border-color: rgba(233,167,72,.4); }
.chip.teal { background: rgba(92,201,181,.12); color: var(--teal); border-color: rgba(92,201,181,.4); }
.chip.blood { background: rgba(226,93,85,.15); color: var(--blood); border-color: rgba(226,93,85,.4); }
.chip.big { font-size: 13px; font-weight: 700; padding: 6px 12px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.hint { font-size: 11px; color: var(--faint); }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }
.display { font-family: var(--display); font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color .2s; }
.input input, .input textarea { flex: 1; min-width: 0; border: 0; background: transparent; }
.input input { height: 100%; }
textarea.area { width: 100%; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); font-family: var(--serif); font-size: 16px; line-height: 1.6; resize: vertical; transition: border-color .2s; }
textarea.area:focus { border-color: var(--lamp); outline: none; }
input.field { height: 52px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-family: var(--serif); font-size: 18px; width: 100%; transition: border-color .2s; }
input.field:focus { border-color: var(--lamp); outline: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--text); background: var(--raised); overflow: hidden; flex: 0 0 auto; image-rendering: pixelated; }
.avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.dead { filter: grayscale(1); opacity: .6; }
.portrait { border-radius: 12px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; color: var(--text-2); image-rendering: pixelated; flex: 0 0 auto; }
.portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--lamp); transition: width .9s var(--ease), background .6s; }
.bar.teal > i { background: var(--teal); }
.bar.low > i { background: var(--blood); }
.pips { display: flex; gap: 2px; margin-top: 4px; }
.pips i { flex: 1; height: 6px; border-radius: 2px; background: var(--line); }
.pips i.on { background: var(--muted); } .pips.hi i.on { background: var(--teal); } .pips.lo i.on { background: var(--blood); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: 0 0 auto; }
.dot.lamp { background: var(--lamp); } .dot.blood { background: var(--blood); } .dot.teal { background: var(--teal); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; width: min(92vw, 420px); }
.toast { animation: toastIn .3s var(--ease) both; background: var(--raised); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 12px; font-size: 13px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.toast.err { border-color: rgba(226,93,85,.5); }

/* ---------- top bar ---------- */
.top { height: calc(56px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 14px; padding: 0 20px; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--line); background: var(--ink-3); position: sticky; top: 0; z-index: 5; }
.top .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; white-space: nowrap; }
.top .title { font-family: var(--display); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.order { display: flex; align-items: center; gap: 6px; }
.order .arrow { color: var(--faint); display: flex; }
.order .avatar.holder { animation: breathe 2.4s ease-in-out infinite; }
.order .avatar.dead { opacity: .45; }

/* ---------- screens ---------- */
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.page { max-width: 1280px; width: 100%; margin: 0 auto; padding: 36px 32px 64px; }
h1.h { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.1; }
h1.h.big { font-size: 40px; color: var(--lamp); text-shadow: 0 0 40px rgba(233,167,72,.3); }
.lead { font-family: var(--serif); font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* login */
.login { align-items: center; justify-content: center; padding: 40px 28px; padding-top: calc(40px + env(safe-area-inset-top, 0px)); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); position: relative; overflow: hidden; }
.login .lamp { position: absolute; left: 50%; top: 18%; width: 460px; height: 460px; margin-left: -230px; border-radius: 50%; background: radial-gradient(closest-side, rgba(233,167,72,.22), rgba(233,167,72,.06) 55%, transparent 75%); pointer-events: none; animation: flicker 3.6s ease-in-out infinite; }
.login .box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 360px; text-align: center; }
.login .logo { width: 84px; height: 84px; border-radius: 24px; background: linear-gradient(160deg, var(--hover), var(--surface)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.login .word { font-family: var(--display); font-weight: 700; font-size: 22px; }
.login .tag { font-family: var(--serif); font-size: 15px; color: var(--muted); line-height: 1.5; }
.login .btn.primary.big { width: 100%; height: 56px; border-radius: 16px; box-shadow: 0 16px 40px rgba(233,167,72,.25); }

/* lobby */
.lobby-grid { display: flex; flex-wrap: wrap; gap: 32px; }
.lobby-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.lobby-side { flex: 1 1 280px; max-width: 340px; display: flex; flex-direction: column; gap: 22px; }
.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tcard { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .25s var(--ease), border-color .25s; }
.tcard:hover { transform: translateY(-4px); border-color: var(--faint); color: var(--text); }
.tcard.mine { grid-column: span 2; border-color: rgba(233,167,72,.5); animation: breatheSoft 2.6s ease-in-out infinite; padding: 20px; }
.tcard .t { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.25; }
.tcard.mine .t { font-size: 20px; }
.tcard .d { font-family: var(--serif); font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard.mine .d { font-size: 15px; color: var(--text-2); max-width: 70ch; }
.tcard.invite { border-style: dashed; background: var(--ink-3); }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.list { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.list a, .list .li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--ink-3); color: var(--text); text-decoration: none; border-top: 1px solid var(--line); font-size: 13px; }
.list a:first-child, .list .li:first-child { border-top: 0; }
.list a:hover { background: var(--surface); }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.grave { padding: 12px 14px; border-radius: 14px; background: var(--ink-3); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* wizard */
.wiz { max-width: 1040px; }
.steps { display: flex; align-items: center; gap: 8px; }
.steps i { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-style: normal; background: var(--raised); color: var(--faint); }
.steps i.on { background: var(--lamp); color: var(--on-lamp); }
.steps b { width: 28px; height: 1px; background: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; min-height: 150px; transition: transform .25s var(--ease), border-color .25s, background .25s; }
.tile:hover { transform: translateY(-4px); border-color: var(--lamp); }
.tile.on { background: var(--raised); border-color: var(--lamp); }
.tile .n { font-family: var(--display); font-weight: 700; font-size: 15px; }
.tile .s { font-family: var(--serif); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.tile .h { font-size: 11px; color: var(--faint); margin-top: auto; }
.tile.on .h { color: var(--lamp); }
.seeds { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seeds .btn { height: 34px; border-radius: 999px; font-weight: 500; color: var(--text-2); }
.thinking-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 420px; text-align: center; }
.thinking-big .t { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--lamp); }
.world-text { font-family: var(--serif); font-size: 18px; line-height: 1.65; max-width: 68ch; }

/* hero */
.hero-grid { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; max-width: 1200px; margin: 0 auto; padding: 44px 32px 64px; }
.hero-form { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-sheet { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.item .e { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.item .n { font-size: 13px; font-weight: 700; }
.item .d { font-size: 11px; color: var(--muted); }

/* table */
.table { height: var(--vvh, 100dvh); display: flex; flex-direction: column; transform: translateY(var(--vvt, 0px)); overflow: hidden; }
html.kb .tabbar { display: none !important; }
body { overscroll-behavior: none; }
.table .cols { flex: 1 1 auto; min-height: 0; display: flex; }
.party { flex: 0 0 280px; border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--ink-2); overflow-y: auto; }
.pcard { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: opacity .4s, border-color .3s, background .3s; }
.pcard.holder { background: var(--raised); border-color: rgba(233,167,72,.5); }
.pcard.inactive { opacity: .45; }
.pcard .nm { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .cl { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .st { margin-top: 3px; font-size: 10px; color: var(--faint); display: flex; justify-content: space-between; gap: 6px; }
.nearby { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.nearby .e { display: flex; align-items: center; gap: 8px; }
.chapter { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-family: var(--serif); font-size: 12px; line-height: 1.5; color: var(--text-2); }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.loc { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 32px; border-bottom: 1px solid var(--raised); font-size: 12px; color: var(--muted); }
.loc b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chron { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 22px 32px 8px; display: flex; flex-direction: column; gap: 26px; }
.turn { max-width: 720px; }
.turn .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.turn .who { font-weight: 700; font-size: 13px; }
.turn .no { font-size: 12px; color: var(--faint); }
.turn .act { font-family: var(--serif); font-size: 13px; font-style: italic; color: var(--muted); margin-bottom: 8px; }
.turn p { font-family: var(--serif); font-size: 17px; line-height: 1.64; margin: 0 0 10px; color: var(--text); max-width: 64ch; }
.turn .deltas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.turn.new > * { animation: fadeUp .7s var(--ease) both; }
.turn.new > *:nth-child(2) { animation-delay: .2s; } .turn.new > *:nth-child(3) { animation-delay: .4s; } .turn.new > *:nth-child(4) { animation-delay: .6s; } .turn.new > *:nth-child(5) { animation-delay: .8s; }
.turn.scene { padding: 14px 18px; border-radius: 16px; background: var(--ink-3); border: 1px solid var(--line); }
.turn.levelup { padding: 14px 18px; border-radius: 16px; border: 1px solid rgba(92,201,181,.4); background: linear-gradient(135deg, rgba(92,201,181,.08), transparent 60%), var(--surface); }
.sys { font-size: 12px; color: var(--faint); text-align: center; }
.thinking { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); max-width: 720px; animation: fadeUp .5s var(--ease) both; }
.thinking .t { font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--lamp); }
.thinking .a { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); margin-top: 4px; }
.deck { flex: 0 0 auto; padding: 14px 32px 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--raised); background: linear-gradient(180deg, var(--ink), var(--ink-3)); }
.deck .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; min-height: 18px; }
.deck .head .you { font-size: 12px; font-weight: 700; color: var(--lamp); }
.deck .body { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.skull { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 16px; border: 1px solid var(--line); background: repeating-linear-gradient(45deg, var(--surface) 0 6px, #1A1820 6px 12px); font-size: 24px; line-height: 1; padding: 0; position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.skull::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(233,167,72,.18) 50%, transparent 70%); background-size: 300% 100%; animation: sheen 4s ease-in-out infinite; pointer-events: none; }
.skull:hover { transform: translateY(-4px) rotate(-6deg); box-shadow: 0 14px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(233,167,72,.5); border-color: var(--lamp); }
.skull:disabled { opacity: .5; transform: none; }
.deck .own { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.deck .input { height: 48px; padding: 0 6px 0 14px; border-radius: 14px; }
.deck .input input { font-family: var(--serif); font-size: 16px; }
.deck .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.skull.small { flex: 0 0 36px; width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
.desktop-only { display: inline; }
.deck .plan .input { height: 48px; border-style: dashed; background: var(--ink-3); }
.deck .plan .input input { font-size: 14px; }
.planned { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(92,201,181,.4); background: rgba(92,201,181,.08); }
.planned .t { font-size: 11px; font-weight: 700; color: var(--teal); }
.planned .x { font-family: var(--serif); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.look .ents { display: flex; gap: 10px; flex-wrap: wrap; }
.ent { flex: 1 1 220px; padding: 10px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.ent .n { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.ent .i { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.ent .acts { display: flex; flex-direction: column; gap: 4px; }
.ent .acts button { text-align: left; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: var(--serif); font-size: 13px; transition: background .2s, border-color .2s; }
.ent .acts button:hover { background: var(--hover); border-color: var(--faint); }
.sheet { flex: 0 0 320px; border-left: 1px solid var(--line); padding: 16px; background: var(--ink-2); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet .top-row { display: flex; gap: 14px; align-items: flex-end; }
.sheet .top-row .portrait { width: 132px; height: 176px; font-size: 40px; }
.portrait.clickable, .avatar.clickable { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.portrait.clickable:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.pm { display: flex; gap: 8px; font-size: 12px; line-height: 1.45; margin-top: 4px; }
.pm b { flex: 0 0 auto; width: 10px; }
.pm.plus b { color: var(--teal); } .pm.minus b { color: var(--blood); }
.bigpic { max-width: min(92vw, 560px); width: 100%; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--raised); box-shadow: 0 40px 90px rgba(0,0,0,.6); image-rendering: pixelated; }
.bigpic img { width: 100%; display: block; image-rendering: pixelated; }
.strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.strip .portrait { width: 60px; height: 80px; font-size: 12px; }
.strip .cap { font-size: 10px; color: var(--faint); text-align: center; margin-top: 2px; }
.sheet .nm { font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1.2; }
.sheet .cl { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat .r { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.stat .r b { color: var(--text); }
.stat.hi .r b { color: var(--teal); } .stat.lo .r b { color: var(--blood); }
.passive { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.passive .n { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.passive .d { font-size: 11px; color: var(--text-2); margin-top: 6px; line-height: 1.45; }
.inv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inv .it { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.inv .it span { font-size: 11px; line-height: 1.3; color: var(--text-2); }
.inv .it b { font-size: 18px; line-height: 1; font-weight: 400; }
.tabbar { display: none; }

/* overlay */
.veil { position: fixed; inset: 0; background: rgba(8,7,11,.78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top, 0px)); z-index: 40; animation: dim .5s ease both; overflow: auto; }
.veil .modal { max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px)); overflow-y: auto; }
.veil .lv { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.veil .lv .lvl { font-family: var(--display); font-weight: 700; font-size: 56px; letter-spacing: .02em; color: var(--lamp); text-shadow: 0 0 40px rgba(233,167,72,.45); line-height: 1; }
.veil .cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; width: 100%; }
.veil .lcard { flex: 1 1 280px; max-width: 340px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid rgba(233,167,72,.5); text-align: left; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.veil .lcard.teal { border-color: rgba(92,201,181,.5); }
.veil .lcard .k { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); }
.veil .lcard.teal .k { color: var(--teal); }
.veil .lcard .n { font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1.3; margin-top: 8px; }
.veil .lcard .d { font-family: var(--serif); font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.veil .lcard .pm { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; margin-top: 6px; }
.veil .lcard .pm b { flex: 0 0 auto; }
.modal { width: 100%; max-width: 480px; }

/* end */
.graves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gcard { display: flex; gap: 16px; padding: 18px; border-radius: 18px; background: var(--ink-3); border: 1px solid var(--line); }
.fate { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.fate.alive { border-color: rgba(233,167,72,.4); }
.fate p { font-family: var(--serif); font-size: 16px; line-height: 1.6; margin: 8px 0 0; max-width: 70ch; }
table.stats { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.stats th { text-align: right; padding: 12px 16px; font-weight: 700; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: var(--ink-3); }
table.stats th:first-child, table.stats td:first-child { text-align: left; }
table.stats td { padding: 12px 16px; text-align: right; border-top: 1px solid var(--line); }
.tablewrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .page { padding: 24px 16px 48px; }
  .top { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .tables, .tiles, .graves, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .tcard.mine { grid-column: auto; }
  .lobby-side { max-width: none; }
  .hero-grid { padding: 24px 16px 48px; gap: 24px; }
  .table .cols { flex-direction: column; }
  .party, .sheet { flex: 1 1 auto; border: 0; display: none; }
  .table[data-tab="party"] .party, .table[data-tab="hero"] .sheet { display: flex; }
  .table[data-tab="party"] .main, .table[data-tab="hero"] .main { display: none; }
  .main { flex: 1 1 auto; }
  .loc { padding: 8px 16px; }
  .chron { padding: 16px 16px 8px; gap: 20px; }
  .turn p { font-size: 16px; }
  .deck { padding: 10px 12px 8px; }
  .table .deck { padding-bottom: 8px; }
  .deck .input { height: 44px; }
  .desktop-only { display: none; }
  .deck .body { gap: 10px; }
  .skull { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px; }
  .deck .own { flex: 1 1 200px; }
  .tabbar { display: flex; flex: 0 0 auto; padding: 6px 10px 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--ink-3); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border: 0; background: transparent; color: var(--faint); font-size: 10px; font-weight: 600; }
  .tabbar button.on { color: var(--lamp); font-weight: 700; }
  .veil .lv .lvl { font-size: 44px; }
  .veil { align-items: flex-start; padding: 12px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .veil .modal { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .sheet .top-row .portrait { width: 84px; height: 112px; font-size: 26px; }
}

/* ---------- clickable people and things ---------- */
.pcard.clickable { cursor: pointer; }
.pcard.clickable:hover { border-color: var(--faint); }
.nearby button.e { background: transparent; border: 0; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; text-align: left; width: calc(100% + 16px); transition: background .2s; }
.nearby button.e:hover { background: var(--surface); }
.inv button.it { text-align: left; cursor: pointer; transition: background .2s, border-color .2s; }
.inv button.it:hover { background: var(--hover); border-color: var(--faint); }
.inv button.it.on { border-color: rgba(233,167,72,.5); }
.props { display: flex; flex-direction: column; }
