:root {
  --title: 'Bangers', 'Lilita One', 'Arial Black', sans-serif;
  --ui: 'Lilita One', 'Trebuchet MS', sans-serif;
  --blood: #b3000c;
  --ink: #0b0610;
  --bone: #f4ead6;
  --purple: #3a1d5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050308; color: var(--bone); font-family: var(--ui); user-select: none; }
#game, #view { position: fixed; inset: 0; display: block; }
#view { image-rendering: pixelated; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui .interactive, #ui button, #ui input, #ui .menu { pointer-events: auto; }
#boot { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--title); font-size: 52px; color: #ffd84a; z-index: 50; letter-spacing: 2px;
  -webkit-text-stroke: 3px #120a1a; paint-order: stroke fill; text-shadow: 4px 4px 0 #e8302a, 7px 7px 0 #120a1a;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, .05) 0 4deg, transparent 4deg 11deg), radial-gradient(ellipse at 50% 50%, #22307e 0%, #121a4e 50%, #070a20 100%); }
/* loaded: the words go away and the gate (Screens.gate, same background, behind) puts its A prompt in their place */
#boot.ready { background: none; pointer-events: none; animation: boot-out .3s ease-in forwards; }
@keyframes boot-out { to { transform: scale(1.3); opacity: 0; } }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 18px; }
.card { position: relative; display: flex; align-items: center; gap: 8px; min-width: 210px; padding: 8px 14px 8px 8px;
  background: linear-gradient(180deg, rgba(20,8,24,.86), rgba(8,2,10,.86)); border: 3px solid var(--pc); border-radius: 14px 14px 22px 6px;
  box-shadow: 0 4px 0 #000, inset 0 0 18px rgba(0,0,0,.6); }
.card.out { opacity: .35; filter: grayscale(1); }
.card.danger { animation: danger .5s infinite alternate; }
@keyframes danger { from { box-shadow: 0 4px 0 #000, 0 0 0 rgba(255,0,0,0); } to { box-shadow: 0 4px 0 #000, 0 0 22px rgba(255,20,20,.8); } }
.portrait { width: 62px; height: 62px; border-radius: 12px; background: radial-gradient(circle at 40% 35%, var(--cc), #120814 80%); border: 2px solid #000; overflow: hidden; display: grid; place-items: center; position: relative; }
.portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; position: absolute; inset: 0; }
.portrait span { font-family: var(--title); font-size: 34px; color: #fff; text-shadow: 2px 2px 0 #000; }
.info { line-height: 1; }
.pname { font-size: 15px; color: var(--pc); text-shadow: 2px 2px 0 #000; }
.pname i { font-style: normal; font-size: 11px; color: #aaa; margin-left: 4px; }
.cname { font-size: 11px; opacity: .75; margin-top: 2px; white-space: nowrap; }
.pct { font-size: 44px; text-shadow: 3px 3px 0 #000, -1px -1px 0 #000; display: inline-block; transform-origin: 30% 70%; }
.pct small { font-size: 22px; }
.pct.bump { animation: bump .25s ease-out; }
@keyframes bump { 0% { filter: brightness(3); } 100% { filter: none; } }
.stocks { display: flex; gap: 3px; margin-top: 2px; min-height: 16px; }
.skull { width: 16px; height: 16px; background: radial-gradient(circle at 35% 45%, #000 18%, transparent 20%), radial-gradient(circle at 65% 45%, #000 18%, transparent 20%), radial-gradient(ellipse at 50% 40%, var(--bone) 55%, transparent 58%); }
.cds { display: flex; gap: 3px; margin-top: 3px; }
.cds i { font-style: normal; font-size: 10px; line-height: 15px; min-width: 22px; padding: 0 3px; text-align: center; border-radius: 8px; border: 1px solid #000; color: #000; font-weight: bold;
  background: conic-gradient(rgba(10, 4, 14, .8) calc(var(--f, 0) * 360deg), var(--pc) 0); }
.cds i.wait { color: #fff8; }
.cds i.ready { animation: cdready .35s ease-out; }
@keyframes cdready { 0% { transform: scale(1.5); filter: brightness(2.2); } 100% { transform: scale(1); filter: none; } }
.timer { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 44px; text-shadow: 3px 3px 0 #000; }
.timer.low { color: #ff3a3a; animation: danger .4s infinite alternate; }

/* ---------- popups ---------- */
.popups { position: absolute; inset: 0; overflow: hidden; }
.popups .pop { position: absolute; transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s)); font-family: var(--title); font-size: 34px; letter-spacing: 1px;
  -webkit-text-stroke: 2px #000; text-shadow: 3px 3px 0 #000; white-space: nowrap; animation: popIn .25s cubic-bezier(.2,1.8,.4,1); }
@keyframes popIn { from { transform: translate(-50%, -50%) rotate(var(--r)) scale(calc(var(--s) * 2.4)); filter: brightness(3); } }
.banner { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-family: var(--title); font-size: 76px; -webkit-text-stroke: 3px #000;
  text-shadow: 5px 5px 0 #000, 0 0 30px rgba(255,0,0,.6); white-space: nowrap; animation: bannerIn .5s cubic-bezier(.2,1.6,.4,1), bannerOut .4s ease-in 1.2s forwards; }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(4) rotate(-8deg); opacity: 0; } }
@keyframes bannerOut { to { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.countdown { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); font-family: var(--title); font-size: 180px; color: #fff; -webkit-text-stroke: 5px #000;
  text-shadow: 8px 8px 0 var(--blood); animation: cd 1s ease-out forwards; }
.countdown.go { font-size: 130px; color: #ff2a2a; text-shadow: 8px 8px 0 #000; }
@keyframes cd { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }

/* controller status (top right) */
.padbadge { position: fixed; top: 14px; right: 16px; z-index: 40; padding: 7px 14px; border-radius: 10px; font-size: 17px; color: #e8ffe8;
  background: rgba(10, 4, 16, .72); border: 2px solid #3cb04a; text-shadow: 1px 1px 0 #000; opacity: 0; transform: translateY(-8px);
  transition: opacity .35s, transform .35s; pointer-events: none; }
.padbadge.show { opacity: 1; transform: none; }
.padbadge.warn { color: #ffe9b0; border-color: #e0b020; animation: padpulse 1.6s ease-in-out infinite; }
@keyframes padpulse { 50% { border-color: #ff8a3a; } }

/* online client: the host's pictures do not arrive */
.netwait { position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%); z-index: 45; padding: 14px 26px; border-radius: 14px;
  font-family: var(--title); font-size: 40px; color: #ffe9b0; background: rgba(10, 4, 16, .8); border: 3px solid #e0b020; text-shadow: 2px 2px 0 #000;
  animation: blink 1.2s infinite; pointer-events: none; }

/* host: errors reported by the guests */
.netdiag { position: fixed; left: 12px; bottom: 120px; max-width: 70vw; z-index: 46; font-size: 14px; color: #ffd0d0; background: rgba(40, 0, 6, .85);
  border: 2px solid #d83a3a; border-radius: 8px; padding: 6px 10px; pointer-events: none; font-family: monospace; }
.netdiag div { margin: 2px 0; }
