/* ═══════════════════════════════════════════════════════
   DAVID & THE LIONS — Stylesheet
   Desert / golden parchment theme
═══════════════════════════════════════════════════════ */

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

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&display=swap');

body {
  font-family: 'Outfit', sans-serif;
  background: #0e0804;
  color: #e8d5b0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

canvas#gameCanvas {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
}

/* ── Wave Banner ──────────────────────────────────────── */
#waveBanner {
  position: fixed;
  top: 46%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  text-align: center;
  text-shadow:
    0 0 24px rgba(245,200,60,0.8),
    0 2px 8px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0;
}
#waveBanner.show {
  animation: dBannerAnim 2.1s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes dBannerAnim {
  0%   { transform:translate(-50%,-50%) scale(0.4); opacity:0; }
  12%  { transform:translate(-50%,-50%) scale(1.06); opacity:1; }
  75%  { opacity:1; }
  100% { transform:translate(-50%,-50%) scale(1.0); opacity:0; }
}

/* ── Overlays ──────────────────────────────────────────── */
.d-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 2, 0.88);
  backdrop-filter: blur(14px);
}

/* ── Setup / Results Panel ────────────────────────────── */
.d-panel {
  background: linear-gradient(148deg, rgba(42,22,8,0.97), rgba(18,10,4,0.99));
  border: 1px solid rgba(200,150,50,0.22);
  border-radius: 28px;
  padding: 38px 46px;
  max-width: 700px;
  width: 95vw;
  max-height: 96vh;
  overflow-y: auto;
  text-align: center;
  box-shadow:
    0 0 80px rgba(200,140,30,0.07),
    0 30px 70px rgba(0,0,0,0.65);
  scrollbar-width: none;
}
.d-panel::-webkit-scrollbar { display:none; }

/* ── Navigation ───────────────────────────────────────── */
.d-back-link {
  display: inline-block;
  color: rgba(220,180,100,0.38);
  text-decoration: none;
  font-size: 0.84rem;
  margin-bottom: 14px;
  transition: color 0.2s;
}
.d-back-link:hover { color: #c8a050; }

/* ── Heading ──────────────────────────────────────────── */
.d-panel h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #f5c842 20%, #c87820);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.d-subtitle {
  color: rgba(220,180,120,0.48);
  font-size: 0.90rem;
  margin-bottom: 28px;
}

/* ── Option Groups ─────────────────────────────────────── */
.option-group { margin-bottom: 22px; }
.option-group h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2.8px;
  color: rgba(200,160,70,0.40);
  margin-bottom: 10px;
}

/* Battlefield 2×2 grid */
.d-arena-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

/* Difficulty 3-col row */
.d-diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
}

/* ── Option Card ──────────────────────────────────────── */
.diff-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 2px solid rgba(200,150,50,0.10);
  background: rgba(200,150,50,0.035);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}
.diff-opt input { position:absolute; opacity:0; pointer-events:none; }
.diff-opt:hover {
  border-color: rgba(200,150,50,0.28);
  background: rgba(200,150,50,0.07);
}
.diff-opt.selected {
  border-color: rgba(200,150,50,0.65);
  background: rgba(180,120,30,0.12);
  box-shadow: 0 0 22px rgba(200,140,30,0.12);
}

.opt-label { font-weight:700; font-size:0.84rem; color:#e8d5b0; }
.opt-desc  { font-size:0.68rem; color:rgba(220,180,100,0.42); }

/* ── Controls Reference ───────────────────────────────── */
.d-controls {
  margin: 18px 0 24px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(200,150,50,0.09);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d-ctrl-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.d-key {
  display: inline-block;
  background: rgba(200,150,50,0.12);
  border: 1px solid rgba(200,150,50,0.22);
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f5c842;
  min-width: 110px;
  text-align: center;
  flex-shrink: 0;
}
.d-ctrl-desc {
  font-size: 0.80rem;
  color: rgba(220,180,120,0.60);
}

/* ── Start Button ─────────────────────────────────────── */
.d-start-btn {
  display: inline-block;
  padding: 14px 52px;
  border: none;
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a0e04;
  background: linear-gradient(135deg, #f5c842 0%, #c87820 100%);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(200,140,30,0.45);
  letter-spacing: 0.3px;
}
.d-start-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 32px rgba(200,140,30,0.58);
}
.d-start-btn:active { transform: translateY(0) scale(0.98); }

/* ── Results ──────────────────────────────────────────── */
.d-results-icon {
  font-size: 3.8rem;
  margin-bottom: 10px;
  display: block;
  animation: dPopIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes dPopIn {
  from { transform:scale(0.2) rotate(-12deg); opacity:0; }
  to   { transform:scale(1) rotate(0); opacity:1; }
}

.d-panel h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #e8d5b0;
  margin-bottom: 22px;
}

.result-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 11px;
  background: rgba(200,150,50,0.055);
  border: 1px solid rgba(200,150,50,0.12);
  margin-bottom: 9px;
  font-size: 0.95rem;
}

.d-hub-link {
  display: inline-block;
  margin-top: 14px;
  color: rgba(220,180,100,0.32);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.2s;
}
.d-hub-link:hover { color: #c8a050; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 560px) {
  .d-panel { padding: 28px 20px; }
  .d-arena-row { grid-template-columns: 1fr; }
  .d-diff-row  { grid-template-columns: 1fr 1fr; }
}
