/* ==========================================================================
   BUCKSHOT ROULETTE — Dark Industrial Horror & Cyberpunk CRT Stylesheet
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #060709;
  --bg-1: #0e1014;
  --bg-2: #181b22;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f0f0f3;
  --text-dim: #8b8e99;
  --accent: #ff6a00;
  --accent-glow: rgba(255, 106, 0, 0.45);
  --live: #ff3333;
  --blank: #38b6ff;
  --defib-on: #2cf07d;
  --defib-off: rgba(255, 255, 255, 0.12);
  --defib-crit: #ff2233;
}

html, body {
  height: 100%;
  background: #060709;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* ---------------- CRT Scanlines & Screen Atmosphere ---------------- */
.crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.28) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
  opacity: 0.85;
}

.damage-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  /* A bright paint-splatter flash instead of a blood vignette — color is set
     per-hit from JS (see triggerDamageFlash) so it varies like real paint. */
  background: radial-gradient(circle, transparent 35%, var(--splat-color, rgba(255, 45, 149, 0.6)) 80%, var(--splat-color-dark, rgba(140, 20, 90, 0.9)) 100%);
  opacity: 0;
  transition: opacity 0.08s ease-out;
}
.damage-flash-overlay.active {
  animation: damage-strobe 0.45s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes damage-strobe {
  0% { opacity: 1; transform: scale(1.04); }
  40% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1); }
}

.muzzle-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 85;
  background: rgba(255, 240, 200, 0.4);
  opacity: 0;
  transition: opacity 0.05s ease-out;
}
.muzzle-flash-overlay.active {
  animation: muzzle-strobe 0.22s ease-out forwards;
}
@keyframes muzzle-strobe {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(10, 11, 14, 0.75);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
  backdrop-filter: blur(10px);
}
.brand {
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 1.15rem;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}
.brand-sub {
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 3px;
  font-weight: 700;
}
.round-pill {
  background: rgba(255, 106, 0, 0.15);
  border: 1px solid rgba(255, 106, 0, 0.5);
  color: var(--accent);
  padding: 4px 16px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 2px;
  box-shadow: 0 0 16px var(--accent-glow);
}
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s;
}
.btn:active { transform: translateY(3px); }
.btn-arcade {
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.8);
}
.btn-arcade:active {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.8);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8f3d);
  color: #0d0600;
  border: 1px solid #ffb27a;
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(255, 106, 0, 0.65);
  filter: brightness(1.1);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-big {
  padding: 16px 36px;
  font-size: 1.1rem;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------------- Screens ---------------- */
.screen { display: none; flex: 1; }
.screen.show { display: flex; }

/* ---------------- Home Screen ---------------- */
#screen-home {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #161820 0%, #050608 75%);
}
.home-wrap {
  text-align: center;
  max-width: 580px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.home-badge {
  background: rgba(255, 106, 0, 0.12);
  border: 1px solid rgba(255, 106, 0, 0.4);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 6px 14px;
  border-radius: 20px;
}
.home-title {
  font-size: 4.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(255, 106, 0, 0.35);
}
.home-title .accent { color: var(--accent); }
.home-sub {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.mode-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.join-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.join-input {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 4px;
  width: 170px;
  text-align: center;
  font-weight: 900;
  font-size: 1.1rem;
}
.join-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.home-footer-links { margin-top: 12px; }
.home-error { color: var(--live); font-size: 0.88rem; min-height: 1.2em; font-weight: 700; }

/* ---------------- Rules Screen ---------------- */
#screen-rules {
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: #0a0b0e;
}
.rules-wrap {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0 40px;
}
.rules-header h2 { font-size: 2rem; font-weight: 900; }
.rules-sub { color: var(--accent); font-weight: 700; font-size: 0.88rem; letter-spacing: 1px; }
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}
.rules-list li {
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 0.94rem;
}
.items-title {
  font-size: 1.3rem;
  font-weight: 900;
  margin-top: 8px;
  color: var(--accent);
}
.rules-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.rule-item-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.rule-item-card .ri-icon { font-size: 2rem; margin-bottom: 4px; }
.rule-item-card .ri-name { font-weight: 900; font-size: 0.92rem; color: #fff; }
.rule-item-card .ri-desc { color: var(--text-dim); font-size: 0.78rem; margin-top: 6px; line-height: 1.4; }

/* ---------------- Character Creator ---------------- */
#screen-creator { flex-direction: row; }
.creator-wrap { display: flex; width: 100%; flex: 1; }
.creator-preview { flex: 1; position: relative; background: radial-gradient(circle at 50% 35%, #181b22, #060709 80%); }
.creator-preview canvas { width: 100%; height: 100%; display: block; }
.creator-panel {
  width: 400px;
  max-width: 44vw;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.creator-panel h2 { font-size: 1.4rem; font-weight: 900; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 0.8rem; color: var(--text-dim); font-weight: 800; text-transform: uppercase; }
.field input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 700;
}
.swatch-group { display: flex; flex-direction: column; gap: 8px; }
.swatch-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 800; text-transform: uppercase; }
.swatch-row, .option-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: scale(1.1);
}
.option-chip {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.12s;
}
.option-chip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.option-chip.selected {
  border-color: var(--accent);
  color: #fff;
  background: rgba(255, 106, 0, 0.18);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------------- Lobby Screen ---------------- */
#screen-lobby { align-items: center; justify-content: center; background: #060709; }
.lobby-wrap {
  text-align: center;
  max-width: 520px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}
.lobby-wrap h2 { font-size: 2rem; font-weight: 900; }
.room-code-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 24px;
}
.room-code-box span { font-size: 0.75rem; color: var(--text-dim); letter-spacing: 2px; font-weight: 800; }
.room-code-box strong { font-size: 2rem; letter-spacing: 6px; color: var(--accent); }
.lobby-seats { display: flex; gap: 20px; }
.lobby-seat {
  width: 130px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lobby-seat .seat-avatar { width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 0 16px rgba(0, 0, 0, 0.8); }
.lobby-seat span { font-weight: 800; font-size: 0.95rem; }
.lobby-seat.empty { opacity: 0.4; border-style: dashed; }
.lobby-hint { color: var(--text-dim); font-size: 0.9rem; max-width: 360px; line-height: 1.5; }

/* ---------------- Fullscreen 3D Game Viewport ---------------- */
#screen-game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: #06070a;
  display: none;
  flex-direction: column;
}
#screen-game.show { display: flex; }

.table-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.table-scene canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
}

.opp-row {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 15;
  pointer-events: none;
}
.opp-row > * { pointer-events: auto; }

.me-row {
  position: absolute;
  bottom: 100px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 14px;
  z-index: 15;
  pointer-events: none;
}
.me-row > * { pointer-events: auto; }

.action-row {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 0;
  z-index: 20;
  width: 90%;
  max-width: 580px;
}

.turn-banner {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.log-feed {
  position: absolute;
  top: 70px;
  right: 20px;
  max-width: 320px;
  width: 28vw;
  max-height: 120px;
  z-index: 15;
}

/* ---------------- Retro CRT Defibrillator Monitors ---------------- */
.crt-monitor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  background: linear-gradient(135deg, #091a12, #040906);
  border: 2px solid rgba(44, 240, 125, 0.4);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: inset 0 0 20px rgba(44, 240, 125, 0.15), 0 0 18px rgba(44, 240, 125, 0.2);
  position: relative;
  overflow: hidden;
}
.crt-monitor.mine {
  border-color: rgba(255, 106, 0, 0.45);
  background: linear-gradient(135deg, #1c0e06, #090502);
  box-shadow: inset 0 0 20px rgba(255, 106, 0, 0.15), 0 0 18px var(--accent-glow);
}
.crt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.crt-label {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: #a4f5c5;
  font-weight: 900;
  text-transform: uppercase;
}
.crt-monitor.mine .crt-label { color: #ffc299; }
.crt-status {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--defib-on);
  letter-spacing: 1px;
}
.crt-charges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.lives-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
}
.lives-tag {
  font-size: 0.76rem;
  font-weight: 900;
  color: #a4f5c5;
  letter-spacing: 1px;
}
.crt-monitor.mine .lives-tag {
  color: #ffb088;
}
.lives-count {
  font-size: 1.05rem;
  font-weight: 900;
  color: #2cf07d;
  text-shadow: 0 0 8px rgba(44, 240, 125, 0.6);
}
.crt-monitor.mine .lives-count {
  color: #ff9933;
  text-shadow: 0 0 8px rgba(255, 153, 51, 0.6);
}
.lives-count.critical {
  color: #ff3333 !important;
  animation: pulse-critical 0.8s infinite alternate;
}
@keyframes pulse-critical {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0.75; }
}
.charges-pips-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.charge-cell {
  width: 26px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(180deg, #2cf07d, #15803d);
  border: 1.5px solid #7affb5;
  box-shadow: 0 0 12px rgba(44, 240, 125, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #002b0c;
  font-weight: 900;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.crt-monitor.mine .charge-cell {
  background: linear-gradient(180deg, #ffaa33, #d97706);
  border-color: #ffd699;
  box-shadow: 0 0 12px rgba(255, 170, 51, 0.75);
  color: #2b1400;
}
.charge-cell.lost {
  background: #11141a !important;
  border-color: #222733 !important;
  box-shadow: none !important;
  color: #4b5563 !important;
  transform: scale(0.9);
}

/* ---------------- Item Trays ---------------- */
.item-tray {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-height: 52px;
  align-items: center;
}
.item-chip {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-1);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  position: relative;
  cursor: default;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.item-chip.usable {
  cursor: pointer;
  border-color: rgba(255, 106, 0, 0.6);
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.15), var(--bg-1));
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.2);
}
.item-chip.usable:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 24px rgba(255, 106, 0, 0.5);
  border-color: #ff9d4d;
}
.item-chip.disabled { opacity: 0.35; }
.item-chip .item-tooltip {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: #060709;
  border: 1px solid var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}
.item-chip:hover .item-tooltip { opacity: 1; }

.cuffed-badge {
  background: #2a0f05;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 10px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}
.cuffed-badge.show { opacity: 1; }

/* ---------------- 3D Table Scene Container ---------------- */
.table-scene {
  flex: 1;
  position: relative;
  min-height: 320px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.9);
}
.table-scene canvas { width: 100%; height: 100%; display: block; }

/* ---------------- Shell Counter HUD ---------------- */
.shell-counter {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 15;
}
.shell-pip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 1px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.shell-pip.live {
  background: rgba(255, 40, 40, 0.25);
  color: #ff6666;
  border: 1.5px solid rgba(255, 60, 60, 0.6);
}
.shell-pip.blank {
  background: rgba(40, 160, 255, 0.25);
  color: #66ccff;
  border: 1.5px solid rgba(60, 180, 255, 0.6);
}
.shell-pip.total {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.shell-pip.sudden {
  background: rgba(255, 0, 0, 0.4);
  color: #ff9999;
  border: 1.5px solid #ff3333;
  animation: pulse-sudden 1.4s infinite alternate;
}
@keyframes pulse-sudden {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); }
  100% { transform: scale(1.06); box-shadow: 0 0 24px rgba(255, 0, 0, 0.8); }
}

.known-banner {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 8, 5, 0.85);
  border: 2px solid var(--accent);
  color: #fff;
  padding: 8px 24px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 15;
  box-shadow: 0 0 30px var(--accent-glow);
}
.known-banner.show { opacity: 1; }

/* ---------------- Item Use Announcement ----------------
   The single biggest readability fix for items: without this, an opponent
   (or the bot Dealer) using an item produced no on-screen event at all, so
   the game state would silently change with nothing to explain why. */
.item-use-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: linear-gradient(160deg, rgba(24, 18, 10, 0.97), rgba(10, 8, 6, 0.97));
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 18px 34px;
  text-align: center;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 60px var(--accent-glow), 0 18px 50px rgba(0, 0, 0, 0.8);
}
.item-use-banner.show {
  animation: item-use-pop 2.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes item-use-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  22%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.96); }
}
.iub-who {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}
.iub-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.iub-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 14px var(--accent-glow));
  animation: iub-icon-spin 2.1s ease-out;
}
@keyframes iub-icon-spin {
  0%   { transform: rotate(-25deg) scale(0.5); }
  20%  { transform: rotate(8deg) scale(1.15); }
  35%  { transform: rotate(0deg) scale(1); }
}
.iub-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
}
.iub-effect {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #c9bda8;
  max-width: 300px;
}
@media (max-width: 600px) {
  .item-use-banner { padding: 14px 22px; }
  .iub-name { font-size: 1.05rem; }
  .iub-icon { font-size: 2rem; }
  .iub-effect { font-size: 0.78rem; max-width: 220px; }
}

/* ---------------- Action Row (Shoot Self vs Opponent) ---------------- */
.action-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 8px 0;
  z-index: 15;
}
.action-btn {
  flex: 1;
  max-width: 280px;
  padding: 16px 20px;
  font-size: 1.05rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  border: 2px solid transparent;
}
.action-target-icon { font-size: 1.8rem; }
.action-text { display: flex; flex-direction: column; text-align: left; }
.action-text strong { font-size: 1.05rem; letter-spacing: 0.5px; }
.action-text small { font-size: 0.72rem; opacity: 0.8; font-weight: 700; }

.shoot-self {
  background: linear-gradient(135deg, #0e2a3a, #06131c);
  color: #99e6ff;
  border-color: rgba(56, 182, 255, 0.4);
}
.shoot-self:hover {
  background: linear-gradient(135deg, #153c52, #0a1e2b);
  border-color: #38b6ff;
  box-shadow: 0 10px 30px rgba(56, 182, 255, 0.35);
}

.shoot-dealer {
  background: linear-gradient(135deg, #3a1010, #1c0505);
  color: #ffb3b3;
  border-color: rgba(255, 51, 51, 0.4);
}
.shoot-dealer:hover {
  background: linear-gradient(135deg, #521818, #2b0808);
  border-color: #ff3333;
  box-shadow: 0 10px 30px rgba(255, 51, 51, 0.35);
}

.action-row.disabled {
  pointer-events: none;
  opacity: 0.35;
  filter: grayscale(0.6);
}

.turn-banner {
  text-align: center;
  font-weight: 900;
  letter-spacing: 3px;
  font-size: 1rem;
  color: var(--accent);
  padding: 4px;
  text-shadow: 0 0 16px var(--accent-glow);
}
.log-feed {
  max-height: 86px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(8px);
}
.log-feed div:last-child { color: #fff; font-weight: 700; }

/* ---------------- Overlays & Modals ---------------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  backdrop-filter: blur(8px);
}
.overlay.show { display: flex; }
.overlay-card {
  background: var(--bg-1);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 38px 32px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
}
.overlay-card h1 { font-size: 2rem; font-weight: 900; letter-spacing: 2px; }
.overlay-card p { color: var(--text-dim); line-height: 1.6; font-size: 0.95rem; }
.overlay-icon { font-size: 3rem; }
.overlay-card.win { border-color: rgba(44, 240, 125, 0.6); box-shadow: 0 0 50px rgba(44, 240, 125, 0.25); }
.overlay-card.lose { border-color: rgba(255, 51, 51, 0.6); box-shadow: 0 0 50px rgba(255, 51, 51, 0.25); }
.modal-btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }

/* ---------------- Adrenaline Steal Grid ---------------- */
.adrenaline-item-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 12px 0;
}
.steal-chip {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.steal-chip:hover {
  transform: scale(1.15);
  box-shadow: 0 0 24px var(--accent-glow);
}

@media (max-width: 640px) {
  .home-title { font-size: 3rem; }
  .action-row { flex-direction: column; align-items: stretch; }
  .action-btn { max-width: 100%; }
  .creator-wrap { flex-direction: column; }
  .creator-panel { width: 100%; max-width: 100%; }
}

/* ---------------- Shell Presentation Banner ---------------- */
.shell-presentation-banner {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(6, 7, 10, 0.94);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 24px 32px;
  text-align: center;
  z-index: 25;
  box-shadow: 0 0 50px rgba(0,0,0,0.9), 0 0 30px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.shell-presentation-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.sp-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 16px rgba(255,255,255,0.4);
}
.sp-sub {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
}
.sp-row {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.sp-shell {
  width: 22px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  animation: pop-shell 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) backwards;
}
.sp-shell.live {
  background: linear-gradient(to top, #d4af37 25%, #ff2222 25%);
  border-color: #ff6666;
  box-shadow: 0 0 16px rgba(255,34,34,0.6);
}
.sp-shell.blank {
  background: linear-gradient(to top, #d4af37 25%, #1e88e5 25%);
  border-color: #64b5f6;
  box-shadow: 0 0 16px rgba(30,136,229,0.6);
}
@keyframes pop-shell {
  0% { transform: translateY(20px) scale(0.5); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Wires Cut CRT Pulse */
.crt-monitor.wires-cut {
  border-color: rgba(255, 34, 34, 0.7);
  background: linear-gradient(135deg, #220505, #0a0101);
  box-shadow: inset 0 0 24px rgba(255, 34, 34, 0.4), 0 0 20px rgba(255, 34, 34, 0.5);
  animation: crt-hazard-pulse 1.5s infinite alternate;
}
@keyframes crt-hazard-pulse {
  0% { filter: drop-shadow(0 0 4px rgba(255,0,0,0.4)); }
  100% { filter: drop-shadow(0 0 18px rgba(255,0,0,0.8)); }
}

/* ---------------- Authentic Retro CRT Horror Post-Processing Overlay ---------------- */
.crt-horror-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(3, 4, 6, 0.88) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: multiply;
}

/* ---------------- Item Hover Tooltip ---------------- */
.item-hover-tooltip {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 16, 20, 0.95);
  border: 1px solid rgba(255, 106, 0, 0.4);
  border-radius: 8px;
  padding: 12px 18px;
  max-width: 380px;
  pointer-events: none;
  z-index: 80;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 106, 0, 0.15);
  backdrop-filter: blur(8px);
  animation: tooltip-fade-in 0.15s ease-out;
}
@keyframes tooltip-fade-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.iht-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.iht-icon {
  font-size: 1.25rem;
}
.iht-name {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.95rem;
  color: #ff9d4d;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.iht-desc {
  font-size: 0.82rem;
  color: #d0d2d8;
  line-height: 1.35;
  margin-bottom: 6px;
}
.iht-status {
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: #2cf07d;
  text-transform: uppercase;
}
.iht-status.disabled {
  color: #ff4444;
}
