/* ============================================================
   NAVAL STRIKE — Cyberpunk Battleship Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  /* Core palette */
  --bg-deep:    #06080f;
  --bg-surface: #0c1020;
  --bg-card:    #111630;
  --bg-hover:   #181e45;
  --border:     #1a2255;
  --border-bright: #2a3680;

  /* Neons */
  --cyan:       #00f0ff;
  --cyan-dim:   #007a82;
  --magenta:    #ff2daa;
  --magenta-dim:#8a1860;
  --gold:       #ffd700;
  --green:      #00ff88;
  --red:        #ff3355;
  --blue:       #4477ff;

  /* Dynamic (overridden by skins) */
  --glow:       rgba(0,240,255,.15);
  --cell-hover: rgba(0,240,255,.2);

  /* Text */
  --text:       #c8d0e8;
  --text-dim:   #6a7499;
  --text-bright:#eaf0ff;

  /* Grid */
  --cell-size:  42px;
  --grid-gap:   3px;
  --board-pad:  8px;

  /* Sizing */
  --header-h:   64px;

  /* Glow */
  --glow-cyan:   0 0 20px rgba(0,240,255,.35), 0 0 60px rgba(0,240,255,.12);
  --glow-mag:    0 0 20px rgba(255,45,170,.35), 0 0 60px rgba(255,45,170,.12);
  --glow-gold:   0 0 20px rgba(255,215,0,.35), 0 0 60px rgba(255,215,0,.12);
}

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

html { font-size: 16px; }

body {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background grid pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0,240,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle radial glow */
body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, rgba(0,240,255,.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  position: relative;
  z-index: 2;
  min-height: 100vh;
  animation: fadeIn .4s ease;
}
.screen.active { display: block; }

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

/* ============================================================
   LANDING SCREEN
   ============================================================ */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  gap: 40px;
}

.logo-wrap {
  text-align: center;
  position: relative;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 200px;
  background: radial-gradient(ellipse at center, rgba(0,240,255,.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: .08em;
  color: var(--text-bright);
  text-shadow: 0 0 40px rgba(0,240,255,.4);
  position: relative;
}

.logo-accent {
  color: var(--cyan);
  text-shadow: 0 0 40px rgba(0,240,255,.6), 0 0 80px rgba(0,240,255,.3);
}

.tagline {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  color: var(--text-dim);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Wallet */
.wallet-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.wallet-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.wallet-address {
  font-family: 'Share Tech Mono', monospace;
  font-size: .85rem;
  color: var(--cyan);
  letter-spacing: .05em;
}

.wallet-balance {
  font-family: 'Orbitron', sans-serif;
  font-size: .95rem;
  color: var(--text-bright);
}

.bal-sep {
  color: var(--text-dim);
  margin: 0 8px;
}

.wallet-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* Menu */
.menu-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 680px;
  animation: fadeIn .5s ease;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
}

/* Mode Cards */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

.mode-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top center, rgba(0,240,255,.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
}

.mode-card:hover, .mode-card.selected {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-4px);
}
.mode-card:hover::before, .mode-card.selected::before { opacity: 1; }

.mode-card.selected {
  border-color: var(--cyan);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0,240,255,.08) 100%);
}

/* Locked / Coming Soon cards */
.mode-card-locked {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(0.3);
  position: relative;
}
.mode-card-locked:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}
.mode-card-locked::before { display: none; }

.coming-soon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--magenta) 0%, #ff6600 100%);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: .55rem;
  letter-spacing: .1em;
  padding: 3px 10px;
  border-radius: 6px;
  z-index: 5;
  box-shadow: 0 2px 12px rgba(255,45,170,.5);
  animation: badgePulse 2s ease-in-out infinite;
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(255,45,170,.3); }
  50% { box-shadow: 0 2px 24px rgba(255,45,170,.7); }
}

.mode-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(0,240,255,.4));
}

.mode-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.mode-card p {
  font-size: .95rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.mode-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: 'Share Tech Mono', monospace;
  font-size: .75rem;
  letter-spacing: .08em;
  background: rgba(0,240,255,.1);
  color: var(--cyan);
  border: 1px solid rgba(0,240,255,.2);
}

.mode-tag-hot {
  background: rgba(255,45,170,.1);
  color: var(--magenta);
  border-color: rgba(255,45,170,.25);
}

/* Bet Section */
.bet-section {
  width: 100%;
  animation: fadeIn .3s ease;
}

.bet-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.token-select {
  display: flex;
  gap: 8px;
}

.token-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  padding: 10px 28px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .08em;
}

.token-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,240,255,.08);
  box-shadow: 0 0 12px rgba(0,240,255,.2);
}

.token-btn:hover:not(.active) {
  border-color: var(--border-bright);
  color: var(--text);
}

.bet-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px 20px;
  transition: border-color .2s;
}

.bet-input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,240,255,.15);
}

.bet-input {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  width: 160px;
  background: transparent;
  border: none;
  color: var(--text-bright);
  outline: none;
}

.bet-input::placeholder { color: var(--text-dim); opacity: .4; }

.bet-token-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--cyan);
}

.bet-presets {
  display: flex;
  gap: 8px;
}

.preset-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: .85rem;
  padding: 6px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s;
}

.preset-btn:hover {
  border-color: var(--cyan-dim);
  color: var(--cyan);
  background: rgba(0,240,255,.05);
}

.bet-pot {
  text-align: center;
  margin-top: 8px;
  animation: fadeIn .3s ease;
}

.pot-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: .8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .15em;
}

.pot-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,215,0,.4);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .08em;
  padding: 12px 32px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dim) 0%, var(--cyan) 100%);
  color: var(--bg-deep);
  border-color: var(--cyan);
}

.btn-primary:hover {
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-glow {
  animation: btnPulse 3s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0,240,255,.2); }
  50%      { box-shadow: 0 0 30px rgba(0,240,255,.45); }
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--cyan-dim);
  color: var(--cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
  font-size: .85rem;
  padding: 8px 16px;
}

.btn-ghost:hover { color: var(--cyan); }

.btn-large {
  padding: 16px 48px;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   GAME HEADER
   ============================================================ */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(12,16,32,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-center { text-align: center; flex: 1; }

.phase-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-bright);
  letter-spacing: .1em;
}

.phase-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: .8rem;
  color: var(--cyan);
  margin-top: 2px;
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.turn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(0,255,136,.6);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.turn-indicator.enemy .turn-dot {
  background: var(--red);
  box-shadow: 0 0 12px rgba(255,51,85,.6);
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .6; transform: scale(.8); }
}

.score-display {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
}

.score-you { color: var(--cyan); }
.score-sep { color: var(--text-dim); margin: 0 6px; }
.score-enemy { color: var(--red); }

.mini-wallet {
  font-family: 'Share Tech Mono', monospace;
  font-size: .75rem;
  color: var(--text-dim);
}

/* ============================================================
   GAME BOARDS
   ============================================================ */
.placement-area, .battle-area {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  flex-wrap: wrap;
}

.board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.board-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.board {
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  grid-template-rows: repeat(10, var(--cell-size));
  gap: var(--grid-gap);
  padding: var(--board-pad);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  position: relative;
}

.board::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0,240,255,.15), transparent 40%, transparent 60%, rgba(0,240,255,.1));
  pointer-events: none;
  z-index: 0;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: rgba(0,240,255,.03);
  border: 1px solid rgba(0,240,255,.08);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.cell:hover {
  background: rgba(0,240,255,.1);
  border-color: rgba(0,240,255,.25);
}

/* Ship cells */
.cell.ship {
  background: linear-gradient(135deg, rgba(0,122,130,.3) 0%, rgba(0,240,255,.15) 100%);
  border-color: rgba(0,240,255,.3);
  box-shadow: inset 0 0 8px rgba(0,240,255,.15);
}

/* Ship being placed (preview) */
.cell.preview {
  background: rgba(0,240,255,.2);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0,240,255,.3);
}

.cell.preview-invalid {
  background: rgba(255,51,85,.15);
  border-color: rgba(255,51,85,.5);
}

/* Hit / Miss */
.cell.hit {
  background: radial-gradient(circle, rgba(255,51,85,.6) 0%, rgba(255,51,85,.15) 70%);
  border-color: var(--red);
  animation: hitFlash .5s ease;
}

.cell.hit::after {
  content: '💥';
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px rgba(255,51,85,.8));
}

.cell.miss {
  background: rgba(100,120,180,.08);
  border-color: rgba(100,120,180,.2);
}

.cell.miss::after {
  content: '•';
  font-size: 1.4rem;
  color: var(--text-dim);
  opacity: .5;
}

.cell.sunk {
  background: radial-gradient(circle, rgba(255,45,170,.5) 0%, rgba(255,45,170,.1) 70%);
  border-color: var(--magenta);
  animation: sunkFlash .6s ease;
}

.cell.sunk::after {
  content: '💀';
  font-size: 1rem;
}

@keyframes hitFlash {
  0%   { transform: scale(1.3); box-shadow: 0 0 25px rgba(255,51,85,.8); }
  100% { transform: scale(1); }
}

@keyframes sunkFlash {
  0%   { transform: scale(1.2); box-shadow: 0 0 30px rgba(255,45,170,.9); }
  100% { transform: scale(1); }
}

/* Enemy board cells */
#board-enemy .cell.ship {
  background: rgba(0,240,255,.03);
  border-color: rgba(0,240,255,.08);
  box-shadow: none;
}

#board-enemy .cell.sunk {
  background: radial-gradient(circle, rgba(255,45,170,.4) 0%, rgba(255,45,170,.08) 70%);
  border-color: var(--magenta);
}

/* ============================================================
   FLEET ROSTER & STATUS
   ============================================================ */
.fleet-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.roster-ship {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}

.roster-ship:hover { border-color: var(--cyan-dim); }
.roster-ship.active {
  border-color: var(--cyan);
  background: rgba(0,240,255,.06);
  box-shadow: 0 0 12px rgba(0,240,255,.1);
}
.roster-ship.placed {
  border-color: var(--green);
}
.roster-ship.placed:hover {
  opacity: .85;
  border-color: var(--cyan);
  background: rgba(0,240,255,.04);
}

.roster-ship .ship-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--text-bright);
  flex: 1;
}

.roster-ship .ship-len {
  font-family: 'Share Tech Mono', monospace;
  font-size: .75rem;
  color: var(--text-dim);
}

.roster-ship .ship-pips {
  display: flex;
  gap: 3px;
}

.roster-ship .pip {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(0,240,255,.15);
  border: 1px solid rgba(0,240,255,.3);
}

.roster-ship.placed .pip {
  background: rgba(0,255,136,.2);
  border-color: rgba(0,255,136,.4);
}

.placement-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.fleet-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

.fleet-pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: .6;
  transition: all .3s;
}

.fleet-pip.dead {
  background: var(--red);
  opacity: .3;
}

/* ============================================================
   BATTLE LOG
   ============================================================ */
.battle-log {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.log-entry {
  font-family: 'Share Tech Mono', monospace;
  font-size: .8rem;
  color: var(--text-dim);
  padding: 2px 0;
  animation: fadeIn .3s ease;
}

.log-entry.hit { color: var(--red); }
.log-entry.miss { color: var(--text-dim); }
.log-entry.sunk { color: var(--magenta); font-weight: 700; }
.log-entry.info { color: var(--cyan); }

/* ============================================================
   WAITING OVERLAY
   ============================================================ */
.waiting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,15,.92);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .3s ease;
}

.waiting-overlay.hidden { display: none; }

.waiting-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.waiting-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.waiting-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-bright);
}

.waiting-content p {
  color: var(--text-dim);
  max-width: 300px;
}

/* ============================================================
   RESULT SCREEN
   ============================================================ */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
  padding: 40px 20px;
}

.result-icon {
  font-size: 5rem;
  animation: resultBounce .6s ease;
}

@keyframes resultBounce {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.result-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: .1em;
}

.result-title.win {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(255,215,0,.5);
}

.result-title.lose {
  color: var(--red);
  text-shadow: 0 0 40px rgba(255,51,85,.4);
}

.result-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  text-align: center;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-card .stat-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--cyan);
}

.stat-card .stat-lbl {
  font-size: .75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 4px;
}

.result-payout {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 20px 32px;
  text-align: center;
  box-shadow: var(--glow-gold);
  animation: fadeIn .5s ease .3s both;
}

.result-payout .payout-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: .8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.result-payout .payout-amount {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  color: var(--gold);
}

.result-actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   BATTLE BET DISPLAY
   ============================================================ */
.bet-display {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--gold);
  background: rgba(255,215,0,.08);
  border: 1px solid rgba(255,215,0,.2);
  border-radius: 8px;
  padding: 4px 16px;
  display: inline-block;
  margin-top: 4px;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  max-width: 320px;
}

.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red); color: var(--red); }
.toast.info    { border-color: var(--cyan); color: var(--cyan); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ============================================================
   LOBBY
   ============================================================ */
.lobby-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 24px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.lobby-create {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lobby-create .bet-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lobby-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-games {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.lobby-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: .85rem;
  padding: 30px 0;
}

.lobby-game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all .2s;
}

.lobby-game-card:hover {
  border-color: var(--cyan-dim);
  background: var(--bg-hover);
}

.lobby-game-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lobby-game-creator {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-bright);
}

.lobby-game-bet {
  font-family: 'Share Tech Mono', monospace;
  font-size: .75rem;
  color: var(--gold);
}

.lobby-waiting {
  position: fixed;
  inset: 0;
  background: rgba(6,8,15,.92);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: fadeIn .3s ease;
}

.lobby-waiting h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-bright);
}

.lobby-waiting p {
  color: var(--text-dim);
  font-size: .9rem;
}

/* ============================================================
   SCOREBOARD
   ============================================================ */
.scoreboard {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  text-align: center;
}

.scoreboard .section-title {
  margin-bottom: 14px;
  font-size: 1rem;
}

.scoreboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sb-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--cyan);
}

.sb-stat-gold .sb-val {
  color: var(--gold);
}

.sb-lbl {
  font-family: 'Share Tech Mono', monospace;
  font-size: .7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sb-username {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sb-name-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: .75rem;
  color: var(--text-dim);
}

.sb-name-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--gold);
  letter-spacing: .05em;
}

/* ============================================================
   USERNAME
   ============================================================ */
.username-section {
  width: 100%;
  max-width: 360px;
  animation: fadeIn .3s ease;
}

.username-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--cyan-dim);
  border-radius: 12px;
}

.username-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.username-input-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
}

.username-input {
  flex: 1;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-bright);
  outline: none;
  letter-spacing: .1em;
  transition: border-color .2s;
}

.username-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,.2);
}

.username-input::placeholder {
  color: var(--text-dim);
  opacity: .4;
  font-size: .8rem;
}

/* ============================================================
   TURN TIMER
   ============================================================ */
.turn-timer {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--cyan);
  background: var(--bg-surface);
  border: 2px solid var(--cyan-dim);
  border-radius: 8px;
  min-width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-left: 8px;
  transition: all .3s;
}

.turn-timer.warning {
  color: var(--gold);
  border-color: rgba(255,215,0,.4);
  animation: timerPulse .5s ease-in-out infinite;
}

.turn-timer.critical {
  color: var(--red);
  border-color: var(--red);
  animation: timerPulse .3s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }

/* Splash screen */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(180deg, #04060e 0%, #081025 40%, #0a1a3a 70%, #0c2040 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.splash-screen.hidden { display: none; }

/* Stars */
.splash-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 30% 25%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 85% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 15% 40%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 45% 35%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 65% 45%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 90% 12%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 25% 50%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.5px 1.5px at 80% 42%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 55% 8%, rgba(255,255,255,.5), transparent);
  animation: starsTwinkle 4s ease-in-out infinite alternate;
}
@keyframes starsTwinkle {
  0% { opacity: .6; }
  100% { opacity: 1; }
}

/* Fog layers */
.splash-fog {
  position: absolute;
  width: 200%;
  height: 30%;
  opacity: .08;
  pointer-events: none;
}
.splash-fog-1 {
  bottom: 25%;
  left: -50%;
  background: radial-gradient(ellipse at center, rgba(0,200,255,.3), transparent 70%);
  animation: fogDrift 20s ease-in-out infinite alternate;
}
.splash-fog-2 {
  bottom: 35%;
  left: -30%;
  background: radial-gradient(ellipse at center, rgba(0,150,255,.2), transparent 70%);
  animation: fogDrift 28s ease-in-out infinite alternate-reverse;
}
@keyframes fogDrift {
  0% { transform: translateX(-10%); }
  100% { transform: translateX(10%); }
}

/* Ocean waves */
.splash-ocean {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%;
  overflow: hidden;
}
.splash-wave {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 100%;
  border-radius: 50% 50% 0 0;
}
.splash-wave-1 {
  background: rgba(0,40,80,.6);
  animation: waveMove 6s ease-in-out infinite;
  bottom: -10px;
}
.splash-wave-2 {
  background: rgba(0,60,100,.4);
  animation: waveMove 8s ease-in-out infinite reverse;
  bottom: -5px;
  height: 90%;
}
.splash-wave-3 {
  background: rgba(0,80,120,.3);
  animation: waveMove 10s ease-in-out infinite;
  bottom: 0;
  height: 80%;
}
@keyframes waveMove {
  0%, 100% { transform: translateX(-2%) scaleY(1); }
  50% { transform: translateX(2%) scaleY(1.15); }
}

/* Ship silhouettes */
.splash-fleet {
  position: absolute;
  bottom: 18%;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
}
.splash-warship {
  position: absolute;
  background: rgba(0,20,40,.8);
  clip-path: polygon(0% 60%, 8% 30%, 15% 25%, 50% 20%, 75% 25%, 90% 30%, 100% 50%, 95% 100%, 5% 100%);
}
.splash-warship-far {
  width: 60px;
  height: 20px;
  right: 15%;
  bottom: 20px;
  opacity: .25;
  animation: shipSail 30s linear infinite;
}
.splash-warship-mid {
  width: 90px;
  height: 28px;
  left: 20%;
  bottom: 30px;
  opacity: .35;
  animation: shipSail 24s linear infinite reverse;
}
.splash-warship-near {
  width: 130px;
  height: 36px;
  right: 30%;
  bottom: 40px;
  opacity: .15;
  animation: shipSail 18s linear infinite;
}
@keyframes shipSail {
  0% { transform: translateX(-10vw); }
  100% { transform: translateX(10vw); }
}

/* Main content */
.splash-content {
  text-align: center;
  position: relative;
  z-index: 10;
  padding: 24px;
  max-width: 560px;
  animation: splashFadeIn 1.2s ease both;
}
@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Emblem */
.splash-emblem {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
}
.splash-emblem-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(0,240,255,.3);
  border-radius: 50%;
  animation: emblemSpin 12s linear infinite;
  border-top-color: var(--cyan);
}
@keyframes emblemSpin {
  to { transform: rotate(360deg); }
}
.splash-emblem-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(0,240,255,.5));
}

/* Title */
.splash-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 3.5rem);
  letter-spacing: .08em;
  color: var(--text-bright);
  margin-bottom: 8px;
  text-shadow: 0 0 40px rgba(0,240,255,.3);
}
.splash-title-accent {
  color: var(--cyan);
  text-shadow: 0 0 40px rgba(0,240,255,.5), 0 0 80px rgba(0,240,255,.2);
}

/* Divider */
.splash-divider {
  width: 120px;
  height: 2px;
  margin: 12px auto 20px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: .5;
}

/* Lore */
.splash-lore {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.splash-lore-accent {
  color: var(--cyan);
  font-weight: 600;
  font-size: 1.05rem;
}

/* Enter button */
.splash-enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 48px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .12em;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--cyan-dim), var(--cyan));
  border: 2px solid var(--cyan);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: all .3s ease;
  margin-bottom: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.splash-enter-btn:hover, .splash-enter-btn:active {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(0,240,255,.5), 0 0 60px rgba(0,240,255,.2);
}
.splash-enter-glow {
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,240,255,.3), transparent, rgba(0,240,255,.3));
  animation: enterGlow 2s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
@keyframes enterGlow {
  0%, 100% { opacity: .3; }
  50% { opacity: .7; }
}
.splash-enter-icon { font-size: 1.3rem; }
.splash-enter-text { position: relative; z-index: 1; }

.splash-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: .65rem;
  color: var(--text-dim);
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: .3;
}

/* Mobile */
@media (max-width: 440px) {
  .splash-enter-btn { padding: 16px 32px; font-size: .95rem; }
  .splash-lore { font-size: .9rem; padding: 0 8px; }
  .splash-fleet { bottom: 14%; }
}


/* Audio buttons (top-right, small) */
.audio-buttons {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 9999;
  display: flex;
  gap: 6px;
}
.audio-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(12,16,32,.85);
  backdrop-filter: blur(6px);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  padding: 0;
  line-height: 1;
}
.audio-btn:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 10px rgba(0,240,255,.25);
}
.audio-btn.off {
  opacity: .45;
  border-color: var(--red);
}
.audio-btn.off:hover {
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(255,51,85,.25);
}

/* ============================================================
   MOBILE-FIRST RESPONSIVE
   ============================================================ */

/* Tablet / small desktop */
@media (max-width: 960px) {
  :root { --cell-size: 36px; }
  .battle-area, .placement-area {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .battle-divider { display: none; }
  .placement-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .fleet-roster { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* Phone landscape + small tablets */
@media (max-width: 700px) {
  :root {
    --cell-size: 32px;
    --grid-gap: 2px;
    --board-pad: 5px;
  }

  .game-header {
    padding: 0 10px;
    height: 52px;
  }
  .phase-title { font-size: .8rem; }
  .phase-sub { font-size: .7rem; }
  .score-display { font-size: 1rem; }

  .landing-container { padding: 20px 16px; gap: 28px; }
  .logo { font-size: 2.6rem; }
  .tagline { font-size: .85rem; }

  .mode-cards { grid-template-columns: 1fr; gap: 14px; }
  .mode-card { padding: 20px 16px; }
  .mode-icon { font-size: 2.2rem; }

  .bet-input { font-size: 1.4rem; width: 120px; }
  .preset-btn { padding: 8px 16px; font-size: .9rem; }
  .token-btn { padding: 10px 22px; }

  .btn { padding: 14px 28px; font-size: .85rem; }
  .btn-large { padding: 16px 36px; font-size: .95rem; }

  /* Placement */
  .placement-area { padding: 16px 10px; gap: 16px; }
  .roster-ship { padding: 6px 10px; gap: 6px; }
  .roster-ship .ship-name { font-size: .7rem; }
  .placement-actions { gap: 8px; }
  .placement-actions .btn { padding: 10px 16px; font-size: .75rem; }

  /* Battle */
  .battle-area { padding: 16px 10px; gap: 16px; }
  .board-wrap { gap: 6px; }
  .board-label { font-size: .65rem; }
  .battle-log { max-height: 80px; padding: 8px 16px; }
  .log-entry { font-size: .7rem; }

  /* Result */
  .result-container { padding: 24px 16px; gap: 16px; }
  .result-icon { font-size: 3.5rem; }
  .result-title { font-size: 2rem; }
  .result-sub { font-size: .95rem; }
  .result-stats { gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-val { font-size: 1.2rem; }
}

/* Phone portrait — primary mobile target */
@media (max-width: 440px) {
  :root {
    --cell-size: 30px;
    --grid-gap: 2px;
    --board-pad: 4px;
  }

  .landing-container { padding: 16px 12px; gap: 24px; }
  .logo { font-size: 2.2rem; }
  .tagline { font-size: .75rem; letter-spacing: .1em; }
  .section-title { font-size: 1rem; }

  .mode-card { padding: 16px 14px; }
  .mode-card h3 { font-size: 1rem; }
  .mode-card p { font-size: .85rem; margin-bottom: 8px; }

  .wallet-section { width: 100%; }
  .wallet-section .btn { width: 100%; }
  .wallet-info { width: 100%; padding: 10px 16px; }

  .bet-section { width: 100%; }
  .bet-controls { gap: 12px; }
  .bet-input-wrap { padding: 6px 14px; }
  .bet-input { font-size: 1.3rem; width: 100px; }
  .bet-token-label { font-size: .85rem; }
  .presets .preset-btn { padding: 8px 14px; font-size: .8rem; }

  .btn-start { width: 100%; }
  .btn-large { width: 100%; padding: 16px 24px; }

  .game-header { height: 48px; padding: 0 8px; }
  .phase-title { font-size: .7rem; letter-spacing: .06em; }
  .turn-indicator { font-size: .7rem; }
  .turn-dot { width: 8px; height: 8px; }
  .score-display { font-size: .9rem; }

  .board-label { font-size: .6rem; letter-spacing: .1em; }

  /* On phone portrait, show only the ENEMY board prominently during battle */
  .battle-area .board-wrap:first-child {
    order: 2;
    opacity: .7;
    transform: scale(.75);
    transform-origin: top center;
    margin-bottom: -20px;
  }
  .battle-area .board-wrap:last-child {
    order: 1;
  }
  .battle-divider { display: none; }

  .fleet-status { gap: 4px; }
  .fleet-pip { width: 6px; height: 6px; }

  .battle-log { max-height: 60px; padding: 6px 12px; font-size: .65rem; }

  /* Placement */
  .placement-area { padding: 12px 8px; gap: 12px; }
  .fleet-roster { gap: 6px; }
  .roster-ship { padding: 5px 8px; gap: 4px; }
  .roster-ship .pip { width: 8px; height: 8px; }
  .placement-actions { gap: 6px; }
  .placement-actions .btn { padding: 10px 14px; font-size: .7rem; }

  /* Result */
  .result-title { font-size: 1.8rem; }
  .result-payout .payout-amount { font-size: 1.5rem; }
  .result-actions { flex-direction: column; width: 100%; }
  .result-actions .btn { width: 100%; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ============================================================
   DRAG-TO-PLACE SHIP PLACEMENT
   ============================================================ */
.drag-ghost {
  position: fixed;
  display: flex;
  gap: 2px;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.85;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, .6));
}
.drag-ghost.vertical { flex-direction: column; }
.drag-pip {
  flex: 1;
  background: rgba(0, 240, 255, .35);
  border: 2px solid rgba(0, 240, 255, .7);
  border-radius: 4px;
}

/* Roster ship draggable indicator */
.roster-ship.draggable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.roster-ship.draggable:active {
  cursor: grabbing;
  transform: scale(0.97);
  opacity: 0.7;
}
.roster-ship.placed {
  opacity: 0.55;
}
.roster-ship.placed .ship-len::after {
  content: ' ✓';
  color: var(--green, #00ff88);
}

/* Ship cells on the board — cursor hint */
#board-place .cell.ship {
  cursor: grab;
  touch-action: none;
}
#board-place .cell.ship:active {
  cursor: grabbing;
}

/* ============================================================
   BATTLE ANIMATIONS
   ============================================================ */

/* Explosion on hit cell */
@keyframes explosion-ring {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  60% { transform: translate(-50%,-50%) scale(2.5); opacity: 0.7; }
  100% { transform: translate(-50%,-50%) scale(3.5); opacity: 0; }
}
@keyframes explosion-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.anim-explosion {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
}
.anim-explosion .ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 60%;
  border-radius: 50%;
  border: 3px solid #ff4422;
  box-shadow: 0 0 20px #ff4422, 0 0 40px #ff660088, inset 0 0 10px #ff442288;
  animation: explosion-ring 0.5s ease-out forwards;
}
.anim-explosion .flash {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle, #ffaa00 0%, #ff4400 40%, transparent 70%);
  animation: explosion-flash 0.4s ease-out forwards;
  border-radius: 4px;
}

/* Miss splash */
@keyframes splash-ring {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(2); opacity: 0; }
}
.anim-splash {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  width: 100%; height: 100%;
  top: 0; left: 0;
}
.anim-splash .ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 60%;
  border-radius: 50%;
  border: 2px solid #4488ff;
  box-shadow: 0 0 12px #4488ff88;
  animation: splash-ring 0.5s ease-out forwards;
}

/* Projectile flying between boards */
@keyframes projectile-fly {
  0% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(0.3); }
}
.anim-projectile {
  position: fixed;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ffaa00;
  box-shadow: 0 0 8px #ff6600, 0 0 16px #ff440088;
  pointer-events: none;
  z-index: 10000;
  transition: left 0.3s cubic-bezier(.25,.46,.45,.94), top 0.3s cubic-bezier(.25,.46,.45,.94);
}
.anim-projectile.miss {
  background: #4488ff;
  box-shadow: 0 0 8px #2266ff, 0 0 16px #4488ff88;
}

/* Ship sinking shake */
@keyframes ship-sink {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3px, -2px); }
  20% { transform: translate(3px, 1px); }
  30% { transform: translate(-2px, 3px); }
  40% { transform: translate(2px, -2px); }
  50% { transform: translate(-1px, 2px); }
  60% { transform: translate(1px, -1px); }
  70% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -3px); }
  90% { transform: translate(-1px, 1px); }
}
@keyframes ship-sink-flash {
  0% { background: #ff4400; box-shadow: 0 0 15px #ff4400; }
  25% { background: #ff8800; box-shadow: 0 0 20px #ff8800; }
  50% { background: #ff4400; box-shadow: 0 0 25px #ff4400; }
  75% { background: #ff2200; box-shadow: 0 0 15px #ff2200; }
  100% { background: #880000; box-shadow: 0 0 8px #880000; }
}
.cell.sinking {
  animation: ship-sink 0.6s ease-in-out, ship-sink-flash 0.6s ease-in-out;
}

/* Cell hit impact shake */
@keyframes cell-shake {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-2px, -1px); }
  40% { transform: translate(2px, 1px); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(1px, -1px); }
}
.cell.impact {
  animation: cell-shake 0.3s ease-out;
}

/* Hit cell glow pulse */
@keyframes hit-glow {
  0% { box-shadow: 0 0 12px #ff4400, inset 0 0 8px #ff4400; }
  50% { box-shadow: 0 0 20px #ff6600, inset 0 0 12px #ff6600; }
  100% { box-shadow: none; }
}
.cell.hit-new {
  animation: hit-glow 1s ease-out forwards;
}

/* ============================================================
   DIFFICULTY SELECTOR
   ============================================================ */
.difficulty-section { margin-top: 16px; }
.difficulty-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.diff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  min-width: 80px;
}
.diff-card:active { transform: scale(0.95); }
.diff-card.active {
  border-color: var(--cyan);
  background: rgba(0,240,255,.08);
  box-shadow: 0 0 12px rgba(0,240,255,.15);
}
.diff-icon { font-size: 1.6rem; }
.diff-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--text-bright);
}
.diff-desc {
  font-size: .6rem;
  color: var(--text-dim);
  text-align: center;
}
@media (max-width: 400px) {
  .diff-card { padding: 8px 10px; min-width: 65px; }
  .diff-icon { font-size: 1.3rem; }
  .diff-name { font-size: .65rem; }
}

/* ============================================================
   DIFFICULTY SELECTOR
   ============================================================ */
.difficulty-section { margin-top: 16px; }
.difficulty-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.diff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  min-width: 80px;
}
.diff-card:active { transform: scale(0.95); }
.diff-card.active {
  border-color: var(--cyan);
  background: rgba(0,240,255,.08);
  box-shadow: 0 0 12px rgba(0,240,255,.15);
}
.diff-icon { font-size: 1.6rem; }
.diff-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--text-bright);
}
.diff-desc {
  font-size: .6rem;
  color: var(--text-dim);
  text-align: center;
}
@media (max-width: 400px) {
  .diff-card { padding: 8px 10px; min-width: 65px; }
  .diff-icon { font-size: 1.3rem; }
  .diff-name { font-size: .65rem; }
}

/* ============================================================
   WATER EFFECT — subtle breathing glow
   ============================================================ */
@keyframes water-breathe {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(0, 140, 255, .12),
      0 0 30px rgba(0, 100, 200, .06),
      inset 0 0 8px rgba(0, 140, 255, .04);
  }
  50% {
    box-shadow:
      0 0 20px rgba(0, 180, 255, .2),
      0 0 45px rgba(0, 120, 220, .1),
      inset 0 0 12px rgba(0, 180, 255, .06);
  }
}

.board-wrap.water-effect {
  position: relative;
}

.board-wrap.water-effect .board {
  border: 1px solid rgba(0, 160, 255, .15);
  border-radius: 4px;
  animation: water-breathe 4s ease-in-out infinite;
}

/* Subtle waterline shimmer on top edge */
.board-wrap.water-effect::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 200, 255, .3) 20%,
    rgba(100, 220, 255, .5) 50%,
    rgba(0, 200, 255, .3) 80%,
    transparent 100%
  );
  animation: water-shimmer 3s ease-in-out infinite;
}

@keyframes water-shimmer {
  0%, 100% { opacity: .4; left: 10%; right: 10%; }
  50% { opacity: 1; left: 5%; right: 5%; }
}

/* ============================================================
   ACHIEVEMENTS
   ============================================================ */
.achievements { margin-top: 20px; }
.ach-count {
  font-family: 'Share Tech Mono', monospace;
  font-size: .7rem;
  color: var(--cyan);
  font-weight: 400;
}
.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.ach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.45;
  transition: all .3s;
}
.ach-item.unlocked {
  opacity: 1;
  border-color: var(--cyan);
  background: rgba(0, 240, 255, .05);
}
.ach-icon { font-size: 1.3rem; flex-shrink: 0; }
.ach-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ach-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .6rem;
  letter-spacing: .04em;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-desc {
  font-size: .55rem;
  color: var(--text-dim);
  line-height: 1.2;
}

/* Achievement unlock toast */
.ach-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, rgba(0,30,60,.95), rgba(0,60,100,.95));
  border: 1px solid var(--cyan);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  box-shadow: 0 0 30px rgba(0, 240, 255, .3);
  animation: ach-slide-in .5s ease-out forwards, ach-slide-out .4s 3s ease-in forwards;
}
.ach-toast .ach-toast-icon { font-size: 1.8rem; }
.ach-toast .ach-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ach-toast .ach-toast-label {
  font-size: .6rem;
  color: var(--cyan);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ach-toast .ach-toast-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-bright);
}
@keyframes ach-slide-in {
  to { transform: translateX(-50%) translateY(0); }
}
@keyframes ach-slide-out {
  to { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}
@media (max-width: 400px) {
  .ach-grid { grid-template-columns: 1fr; }
  .ach-item { padding: 6px 8px; gap: 6px; }
  .ach-icon { font-size: 1.1rem; }
  .ach-name { font-size: .55rem; }
}

/* ============================================================
   SKIN / THEME PICKER
   ============================================================ */
.skins-section { margin-top: 16px; }
.skin-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: .7rem;
  color: var(--cyan);
  font-weight: 400;
}
.skin-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}
.skin-swatch {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skin-swatch:active { transform: scale(0.9); }
.skin-swatch.active {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,.3);
}
.skin-swatch.locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.skin-swatch.locked:active { transform: none; }
.skin-color {
  width: 30px; height: 30px;
  border-radius: 50%;
}
.skin-lock {
  position: absolute;
  font-size: .7rem;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
@media (max-width: 400px) {
  .skin-swatch { width: 38px; height: 38px; }
  .skin-color { width: 26px; height: 26px; }
}

/* ============================================================
   TURN COUNTER
   ============================================================ */
.turn-count {
  font-family: 'Share Tech Mono', monospace;
  font-size: .65rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  margin-top: 2px;
}

/* ============================================================
   SHIP TYPE COLORS — each ship gets its own accent
   ============================================================ */
.cell.ship-carrier    { background: rgba(30, 100, 200, .35); border-color: rgba(60, 130, 220, .5); }
.cell.ship-battleship { background: rgba(200, 50, 50, .35);  border-color: rgba(220, 80, 80, .5); }
.cell.ship-cruiser    { background: rgba(40, 180, 80, .35);  border-color: rgba(60, 200, 100, .5); }
.cell.ship-submarine  { background: rgba(140, 60, 200, .35); border-color: rgba(160, 90, 220, .5); }
.cell.ship-destroyer  { background: rgba(220, 180, 40, .35); border-color: rgba(240, 200, 60, .5); }

/* Ship-specific hit glow */
.cell.hit.ship-carrier    { box-shadow: inset 0 0 8px rgba(60, 130, 220, .5); }
.cell.hit.ship-battleship { box-shadow: inset 0 0 8px rgba(220, 80, 80, .5); }
.cell.hit.ship-cruiser    { box-shadow: inset 0 0 8px rgba(60, 200, 100, .5); }
.cell.hit.ship-submarine  { box-shadow: inset 0 0 8px rgba(160, 90, 220, .5); }
.cell.hit.ship-destroyer  { box-shadow: inset 0 0 8px rgba(240, 200, 60, .5); }

/* Ship-specific sunk */
.cell.sunk.ship-carrier    { background: rgba(30, 100, 200, .15); }
.cell.sunk.ship-battleship { background: rgba(200, 50, 50, .15); }
.cell.sunk.ship-cruiser    { background: rgba(40, 180, 80, .15); }
.cell.sunk.ship-submarine  { background: rgba(140, 60, 200, .15); }
.cell.sunk.ship-destroyer  { background: rgba(220, 180, 40, .15); }

/* ============================================================
   INVITE CODE JOIN SECTION
   ============================================================ */
.lobby-join-code {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--cyan-dim);
  border-radius: 10px;
  margin-top: 12px;
}
.lobby-join-code .bet-input {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: .25em;
}

/* ============================================================
   PLAYER PROFILE SCREEN
   ============================================================ */
.profile-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 16px;
}
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.profile-avatar {
  font-size: 3rem;
  width: 80px; height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: rgba(0,240,255,.06);
  box-shadow: 0 0 20px rgba(0,240,255,.15);
}
.profile-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-bright);
  letter-spacing: .1em;
}
.profile-level {
  font-size: .7rem;
  color: var(--cyan);
  letter-spacing: .08em;
}
.profile-section {
  margin-bottom: 20px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.profile-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.ps-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-bright);
}
.ps-lbl {
  font-size: .6rem;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.profile-ach-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.profile-ach-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  opacity: 0.4;
}
.profile-ach-item.done {
  opacity: 1;
  border-color: var(--cyan);
}
.profile-ach-icon { font-size: 1rem; }
.profile-ach-name {
  font-size: .6rem;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-bright);
}
.profile-themes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-theme {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .65rem;
  color: var(--text-bright);
}
.profile-theme.locked { opacity: 0.35; }
.profile-theme-color {
  width: 16px; height: 16px;
  border-radius: 50%;
}
.btn-inline {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  padding: 2px 4px;
  vertical-align: middle;
}

/* ============================================================
   GLOBAL LEADERBOARD
   ============================================================ */
.lb-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 16px;
}
.lb-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.lb-tab {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .2s;
}
.lb-tab.active {
  border-color: var(--cyan);
  color: var(--text-bright);
  background: rgba(0,240,255,.06);
}
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .2s;
}
.lb-you-row {
  border-color: var(--cyan);
  background: rgba(0,240,255,.06);
  box-shadow: 0 0 10px rgba(0,240,255,.1);
}
.lb-rank {
  font-size: 1.2rem;
  min-width: 36px;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-dim);
}
.lb-player { flex: 1; min-width: 0; }
.lb-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: .8rem;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-detail {
  font-size: .55rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.lb-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--cyan);
  white-space: nowrap;
}
.lb-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 30px;
  font-size: .8rem;
}
.lb-your-rank {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(0,240,255,.04);
  border: 1px solid var(--cyan-dim);
  border-radius: 8px;
  font-size: .7rem;
  color: var(--cyan);
}

/* ============================================================
   PILL BUTTONS (Profile & Ranks)
   ============================================================ */
.sb-actions {
  float: right;
  display: flex;
  gap: 6px;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(0,240,255,.08);
  border: 1px solid var(--cyan-dim);
  border-radius: 20px;
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-pill:hover, .btn-pill:active {
  background: rgba(0,240,255,.15);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,240,255,.2);
  transform: scale(1.05);
}
@media (max-width: 400px) {
  .btn-pill { padding: 3px 8px; font-size: .5rem; }
  .sb-actions { gap: 4px; }
}

/* ============================================================
   NEW FEATURES: Debris, Battle Log, Fog, Time Attack
   ============================================================ */

/* Ship debris particles */
.debris {
  position: absolute;
  width: 6px; height: 6px;
  background: #ff6644;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  top: 50%; left: 50%;
  animation: debris-fly 0.7s ease-out forwards;
}
@keyframes debris-fly {
  0% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3); opacity: 0; }
}

/* Battle log fade-in */
@keyframes log-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.log-fade-in {
  animation: log-fade 0.3s ease-out;
}
.log-ts {
  font-family: 'Share Tech Mono', monospace;
  font-size: .55rem;
  color: var(--text-dim);
  margin-right: 6px;
  opacity: 0.6;
}

/* Fog of War cell — completely hidden, looks like unexplored ocean */
.cell.fog {
  background: rgba(6, 8, 15, 0.95);
  border-color: rgba(20, 30, 60, 0.4);
  border-style: solid;
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.03);
  cursor: default;
  animation: fog-idle 4s ease-in-out infinite;
}
.cell.fog::after {
  content: '';
  font-size: 0;
}
.cell.fog:hover {
  background: rgba(6, 8, 15, 0.95);
  border-color: rgba(20, 30, 60, 0.4);
}

@keyframes fog-idle {
  0%, 100% { box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.02); }
  50% { box-shadow: inset 0 0 16px rgba(0, 240, 255, 0.05); }
}

/* Fog of War recent shot — just fired, clearly visible with glow */
.cell.fog-recent {
  animation: fog-reveal 0.6s ease-out, fog-recent-pulse 2s ease-in-out 0.6s infinite;
}
.cell.hit.fog-recent {
  box-shadow: 0 0 14px rgba(255, 51, 85, 0.6), inset 0 0 8px rgba(255, 51, 85, 0.3);
  border-color: rgba(255, 51, 85, 0.7);
}
.cell.miss.fog-recent {
  box-shadow: 0 0 10px rgba(68, 119, 255, 0.4), inset 0 0 6px rgba(68, 119, 255, 0.2);
  border-color: rgba(68, 119, 255, 0.5);
}

@keyframes fog-reveal {
  0% { transform: scale(1.3); box-shadow: 0 0 30px rgba(0, 240, 255, 0.8); }
  100% { transform: scale(1); }
}
@keyframes fog-recent-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* Sunk ship — always visible in fog, with strong glow */
.cell.sunk.fog-faded {
  opacity: 1;
  background: radial-gradient(circle, rgba(255, 45, 170, 0.5) 0%, rgba(255, 45, 170, 0.1) 70%);
  border-color: var(--magenta);
  box-shadow: 0 0 12px rgba(255, 45, 170, 0.3);
}

/* Radar sweep animation on enemy board */
.radar-sweep {
  position: relative;
  overflow: hidden;
}
.radar-sweep::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 240, 255, 0.12) 40%, rgba(0, 240, 255, 0.25) 50%, rgba(0, 240, 255, 0.12) 60%, transparent 100%);
  animation: radar-sweep-anim 1.5s ease-in-out;
  pointer-events: none;
  z-index: 20;
}
@keyframes radar-sweep-anim {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Radar Pulse button */
.battle-actions {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
}
.radar-btn {
  font-size: 0.85rem;
  padding: 10px 24px;
  border: 2px solid rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.08);
  color: var(--cyan);
  position: relative;
  transition: all 0.25s ease;
}
.radar-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}
.radar-btn:disabled {
  opacity: 0.35;
  border-color: rgba(100, 120, 160, 0.2);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.radar-btn .radar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  margin-left: 6px;
  padding: 0 4px;
}
.radar-btn:disabled .radar-count {
  background: rgba(100, 120, 160, 0.1);
  border-color: rgba(100, 120, 160, 0.2);
}

/* Time Attack timer */
.time-attack-timer {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--cyan);
  text-align: center;
  padding: 8px;
  letter-spacing: .1em;
  text-shadow: 0 0 12px rgba(0,240,255,.4);
  margin-bottom: 8px;
}
.time-attack-timer.critical {
  color: var(--red);
  text-shadow: 0 0 12px rgba(255,50,50,.5);
  animation: timer-pulse 0.5s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 320px screen fix — iPhone SE gen 1 */
@media (max-width: 330px) {
  :root { --cell-size: 27px; --grid-gap: 1px; --board-pad: 2px; }
}
