/* GRENDEL — Anglo-Saxon mead-hall horror. Warm hearthlight on bone, blood, and gilt. */

:root {
  --bg-0: #08050a;
  --bg-1: #110b08;
  --bg-2: #1a1310;
  --bg-3: #221814;
  --bg-4: #2a1d18;

  --ink:     #f3e7d4;
  --ink-2:   #c8b9a3;
  --ink-dim: #8a7765;
  --ink-mut: #5e5046;

  --blood:    #c93021;
  --blood-2:  #ff5446;
  --ember:    #ff8a3a;
  --gold:     #f4c468;
  --gold-2:   #ffe6a8;
  --gold-dim: #a07a3a;
  --bone:     #efe2cf;
  --moss:     #6ad07a;

  --border:   #2b1e16;
  --border-2: #3e2c1f;
  --border-gold: rgba(244, 196, 104, 0.4);
  --shadow:   0 18px 38px rgba(0,0,0,0.55), 0 2px 0 rgba(255,255,255,0.04) inset;
  --shadow-soft: 0 4px 16px rgba(0,0,0,0.45);

  --font-display: "Cinzel", "UnifrakturMaguntia", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#atmosphere {
  position: fixed; inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}

#root { position: relative; width: 100vw; height: 100vh; z-index: 1; }

.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.screen.active { display: flex; }

button {
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  transition: transform 80ms, background 120ms, border-color 120ms, box-shadow 120ms;
}
button:hover:not(:disabled) {
  background: var(--bg-4);
  border-color: #5a3a22;
  box-shadow: var(--shadow-soft);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.primary {
  background: linear-gradient(180deg, #b3290f, #6f1908);
  border: 1px solid #d8a648;
  color: #fff5dc;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4) inset,
    0 0 18px rgba(216, 51, 31, 0.3),
    0 6px 14px rgba(0,0,0,0.55);
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d23320, #8e2010);
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4) inset,
    0 0 26px rgba(244, 196, 104, 0.35),
    0 6px 18px rgba(0,0,0,0.6);
}
button.primary:disabled {
  background: linear-gradient(180deg, #3a1a14, #1f0c0b);
  border-color: #5a3a22;
  box-shadow: none;
}
button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-dim);
}
button.ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  border-color: var(--border-2);
}

button.big {
  padding: 14px 22px;
  font-size: 14px;
  letter-spacing: 0.25em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
button.big .btn-glyph {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold-2);
  text-shadow: 0 0 12px rgba(244,196,104,0.7);
}
button.big .btn-label { flex: 1; text-align: left; }
button.big .btn-sub {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: rgba(255, 230, 200, 0.65);
  text-transform: uppercase;
}

input, input[type=text] {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 15px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
input:focus {
  border-color: var(--gold);
  background: rgba(0,0,0,0.65);
  box-shadow: 0 0 0 2px rgba(244, 196, 104, 0.18);
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

/* ---------------- HOME ---------------- */

.brand {
  text-align: center;
  margin-bottom: 32px;
  animation: fade-in 700ms ease;
  position: relative;
}

.brand-eyes {
  position: absolute;
  top: -88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 80px;
  opacity: 0.55;
  pointer-events: none;
}
.brand-eyes .eye {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff0a6 0%, #f4c468 45%, rgba(244,196,104,0) 80%);
  filter: drop-shadow(0 0 14px rgba(244, 196, 104, 0.85));
  animation: blink 4s infinite;
}
.brand-eyes .eye:nth-child(2) { animation-delay: 0.05s; }
@keyframes blink {
  0%, 88%, 92%, 100% { transform: scaleY(1); }
  90% { transform: scaleY(0.1); }
}

.brand-overline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-dim);
  letter-spacing: 0.32em;
  text-transform: lowercase;
  margin-bottom: 4px;
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(72px, 14vw, 132px);
  margin: 0;
  letter-spacing: 0.24em;
  color: var(--bone);
  background: linear-gradient(180deg, #fff0d4 0%, #f4c468 50%, #6b1209 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 28px rgba(244,196,104,0.35),
    0 0 2px rgba(255,150,90,0.4);
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(244,196,104,0.4)); }
  50%      { filter: drop-shadow(0 0 28px rgba(255,180,90,0.6)); }
}

.ornament {
  width: 220px;
  height: 14px;
  margin: 4px auto 12px auto;
  background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 12%, var(--gold-dim) 88%, transparent 100%) center / 100% 1px no-repeat;
  position: relative;
}
.ornament::before, .ornament::after {
  content: ''; position: absolute; top: 50%;
  width: 9px; height: 9px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--gold-dim);
}
.ornament::before { left: 0; }
.ornament::after  { right: 0; }

.tagline {
  margin: 0;
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.panel {
  background: linear-gradient(180deg, rgba(26,19,16,0.96), rgba(16,11,9,0.96));
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(244,196,104,0.35), rgba(0,0,0,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.home-panel { width: 460px; max-width: calc(100vw - 40px); }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 11px;
  color: var(--ink-mut);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
#btn-create { width: 100%; justify-content: flex-start; }

.or {
  text-align: center;
  position: relative;
  margin: 4px 0;
}
.or span {
  display: inline-block;
  padding: 0 10px;
  font-size: 10px;
  color: var(--ink-mut);
  letter-spacing: 0.3em;
  background: var(--bg-2);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.or::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border-2);
}

.join-row { display: flex; gap: 8px; }
.join-row input {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
}
.join-row button { flex: 0 0 auto; }

.demo-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  padding: 9px 14px;
}
.demo-btn .demo-glyph { color: var(--gold); font-size: 12px; }
.demo-btn:hover:not(:disabled) { color: var(--gold-2); border-color: var(--gold); }

.demo-tag {
  font-size: 9px;
  letter-spacing: 0.32em;
  background: rgba(244,196,104,0.12);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 2px;
  margin-top: 4px;
}

.bot-tag {
  font-size: 9px;
  letter-spacing: 0.3em;
  background: rgba(255,255,255,0.06);
  color: var(--ink-mut);
  border: 1px solid var(--border-2);
  padding: 1px 5px;
  border-radius: 2px;
}

.shaper-tag {
  font-size: 9px;
  letter-spacing: 0.3em;
  background: rgba(255, 230, 168, 0.16);
  color: var(--gold-2);
  border: 1px solid var(--gold);
  padding: 1px 5px;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 230, 168, 0.25);
}

.role-tag.shaper { box-shadow: 0 0 16px rgba(255, 230, 168, 0.35); border-color: var(--gold-2); }
.role-tag.shaper .role-name { color: var(--gold-2); }
.role-tag.shaper .role-sub  { color: var(--gold); }

.error {
  color: var(--blood-2);
  font-size: 12px;
  margin: 12px 0 0 0;
  padding: 8px 10px;
  background: rgba(216, 51, 31, 0.1);
  border-left: 2px solid var(--blood);
  border-radius: 2px;
}

.dim   { color: var(--ink-dim); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.foot  { margin-top: 28px; }

/* ---------------- LOBBY ---------------- */

.lobby-card {
  width: 760px;
  max-width: calc(100vw - 40px);
  background: linear-gradient(180deg, rgba(26,19,16,0.96), rgba(16,11,9,0.96));
  border: 1px solid var(--border-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade-in 500ms ease;
}

.lobby-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(244,196,104,0.06), rgba(0,0,0,0));
}

.code-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.32em;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(244,196,104,0.35), 0 0 2px rgba(0,0,0,0.5);
  background: transparent;
  border: 1px dashed rgba(244,196,104,0.4);
  border-radius: 3px;
  padding: 4px 12px;
  margin-top: 4px;
  text-transform: none;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.code-pill:hover { background: rgba(244,196,104,0.06); border-color: var(--gold); }
.code-pill .copy-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-mut);
  text-transform: uppercase;
}
.copied {
  font-family: var(--font-mono);
  color: var(--moss);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 6px;
  animation: fade-in 200ms ease;
}

.lobby-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.lobby-section, .lobby-rules { padding: 18px 22px; }
.lobby-section { border-right: 1px solid var(--border); }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px 0;
  color: var(--ink);
  letter-spacing: 0.12em;
}
.title-bar { display: inline-block; width: 24px; height: 2px; background: var(--gold); }

.players { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow: auto; }
.players li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px dashed var(--border);
  transition: background 120ms;
}
.players li:hover { background: rgba(255,255,255,0.02); }
.players li:last-child { border-bottom: none; }
.players .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex: 0 0 28px;
  position: relative;
}
.players .avatar.grendel  {
  background: radial-gradient(circle at 35% 35%, #2a1408 0%, #050100 80%);
  border: 1px solid #5e1a13;
}
.players .avatar.grendel::before, .players .avatar.grendel::after {
  content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  top: 10px;
  box-shadow: 0 0 6px var(--gold);
}
.players .avatar.grendel::before { left: 7px; }
.players .avatar.grendel::after  { right: 7px; }
.players .avatar.beowulf {
  background: radial-gradient(circle at 35% 35%, #f4c468 0%, #8a5a2a 80%);
  border: 1px solid var(--gold);
  box-shadow: 0 0 10px rgba(244,196,104,0.5);
}
.players .avatar.beowulf::after {
  content: '★';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #2a1a08;
}
.players .avatar.thane {
  background: linear-gradient(180deg, #b8946a, #6a4a32);
  border: 1px solid #5a3d28;
}
.players .name {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
}
.players .name.you::after {
  content: ' (you)';
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.2em;
}
.players .role {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
}
.players .role.grendel  { background: rgba(216,51,31,0.18); color: var(--blood-2); border: 1px solid rgba(216,51,31,0.45); }
.players .role.beowulf  { background: rgba(244,196,104,0.12); color: var(--gold); border: 1px solid rgba(244,196,104,0.45); }
.players .role.thane    { background: rgba(216,178,128,0.06); color: var(--ink-2); border: 1px solid var(--border-2); }
.players .host-tag {
  font-size: 9px; letter-spacing: 0.3em;
  background: var(--blood); color: #fff0d4;
  padding: 1px 5px; border-radius: 2px;
}
.players .beowulf-tag-pill {
  font-size: 9px; letter-spacing: 0.3em;
  background: var(--gold); color: #2a1a08;
  padding: 1px 5px; border-radius: 2px;
}

.lobby-rules h4 {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--ink-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.lobby-rules ul {
  list-style: none; padding: 0; margin: 0;
  font-size: 12px; color: var(--ink-dim); line-height: 1.7;
}
.lobby-rules ul li {
  position: relative;
  padding-left: 14px;
}
.lobby-rules ul li::before {
  content: '✦';
  position: absolute; left: 0;
  color: var(--gold);
  font-size: 9px; top: 6px;
}
.lobby-rules ul b { color: var(--ink); font-weight: 600; }
.lobby-rules em { color: var(--gold-2); font-style: italic; }
.lobby-rules h4.scop-head {
  margin-top: 18px;
  color: var(--gold);
  font-size: 12px;
}
.lobby-rules .scop-notes {
  font-size: 11px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-mut);
}
.lobby-rules .scop-notes li::before { content: '✧'; color: var(--gold-dim); }
.lobby-rules .scop-notes b { color: var(--gold-2); font-style: normal; }

.re-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-2);
  margin: 18px 0 22px 0;
  padding: 14px 18px;
  border-left: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  background: rgba(244, 196, 104, 0.04);
  line-height: 1.55;
  text-align: center;
}
.re-quote cite {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-mut);
  margin-top: 8px;
  font-style: normal;
  text-transform: uppercase;
}

.lobby-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(244,196,104,0.05));
}
.lobby-foot .lobby-tip { text-align: right; line-height: 1.8; max-width: 280px; }

/* ---------------- GAME ---------------- */

.screen.game {
  background: #000;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

#canvas {
  display: block;
  image-rendering: pixelated;
  background: var(--bg-0);
  cursor: crosshair;
}

.hud {
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: var(--font-mono);
}

.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.65), rgba(0,0,0,0));
}
.hud-left  { display: flex; flex-direction: column; gap: 8px; }
.hud-right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.role-tag {
  font-family: var(--font-display);
  display: inline-flex; flex-direction: column;
  padding: 5px 14px;
  border-radius: 2px;
  align-self: flex-start;
}
.role-tag .role-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
  line-height: 1.1;
}
.role-tag .role-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: none;
  opacity: 0.7;
  margin-top: 2px;
}
.role-tag.grendel { background: rgba(216,51,31,0.18); color: #ffb4a4; border: 1px solid var(--blood); box-shadow: 0 0 16px rgba(216,51,31,0.3); }
.role-tag.beowulf { background: rgba(244,196,104,0.15); color: var(--gold-2); border: 1px solid var(--gold); box-shadow: 0 0 16px rgba(244,196,104,0.25); }
.role-tag.thane   { background: rgba(255,196,103,0.08); color: var(--gold); border: 1px solid var(--border-gold); }

.round-meta { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); }
.timer {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.dot-sep { color: var(--ink-mut); }
.kills { font-size: 12px; letter-spacing: 0.14em; }
.kills .kills-num { color: var(--gold); font-size: 16px; font-weight: 600; }
.kills .kills-sep { color: var(--ink-mut); margin: 0 2px; }
.kills .kills-tot { color: var(--ink-2); }
.kills .kills-lbl { color: var(--ink-mut); margin-left: 6px; text-transform: uppercase; }

.room-tag {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.room-lbl  { font-size: 9px; color: var(--ink-mut); letter-spacing: 0.32em; }
.room-code {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--gold); letter-spacing: 0.25em;
}

.beowulf-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: rgba(244,196,104,0.1);
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold-2);
  box-shadow: 0 0 12px rgba(244,196,104,0.15);
}
.beowulf-tag .bw-glyph { color: var(--gold); }
.beowulf-tag .bw-lbl   { color: var(--ink-dim); }
.beowulf-tag .bw-name  { color: var(--gold-2); font-weight: 600; }

.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 18px; align-items: flex-end;
  padding: 18px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
}

.hp {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.hp-icon { font-size: 24px; color: var(--blood-2); filter: drop-shadow(0 0 8px rgba(216,51,31,0.6)); }
.hp-stack { display: flex; flex-direction: column; gap: 5px; min-width: 240px; }
.hp-row { display: flex; justify-content: space-between; align-items: baseline; }
.hp-label { font-size: 10px; color: var(--ink-mut); letter-spacing: 0.28em; }
.hp-text  { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hp-bar {
  position: relative;
  height: 14px;
  background: linear-gradient(180deg, #1a0a06, #2a1208);
  border: 1px solid #3a201a;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 0 0 1px rgba(0,0,0,0.5) inset;
}
.hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #c93021, #f4c468 60%, #ffe6a8);
  box-shadow: 0 0 16px rgba(244,196,104,0.4);
  transition: width 220ms cubic-bezier(.2,.7,.2,1);
  position: relative;
}
.hp-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.25));
}
.hp-bar-notches {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 24px, rgba(0,0,0,0.4) 24px 25px);
  pointer-events: none;
}

.weapon-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 220px;
}
.weapon-icon {
  width: 38px; height: 38px;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mut);
  font-size: 18px;
}
.weapon-meta { display: flex; flex-direction: column; gap: 5px; }
.weapon-name {
  font-size: 12px; color: var(--ink-dim);
  letter-spacing: 0.22em; text-transform: uppercase;
}
.weapon-card.has .weapon-name { color: var(--gold); }
.weapon-card.has .weapon-icon { color: var(--gold); border-color: rgba(244,196,104,0.5); background: rgba(244,196,104,0.04); box-shadow: 0 0 14px rgba(244,196,104,0.15); }
.weapon-card.barehand .weapon-name { color: var(--gold-2); }
.weapon-card.barehand .weapon-icon { color: var(--gold-2); border-color: var(--gold); background: rgba(244,196,104,0.06); box-shadow: 0 0 14px rgba(244,196,104,0.3); }
.weapon-dura { display: flex; gap: 4px; }
.weapon-dura span {
  width: 14px; height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  transition: background 160ms;
}
.weapon-dura span.full { background: var(--gold); box-shadow: 0 0 6px rgba(244,196,104,0.5); }

.abilities { display: flex; gap: 10px; margin-left: auto; }
.ab {
  position: relative;
  display: grid;
  grid-template-rows: 28px 1fr 16px;
  align-items: center;
  justify-items: center;
  gap: 0;
  width: 88px; height: 84px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 6px;
  cursor: default;
  text-transform: none;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  overflow: hidden;
}
.ab:hover:not(:disabled) { background: rgba(0,0,0,0.55); box-shadow: none; transform: none; border-color: var(--border-2); }
.ab .ab-icon { color: var(--blood-2); display: inline-flex; }
.ab .lbl { font-size: 10px; color: var(--ink); letter-spacing: 0.22em; text-transform: uppercase; }
.ab .key {
  font-size: 9px;
  color: var(--ink-mut);
  letter-spacing: 0.2em;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border-2);
  padding: 1px 6px;
  border-radius: 2px;
}
.ab .cd {
  position: absolute; inset: 0;
  background: rgba(8,5,4,0.78);
  color: var(--ink);
  display: none;
  align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}
.ab.cooling .cd { display: flex; }
.ab.ready { box-shadow: 0 0 18px rgba(216,51,31,0.35) inset; border-color: rgba(216,51,31,0.45); }

/* KILL prompt */
.kill-prompt, .grapple-prompt {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.kp-inner, .gp-inner {
  position: relative;
  margin-bottom: 130px;
  color: #fff5dc;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.34em;
  padding: 14px 30px;
  border-radius: 4px;
  display: inline-flex; align-items: center; gap: 14px;
}
.kp-inner {
  background: linear-gradient(180deg, #d93020, #82150a);
  font-size: 28px;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.4) inset,
    0 0 0 4px rgba(216, 48, 32, 0.15),
    0 0 36px rgba(216, 48, 32, 0.6);
  animation: kp-pulse 700ms cubic-bezier(.5,0,.5,1) infinite;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}
.gp-inner {
  background: linear-gradient(180deg, #d8a648, #8a5a2a);
  color: #2a1a08;
  font-size: 24px;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.35) inset,
    0 0 0 4px rgba(244, 196, 104, 0.2),
    0 0 38px rgba(244, 196, 104, 0.55);
  animation: kp-pulse 700ms cubic-bezier(.5,0,.5,1) infinite;
  flex-direction: column; gap: 6px;
}
.kp-pulse, .gp-pulse {
  position: absolute; inset: -10px;
  border: 1px solid rgba(255,160,80,0.45);
  border-radius: 6px;
  animation: kp-ring 1.2s ease-out infinite;
  pointer-events: none;
}
.gp-pulse { border-color: rgba(244, 196, 104, 0.55); }
.kp-key, .gp-key {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.32em;
  background: rgba(0,0,0,0.45);
  color: #fff5dc;
  padding: 4px 10px;
  border-radius: 2px;
  text-shadow: none;
}
.gp-key { background: rgba(0,0,0,0.55); color: var(--gold-2); }
.gp-sub {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #2a1a08;
  text-transform: none;
}
.gp-label { display: inline-flex; align-items: center; gap: 14px; }
@keyframes kp-pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.05); }
}
@keyframes kp-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Grapple banner — visible to all when the famous grip is on */
.grapple-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.45em;
  color: var(--gold-2);
  padding: 6px 18px;
  background: rgba(0,0,0,0.55);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  text-shadow: 0 0 18px rgba(244,196,104,0.7);
  animation: grapple-pulse 1.4s ease-in-out infinite;
}
@keyframes grapple-pulse {
  0%, 100% { opacity: 0.85; letter-spacing: 0.45em; }
  50%      { opacity: 1;    letter-spacing: 0.55em; }
}

/* Saga feed */
.saga {
  position: absolute;
  right: 18px;
  top: 130px;
  width: 320px;
  display: flex; flex-direction: column; gap: 5px;
  pointer-events: none;
}
.saga-line {
  background: linear-gradient(90deg, rgba(0,0,0,0.75), rgba(0,0,0,0.4));
  border-left: 2px solid var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  padding: 6px 10px;
  letter-spacing: 0.02em;
  animation: slide-in 320ms cubic-bezier(.2,.7,.2,1);
  opacity: 1;
  transition: opacity 600ms;
  box-shadow: var(--shadow-soft);
}
.saga-line.fade { opacity: 0.5; }
.saga-line::before {
  content: '✦ ';
  color: var(--gold);
  font-style: normal;
  margin-right: 2px;
}
@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.respawn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(40,8,4,0.4), rgba(0,0,0,0.88));
  backdrop-filter: blur(3px);
  animation: fade-in 220ms ease;
}
.respawn-inner { text-align: center; }
.respawn-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  color: var(--blood-2);
  letter-spacing: 0.34em;
  margin-bottom: 14px;
  text-shadow: 0 0 24px rgba(216,51,31,0.7);
  animation: bleed 1.6s ease-in-out infinite;
}
@keyframes bleed {
  0%, 100% { text-shadow: 0 0 20px rgba(216,51,31,0.55); }
  50%      { text-shadow: 0 0 36px rgba(216,51,31,0.85); }
}
.respawn-count {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  font-size: 80px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  line-height: 1;
}

.round-end {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(0,0,0,0.55), rgba(0,0,0,0.95));
  pointer-events: auto;
  animation: fade-in 380ms ease;
}
.re-inner { text-align: center; max-width: 580px; padding: 28px; }
.re-mark {
  width: 60px; height: 60px;
  margin: 0 auto 14px auto;
  background: radial-gradient(circle, var(--gold) 0 4px, transparent 5px),
              conic-gradient(from 0deg, transparent 0 84deg, var(--gold) 86deg 94deg, transparent 96deg 174deg, var(--gold) 176deg 184deg, transparent 186deg 264deg, var(--gold) 266deg 274deg, transparent 276deg 354deg, var(--gold) 356deg);
  border-radius: 50%;
  opacity: 0.9;
  animation: spin 28s linear infinite;
  filter: drop-shadow(0 0 18px rgba(244,196,104,0.5));
}
@keyframes spin { to { transform: rotate(360deg); } }
.re-title {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--bone);
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fff0d4, #f4c468 65%, #6b1209);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(244,196,104,0.35);
}
.re-sub   {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-dim);
  margin-bottom: 26px;
  letter-spacing: 0.08em;
}
.re-actions { display: flex; justify-content: center; gap: 10px; }

.conn-banner {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--blood);
  color: var(--blood-2);
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  z-index: 100;
  box-shadow: 0 0 22px rgba(216,51,31,0.35);
}
.conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blood-2);
  animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  .title { font-size: 60px; }
  .lobby-body { grid-template-columns: 1fr; }
  .lobby-section { border-right: none; border-bottom: 1px solid var(--border); }
  .hp-stack { min-width: 160px; }
  .abilities .ab { width: 72px; height: 76px; }
  .saga { width: 260px; top: 120px; right: 12px; }
  .saga-line { font-size: 11px; }
}
