html, body.gameBody {
  height: 100%;
  overflow: hidden;
}

.gameScreen {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #020304;
}

.gameHud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(3, 6, 10, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.gameHudLeft, .gameHudRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hudStat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  min-width: 56px;
}

.hudStat span {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}

.hudStat strong {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
}

.hudStat.accent strong { color: var(--green); }
.hudStat.warn strong { color: var(--red); }
.hudStat.bonus strong { color: var(--purple); }

.hudStat.warn {
  border-color: rgba(242,95,76,.4);
  background: rgba(242,95,76,.1);
  animation: bossPulse 1s ease infinite;
}

@keyframes bossPulse {
  50% { box-shadow: 0 0 12px rgba(242,95,76,.3); }
}

.gameMain {
  display: grid;
  grid-template-columns: 1fr min(260px, 28vw);
  min-height: 0;
  overflow: hidden;
}

.canvasStage.bossRage {
  animation: arenaRage 0.5s ease infinite alternate;
}

@keyframes arenaRage {
  from { box-shadow: inset 0 0 40px rgba(255,30,20,.15); }
  to { box-shadow: inset 0 0 80px rgba(255,30,20,.35); }
}

.canvasStage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.canvasStage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gameSidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
  background: rgba(3, 6, 10, 0.92);
  border-left: 1px solid var(--line);
}

.crtOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.heatMeter {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 72px;
}

.heatMeter span {
  font-size: .55rem;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 800;
}

.heatBar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid var(--line);
}

.heatFill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #33d17a, #f9f06b, #f66151);
  transition: width .25s ease;
  box-shadow: 0 0 10px rgba(249,240,107,.5);
}

.minimapWrap,
.killFeed {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(61,232,138,.2);
  min-height: 0;
}

.minimapWrap h3,
.killFeed h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: .58rem;
  letter-spacing: .14em;
  color: var(--green);
}

#minimap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #040608;
}

.killFeed {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.killFeed ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
  max-height: 170px;
  overflow: auto;
}

.killFeed li {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.3;
  border-left: 2px solid transparent;
  padding-left: 6px;
}

.killFeed li.feed-new {
  animation: feedIn .35s ease;
}

.killFeed li.death { border-color: var(--red); color: #ffb4a9; }
.killFeed li.kill { border-color: #ff6b5a; color: #ffc4bc; font-weight: 700; }
.killFeed li.combo { border-color: var(--yellow); color: #ffe8a3; }
.killFeed li.bonus { border-color: var(--purple); color: #e9c4ff; }
.killFeed li.boss { border-color: #ff3b2e; color: #ff9b93; font-weight: 700; }

@keyframes feedIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.epicDeath .deathKicker {
  margin: 0 0 4px;
  font-size: .65rem;
  letter-spacing: .2em;
  color: var(--green);
  font-family: var(--font-display);
}

.glitchTitle {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: .12em;
  color: var(--red);
  position: relative;
  animation: glitchSkew 2.5s infinite;
}

.glitchTitle::before,
.glitchTitle::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
}

.glitchTitle::before {
  color: #62a0ea;
  clip-path: inset(0 0 55% 0);
  animation: glitchTop 2s infinite;
}

.glitchTitle::after {
  color: #3de88a;
  clip-path: inset(45% 0 0 0);
  animation: glitchBot 1.8s infinite;
}

@keyframes glitchSkew {
  0%, 90%, 100% { transform: skew(0); }
  92% { transform: skew(-2deg); }
  94% { transform: skew(2deg); }
}

@keyframes glitchTop {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(-3px, 1px); }
}

@keyframes glitchBot {
  0%, 86%, 100% { transform: translate(0); }
  88% { transform: translate(3px, -1px); }
}

.deathReasonText {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: .9rem;
}

.hudStat.hidden { display: none; }

#comboHud strong {
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(249,240,107,.5);
}

#comboHud.pulse strong {
  animation: comboPulse .4s ease;
}

@keyframes comboPulse {
  50% { transform: scale(1.25); color: #fff; }
}

.gameBody {
  touch-action: manipulation;
  overscroll-behavior: none;
}

.overlayPanel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 32px));
  padding: 28px;
  z-index: 20;
  text-align: center;
}

.overlayPanel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: .08em;
}

.overlayPanel.hidden { display: none; }

.deathStats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: .88rem;
}

.deathStats b { color: var(--text); }

.overlayActions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playersFloat {
  position: absolute;
  bottom: 12px;
  left: 12px;
  max-width: 200px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(3,6,10,.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.playersFloat h3 {
  margin: 0 0 6px;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.playersFloat ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: .78rem;
  color: var(--muted);
}

.playersFloat li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.playersFloat .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .gameMain {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .gameSidebar {
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 118px;
  }

  .minimapWrap,
  .killFeed {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
  }

  .killFeed ul {
    max-height: 64px;
  }

  .playersFloat { display: none; }
}
