/* ═══════════════════════════════════════
   CASTLE DUEL — Styles
   ═══════════════════════════════════════ */

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

html, body {
  width: 100%; height: 100%;
  background: #0d121c;
  font-family: 'Outfit', system-ui, sans-serif;
  overflow: hidden;
  color: #fff;
}

canvas#castleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

/* Split line */
.split-divider {
  position: fixed;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.18);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 2px;
}

/* ══ Overlay Shell ══════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 18, 28, 0.94);
  z-index: 200;
  backdrop-filter: blur(8px);
}

.overlay-card {
  background: linear-gradient(150deg, rgba(24,32,48,0.95) 0%, rgba(14,18,28,0.95) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 38px 46px 32px;
  width: min(680px, 93vw);
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02),
    0 8px 80px rgba(0,0,0,0.4),
    0 2px 8px rgba(0,0,0,0.6);
  animation: cardPop .35s cubic-bezier(.34,1.56,.64,1) both;
}

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

/* ══ Logo ════════════════════════════════ */
.game-logo {
  font-size: clamp(52px, 9vw, 84px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  margin-bottom: 8px;
}
.logo-castle { color: #f7b42c; text-shadow: 0 0 36px rgba(247,180,44,0.4); }
.logo-duel   { color: #d6334a; text-shadow: 0 0 36px rgba(214,51,74,0.4); }

.game-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

/* ══ Settings Row ════════════════════════ */
.settings-col { margin-bottom: 24px; text-align: left; }

.settings-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 9px;
  text-align: center;
}

/* Diff buttons */
.diff-grid  { display: flex; gap: 8px; justify-content: center; }
.diff-opt {
  flex: 1;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 12px;
  text-align: center;
  transition: border-color .18s, background .18s;
  background: rgba(255,255,255,0.02);
  user-select: none;
}
.diff-opt input { display: none; }
.diff-opt:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }
.diff-opt.selected {
  border-color: #f7b42c;
  background: rgba(247,180,44,0.08);
  box-shadow: 0 0 12px rgba(247,180,44,0.12);
}
.diff-name { font-size: 14px; font-weight: 700; color: #fff; }

/* ══ Controls Strip ══════════════════════ */
.controls-strip {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  gap: 10px;
}
.ctrl-panel { flex: 1; text-align: center; }
.ctrl-player { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.ctrl-key-row { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.ctrl-divider { font-weight: 900; font-size: 24px; opacity: 0.3; display: flex; align-items: center; }

kbd {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin: 0 2px;
}

/* ══ Buttons ══════════════════════════════ */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #f7b42c 0%, #eb5b33 100%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: opacity .18s, transform .1s;
  box-shadow: 0 4px 28px rgba(247,180,44,0.3);
  margin-bottom: 12px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-primary:active { opacity: 1; transform: translateY(0); }

.btn-secondary {
  flex: 1;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s, color .18s;
  letter-spacing: 1px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

.back-link {
  display: inline-block;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  text-decoration: none;
  transition: color .18s;
}
.back-link:hover { color: rgba(255,255,255,0.7); }

/* ══ Results ══════════════════════════════ */
.results-card { max-width: 480px; }
.results-emoji { font-size: 64px; margin-bottom: 8px; filter: drop-shadow(0 4px 12px rgba(255,200,0,0.4)); }
.results-headline {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(255,220,80,0.3);
}
.result-btns  { display: flex; gap: 10px; align-items: stretch; margin-top:24px;}
.result-btns .btn-primary { flex: 2; margin-bottom: 0; }
