/* ═══════════════════════════════════════════════════════
   STYLES
   Single Responsibility: Only presentation concerns
   ═══════════════════════════════════════════════════════ */

:root {
  --dark: #0d0a07;
  --dark-wood: #1a0e06;
  --amber: #d4820a;
  --fire: #e8500a;
  --gold: #FFD700;
  --cream: #f0e6d3;
  --green: #2ecc71;
  --teal: #1abc9c;
  --teal-dark: #16a085;
  --extreme: #ff0040;
  --btn-text: #000;
  --border-subtle: rgba(212, 130, 10, 0.3);
  --border-medium: rgba(212, 130, 10, 0.5);
  --text-dim: rgba(240, 230, 211, 0.65);
  --text-faint: rgba(240, 230, 211, 0.4);
  --bg-panel: rgba(28, 14, 5, 0.92);
  --bg-overlay: var(--dark);
}

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

body {
  background: var(--bg-overlay);
  font-family: 'Libre Baskerville', serif;
  color: var(--cream);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

/* ── Page layout ── */
#page {
  display: flex;
  height: 100vh;
  height: 100dvh;
  align-items: stretch;
}

#ad-left {
  width: 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

#ad-right {
  width: 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

#game-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  gap: 7px;
  overflow: hidden;
  min-width: 0;
}

/* ── Ad slots ── */
.ad-slot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(212, 130, 10, 0.25);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(240, 230, 211, 0.2);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.ad-slot:hover {
  border-color: rgba(212, 130, 10, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.ad-slot .ad-icon {
  font-size: 20px;
  opacity: 0.28;
}

.ad-slot .ad-size {
  font-size: 8px;
  opacity: 0.3;
  letter-spacing: 1px;
}

.ad-slot.tall {
  flex: 1;
  min-height: 180px;
}

.ad-slot.short {
  height: 90px;
}

.ad-img-slot {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(212, 130, 10, 0.25);
  transition: border-color .2s, transform .2s;
  cursor: pointer;
}

.ad-img-slot:hover {
  border-color: rgba(212, 130, 10, 0.5);
  transform: scale(1.01);
}

.ad-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-img-slot.tall {
  flex: 1;
  min-height: 120px;
}

/* ── Advertise CTA ── */
.advertise-cta {
  background: linear-gradient(135deg, rgba(212, 130, 10, 0.12), rgba(232, 80, 10, 0.08));
  border: 1.5px solid rgba(212, 130, 10, 0.4);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.advertise-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(212, 130, 10, 0.06) 50%, transparent 60%);
  background-size: 200% 200%;
  animation: none;
}

@keyframes cta-shimmer {
  0% { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

.advertise-cta:hover {
  border-color: var(--amber);
  background: linear-gradient(135deg, rgba(212, 130, 10, 0.2), rgba(232, 80, 10, 0.15));
  transform: scale(1.02);
}

.advertise-cta .ad-cta-icon {
  font-size: 24px;
}

.advertise-cta .ad-cta-title {
  font-family: 'Rye', cursive;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--amber);
  text-transform: uppercase;
}

.advertise-cta .ad-cta-sub {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: rgba(240, 230, 211, 0.4);
  text-transform: uppercase;
  text-align: center;
}

/* ── Mute button ── */
/* Legacy fixed buttons — replaced by top-bar */
#mute-btn, #boss-btn { display: none !important; }

/* ── Mobile bottom ad ── */
#ad-mobile-bottom {
  display: none;
}

/* ── Header row ── */
.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
}

.header-left, .header-right {
  flex-shrink: 0;
}

/* ── Common ── */
.title-logo {
  height: 1.1em;
  width: auto;
  vertical-align: middle;
  margin: 0 6px;
  filter: drop-shadow(0 0 8px rgba(212, 130, 10, 0.4));
}

h1 {
  font-family: 'Rye', cursive;
  font-size: clamp(18px, 3.5vw, 42px);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 28px rgba(212, 130, 10, 0.45), 3px 3px 0 rgba(0, 0, 0, 0.8);
  letter-spacing: 4px;
}

.sub {
  font-size: 9px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.28);
}

/* ── Animations ── */
@keyframes blink {
  from { opacity: 1 }
  to { opacity: .2 }
}

@keyframes combo-pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.4); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes best-pulse {
  0% { color: var(--cream); transform: scale(1); }
  30% { color: #FFD700; transform: scale(1.3); text-shadow: 0 0 12px rgba(255,215,0,0.6); }
  100% { color: var(--cream); transform: scale(1); text-shadow: none; }
}

@keyframes btn-pulse {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(212, 130, 10, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(212, 130, 10, 0.8), 0 0 45px rgba(212, 130, 10, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(212, 130, 10, 0.4); }
}

@keyframes dart-pulse {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(26, 188, 156, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(26, 188, 156, 0.8), 0 0 45px rgba(26, 188, 156, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(26, 188, 156, 0.4); }
}

/* ── Mode selector ── */
#mode-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  font-family: 'Rye', cursive;
  font-size: 15px;
  padding: 12px 10px 10px;
  background: rgba(28, 14, 5, 0.85);
  border: 2px solid rgba(212, 130, 10, 0.25);
  border-radius: 6px;
  color: rgba(240, 230, 211, 0.45);
  cursor: pointer;
  letter-spacing: 2px;
  transition: border-color .15s, background .15s, color .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
}

.mode-btn .m-icon {
  font-size: 28px;
  line-height: 1;
}

.mode-btn .m-label {
  font-size: 14px;
  letter-spacing: 3px;
}

.mode-btn .m-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.28);
  font-weight: 400;
}

.mode-btn:hover {
  border-color: rgba(212, 130, 10, 0.55);
  color: var(--cream);
  background: rgba(212, 130, 10, 0.08);
}

.mode-btn:hover .m-desc {
  color: rgba(240, 230, 211, 0.5);
}

.mode-btn.active {
  color: var(--dark);
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 22px rgba(212, 130, 10, 0.45);
}

.mode-btn.active .m-desc {
  color: rgba(13, 10, 7, 0.6);
}

.mode-btn.active.dart {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 22px rgba(26, 188, 156, 0.45);
}

.mode-btn.active.dart .m-desc {
  color: rgba(13, 10, 7, 0.55);
}

/* ── HUD ── */
.hud {
  display: flex;
  align-items: stretch;
  background: rgba(28, 14, 5, 0.92);
  border: 1px solid rgba(212, 130, 10, 0.28);
  border-radius: 3px;
  overflow: hidden;
  min-height: 52px;
}

.hc {
  text-align: center;
  padding: 5px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hl {
  font-size: 7px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(212, 130, 10, 0.8);
}

.hv {
  font-family: 'Rye', cursive;
  font-size: 20px;
  color: var(--cream);
  line-height: 1.1;
}

.hv.lives {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--fire);
}

.hv.timer {
  font-size: 24px;
}

.hv.timer.low {
  color: var(--fire);
  animation: blink .38s infinite alternate;
}

.hs {
  width: 1px;
  background: rgba(212, 130, 10, 0.18);
}

/* Dart HUD */
#dart-hud {
  display: flex;
  align-items: stretch;
  background: rgba(5, 20, 22, 0.92);
  border: 1px solid rgba(26, 188, 156, 0.3);
  border-radius: 3px;
  overflow: hidden;
  min-height: 52px;
}

#dart-hud .hc {
  padding: 5px 13px;
}

#dart-hud .hl {
  color: rgba(26, 188, 156, 0.7);
}

#dart-hud .hs {
  background: rgba(26, 188, 156, 0.2);
}

/* ── Timer bar ── */
#bar-wrap {
  width: 100%;
  max-width: 860px;
  height: 5px;
  background: rgba(28, 14, 5, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

#bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
}

/* ── Canvas wrap ── */
#cvs-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

canvas {
  border: 2px solid rgba(100, 60, 20, 0.45);
  border-radius: 4px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  cursor: crosshair;
  display: block;
  max-height: 100%;
}

/* ── Combo flash ── */
#cf {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Rye', cursive;
  font-size: 36px;
  color: var(--amber);
  text-shadow: 0 0 18px var(--amber);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .15s;
}

/* ── Dart toast ── */
#dart-toast {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Rye', cursive;
  font-size: clamp(22px, 4vw, 40px);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .15s, top .4s ease-out;
  z-index: 15;
}

/* ── Overlay ── */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 40px 10px 12px;
  background: var(--bg-overlay);
  gap: 6px;
  border-radius: 4px;
  z-index: 20;
  overflow-y: auto;
  overflow-x: hidden;
}

#overlay h2 {
  font-family: 'Rye', cursive;
  font-size: clamp(22px, 4.5vw, 52px);
  color: var(--amber);
  text-shadow: 0 0 38px rgba(212, 130, 10, 0.5);
}

#overlay h2.dart-title {
  color: var(--teal);
  text-shadow: 0 0 38px rgba(26, 188, 156, 0.5);
}

#overlay p {
  color: rgba(240, 230, 211, 0.48);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.6;
}

.big-score {
  font-family: 'Rye', cursive;
  font-size: clamp(24px, 5vw, 42px);
  color: var(--cream);
}

.play-btn {
  font-family: 'Rye', cursive;
  font-size: 24px;
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--amber), var(--fire));
  border: 2px solid var(--gold);
  padding: 14px 45px;
  cursor: pointer;
  letter-spacing: 4px;
  border-radius: 6px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  box-shadow: 0 0 15px rgba(212, 130, 10, 0.4);
  animation: btn-pulse 1.8s infinite;
  text-shadow: 1px 1px 0px rgba(255,255,255,0.4);
  margin-top: 4px;
}

.play-btn:hover {
  background: linear-gradient(135deg, #f0951a, #ff6600);
  transform: translateY(-3px) scale(1.08) !important;
  border-color: #fff;
}

.play-btn.dart-btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-color: #7bffd4;
  box-shadow: 0 0 15px rgba(26, 188, 156, 0.4);
  animation: dart-pulse 1.8s infinite;
}

.play-btn.dart-btn:hover {
  background: linear-gradient(135deg, #1abc9c, #117a65);
  border-color: #fff;
}

#top-bar {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 25;
  pointer-events: none;
}

#top-bar > * {
  pointer-events: auto;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.bar-btn {
  font-family: 'Rye', cursive;
  font-size: 11px;
  color: rgba(240, 230, 211, 0.6);
  background: rgba(28, 14, 5, 0.6);
  border: 1px solid rgba(212, 130, 10, 0.3);
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 2px;
  border-radius: 3px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  white-space: nowrap;
}

.bar-btn:hover {
  background: rgba(212, 130, 10, 0.2);
  color: var(--fire);
  border-color: var(--fire);
}

.bar-btn-exit {
  color: rgba(240, 230, 211, 0.8);
  border-color: rgba(212, 130, 10, 0.5);
}

/* ── Difficulty buttons ── */
.diff-row {
  display: flex;
  gap: 8px;
}

.d-btn {
  font-family: 'Rye', cursive;
  font-size: 11px;
  padding: 7px 14px;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  letter-spacing: 2px;
  border-radius: 2px;
  transition: background .12s, color .12s, border-color .12s;
}

.d-btn.easy {
  color: var(--green);
  border-color: var(--green);
}

.d-btn.med {
  color: var(--amber);
  border-color: var(--amber);
}

.d-btn.hard {
  color: var(--fire);
  border-color: var(--fire);
}

.d-btn:hover,
.d-btn.on {
  color: var(--dark);
}

.d-btn.easy:hover,
.d-btn.easy.on {
  background: var(--green);
}

.d-btn.med:hover,
.d-btn.med.on {
  background: var(--amber);
}

.d-btn.hard:hover,
.d-btn.hard.on {
  background: var(--fire);
}

.diff-hint {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.35);
  text-align: center;
  min-height: 14px;
  margin-top: -2px;
  transition: color .2s;
}

.d-btn.extreme {
  color: var(--extreme);
  border-color: var(--extreme);
  font-size: 9px;
  letter-spacing: 1px;
}

.d-btn.extreme:hover,
.d-btn.extreme.on {
  background: var(--extreme);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 64, 0.5);
}

/* ── Bottom row (leaderboard + how to play) ── */
.ov-bottom-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.ov-invite-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.invite-btn {
  font-size: 10px !important;
  padding: 6px 12px !important;
  color: rgba(240, 230, 211, 0.7) !important;
  border-color: rgba(212, 130, 10, 0.35) !important;
}

.invite-btn:hover {
  color: var(--cream) !important;
  border-color: var(--amber) !important;
}

.lb-tab-btn {
  font-family: 'Rye', cursive;
  font-size: 10px;
  padding: 5px 12px;
  border: 1px solid rgba(212, 130, 10, 0.3);
  background: transparent;
  color: rgba(240, 230, 211, 0.5);
  cursor: pointer;
  letter-spacing: 1px;
  border-radius: 2px;
  transition: background .12s, color .12s;
}

.lb-tab-btn.active {
  background: var(--amber);
  color: var(--dark);
  border-color: var(--amber);
  justify-content: center;
}

/* ── Legend ── */
.legend {
  display: flex;
  gap: 10px;
}

.lg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.38);
}

.ld {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
}

.tip {
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.5);
  text-align: center;
}

/* ── Responsive Mobile & Tablet ── */

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Tablet & Mobile (<900px) */
/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET (max-width: 900px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Hide ads, stack layout */
  #ad-left, #ad-right { display: none !important; }
  #page { flex-direction: column; }

  /* Safe area for notched phones */
  #game-col {
    padding: 6px;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    gap: 4px;
  }

  /* Header */
  h1 { font-size: clamp(16px, 5vw, 28px); letter-spacing: 2px; }
  .sub { font-size: 7px; letter-spacing: 3px; }

  /* HUD */
  .hud, #dart-hud { flex-wrap: wrap; justify-content: center; min-height: 44px; }
  .hc { padding: 3px 8px; flex: 1 1 auto; min-width: 0; }
  .hl { font-size: 6px; letter-spacing: 1px; }
  .hv { font-size: 15px; }
  .hv.timer { font-size: 18px; }
  .hv.lives { font-size: 11px; }
  #bar-wrap { height: 3px; }

  /* Overlay */
  #overlay { gap: 7px; }
  #overlay h2 { font-size: clamp(20px, 7vw, 36px); }
  #overlay p { font-size: 9px; line-height: 1.6; letter-spacing: 1px; padding: 0 10px; }

  /* Buttons: 44px min touch target */
  .play-btn { padding: 12px 28px; font-size: 16px; min-height: 48px; }
  .diff-row { gap: 6px; }
  .diff-row .d-btn { padding: 8px 16px; font-size: 11px; min-height: 40px; }
  .exit-btn { padding: 10px 18px; font-size: 12px; min-height: 40px; }
  .lb-btn { padding: 10px 24px; font-size: 11px; min-height: 40px; }

  /* Mode buttons */
  #mode-bar { gap: 6px; max-width: 100%; padding: 0 4px; }
  .mode-btn { padding: 10px 8px; font-size: 12px; min-height: 60px; }
  .mode-btn .m-icon { font-size: 22px; }
  .mode-btn .m-label { font-size: 12px; letter-spacing: 2px; }
  .mode-btn .m-desc { display: none; }

  /* Canvas */
  #cvs-wrap { flex: 1; min-height: 200px; }
  canvas { border-width: 1px; }

  /* Top bar buttons */
  .bar-btn { font-size: 9px; padding: 6px 8px; }

  /* User bar */
  #user-bar { gap: 6px; }
  #user-nick { font-size: 8px; }
  #btn-leaderboard { padding: 4px 10px; min-height: 32px; }

  /* Leaderboard panel */
  .lb-inner { width: 95%; max-height: 85vh; }

  /* How to Play modal */
  .htp-box { width: 92%; max-height: 80vh; }

  /* Nickname modal */
  .nick-box { min-width: 260px; padding: 24px; }
  #nick-input { font-size: 18px; padding: 12px 14px; min-height: 48px; }
  #nick-save { min-height: 48px; padding: 12px 36px; }

  /* Bottom row */
  .ov-bottom-row { gap: 6px; }

  /* Boss screen */
  .boss-doc { padding: 36px 28px 40px; height: auto; min-height: 500px; overflow: visible; }
  .boss-page { gap: 16px; }
  .boss-toolbar { gap: 2px; }
  .boss-font-select { width: 100px; }
  .boss-style-box { display: none !important; }
  .boss-filename { max-width: 180px; }
  .boss-ruler { display: none; }
  .boss-table { font-size: 11px; }
  .boss-table th, .boss-table td { padding: 4px 6px; }
  .boss-h1 { font-size: 22px; }
  .boss-h2 { font-size: 14px; }
  .boss-footer { position: static; margin-top: 20px; }

  /* Install banner tablet */
  .install-banner { padding: 8px 14px; gap: 10px; }
  .install-banner-text { font-size: 12px; }
  .install-banner-btn { font-size: 11px; padding: 7px 16px; }

  /* Mobile bottom ad */
  #ad-mobile-bottom {
    display: block;
    padding: 0; margin: 0; border-radius: 0; border: none;
    width: 100%; max-height: 60px; overflow: hidden; flex-shrink: 0;
  }
  #ad-mobile-bottom img { width: 100%; height: 60px; object-fit: cover; display: block; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — PHONE (max-width: 480px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Header */
  header { padding: 0 !important; }
  h1 { font-size: clamp(14px, 5.5vw, 22px); letter-spacing: 1px; }
  .sub { font-size: 6px; letter-spacing: 2px; }

  #game-col { padding: 4px; gap: 3px; }

  /* HUD: compact, separators hidden */
  .hud, #dart-hud { min-height: 38px; border-radius: 2px; }
  .hs { display: none; }
  .hc { padding: 2px 5px; border-right: 1px solid rgba(212,130,10,0.1); }
  .hc:last-child { border-right: none; }
  .hv { font-size: 13px; }
  .hv.timer { font-size: 15px; }
  .hv.lives { font-size: 9px; letter-spacing: 1px; }
  #h-speed { font-size: 10px !important; }
  .legend { display: none !important; }

  /* Overlay */
  #overlay { gap: 5px; }
  #mode-bar { gap: 4px; margin-bottom: 8px; }
  .mode-btn { min-height: 50px; padding: 8px 4px; }
  .mode-btn .m-icon { font-size: 18px; }
  .mode-btn .m-label { font-size: 10px; letter-spacing: 1px; }
  .play-btn { padding: 10px 24px; font-size: 14px; min-height: 44px; }
  .diff-row .d-btn { padding: 7px 12px; font-size: 10px; min-height: 36px; }
  .big-score { font-size: clamp(20px, 6vw, 32px); }
  .tip { font-size: 7px; padding: 0 8px; }

  /* Canvas */
  #cvs-wrap { min-height: 120px; }

  /* Top bar buttons compact */
  .bar-btn { font-size: 0; padding: 6px 8px; letter-spacing: 0; }
  .bar-btn::after { font-size: 13px; }
  #top-mute { font-size: 13px; }
  #top-boss::after { content: '💼'; font-size: 13px; }
  #btn-exit { font-size: 10px !important; letter-spacing: 1px !important; }
  .boss-back-btn {
    bottom: calc(28px + env(safe-area-inset-bottom));
    right: calc(14px + env(safe-area-inset-right));
    font-size: 11px; padding: 7px 14px;
  }

  /* Install banner phone */
  .install-banner {
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .install-banner-text { font-size: 11px; flex: 1; min-width: 0; }
  .install-banner-btn { font-size: 10px; padding: 7px 14px; min-height: 34px; }

  /* User bar */
  #user-bar { margin-top: 2px; gap: 4px; }

  /* Overlay bottom row */
  .ov-bottom-row { flex-direction: column; gap: 4px; width: 100%; align-items: center; }
  .lb-btn { padding: 8px 12px; font-size: 10px; width: 100%; max-width: 220px; text-align: center; }

  /* Difficulty row — extreme fits */
  .d-btn.extreme { font-size: 8px; padding: 7px 8px; letter-spacing: 0; }

  /* Nickname modal */
  .nick-box { min-width: min(calc(100vw - 24px), 220px); padding: 18px 14px; }

  /* How to Play modal */
  .htp-box { width: 96%; }
  .htp-header h3 { font-size: clamp(12px, 4vw, 16px); }
  .htp-content { padding: 12px 16px 16px; font-size: 11px; }
  .htp-content .htp-zone { min-width: 50px; }

  /* Leaderboard */
  .lb-inner { width: 98%; border-radius: 4px; }
  .lb-table { font-size: 11px; }
  .lb-header h3 { font-size: clamp(12px, 4vw, 18px); }
  .lb-mode-btn, .lb-diff-btn { font-size: 10px; padding: 6px; min-height: 36px; }

  /* Mobile bottom ad — smaller on phone */
  #ad-mobile-bottom { max-height: 50px; }
  #ad-mobile-bottom img { height: 50px; }

  /* Boss screen */
  .boss-doc { padding: 24px 18px 36px; font-size: 13px; }
  .boss-doc p, .boss-doc li { font-size: 13px; }
  .boss-h1 { font-size: 19px; }
  .boss-h2 { font-size: 13px; margin: 14px 0 6px; }
  .boss-titlebar { height: 28px; }
  .boss-filename { max-width: 120px; font-size: 11px; }
  .boss-autosave { display: none; }
  .boss-tab { padding: 5px 6px; font-size: 10px; }
  .boss-toolbar { padding: 2px 6px; }
  .boss-tool-sep { height: 36px; }
  .boss-tool-big { font-size: 16px; }
  .boss-font-select { width: 80px; font-size: 11px; }
  .boss-size-select { width: 36px; font-size: 11px; }
  .boss-page { padding: 10px 8px; gap: 12px; }
  .boss-table th, .boss-table td { padding: 3px 5px; font-size: 10px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — LANDSCAPE PHONE
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) and (orientation: landscape) {
  /* Hide header, maximize canvas */
  header { display: none !important; }

  /* HUD: fixed top strip, compact */
  .hud, #dart-hud {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 50; border-radius: 0; min-height: 28px;
    background: rgba(28, 14, 5, 0.95) !important;
  }
  #dart-hud { background: rgba(5, 20, 22, 0.95) !important; }
  .hl { display: none; }
  .hc { padding: 2px 6px; }
  .hv { font-size: 13px; }
  .hv.timer { font-size: 14px; }
  .hv.lives { font-size: 9px; }
  #bar-wrap { display: none; }
  #game-col { padding: 0; gap: 0; }
  #cvs-wrap { margin-top: 28px; }
  #ad-mobile-bottom { display: none !important; }

  /* Overlay: compact for landscape */
  #overlay { gap: 4px; padding: 6px 8px; }
  #mode-bar { margin-bottom: 4px; }
  .mode-btn { min-height: 40px; padding: 6px 8px; }
  .play-btn { padding: 8px 24px; font-size: 14px; min-height: 40px; }
  .diff-row .d-btn { min-height: 32px; padding: 5px 10px; }
  .big-score { font-size: clamp(18px, 4vw, 28px); }
  .tip { display: none; }
  .lb-btn { min-height: 32px; padding: 6px 16px; font-size: 10px; }
  .ov-bottom-row { gap: 4px; }

  /* Modals: landscape-friendly */
  .lb-inner { max-height: 90vh; }
  .htp-box { max-height: 90vh; width: 70%; }
  .nick-box { padding: 16px 20px; }

  /* Fixed buttons */
  .bar-btn { font-size: 0; padding: 5px 6px; letter-spacing: 0; }
  #top-mute { font-size: 12px; }
  #top-boss::after { content: '💼'; font-size: 12px; }
  #btn-exit { font-size: 9px !important; letter-spacing: 1px !important; }
}

/* ═══════════════════════════════════════════════════
   USER BAR
   ═══════════════════════════════════════════════════ */

#user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

#user-nick {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.45);
  cursor: pointer;
  transition: color .2s;
  border-bottom: 1px dashed rgba(240, 230, 211, 0.2);
  padding-bottom: 1px;
}

#user-nick:hover {
  color: var(--amber);
  border-color: var(--amber);
}

#btn-leaderboard {
  background: none;
  border: 1px solid rgba(212, 130, 10, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  color: rgba(240, 230, 211, 0.5);
}

#btn-leaderboard:hover {
  border-color: var(--amber);
  background: rgba(212, 130, 10, 0.15);
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════
   DART VISUAL PIPS
   ═══════════════════════════════════════════════════ */

.dart-pips {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
  max-width: 860px;
  width: 100%;
  padding: 4px 0;
}

.dart-pip {
  font-size: 22px;
  color: var(--teal);
  text-shadow: 0 0 8px rgba(26, 188, 156, 0.5);
  transition: color .15s, opacity .15s, transform .15s;
  display: inline-block;
  line-height: 1;
}

.dart-pip.used {
  color: rgba(26, 188, 156, 0.12);
  text-shadow: none;
  transform: scale(0.6) rotate(45deg);
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════
   LEADERBOARD BUTTON (overlay)
   ═══════════════════════════════════════════════════ */

.lb-btn {
  font-family: 'Rye', cursive;
  font-size: 12px;
  color: rgba(240, 230, 211, 0.8);
  background: rgba(28, 14, 5, 0.8);
  border: 1px solid rgba(212, 130, 10, 0.45);
  padding: 8px 22px;
  cursor: pointer;
  letter-spacing: 2px;
  border-radius: 4px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}

.lb-btn:hover {
  background: rgba(212, 130, 10, 0.25);
  border-color: var(--amber);
  color: var(--cream);
}

/* ═══════════════════════════════════════════════════
   NICKNAME MODAL
   ═══════════════════════════════════════════════════ */

#nick-modal, #join-modal, #invite-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(2px);
}

.nick-box {
  background: linear-gradient(135deg, var(--dark-wood), var(--dark));
  border: 2px solid var(--amber);
  border-radius: 8px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  box-shadow: 0 0 40px rgba(212, 130, 10, 0.3);
}

.nick-box h3 {
  font-family: 'Rye', cursive;
  font-size: 16px;
  color: var(--amber);
  letter-spacing: 3px;
}

.join-desc {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-align: center;
  margin-top: -4px;
}

/* Shared input style for nick + join modals */
#nick-input, #join-input {
  width: 100%;
  font-family: 'Libre Baskerville', serif;
  font-size: 16px;
  padding: 10px 14px;
  border: 2px solid rgba(212, 130, 10, 0.4);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--cream);
  text-align: center;
  outline: none;
  letter-spacing: 2px;
  transition: border-color .2s;
}

#nick-input:focus, #join-input:focus {
  border-color: var(--amber);
}

#nick-save, #join-save, #invite-copy-btn, #invite-share-btn {
  font-family: 'Rye', cursive;
  font-size: 14px;
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  border: 2px solid var(--gold);
  color: var(--btn-text);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 3px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}

#nick-save:hover {
  background: linear-gradient(135deg, #f0951a, #ff6600);
  transform: scale(1.05);
}

.nick-cancel-btn {
  font-family: 'Libre Baskerville', serif;
  font-size: 10px;
  color: rgba(240, 230, 211, 0.35);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color .2s;
}

.nick-cancel-btn:hover {
  color: var(--cream);
}

/* ═══════════════════════════════════════════════════
   HOW TO PLAY MODAL
   ═══════════════════════════════════════════════════ */

#htp-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(2px);
}

.htp-box {
  background: linear-gradient(135deg, var(--dark-wood), var(--dark));
  border: 2px solid var(--amber);
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(212, 130, 10, 0.25);
}

.htp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(212, 130, 10, 0.2);
}

.htp-header h3 {
  font-family: 'Rye', cursive;
  font-size: 16px;
  color: var(--amber);
  letter-spacing: 3px;
}

.htp-content {
  padding: 18px 22px 22px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.8;
  color: rgba(240, 230, 211, 0.75);
}

.htp-content h4 {
  font-family: 'Rye', cursive;
  font-size: 13px;
  color: var(--amber);
  margin: 14px 0 6px;
  letter-spacing: 2px;
}

.htp-content h4:first-child {
  margin-top: 0;
}

.htp-content ul {
  padding-left: 18px;
  margin: 0 0 8px;
}

.htp-content li {
  margin-bottom: 4px;
}

.htp-content .htp-zone {
  display: inline-block;
  min-width: 70px;
  font-family: 'Rye', cursive;
  color: var(--cream);
}

.htp-content .htp-pts {
  color: var(--amber);
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════
   LEADERBOARD PANEL
   ═══════════════════════════════════════════════════ */

#lb-panel {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(2px);
}

.lb-inner {
  background: linear-gradient(135deg, var(--dark-wood), var(--dark));
  border: 2px solid var(--amber);
  border-radius: 8px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(212, 130, 10, 0.25);
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(212, 130, 10, 0.2);
}

.lb-header h3 {
  font-family: 'Rye', cursive;
  font-size: 18px;
  color: var(--amber);
  letter-spacing: 3px;
}

.lb-close {
  background: none;
  border: 1px solid rgba(240, 230, 211, 0.2);
  color: rgba(240, 230, 211, 0.5);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close:hover {
  border-color: var(--fire);
  color: var(--fire);
  background: rgba(232, 80, 10, 0.15);
}

.lb-filters {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-mode-row,
.lb-diff-row {
  display: flex;
  gap: 6px;
}

.lb-mode-btn,
.lb-diff-btn {
  flex: 1;
  font-family: 'Rye', cursive;
  font-size: 11px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(212, 130, 10, 0.25);
  color: rgba(240, 230, 211, 0.4);
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}

.lb-mode-btn:hover,
.lb-diff-btn:hover {
  border-color: rgba(212, 130, 10, 0.5);
  color: var(--cream);
}

.lb-mode-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--dark);
}

.lb-diff-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--dark);
}

.lb-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  min-height: 120px;
  max-height: 50vh;
}

.lb-loading {
  text-align: center;
  color: rgba(240, 230, 211, 0.3);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 30px 0;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lb-table thead th {
  font-family: 'Rye', cursive;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(212, 130, 10, 0.8);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(212, 130, 10, 0.15);
}

.lb-table tbody td {
  padding: 7px 6px;
  color: rgba(240, 230, 211, 0.7);
  border-bottom: 1px solid rgba(240, 230, 211, 0.05);
}

.lb-table tbody tr:hover {
  background: rgba(212, 130, 10, 0.06);
}

.lb-table tbody tr.lb-me td {
  color: var(--amber);
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════
   HIDE FROM BOSS — Fake Microsoft Word Online
   ═══════════════════════════════════════════════════ */

#boss-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #f3f3f3;
  font-family: 'Segoe UI', Calibri, Arial, sans-serif;
  color: #333;
  cursor: default;
}

/* ── Title bar ── */
.boss-titlebar {
  background: #2b579a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  height: 32px;
  flex-shrink: 0;
  -webkit-app-region: drag;
}

.boss-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.boss-word-logo { flex-shrink: 0; }

.boss-filename {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.boss-autosave {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

.boss-titlebar-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.boss-titlebar-btn {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  cursor: default;
  border-radius: 2px;
}

.boss-titlebar-btn:hover { background: rgba(255,255,255,0.1); }

.boss-titlebar-user {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a3f6f;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
}

.boss-win-close:hover { background: #c42b1c !important; color: #fff; }

/* ── Ribbon tabs ── */
.boss-ribbon {
  background: #2b579a;
  padding: 0;
  flex-shrink: 0;
}

.boss-ribbon-tabs {
  display: flex;
  padding: 0 8px;
}

.boss-tab {
  padding: 6px 12px 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  cursor: default;
  border-radius: 3px 3px 0 0;
  white-space: nowrap;
}

.boss-tab:hover { background: rgba(255,255,255,0.08); }
.boss-tab.active { background: #f3f3f3; color: #2b579a; font-weight: 600; }

/* ── Toolbar ── */
.boss-toolbar {
  background: #f3f3f3;
  padding: 4px 10px 6px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  border-bottom: 1px solid #d6d6d6;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.boss-tool-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.boss-tool-row {
  display: flex;
  align-items: center;
  gap: 1px;
}

.boss-tool-big {
  font-size: 20px;
  display: block;
  text-align: center;
}

.boss-tool-label {
  font-size: 9px;
  text-align: center;
  color: #555;
}

.boss-tool-sm {
  padding: 3px 5px;
  font-size: 12px;
  color: #444;
  cursor: default;
  border-radius: 2px;
  min-width: 22px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.boss-tool-sm:hover { background: #e0e0e0; }

.boss-highlight {
  color: #c00;
  font-weight: bold;
  border-bottom: 3px solid #ff0;
}

.boss-tool-sep {
  width: 1px;
  height: 48px;
  background: #d6d6d6;
  margin: 0 4px;
  flex-shrink: 0;
}

.boss-tool-sep-sm {
  width: 1px;
  height: 18px;
  background: #d6d6d6;
  margin: 0 3px;
}

.boss-font-select,
.boss-size-select {
  font-family: 'Segoe UI', Calibri, sans-serif;
  font-size: 12px;
  padding: 2px 4px;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  background: #fff;
  color: #333;
  cursor: default;
  outline: none;
  -webkit-appearance: auto;
}

.boss-font-select { width: 140px; }
.boss-size-select { width: 48px; }

.boss-style-box {
  font-size: 10px !important;
  padding: 2px 8px !important;
  border: 1px solid #ccc;
  border-radius: 2px;
  min-width: 58px !important;
  background: #fff;
}

.boss-style-h1 { font-size: 13px !important; color: #2b579a; font-weight: 600; }
.boss-style-h2 { font-size: 11px !important; color: #2b579a; }

/* ── Ruler ── */
.boss-ruler {
  background: #fff;
  border-bottom: 1px solid #d6d6d6;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.boss-ruler-inner {
  display: flex;
  width: 680px;
  max-width: 100%;
  justify-content: space-between;
  padding: 0 12px;
}

.boss-ruler-inner span {
  font-size: 8px;
  color: #999;
  position: relative;
}

.boss-ruler-inner span::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 1px;
  height: 6px;
  background: #bbb;
}

/* ── Document page ── */
.boss-page {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 20px;
  background: #e8e8e8;
}

.boss-doc {
  background: #fff;
  width: 100%;
  max-width: 680px;
  height: 1060px;
  padding: 72px 80px 52px;
  box-shadow: 0 0 8px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
  font-family: Calibri, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: #1a1a1a;
  outline: none;
  cursor: text;
  caret-color: #1a1a1a;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.boss-doc:focus { outline: none; }

.boss-doc p {
  margin: 0 0 11px;
  color: #1a1a1a;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  line-height: 1.65;
}

/* Document heading classes (replaces inline styles) */
/* Reset game globals leaking into boss screen */
#boss-screen h1,
#boss-screen h2,
#boss-screen p {
  font-family: Calibri, 'Segoe UI', sans-serif;
  text-shadow: none;
  color: #1a1a1a;
  letter-spacing: 0;
  text-transform: none;
}

.boss-h1 {
  font-family: 'Calibri Light', Calibri, sans-serif;
  font-size: 28px;
  color: #1a1a1a;
  margin: 0 0 6px;
  font-weight: 300;
  letter-spacing: -.5px;
  line-height: 1.3;
  text-shadow: none;
}

.boss-h2 {
  font-family: Calibri, sans-serif;
  font-size: 15px;
  color: #2b579a;
  margin: 20px 0 8px;
  font-weight: 600;
  border-bottom: 1px solid #d6e4f0;
  padding-bottom: 4px;
  line-height: 1.4;
}

.boss-meta {
  color: #888;
  font-size: 10.5px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.boss-confidential {
  color: #888;
  margin-top: 36px;
  font-size: 10px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
}

.boss-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  color: #bbb;
  pointer-events: none;
}

.boss-doc ul, .boss-doc ol {
  margin: 0 0 12px;
  padding-left: 28px;
}

.boss-doc li {
  margin-bottom: 3px;
  font-size: 14px;
  line-height: 1.65;
}

/* Table inside boss doc */
.boss-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 13px;
}

.boss-table th {
  background: #f0f4f8;
  font-weight: 600;
  text-align: left;
  padding: 7px 10px;
  border: 1px solid #c8d6e5;
  font-size: 12px;
  color: #2b579a;
}

.boss-table td {
  padding: 6px 10px;
  border: 1px solid #ddd;
  color: #333;
}

.boss-table tbody tr:nth-child(even) { background: #fafbfc; }
.boss-table tbody tr:hover { background: #eef3f9; }

/* ── Back to game button ── */
.boss-back-btn {
  position: fixed;
  bottom: 36px;
  right: 24px;
  z-index: 10000;
  font-family: 'Segoe UI', Calibri, sans-serif;
  font-size: 12px;
  padding: 8px 18px;
  background: #2b579a;
  color: #fff;
  border: 1px solid #1a3f6f;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  letter-spacing: 0;
  text-transform: none;
}

.boss-back-btn:hover {
  background: #1a3f6f;
  transform: scale(1.05);
}

/* ── Status bar ── */
.boss-status {
  background: #2b579a;
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  padding: 3px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  height: 24px;
}

.boss-status-left,
.boss-status-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.boss-status-sep {
  color: rgba(255,255,255,0.25);
  font-size: 10px;
}

.boss-zoom-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.boss-zoom-btn {
  cursor: default;
  padding: 0 3px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.boss-zoom-bar {
  width: 60px;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: relative;
}

.boss-zoom-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 60%;
  height: 100%;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}

/* (all responsive rules consolidated above) */

/* ═══════════════════════════════════════════════════
   PWA INSTALL BANNER
   ═══════════════════════════════════════════════════ */

.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--bg-overlay);
  border-top: 2px solid var(--amber);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
  animation: slideUp .4s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.install-banner-text {
  font-size: 13px;
  color: var(--cream);
  letter-spacing: 0.5px;
  font-family: 'Libre Baskerville', serif;
}

.install-banner-text strong {
  color: var(--amber);
  font-family: 'Rye', cursive;
  letter-spacing: 1px;
}

.install-banner-btn {
  font-family: 'Rye', cursive;
  font-size: 12px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  border: 1px solid #ffcc00;
  color: var(--btn-text);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
  white-space: nowrap;
}

.install-banner-btn:hover {
  background: linear-gradient(135deg, #f0951a, #ff6600);
  transform: scale(1.05);
}

.install-banner-close {
  background: none;
  border: none;
  color: rgba(240, 230, 211, 0.3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color .2s;
  line-height: 1;
}

.install-banner-close:hover {
  color: var(--cream);
}

/* Desktop: install banner stays between ad columns */
@media (min-width: 901px) {
  .install-banner { left: 200px; right: 200px; }
}

/* ═══════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════ */

/* Focus indicators — visible keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible,
[data-action]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Skip to content (screen readers) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion — disable animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
