/* ============================================================
   Battleship styles — reorganized
   Sections:
     1. Variables
     2. Reset / Base
     3. Layout (viewport, containers)
     4. Board & grid
     5. Controls / UI panels
     6. Components (cards, ships, legends)
     7. Utilities & responsive
   ============================================================ */



/* 1. Variables ------------------------------------------------- */
:root {
  --cell-size: 38px;
  --gap: 4px;

  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;

  --success: #10b981;
  --danger: #ef4444;
  --neutral: #6b7280;

  --bg: #0f172a;
  --bg-light: #1e293b;
  --surface: #334155;
  --border: #475569;

  --text: #f1f5f9;
  --text-muted: #cbd5e1;
}

/* 2. Reset / Base -------------------------------------------- */
* {
  box-sizing: border-box
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-light) 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.screen {
  max-width: 1200px;
  width: 100%;
  height: 100%;
  max-height: 900px;
  display: flex;
  flex-direction: column
}

.hidden {
  display: none !important;
}

/* Typography / small UI */
h1 {
  margin: 0 0 24px 0;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text)
}

label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 8px
}

/* Inputs */
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  margin: 8px 0 16px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all .2s
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
  background: rgba(255, 255, 255, 0.08)
}

input[type="text"]::placeholder {
  color: var(--text-muted)
}

/* Buttons */
.btn {
  padding: 11px 20px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
  flex: 1;
  min-width: 100px
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, .4)
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, .3)
}

.btn.secondary {
  background: rgba(59, 130, 246, .1);
  color: var(--primary-light);
  box-shadow: none;
  border: 1px solid rgba(59, 130, 246, .3)
}

.btn.secondary:hover {
  background: rgba(59, 130, 246, .15);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(59, 130, 246, .15)
}

.reset {
  background: linear-gradient(135deg, var(--danger) 0%, rgba(128,0,0,1) 100%);
  box-shadow: none;
  margin-bottom: 10px;
  
}

/* 3. Layout --------------------------------------------------- */
#screen-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.card {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--surface) 100%);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 10px 10px -5px rgba(0, 0, 0, .1);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Main two-column game area */
.wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  overflow: hidden
}

.board-wrap {
  display: block;
  flex: 0.25 auto;
  min-width: 0
}

/* ensure participates in flex sizing */

/* Game-wide wrapper (two equal columns) */
.game-wrap {
  width: 100%;
  display: flex;
  gap: 32px;
  flex-grow: 1;
  overflow: hidden;
  align-items: stretch
}

.game-wrap>* {
  flex: 0 0 50%;
  max-width: 50%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px
}

/* 4. Board & grid ------------------------------------------- */
.col-labels,
.row-labels {
  display: flex;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  gap: var(--gap)
}

.col-labels {
  margin-bottom: 8px;
  margin-left: 32px;
  text-transform: uppercase;
  letter-spacing: 2px
}

.row-labels {
  flex-direction: column;
  width: 32px;
  margin-right: 8px;
  text-align: center
}

.board-container {
  display: flex
}

.board {
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  grid-template-rows: repeat(10, var(--cell-size));
  gap: var(--gap);
  background: rgba(30, 64, 175, 0.1);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .3)
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: linear-gradient(135deg, rgba(59, 130, 246, .15) 0%, rgba(30, 64, 175, .2) 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(59, 130, 246, .3);
  transition: all .15s;
  font-weight: 600;
  font-size: 12px;
  position: relative; /* allow pseudo-elements positioned relative to cell */
  overflow: visible;  /* allow effects to extend outside the cell */
}

.cell:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, .25) 0%, rgba(30, 64, 175, .35) 100%);
  border-color: rgba(59, 130, 246, .5);
  transform: scale(1.05)
}

.cell.preview {
  background: linear-gradient(135deg, rgba(245, 158, 11, .4) 0%, rgba(217, 119, 6, .3) 100%);
  border-color: rgba(245, 158, 11, .8);
  box-shadow: 0 0 12px rgba(245, 158, 11, .2)
}

.cell.placed {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .3)
}

.cell.invalid {
  background: linear-gradient(135deg, rgba(239, 68, 68, .4) 0%, rgba(220, 38, 38, .3) 100%);
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, .2);
  animation: shake .3s
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0)
  }

  25% {
    transform: translateX(-4px)
  }

  75% {
    transform: translateX(4px)
  }
}

/* Enhanced hit/miss visuals that can extend outside the cell without using textContent */

/* Base adjustments so pseudo-elements can overflow the grid cell */
.cell {
  position: relative; /* allow pseudo-elements positioned relative to cell */
  overflow: visible;  /* allow effects to extend outside the cell */
}

/* HIT: bright burst that spills outside the cell */
.cell.hit {
  background: radial-gradient(circle at 40% 30%,
              rgba(255,240,230,0.98) 0%,
              rgba(255,120,90,0.14) 18%,
              rgba(239,68,68,0.92) 52%,
              #8b0f0f 100%);
  border-color: rgba(255,120,120,0.95);
  box-shadow:
    0 10px 26px rgba(239,68,68,0.28),
    inset 0 4px 12px rgba(255,200,200,0.06);
  z-index: 5;
  color: transparent;
  font-size: 0;
}

/* large burst halo (extends outside cell) */
.cell.hit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240%;      /* intentionally larger than cell */
  height: 240%;
  transform: translate(-50%, -50%) scale(0.6);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%,
      rgba(255,245,220,0.95) 0%,
      rgba(255,180,140,0.12) 25%,
      rgba(239,68,68,0.85) 48%,
      transparent 65%);
  filter: blur(6px) drop-shadow(0 10px 28px rgba(239,68,68,0.28));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
  animation: hit-expand 560ms cubic-bezier(.2,.9,.2,1) forwards;
}

/* sharper flash / shards */
.cell.hit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%) rotate(12deg) scale(0.28);
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(255,220,150,0.95) 0deg 18deg,
    rgba(255,140,110,0.0) 18deg 60deg);
  mix-blend-mode: screen;
  filter: blur(1px);
  pointer-events: none;
  z-index: 4;
  animation: hit-spark 420ms ease-out 70ms forwards;
}

/* Hit keyframes */
@keyframes hit-expand {
  0%   { transform: translate(-50%, -50%) scale(0.28); opacity: 0; }
  55%  { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.98); opacity: .96; }
}
@keyframes hit-spark {
  0%   { transform: translate(-50%, -50%) rotate(12deg) scale(0.28); opacity: 0; }
  55%  { transform: translate(-50%, -50%) rotate(12deg) scale(1.02); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(12deg) scale(1); opacity: 0; }
}

/* MISS: ripple that gently extends beyond the cell */
.cell.miss {
  background: linear-gradient(180deg,
    rgba(13,78,142,0.06) 0%,
    rgba(20,115,230,0.10) 100%);
  border-color: rgba(59,130,246,0.95);
  box-shadow: inset 0 4px 10px rgba(59,130,246,0.05);
  z-index: 4;
  color: transparent;
  font-size: 0;
  /* subtle base glow so misses read at-a-glance */
  outline: 2px solid rgba(96,165,250,0.04);
  transition: outline-color .25s, transform .18s;
}

/* big soft ripple that explodes outward (visible only during animation) */
.cell.miss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320%;            /* larger burst */
  height: 320%;
  transform: translate(-50%, -50%) scale(0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%,
      rgba(255,255,255,0.96) 0%,
      rgba(255,255,255,0.86) 4%,
      rgba(59,130,246,0.22) 36%,
      rgba(59,130,246,0.10) 58%,
      transparent 72%);
  filter: blur(6px) drop-shadow(0 10px 28px rgba(59,130,246,0.12));
  pointer-events: none;
  z-index: 2;
  animation: miss-ripple-ext 1100ms cubic-bezier(.15,.9,.25,1) forwards;
}

/* small ring that pulses outward and fades */
.cell.miss::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  transform: translate(-50%, -50%) scale(0.26);
  border-radius: 50%;
  border: 2px solid rgba(96,165,250,0.18);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  animation: miss-ring-ext 980ms ease-out forwards;
}

/* persistent pin (appears at end so you can see which cells were misses) */
.cell.miss .miss-pin,
.cell.miss[data-miss-pin]::marker { /* fallback selectors - see below for CSS-only approach */ }

/* fallback: create a tiny permanent dot using an adjacent pseudo (uses ::marker alternative only for completeness) */
.cell.miss > .pin { display: none; }

/* Instead, create a small end-state dot using an extra pseudo placed via a very quick animation:
   it's animated to visible only at the end of the ripple so the cell retains an unmistakable marker. */
.cell.miss::marker { /* no-op: kept to avoid linter warnings if browser doesn't support ::marker here */ }

/* we use an additional tiny persistent dot by reusing ::before with final keyframe */
@keyframes miss-ring-ext {
  0%   { transform: translate(-50%, -50%) scale(0.26); opacity: 0; border-color: rgba(96,165,250,0.18); }
  60%  { transform: translate(-50%, -50%) scale(1.24); opacity: 0.78; border-color: rgba(96,165,250,0.36); }
  100% { transform: translate(-50%, -50%) scale(1.00); opacity: 0.22; border-color: rgba(96,165,250,0.42); }
}

/* longer/extreme ripple */
@keyframes miss-ripple-ext {
  0%   { transform: translate(-50%, -50%) scale(0.22); opacity: 1; filter: blur(6px); }
  50%  { transform: translate(-50%, -50%) scale(1.18); opacity: 0.92; filter: blur(6px); }
  85%  { transform: translate(-50%, -50%) scale(1.02); opacity: 0.36; filter: blur(4px); }
  100% { transform: translate(-50%, -50%) scale(1.00); opacity: 0; filter: blur(2px); }
}

/* add a visible end-state indicator using a very short extra animation on a pseudo element overlap.
   Here we overlay a small hollow ring + dot by using an extra pseudo via box-shadow on ::before at the end.
   The ring's opacity is left low so it reads without overpowering the board. */
.cell.miss::before {
  box-shadow:
    0 0 0 2px rgba(96,165,250,0.0),
    0 0 8px rgba(96,165,250,0.0) inset;
}

/* ensure the cell shows a subtle permanent badge after the animations complete by transitioning outline */
.cell.miss { outline-color: rgba(96,165,250,0.22); }

/* ensure no text fallback */
.cell.miss { color: transparent; font-size: 0; }
/* 5. Controls / UI panels ----------------------------------- */
.controls {
  width: 320px;
  max-width: 320px;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--surface) 100%);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
  gap: 12px;
  height: fit-content;
  max-height: 500px;
  overflow-y: auto;
}

.meta {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(255, 255, 255, .03);
  border-radius: 6px;
  font-weight: 500
}

.meta span {
  color: var(--text);
  font-weight: 600
}

/* 6. Components (ships, legend, score) ---------------------- */
.ship-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0
}

.ship {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, .2);
  background: rgba(59, 130, 246, .05);
  cursor: pointer;
  transition: all .2s;
  font-weight: 500
}

.ship:hover {
  background: rgba(59, 130, 246, .1);
  border-color: rgba(59, 130, 246, .4)
}

.ship.selected {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, rgba(59, 130, 246, .2) 0%, rgba(59, 130, 246, .1) 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, .2);
  transform: scale(1.02)
}

.ship .len {
  background: rgba(59, 130, 246, .3);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--primary-light)
}

.legend {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .02);
  border-radius: 6px;
  line-height: 1.5
}

/* 7. Utilities & Responsive --------------------------------- */
.row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap
}

/* Card visuals used by Blackjack etc. keep here for reuse */
.card-visual {
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  color: #111;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .08)
}

.card-visual .pip {
  font-weight: 700
}

/* Make .controls expand to fill its column (override fixed width) when inside .game-wrap */
.game-wrap .controls {
  width: 100%;
  max-width: none;
  flex: 1 1 0
}

/* Responsive tweaks */
@media (max-width:900px) {
  .game-wrap {
    flex-direction: column
  }

  .game-wrap>* {
    flex: 1 1 auto;
    max-width: 100%
  }

  .controls {
    width: 100%;
    max-width: none
  }
}

@media (max-width:700px) {
  .card {
    padding: 20px
  }

  .cell {
    width: var(--cell-size);
    height: var(--cell-size)
  }
}

/* Replace previous .cell.hit / .cell.miss rules with this cartoony explosion (pure CSS).
   The pseudo-elements animate outward and fade — the "spill" is visible only during the animation. */

/* keep base cell styles (position & overflow must permit visual spill) */
.cell { position: relative; overflow: visible; }

/* HIT — cartoony explosive burst */
.cell.hit {
  background: radial-gradient(circle at 35% 30%,
              rgba(255,245,240,0.98) 0%,
              rgba(255,120,90,0.18) 20%,
              rgba(239,68,68,0.95) 60%,
              #7b0b0b 100%);
  border-color: rgba(255,110,110,0.95);
  box-shadow: 0 8px 18px rgba(239,68,68,0.22), inset 0 3px 8px rgba(255,200,200,0.05);
  color: transparent;
  font-size: 0;
  z-index: 4;
}

/* central burst: expanding, fading circle */
.cell.hit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%,
              rgba(255,245,200,0.98) 0%,
              rgba(255,180,140,0.18) 30%,
              rgba(239,68,68,0.85) 58%,
              transparent 75%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 5;
  animation: hit-burst 620ms cubic-bezier(.2,.85,.25,1) forwards;
}

/* particle cluster: small dots created with box-shadow that fly outward and fade */
.cell.hit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,220,140,0.98);
  transform: translate(-50%, -50%) scale(0.9);
  box-shadow:
    0 -10px 0 rgba(255,200,120,0.95),
    8px -6px 0 rgba(255,160,110,0.92),
    12px 2px 0 rgba(255,140,100,0.9),
    6px 12px 0 rgba(255,120,90,0.84),
    -6px 10px 0 rgba(255,180,120,0.88),
    -12px 2px 0 rgba(255,140,100,0.86),
    -8px -8px 0 rgba(255,160,110,0.9);
  filter: blur(.6px) drop-shadow(0 6px 14px rgba(239,68,68,0.15));
  pointer-events: none;
  z-index: 6;
  animation: hit-shards 820ms cubic-bezier(.2,.85,.25,1) forwards;
}

/* MISS — cartoony splash/ripple */
.cell.miss {
  background: linear-gradient(180deg, rgba(59,130,246,0.06) 0%, rgba(59,130,246,0.12) 100%);
  border-color: rgba(96,165,250,0.9);
  box-shadow: inset 0 3px 8px rgba(96,165,250,0.05);
  color: transparent;
  font-size: 0;
  z-index: 3;
}

/* soft inner splash that expands then fades */
.cell.miss::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
              rgba(255,255,255,0.95) 0%,
              rgba(255,255,255,0.85) 6%,
              rgba(59,130,246,0.18) 40%,
              transparent 70%);
  filter: blur(3px);
  pointer-events: none;
  z-index: 4;
  animation: miss-splash 900ms cubic-bezier(.2,.9,.3,1) forwards;
}

/* outward ripple ring */
.cell.miss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 30%;
  transform: translate(-50%, -50%) scale(0.4);
  border-radius: 50%;
  border: 2px solid rgba(96,165,250,0.18);
  opacity: 0.0;
  pointer-events: none;
  z-index: 5;
  animation: miss-ring 920ms ease-out forwards;
}

/* KEYFRAMES */
@keyframes hit-burst {
  0%   { transform: translate(-50%, -50%) scale(0.18); opacity: 1; }
  55%  { transform: translate(-50%, -50%) scale(1.12); opacity: 0.98; }
  100% { transform: translate(-50%, -50%) scale(1.0); opacity: 0.0; } /* fades away */
}
@keyframes hit-shards {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 1;
    filter: blur(.6px) drop-shadow(0 6px 14px rgba(239,68,68,0.15));
    box-shadow:
      0 -10px 0 rgba(255,200,120,0.95),
      8px -6px 0 rgba(255,160,110,0.92),
      12px 2px 0 rgba(255,140,100,0.9),
      6px 12px 0 rgba(255,120,90,0.84),
      -6px 10px 0 rgba(255,180,120,0.88),
      -12px 2px 0 rgba(255,140,100,0.86),
      -8px -8px 0 rgba(255,160,110,0.9);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.9;
    box-shadow:
      0 -36px 0 rgba(255,200,120,0.0),
      24px -20px 0 rgba(255,160,110,0.0),
      36px 6px 0 rgba(255,140,100,0.0),
      18px 36px 0 rgba(255,120,90,0.0),
      -18px 30px 0 rgba(255,180,120,0.0),
      -36px 6px 0 rgba(255,140,100,0.0),
      -24px -24px 0 rgba(255,160,110,0.0);
    filter: blur(1.6px) drop-shadow(0 12px 20px rgba(239,68,68,0.16));
  }
  100% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 0;
    box-shadow: none;
    filter: blur(0);
  }
}

@keyframes miss-splash {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  45%  { transform: translate(-50%, -50%) scale(1.05); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1.00); opacity: 0; }
}
@keyframes miss-ring {
  0%   { transform: translate(-50%, -50%) scale(0.36); opacity: 0; }
  55%  { transform: translate(-50%, -50%) scale(1.12); opacity: 0.78; }
  100% { transform: translate(-50%, -50%) scale(1.00); opacity: 0; }
}

#opponentBoard.active {
  position: relative;           /* needed for pseudo-element highlighting */
  border: 2px solid rgba(255,215,0,0.95); /* solid thin yellow border */
  border-radius: 8px;
  transition: box-shadow .18s ease, transform .18s ease;
  box-shadow: 0 6px 18px rgba(255,200,60,1.0); /* subtle base depth */
}

#gameStatus {
  flex: 1;
  font-size: 3rem;
  justify-content: center;
}

/* place after existing #gameStatus rules to override */
#gameStatus {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(920px, calc(100% - 48px));
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(96,165,250,0.06);
  backdrop-filter: blur(6px) saturate(120%);
  color: #e6f6ff;
  font-size: clamp(1rem, 2.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-align: center;
  box-shadow: 0 14px 34px rgba(2,6,23,0.55), inset 0 -4px 14px rgba(96,165,250,0.02);
  z-index: 40;
}

/* small glowing accent dot on the left and a gentle pulse */
#gameStatus::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7d6 0%, #ffd54d 28%, #ff9800 60%);
  box-shadow: 0 6px 18px rgba(255,170,60,0.22), 0 0 8px rgba(255,183,77,0.14);
  transform: translateY(-1px);
  flex: 0 0 auto;
  animation: status-dot-pulse 2400ms ease-in-out infinite;
}

/* readable text glow */
#gameStatus span {
  text-shadow: 0 2px 10px rgba(3,12,30,0.45), 0 1px 0 rgba(255,255,255,0.02);
}

/* subtle attention animation you can toggle by adding .pulse to #gameStatus */
#gameStatus.pulse {
  transform: translateX(-50%) translateY(-6px);
  transition: transform .28s cubic-bezier(.2,.9,.2);
}
#gameStatus.pulse::before { animation-duration: 1200ms; }

/* reduced motion respects user preference */
@media (prefers-reduced-motion: reduce) {
  #gameStatus::before,
  #gameStatus.pulse { animation: none; transition: none; transform: translateX(-50%); }
}

/* keyframes */
@keyframes status-dot-pulse {
  0%   { transform: translateY(-1px) scale(0.94); opacity: 0.9; box-shadow: 0 6px 18px rgba(255,170,60,0.22); }
  50%  { transform: translateY(-3px) scale(1.06); opacity: 1; box-shadow: 0 18px 40px rgba(255,170,60,0.28); }
  100% { transform: translateY(-1px) scale(0.94); opacity: 0.9; box-shadow: 0 6px 18px rgba(255,170,60,0.22); }
}