:root {
  color-scheme: dark;
  --ink: #e9e4dc;
  --muted: #9a938a;
  --dim: #6b655e;
  --bg: #07070a;
  --panel: rgba(10, 9, 12, 0.82);
  --panel-solid: #0d0c10;
  --silver: #b9b4ad;
  --silver-dim: #5d5953;
  --blood: #a3121f;
  --blood-bright: #e0283a;
  --holy: #d8b45a;
  --hunter: #6f9fd8;
  --good: #7fc28a;
  --warn: #e0a046;
  --power: #d0473c;
  --agility: #5fb0a4;
  --tactical: #b58ad8;
  --serif: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body: 'IM Fell English', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); overflow: hidden; }
button, input { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

#viewport { position: fixed; inset: 0; }
#viewport canvas { display: block; }

/* ---------------------------------------------------------------- buttons */
.btn {
  font-family: var(--serif); letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px;
  padding: 10px 22px; border-radius: 2px; cursor: pointer; color: var(--ink);
  border: 1px solid var(--silver-dim); background: linear-gradient(#1b191d, #0c0b0e);
  box-shadow: inset 0 0 0 1px #000, 0 2px 10px #0008; transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-blood { border-color: #6b0d16; background: linear-gradient(#5a0b14, #2a0509); }
.btn-ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* ---------------------------------------------------------------- main menu (launcher) */
/* Layout: sidebar menu | frosted panel | floating hero portrait, over a parallax blood-moon backdrop. */
.launcher {
  --l-text: #d1c2b0; --l-high: #f0e0d0; --l-dim: #8d7a6d; --l-rose: #b69d9d; --l-ember: #ff3c3c; --l-blood: #7a0000;
  --gothic: 'UnifrakturCook', 'Cinzel', Georgia, serif; --garamond: 'Cormorant Garamond', Georgia, serif;
  position: fixed; inset: 0; z-index: 20; overflow: hidden; background: #000; color: var(--l-text); font-family: var(--serif);
}
.l-bg { position: absolute; inset: -2%; background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.82)), url('assets/menu/bg.jpg') center / cover; transform: scale(1.02); transition: transform .2s ease-out; }
.l-vignette { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 15%, rgba(0,0,0,.75) 100%); }
.l-moon { position: absolute; top: 70px; right: 27%; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,0,0,.15); filter: blur(70px); animation: lMoon 6s ease-in-out infinite; pointer-events: none; }
@keyframes lMoon { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
.l-fog { position: absolute; width: 140%; height: 260px; left: -20%; background: rgba(255,255,255,.05); filter: blur(80px); pointer-events: none; }
.l-fog1 { bottom: -50px; animation: lFog 18s linear infinite; }
.l-fog2 { bottom: 120px; opacity: .25; animation: lFog 28s linear infinite reverse; }
@keyframes lFog { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-120px); } }
.l-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.l-ember { position: absolute; bottom: -20px; border-radius: 50%; background: var(--l-ember); opacity: 0; animation: lRise linear infinite; box-shadow: 0 0 6px rgba(255,60,60,.8); }
@keyframes lRise { from { transform: translateY(0); opacity: 0; } 20% { opacity: .8; } to { transform: translateY(-105vh); opacity: 0; } }

.l-grid { position: relative; z-index: 5; height: 100%; display: grid; grid-template-columns: minmax(230px, 18%) minmax(0, 46%) minmax(0, 1fr); }
.l-sidebar {
  padding: 40px 24px; display: flex; flex-direction: column; justify-content: center; gap: 0;
  background: linear-gradient(to right, rgba(0,0,0,.75), rgba(0,0,0,.25)); border-right: 1px solid rgba(255,255,255,.05); backdrop-filter: blur(8px);
}
.l-logo { margin-bottom: 64px; }
.l-logo-main { font-family: var(--gothic); font-size: 76px; line-height: 1; color: #d7c5b1; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255,255,255,.08), 0 0 20px rgba(255,0,0,.2), 0 0 40px rgba(255,0,0,.12); }
.l-logo-sub { margin-top: 10px; font-size: 10px; letter-spacing: 5px; color: #a88b8b; }
.l-menu { display: flex; flex-direction: column; gap: 18px; }
.l-item {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; text-align: left;
  font-family: var(--serif); font-size: 13px; letter-spacing: 2px; color: var(--l-text);
  background: linear-gradient(to right, rgba(17,17,22,.95), rgba(26,26,33,.65)); border: 1px solid rgba(255,255,255,.05); transition: .35s;
}
.l-item::before { content: ''; position: absolute; left: 0; top: 0; width: 0; height: 100%; background: linear-gradient(to right, rgba(122,0,0,.25), transparent); transition: .4s; }
.l-item:hover, .l-item:focus-visible, .l-item.active { transform: translateX(8px) scale(1.02); border-color: rgba(255,0,0,.2); box-shadow: 0 0 18px rgba(255,0,0,.25); outline: none; }
.l-item:hover::before, .l-item.active::before { width: 100%; }
.l-item.active { color: var(--l-high); }
.l-icon { color: #ff4444; font-size: 15px; position: relative; }
.l-sidebar .net-status { margin-top: 40px; align-self: flex-start; }

.l-center { display: flex; justify-content: center; align-items: center; padding: 32px; min-width: 0; overflow-y: auto; }
.l-panel {
  position: relative; width: 100%; max-width: 560px; padding: 48px 54px; max-height: calc(100vh - 64px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a1a1a transparent;
  background: linear-gradient(to bottom, rgba(10,10,12,.82), rgba(0,0,0,.75)); border: 1px solid rgba(255,255,255,.06); backdrop-filter: blur(18px);
  box-shadow: 0 0 50px rgba(0,0,0,.9), 0 0 50px rgba(255,0,0,.08); animation: lPanel .45s ease-out;
}
.l-panel::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(255,0,0,.08); pointer-events: none; }
@keyframes lPanel { from { opacity: 0; transform: translateY(12px); } }
.l-eyebrow { color: var(--l-rose); font-size: 11px; letter-spacing: 6px; margin-bottom: 16px; }
.l-title { font-family: var(--serif); font-weight: 400; font-size: 50px; line-height: .98; margin: 0 0 16px; color: var(--l-high); text-shadow: 0 0 15px rgba(255,255,255,.05); text-wrap: balance; }
.l-title.small { font-size: 44px; }
.l-desc { font-family: var(--garamond); font-size: 21px; line-height: 1.4; color: #c4b5a6; margin: 0 0 26px; }
.l-field { margin-bottom: 22px; }
.l-field > label, .l-setting > label { display: block; margin-bottom: 10px; font-size: 11px; letter-spacing: 4px; color: var(--l-dim); }
#player-name { width: 100%; padding: 16px 18px; background: rgba(0,0,0,.7); border: 1px solid rgba(255,0,0,.14); color: #fff; font-size: 15px; font-family: var(--garamond); outline: none; transition: .3s; }
#player-name:focus { border-color: #ff3b3b; box-shadow: 0 0 15px rgba(255,0,0,.25); }
.l-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.l-pick-h { display: block; font-size: 10px; letter-spacing: 3px; margin-bottom: 6px; text-transform: uppercase; }
.l-pick-h.vampire { color: #ff6b6b; }
.l-pick-h.hunter { color: #b9b4ad; }
.l-pick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.char-card {
  aspect-ratio: 3 / 4; max-width: 100%; cursor: pointer; padding: 0; background: #000 center 12% / cover no-repeat; border: 1px solid rgba(255,255,255,.08);
  filter: grayscale(.6) brightness(.6); transition: .3s;
}
.char-card:hover, .char-card:focus-visible { filter: none; outline: none; border-color: rgba(255,0,0,.35); }
.char-card.selected { filter: none; border-color: #ff3b3b; box-shadow: 0 0 15px rgba(255,0,0,.35); }
.l-chosen { font-family: var(--garamond); font-size: 17px; color: #c4b5a6; min-height: 48px; margin: 4px 0 18px; line-height: 1.35; }
.l-chosen b { font-family: var(--serif); font-weight: 600; color: var(--l-high); font-size: 15px; letter-spacing: 1px; }
.l-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; font-size: 13px; }
.l-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.l-check input { accent-color: #920000; }
.l-options a { text-decoration: none; color: #ff5959; }
.l-options a:hover { text-decoration: underline; }
.l-enter {
  width: 100%; padding: 20px; cursor: pointer; font-family: var(--serif); font-size: 15px; letter-spacing: 4px; color: #fff;
  background: linear-gradient(to bottom, #920000, #350000); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 25px rgba(255,0,0,.15); transition: .3s;
}
.l-enter:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 30px rgba(255,0,0,.35); }
.l-enter:active:not(:disabled) { transform: scale(.98); }
.l-enter:disabled { opacity: .6; cursor: progress; }
.l-enter.ghost { background: rgba(0,0,0,.4); margin-top: 22px; }
.l-setting { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.l-setting > label { margin: 0; }
.l-setting b { color: var(--l-high); font-weight: 400; letter-spacing: 1px; }
.l-setting select, .l-setting input[type=range] { accent-color: #920000; background: #000; color: var(--l-text); border: 1px solid rgba(255,0,0,.2); padding: 6px; font-family: var(--serif); }
.l-setting input[type=checkbox] { accent-color: #920000; width: 18px; height: 18px; }
.l-note { font-family: var(--garamond); color: var(--l-dim); font-size: 16px; margin: 14px 0 0; }
.l-credits p { font-family: var(--garamond); font-size: 18px; line-height: 1.4; color: #c4b5a6; margin: 0 0 16px; }
.l-credits b { font-family: var(--serif); font-weight: 600; font-size: 12px; letter-spacing: 3px; color: var(--l-rose); }

.l-hero-wrap { position: relative; overflow: hidden; pointer-events: none; }
.l-hero {
  position: absolute; right: 6%; bottom: 0; height: 90%; aspect-ratio: 62 / 90; max-width: 100%; background: center / cover no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
  animation: lFloat 6s ease-in-out infinite; transition: opacity .35s;
}
.l-hero.swap { opacity: 0; }
@keyframes lFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.l-hero-name { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-size: 13px; letter-spacing: 6px; color: var(--l-rose); text-shadow: 0 2px 10px #000; }

.char-detail { font-family: var(--garamond); font-size: 17px; }
.char-detail h3 { font-family: var(--serif); font-weight: 600; margin: 0; font-size: 22px; letter-spacing: .06em; color: var(--l-high); }
.char-detail .sub { color: var(--l-dim); font-family: var(--serif); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 10px; }
.char-detail .stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0; font-size: 16px; }
.char-detail .passive { border-left: 2px solid var(--blood); padding: 6px 12px; margin: 10px 0; background: rgba(255,0,0,.04); }
.char-detail.hunter .passive { border-color: var(--hunter); }
.char-detail ul { list-style: none; padding: 0; margin: 6px 0 0; columns: 2; column-gap: 14px; font-size: 16px; }
.char-detail li { break-inside: avoid; padding: 2px 0; }
.char-detail .kit { color: var(--l-dim); font-style: italic; font-size: 15px; }
.l-roster-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.l-roster-nav button { font-family: var(--serif); font-size: 11px; letter-spacing: 2px; padding: 6px 10px; cursor: pointer; color: var(--l-text); background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.08); }
.l-roster-nav button.on { border-color: #ff3b3b; color: #fff; }

.net-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 12px; border: 1px solid rgba(255,255,255,.06); background: rgba(0,0,0,.5); line-height: 1.3; font-family: var(--garamond); }
.net-status .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px currentColor; }
.net-status.online .dot { background: var(--good); }
.net-status.offline .dot { background: var(--holy); }
.net-status.error .dot { background: var(--blood-bright); }
.net-status.error { color: #ff9a9a; }

@media (prefers-reduced-motion: reduce) { .l-moon, .l-fog, .l-ember, .l-hero, .l-panel { animation: none !important; } }
@media (max-width: 1100px) { .l-grid { grid-template-columns: 220px minmax(0, 1fr) 30%; } .l-title { font-size: 44px; } }
@media (max-width: 900px) {
  .launcher { overflow-y: auto; overflow-x: hidden; }
  .l-picks { grid-template-columns: 1fr; }
  .l-grid { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .l-sidebar { padding: 16px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .l-logo { margin: 0; }
  .l-logo-main { font-size: 40px; }
  .l-menu { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .l-item { padding: 10px 12px; font-size: 11px; }
  .l-item:hover, .l-item.active { transform: none; }
  .l-sidebar .net-status { margin: 0; }
  .l-hero-wrap { position: fixed; inset: 0; opacity: .18; z-index: -1; }
  .l-center { padding: 16px; }
  .l-panel { max-height: none; padding: 32px 22px; }
  .l-title { font-size: 36px; }
  .l-desc { font-size: 18px; }
}

/* ---------------------------------------------------------------- frames */
.frame { position: fixed; background: var(--panel); border: 1px solid #2c292e; box-shadow: 0 0 0 1px #000, 0 6px 22px #0009; z-index: 5; }
.portrait { width: 64px; height: 84px; background: #000 center 15% / cover; border: 1px solid var(--silver-dim); flex: none; }
.bar { position: relative; height: 14px; background: #1a1719; border: 1px solid #000; margin-top: 4px; overflow: hidden; }
.bar .fill { position: absolute; inset: 0; width: 50%; transition: width .25s; }
.bar span { position: absolute; inset: 0; font-size: 11px; line-height: 13px; text-align: center; font-family: var(--serif); text-shadow: 0 1px 2px #000; }
.bar.hp .fill { background: linear-gradient(#c3343f, #6d0f18); }
.bar.bp .fill { background: linear-gradient(#7b0a2a, #3a0414); }
.bar.rp .fill { background: linear-gradient(#a08a52, #4f4126); }
.bar.xp { height: 5px; }
.bar.xp .fill { background: var(--holy); }
.bar.big { height: 20px; }
.bar.big span { font-size: 13px; line-height: 19px; }

#player-frame { top: 12px; left: 12px; display: flex; gap: 10px; padding: 8px; width: 300px; }
.pf-info { flex: 1; min-width: 0; }
.pf-name { font-family: var(--serif); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-name .lvl { color: var(--holy); font-size: 12px; }
.buffs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.buff { font-size: 11px; padding: 1px 6px; border: 1px solid #3a363a; background: #000a; font-family: var(--serif); }
.buff.bad { border-color: #7a1a22; color: #ff8a8a; }
.buff.good { border-color: #2f5f3a; color: #a9e6b4; }
.buff.holy { border-color: #6a5a2a; color: var(--holy); }

#district-frame { top: 12px; left: 50%; transform: translateX(-50%); padding: 8px 14px; min-width: 330px; text-align: center; }
.dist-name { font-family: var(--serif); font-size: 18px; letter-spacing: .12em; text-transform: uppercase; }
.dist-owner { font-size: 13px; color: var(--blood-bright); min-height: 16px; }
.dist-owner.neutral { color: var(--muted); }
.dist-stats { display: flex; justify-content: center; gap: 16px; font-size: 13px; margin-top: 3px; }
.dist-stats label { color: var(--muted); margin-right: 4px; }
.notoriety { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; margin-top: 4px; }
.notoriety label { color: var(--muted); }
.pips { display: flex; gap: 2px; }
.pip { width: 10px; height: 10px; border: 1px solid #3a2a2a; background: #120b0c; transform: rotate(45deg); margin: 0 1px; }
.pip.on { background: var(--blood-bright); border-color: #ff6b77; box-shadow: 0 0 6px var(--blood-bright); }
.pips .more { font-size: 12px; color: var(--blood-bright); margin-left: 4px; }
.cathedral { font-size: 12px; color: var(--holy); margin-top: 4px; min-height: 15px; }

#minimap-wrap { top: 12px; right: 12px; padding: 4px; cursor: pointer; }
#minimap { display: block; width: 260px; height: 170px; }

#target-frame { right: 12px; top: 196px; display: flex; gap: 10px; padding: 8px; width: 260px; }
.tf-info { flex: 1; min-width: 0; }
.tf-name { font-family: var(--serif); font-size: 14px; }
.tf-sub { font-size: 12px; color: var(--muted); }
#target-frame.hostile { border-color: #5a1018; }
#target-frame.hostile .tf-name { color: #ff8f8f; }
#target-frame.friend .tf-name { color: #9fc4ff; }

#channel { position: fixed; left: 50%; bottom: 190px; transform: translateX(-50%); width: 280px; text-align: center; z-index: 6; }
#channel .label { font-family: var(--serif); font-size: 13px; text-shadow: 0 1px 3px #000; }
#channel .bar { height: 10px; }
#channel .fill { background: linear-gradient(90deg, #6d0f18, #e0283a); }

#bottom { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 5; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 720px; }
.action {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; background: var(--panel); border: 1px solid #36323a;
  cursor: pointer; font-family: var(--serif); font-size: 13px; color: var(--ink); box-shadow: 0 0 0 1px #000;
}
.action:hover { border-color: var(--silver); }
.action.disabled { opacity: .45; }
.action.hot { border-color: var(--blood-bright); box-shadow: 0 0 12px rgba(224, 40, 58, .4); }
.key { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--silver-dim); background: #000; font-size: 12px; color: var(--silver); }
.world-cards { display: flex; gap: 6px; }
.wcard {
  position: relative; width: 82px; height: 96px; background: linear-gradient(#141216, #070608); border: 1px solid var(--silver-dim);
  outline: 1px solid #000; cursor: pointer; text-align: center; padding: 4px 4px 0; overflow: hidden; color: var(--ink);
}
.wcard:hover { border-color: var(--silver); }
.wcard .glyph { font-size: 20px; line-height: 26px; color: var(--silver); }
.wcard .nm { font-family: var(--serif); font-size: 10px; line-height: 12px; height: 24px; display: grid; place-items: center; }
.wcard .cost { font-size: 11px; color: #ff7c86; }
.wcard .k { position: absolute; top: 2px; left: 3px; font-size: 10px; color: var(--muted); }
.wcard .cd { position: absolute; inset: 0; background: #000b; display: grid; place-items: center; font-family: var(--serif); font-size: 20px; }
.wcard.poor { opacity: .5; }

#chat { left: 12px; bottom: 12px; width: 380px; padding: 6px; }
#log { height: 170px; overflow-y: auto; font-size: 13.5px; line-height: 1.3; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
#log div { margin: 1px 0; text-shadow: 0 1px 2px #000; }
#log .blood { color: #ff8a92; }
#log .holy { color: var(--holy); }
#log .good { color: var(--good); }
#log .warn { color: var(--warn); }
#log .notoriety { color: #f07a4a; }
#log .level { color: var(--holy); font-weight: bold; }
#log .tip { color: #a9c2e8; font-style: italic; }
#log .world { color: var(--muted); }
#log .chat b { font-family: var(--serif); font-size: 12px; }
#log .chat.vampire b { color: var(--blood-bright); }
#log .chat.hunter b { color: var(--hunter); }
#chat-input { width: 100%; margin-top: 4px; background: #000a; border: 1px solid #2c292e; color: var(--ink); padding: 5px 8px; font-size: 13px; }
#chat-input:focus { outline: 1px solid var(--silver-dim); }

#toast { position: fixed; top: 150px; left: 50%; transform: translateX(-50%); font-family: var(--serif); font-size: 20px; letter-spacing: .08em; text-shadow: 0 2px 8px #000, 0 0 2px #000; pointer-events: none; z-index: 8; text-align: center; opacity: 0; transition: opacity .4s; }
#toast.show { opacity: 1; }

#cathedral-card {
  position: fixed; right: 290px; top: 12px; width: 210px; padding: 12px; z-index: 7; text-align: center;
  background: linear-gradient(#17140d, #0a0806); border: 2px solid #6a5a2a; outline: 1px solid #000; box-shadow: 0 0 30px rgba(216, 180, 90, .25);
  animation: drop .5s ease-out;
}
#cathedral-card .ch { font-family: var(--serif); font-size: 10px; letter-spacing: .3em; color: var(--holy); }
#cathedral-card .cn { font-family: var(--serif); font-size: 17px; margin: 4px 0; }
#cathedral-card .ct { font-size: 13px; color: #d8d0bf; }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }

.help-btn { position: fixed; right: 12px; bottom: 12px; z-index: 6; width: 32px; height: 32px; padding: 0; }

/* ---------------------------------------------------------------- duel */
#hud.dueling > :not(#toast):not(#cathedral-card) { visibility: hidden; }
#duel {
  position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 16px 22px;
  background: radial-gradient(ellipse at 50% 45%, rgba(40, 0, 6, .55), rgba(0, 0, 0, .9) 75%);
}
.duel-top { display: grid; grid-template-columns: 1fr minmax(240px, 420px) 1fr; gap: 16px; width: 100%; max-width: 1200px; align-items: start; }
.duelist { display: flex; gap: 12px; align-items: flex-start; }
.duelist.foe { justify-content: flex-end; text-align: right; }
.duel-art { width: 110px; height: 160px; border: 2px solid var(--silver-dim); outline: 1px solid #000; background: #000 center 15% / cover; box-shadow: 0 6px 24px #000; flex: none; }
.duelist-info { flex: 1; max-width: 260px; }
.dname { font-family: var(--serif); font-size: 18px; letter-spacing: .05em; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.duelist.foe .badges { justify-content: flex-end; }
.badge { font-size: 12px; padding: 1px 7px; border: 1px solid #3a363a; background: #000c; }
.badge.buff { border-color: #2f5f3a; color: #a9e6b4; }
.badge.debuff { border-color: #7a1a22; color: #ff9a9a; }
.badge.ally { border-color: #3a4a6a; color: #9fc4ff; }
.duel-center { text-align: center; }
.duel-center .round { font-family: var(--serif); letter-spacing: .3em; text-transform: uppercase; color: var(--silver); font-size: 13px; }
.duel-center .timer { font-family: var(--serif); font-size: 34px; color: var(--blood-bright); text-shadow: 0 0 14px rgba(224, 40, 58, .5); }
.duel-log { font-size: 14px; line-height: 1.35; max-height: 170px; overflow-y: auto; background: #0008; border: 1px solid #221f24; padding: 6px 10px; text-align: left; }
.duel-log div:nth-child(-n+2) { color: var(--silver); font-style: italic; }
.duel-rules { font-size: 13px; color: var(--muted); margin: 6px 0; text-align: center; }
.hand { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; perspective: 900px; }
.card {
  position: relative; width: 168px; height: 248px; padding: 12px 12px 10px; cursor: pointer; text-align: center; color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, #1c1a1f, #050506 70%); border: 2px solid #8e8a84; outline: 1px solid #000;
  box-shadow: inset 0 0 0 4px #000, inset 0 0 0 5px #3d3a37, 0 10px 26px #000c; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; align-items: center;
}
.card:hover:not(.locked) { transform: translateY(-10px) rotateX(4deg); box-shadow: inset 0 0 0 4px #000, inset 0 0 0 5px #3d3a37, 0 0 26px rgba(224, 40, 58, .5); }
.card.locked { cursor: not-allowed; filter: grayscale(.8) brightness(.55); }
.card.played { transform: translateY(-24px); box-shadow: inset 0 0 0 4px #000, inset 0 0 0 5px #3d3a37, 0 0 30px rgba(224, 200, 120, .55); }
.card .medal { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #8e8a84; display: grid; place-items: center; font-size: 22px; background: #000; flex: none; }
.card.power .medal { color: var(--power); }
.card.agility .medal { color: var(--agility); }
.card.tactical .medal { color: var(--tactical); }
.card .cname { font-family: var(--serif); font-size: 15px; margin: 6px 0 2px; line-height: 1.1; }
.card .ctype { font-family: var(--serif); font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.card .rule { width: 70%; height: 1px; background: linear-gradient(90deg, transparent, #8e8a84, transparent); margin: 6px 0; flex: none; }
.card .ctext { font-size: 12.5px; line-height: 1.25; flex: 1; overflow: hidden; }
.card .cquote { font-size: 11.5px; font-style: italic; color: var(--muted); margin-top: 4px; line-height: 1.2; }
.card .ccost { position: absolute; top: 8px; right: 10px; font-family: var(--serif); font-size: 13px; color: #ff7c86; }
.card .cwhy { position: absolute; bottom: 8px; left: 0; right: 0; font-size: 12px; color: #ff9a9a; }
.duel-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; min-height: 40px; color: var(--silver); font-style: italic; }
#duel-result { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: #000a; }
.res-title { font-family: var(--serif); font-size: 64px; letter-spacing: .2em; color: var(--blood-bright); text-shadow: 0 0 30px rgba(224, 40, 58, .5); }
.res-title.win { color: var(--holy); text-shadow: 0 0 30px rgba(216, 180, 90, .5); }
.res-sub { color: var(--silver); margin: 8px 0 20px; font-size: 18px; }

@media (max-width: 760px) {
  .duel-top { grid-template-columns: 1fr 1fr; }
  .duel-center { grid-column: 1 / -1; order: 3; }
  .duel-art { width: 64px; height: 92px; }
  .card { width: 140px; height: 220px; }
}

/* ---------------------------------------------------------------- overlays */
#death { position: fixed; inset: 0; z-index: 11; display: grid; place-content: center; text-align: center; background: radial-gradient(rgba(60, 0, 0, .4), rgba(0, 0, 0, .85)); pointer-events: none; }
.death-title { font-family: var(--serif); font-size: 60px; letter-spacing: .2em; color: var(--blood-bright); }
.death-sub { font-size: 20px; color: var(--silver); }
.modal { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: #000a; padding: 16px; }
.modal-box { background: var(--panel-solid); border: 1px solid #3a363a; outline: 1px solid #000; padding: 18px 22px; max-width: 520px; width: 100%; max-height: 92vh; overflow-y: auto; }
.modal-box.wide { max-width: 960px; }
.modal-box h3 { font-family: var(--serif); letter-spacing: .15em; text-transform: uppercase; margin: 0 0 8px; }
.travel-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #222; gap: 10px; }
.travel-row .why { color: #ff9a9a; font-size: 13px; }
#bigmap-canvas { width: 100%; height: auto; display: block; background: #000; border: 1px solid #222; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.help-box h2 { font-family: var(--serif); margin: 0 0 6px; letter-spacing: .1em; }
.help-box h4 { font-family: var(--serif); margin: 14px 0 4px; color: var(--silver); letter-spacing: .08em; }
.help-box p, .help-box li { font-size: 15px; line-height: 1.4; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
@media (max-width: 760px) { .help-grid { grid-template-columns: 1fr; } }
kbd { border: 1px solid var(--silver-dim); background: #000; padding: 0 5px; font-size: 12px; font-family: var(--serif); }

@media (max-width: 900px) {
  #district-frame { top: auto; bottom: 230px; min-width: 0; width: calc(100% - 24px); }
  #chat { width: calc(100% - 24px); bottom: auto; top: 120px; }
  #log { height: 80px; }
  #minimap-wrap { display: none; }
  #target-frame { top: auto; bottom: 330px; }
}

/* ================================================================ VEYRAATH campaign */
.camp-status { font-family: var(--garamond, Georgia); font-size: 17px; color: #c4b5a6; margin: -6px 0 18px; line-height: 1.4; }
.camp-status b { color: #f0e0d0; font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: 1px; }
.camp-buttons { margin-bottom: 14px; }
.camp-parts { display: grid; gap: 4px; margin-top: 14px; max-height: 210px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a1a1a transparent; }
.camp-part { display: grid; grid-template-columns: 54px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 8px; border: 1px solid rgba(255,255,255,.05); background: rgba(0,0,0,.35); font-size: 12px; letter-spacing: 1px; }
.camp-part .n { color: #ff5959; }
.camp-part .s { font-family: var(--garamond, Georgia); font-size: 13px; color: #8d7a6d; letter-spacing: 0; }
.camp-part.sealed { opacity: .55; }
.camp-part.done .s { color: #7fc28a; }

#cmp { position: fixed; inset: 0; z-index: 11; pointer-events: none; font-family: var(--serif); color: #e9e4dc; }
#cmp > * { pointer-events: none; }
#cmp .cmp-choices, #cmp .cmp-pause, #cmp .cmp-end, #cmp .cmp-choices * , #cmp .cmp-pause *, #cmp .cmp-end * { pointer-events: auto; }
.cmp-bar { position: fixed; left: 0; right: 0; height: 0; background: #000; transition: height .6s ease; z-index: 3; }
.cmp-bar.top { top: 0; } .cmp-bar.bottom { bottom: 0; }
#cmp.cine .cmp-bar { height: 11vh; }
#cmp.cine .cmp-hud, #cmp.cine .cmp-obj, #cmp.cine .cmp-abil, #cmp.cine .cmp-prompt, #cmp.cine .cmp-hint { opacity: 0; }
.cmp-hud { position: fixed; top: 16px; left: 16px; width: 300px; transition: opacity .4s; }
.cmp-name { font-size: 15px; letter-spacing: .2em; margin-bottom: 6px; text-shadow: 0 2px 6px #000; }
.cmp-name span { color: #ff5959; font-size: 11px; letter-spacing: .3em; margin-left: 6px; }
.cmp-meter { position: relative; height: 14px; margin-top: 5px; background: rgba(10,6,8,.8); border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.cmp-meter .fill { position: absolute; inset: 0; width: 50%; transition: width .2s; }
.cmp-meter span { position: absolute; inset: 0; font-size: 10.5px; line-height: 13px; letter-spacing: .1em; padding-left: 8px; text-shadow: 0 1px 2px #000; }
.cmp-meter.hp .fill { background: linear-gradient(#c3343f, #6d0f18); }
.cmp-meter.blood .fill { background: linear-gradient(#8a0a2a, #40041a); }
.cmp-meter.blood.starving { animation: starve 1s infinite; }
@keyframes starve { 50% { box-shadow: 0 0 12px rgba(255,0,40,.7); border-color: #ff2040; } }
.cmp-meter.frenzy .fill { background: linear-gradient(90deg, #6d0010, #ff1030); }
.cmp-meter.frenzy.ready { box-shadow: 0 0 14px rgba(255,20,50,.8); border-color: #ff3050; }
.cmp-moral { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; letter-spacing: .15em; color: #b69d9d; text-shadow: 0 1px 3px #000; }
.cmp-moral b { color: #f0e0d0; font-weight: 600; }
.cmp-obj { position: fixed; top: 18px; right: 18px; max-width: 360px; text-align: right; font-size: 14px; letter-spacing: .05em; text-shadow: 0 2px 6px #000, 0 0 2px #000; transition: opacity .4s; }
.cmp-obj .dot { color: #ff3b3b; }
#cmp-obj-side { margin-top: 6px; font-size: 13px; color: #c8b8a8; }
.cmp-abil { position: fixed; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; max-width: 60vw; font-size: 11px; letter-spacing: .08em; color: #b9b4ad; text-shadow: 0 1px 3px #000; transition: opacity .4s; }
#cmp kbd { border: 1px solid #6a5e56; background: rgba(0,0,0,.7); padding: 0 5px; font-family: var(--serif); font-size: 11px; color: #f0e0d0; }
.cmp-prompt { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); font-size: 15px; letter-spacing: .08em; background: rgba(0,0,0,.6); padding: 8px 16px; border: 1px solid rgba(255,0,0,.2); }
.cmp-hint { position: fixed; left: 50%; top: 27%; transform: translateX(-50%); max-width: min(640px, 90vw); text-align: center; font-family: var(--garamond, Georgia); font-size: 19px; background: rgba(0,0,0,.55); padding: 10px 18px; border-left: 2px solid #7a0000; transition: opacity .4s; }
.cmp-sub { position: fixed; left: 50%; bottom: 13vh; transform: translateX(-50%); width: min(820px, 92vw); text-align: center; z-index: 4; font-family: var(--garamond, Georgia); font-size: 23px; line-height: 1.35; text-shadow: 0 2px 8px #000, 0 0 2px #000; }
.cmp-sub b { display: block; font-family: var(--serif); font-size: 12px; letter-spacing: .35em; text-transform: uppercase; color: #ff6b6b; margin-bottom: 4px; }
.cmp-system { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; z-index: 5; animation: sysIn 2.8s ease forwards; }
.cmp-system .t { font-size: clamp(22px, 3.6vw, 42px); letter-spacing: .3em; color: #ff2838; text-shadow: 0 0 22px rgba(255,20,40,.75), 0 0 2px #000; }
.cmp-system .s { margin-top: 10px; font-size: 14px; letter-spacing: .4em; color: #f0e0d0; }
@keyframes sysIn { 0% { opacity: 0; filter: blur(8px); letter-spacing: .6em; } 12% { opacity: 1; filter: blur(0); } 85% { opacity: 1; } 100% { opacity: 0; } }
.cmp-title { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; z-index: 6; animation: titleIn 3.6s ease forwards; }
.cmp-title .t { font-family: 'UnifrakturCook', var(--serif); font-size: clamp(48px, 9vw, 110px); color: #e8d6c4; text-shadow: 0 0 30px rgba(255,0,0,.35); }
.cmp-title .s { font-size: 16px; letter-spacing: .5em; color: #ff5959; margin-top: 6px; }
@keyframes titleIn { 0% { opacity: 0; transform: scale(1.04); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
.cmp-banner { position: fixed; left: 50%; top: 11%; transform: translateX(-50%); text-align: center; z-index: 4; animation: bannerIn 3.8s ease forwards; }
.cmp-banner .k { font-size: 12px; letter-spacing: .45em; color: #ff5959; }
.cmp-banner .t { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: .12em; text-shadow: 0 2px 10px #000; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, 10px); } 15% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
.cmp-toast { position: fixed; left: 50%; top: 36%; transform: translateX(-50%); font-size: 15px; letter-spacing: .08em; color: #f0d8b0; text-shadow: 0 2px 6px #000; opacity: 0; transition: opacity .4s; text-align: center; max-width: 80vw; }
.cmp-toast.show { opacity: 1; }
.cmp-choices { position: fixed; left: 50%; bottom: 14vh; transform: translateX(-50%); width: min(640px, 92vw); z-index: 7; display: grid; gap: 8px; }
.cmp-choices .p { font-family: var(--garamond, Georgia); font-size: 20px; text-align: center; margin-bottom: 6px; text-shadow: 0 2px 6px #000; }
.cmp-choices button { text-align: left; font-family: var(--garamond, Georgia); font-size: 18px; color: #f0e0d0; padding: 12px 16px; cursor: pointer; background: linear-gradient(to right, rgba(17,17,22,.95), rgba(26,26,33,.75)); border: 1px solid rgba(255,0,0,.18); transition: .25s; display: flex; gap: 12px; align-items: center; }
.cmp-choices button:hover, .cmp-choices button:focus-visible { border-color: #ff3b3b; box-shadow: 0 0 16px rgba(255,0,0,.3); transform: translateX(6px); outline: none; }
.cmp-death { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: radial-gradient(rgba(70,0,0,.5), rgba(0,0,0,.9)); z-index: 8; }
.cmp-death div { font-size: clamp(30px, 5vw, 60px); letter-spacing: .3em; color: #ff2838; }
.cmp-death span { font-family: var(--garamond, Georgia); font-size: 20px; color: #c4b5a6; margin-top: 8px; }
.cmp-fade { position: fixed; inset: 0; background: #000; opacity: 0; z-index: 9; transition: opacity .8s; }
.cmp-vfx { position: fixed; inset: 0; opacity: 0; transition: opacity .5s; }
#cmp-frenzy { background: radial-gradient(ellipse at center, rgba(255,0,30,.05) 30%, rgba(160,0,20,.55) 100%); mix-blend-mode: multiply; }
#cmp-frenzy.on { opacity: 1; animation: frenzyPulse .9s infinite; }
@keyframes frenzyPulse { 50% { filter: brightness(1.4); } }
#cmp-nv { background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.6) 100%); }
#cmp-nv.on { opacity: 1; }
#cmp.hurt::after { content: ''; position: fixed; inset: 0; box-shadow: inset 0 0 120px rgba(255,0,0,.55); }
#cmp.starving::before { content: ''; position: fixed; inset: 0; box-shadow: inset 0 0 90px rgba(120,0,10,.5); animation: starve 1.6s infinite; }
#cmp.human #cmp-blood-w, #cmp.human #cmp-frenzy-w { display: none; }
.cmp-num { position: fixed; left: 0; top: 0; font-size: 18px; font-weight: 700; text-shadow: 0 2px 4px #000; pointer-events: none; will-change: transform; }
.cmp-pause, .cmp-end { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0,0,0,.72); padding: 16px; }
.cmp-pause .box { width: min(820px, 100%); max-height: 90vh; overflow-y: auto; background: linear-gradient(to bottom, rgba(12,10,12,.96), rgba(4,3,4,.96)); border: 1px solid rgba(255,255,255,.07); padding: 26px 30px; }
.cmp-pause h3 { margin: 0 0 12px; letter-spacing: .25em; font-weight: 400; }
.cmp-pause .stats, .cmp-end .stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; letter-spacing: .15em; color: #b69d9d; margin-bottom: 14px; }
.cmp-pause .stats b, .cmp-end .stats b { color: #f0e0d0; }
.cmp-pause details { border-top: 1px solid rgba(255,255,255,.06); padding: 8px 0; }
.cmp-pause summary { cursor: pointer; letter-spacing: .1em; }
.cmp-pause summary .num { color: #ff5959; font-size: 12px; letter-spacing: .3em; margin-right: 8px; }
.cmp-pause summary .seal { font-size: 11px; color: #6b655e; letter-spacing: .2em; margin-left: 8px; }
.cmp-pause details p { font-family: var(--garamond, Georgia); color: #c4b5a6; font-size: 16px; margin: 6px 0; }
.cmp-pause ol, .cmp-pause ul { margin: 6px 0 4px; padding-left: 22px; font-size: 13px; }
.cmp-pause li { margin: 4px 0; color: #8d7a6d; }
.cmp-pause li div { font-family: var(--garamond, Georgia); font-size: 15px; }
.cmp-pause li.done b { color: #7fc28a; } .cmp-pause li.done b::after { content: '  ✓'; }
.cmp-pause li.current b { color: #ff5959; } .cmp-pause li.current b::after { content: '  ◀ current'; font-size: 11px; letter-spacing: .1em; }
.cmp-pause li.active b { color: #f0d8b0; } .cmp-pause li.failed b { color: #8a4a4a; text-decoration: line-through; }
.cmp-pause li.todo b { color: #d1c2b0; }
.cmp-pause details.sealed summary { color: #8d7a6d; }
.cmp-pause .row, .cmp-end .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cmp-pause .keys { font-size: 12px; color: #8d7a6d; line-height: 2; margin-top: 14px; }
.cmp-end { text-align: center; place-content: center; display: grid; gap: 6px; background: radial-gradient(ellipse at center, rgba(40,0,6,.85), rgba(0,0,0,.96)); }
.cmp-end .k { font-size: 13px; letter-spacing: .5em; color: #ff5959; }
.cmp-end .t { font-family: 'UnifrakturCook', var(--serif); font-size: clamp(44px, 7vw, 86px); color: #e8d6c4; }
.cmp-end .stats { justify-content: center; }
.cmp-end p { font-family: var(--garamond, Georgia); font-size: 19px; color: #c4b5a6; max-width: 560px; margin: 4px auto; }
.cmp-end .next { font-size: 13px; letter-spacing: .2em; color: #8d7a6d; margin-top: 8px; }
.cmp-end .next span { color: #ff5959; margin-right: 8px; }
.cmp-end .row { justify-content: center; }
@media (max-width: 700px) { .cmp-hud { width: 220px; } .cmp-obj { max-width: 55vw; font-size: 12px; } }

.camp-code { margin-top: 14px; font-size: 12px; letter-spacing: .1em; color: #b69d9d; }
.camp-code summary { cursor: pointer; }
.camp-code .code-row { display: flex; gap: 8px; margin-top: 8px; }
.camp-code input { flex: 1; min-width: 0; background: rgba(0,0,0,.7); border: 1px solid rgba(255,0,0,.14); color: #f0e0d0; padding: 8px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: .05em; }

.cmp-clans { margin-top: 4px; }
.cmp-clans b { color: inherit; }
