/* KNATR — Viking Storm Football · obsidian & runestone design language */
:root {
  --ink: #0a0e1a;
  --stone: #141b2a;
  --stone-edge: #2a3548;
  --rune: #66ffcc;
  --rune-dim: #3aa88a;
  --ember: #ff7733;
  --bone: #e8ecdf;
  --blood: #e06a5a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: var(--bone);
  user-select: none;
}
.hidden { display: none !important; }

/* ─── overlays & stone panels ─── */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 30, 55, 0.88), rgba(6, 8, 15, 0.96));
  backdrop-filter: blur(3px);
}
#endScreen { display: none; }
#endScreen.show { display: flex; }
.stone-panel {
  background: linear-gradient(160deg, #182034, #0e1424 70%);
  border: 1px solid #2c3a58;
  border-radius: 14px;
  padding: 34px 44px;
  max-width: 640px; width: min(92vw, 640px);
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 0 0 4px rgba(10, 14, 26, 0.6), 0 24px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(140, 180, 255, 0.08);
  text-align: center;
}

/* ─── brand ─── */
.brand-rune {
  filter: drop-shadow(0 0 18px rgba(102, 255, 204, 0.6));
}
.brand h1 {
  font-size: 64px; letter-spacing: 14px; margin: 4px 0 0;
  color: var(--bone);
  text-shadow: 0 3px 0 #000, 0 0 34px rgba(102, 255, 204, 0.25);
  font-weight: 900;
}
.tagline { color: var(--rune); letter-spacing: 6px; font-size: 13px; margin-top: 2px; }
.lore { color: #8b98b8; font-style: italic; margin: 10px 0 22px; font-size: 14px; }

/* ─── settings ─── */
.settings {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px;
  text-align: left; margin-bottom: 20px;
}
.settings label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; letter-spacing: 2px; color: #9fb0d0;
}
.settings label:last-child { grid-column: 1 / -1; }
.settings select {
  background: #0d1322; color: var(--bone);
  border: 1px solid #33436a; border-radius: 8px;
  padding: 10px 12px; font-size: 15px; outline: none;
}
.settings select:focus { border-color: var(--rune); }

/* ─── controls guide ─── */
.controls-runes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 22px; font-size: 12px; color: #a8b6d4;
}
.controls-runes > div {
  background: rgba(12, 18, 32, 0.8); border: 1px solid #24304e;
  border-radius: 8px; padding: 8px 6px;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.controls-runes .pad-note { grid-column: 1 / -1; color: #7787a8; font-size: 11px; }
kbd {
  background: #1c2740; border: 1px solid #3a4c78; border-bottom-width: 3px;
  border-radius: 6px; padding: 2px 8px; font-family: inherit; font-weight: 700;
  color: var(--rune); font-size: 12px;
}

/* ─── buttons ─── */
.rune-btn {
  display: block; width: 100%; margin-top: 10px;
  background: linear-gradient(180deg, #2aa884, #177a5e);
  color: #04120c; font-weight: 900; letter-spacing: 4px; font-size: 17px;
  border: none; border-radius: 10px; padding: 15px;
  cursor: pointer; text-transform: uppercase;
  box-shadow: 0 6px 24px rgba(42, 168, 132, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s, box-shadow 0.12s;
}
.rune-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(42, 168, 132, 0.5); }
.rune-btn.ghost { background: #232e4a; color: #a8b6d4; box-shadow: none; }

/* ─── in-game UI ─── */
#pitch { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#scoreboard {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.92), rgba(10, 14, 26, 0.88));
  border: 1px solid #2c3a58; border-radius: 12px;
  padding: 10px 22px; z-index: 20;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-weight: 800;
}
.sb-clan { display: flex; align-items: center; gap: 8px; font-size: 15px; letter-spacing: 2px; }
.sigil { display: inline-flex; align-items: center; }
.sb-score { font-size: 26px; display: flex; gap: 8px; align-items: baseline; }
.sb-score em { color: #5a6a8e; font-style: normal; }
.sb-clock {
  display: flex; flex-direction: column; align-items: center;
  border-left: 1px solid #2c3a58; padding-left: 16px; line-height: 1.05;
}
.sb-clock span { font-size: 19px; color: var(--rune); }
.sb-clock small { font-size: 9px; letter-spacing: 2px; color: #7787a8; }

/* banner */
#banner {
  position: fixed; top: 26%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
  text-align: center; z-index: 25; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#bannerText {
  font-size: 84px; font-weight: 900; letter-spacing: 10px;
  color: var(--bone);
  text-shadow: 0 0 40px rgba(102, 255, 204, 0.7), 0 6px 0 #000;
}
#bannerSub { font-size: 18px; color: var(--rune); letter-spacing: 3px; }

/* bottom hud */
#hudBottom {
  position: fixed; left: 0; right: 0; bottom: 12px; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 18px; pointer-events: none;
}
#playerCard {
  display: flex; align-items: center; gap: 10px;
  background: rgba(12, 17, 30, 0.88); border: 1px solid #2c3a58;
  border-radius: 10px; padding: 8px 14px 8px 8px; min-width: 170px;
}
#pcNum {
  font-size: 26px; font-weight: 900; color: var(--ink);
  background: var(--rune); border-radius: 8px; padding: 2px 10px;
}
.pc-meta { display: flex; flex-direction: column; line-height: 1.1; }
.pc-meta strong { font-size: 16px; }
.pc-meta small { color: #7787a8; font-size: 11px; letter-spacing: 2px; }
#staminaRing { width: 40px; height: 40px; }

#radar {
  background: rgba(10, 14, 24, 0.6); border-radius: 10px;
  border: 1px solid #22304e;
}

#stormBox {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(12, 17, 30, 0.88); border: 1px solid #2c3a58;
  border-radius: 10px; padding: 10px 14px; min-width: 130px;
}
#windCompass {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid #33436a; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #16203a, #0d1322);
}
#windArrow { font-size: 20px; color: var(--rune); transition: transform 0.4s; }
.storm-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #9fb0d0; }
.gust {
  font-size: 9px; letter-spacing: 1px; padding: 2px 6px; border-radius: 4px;
  background: #232e4a; color: #55648a; transition: all 0.3s;
}
.gust.active { background: var(--ember); color: #1a0c04; font-weight: 900; }
#powerBar {
  width: 110px; height: 8px; border-radius: 4px; background: #1c2438;
  overflow: hidden; border: 1px solid #2c3a58;
}
#powerFill {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #66ffcc, #ffd166);
  transition: width 0.05s linear;
}
#powerFill.ember { background: linear-gradient(90deg, #ffd166, #ff5511); box-shadow: 0 0 12px #ff5511; }

/* end screen */
#endScore { font-size: 30px; font-weight: 900; margin: 14px 0; color: var(--rune); }
#endStats { margin: 0 auto 16px; max-width: 360px; }
.stat-row {
  display: flex; justify-content: space-between; padding: 6px 4px;
  border-bottom: 1px solid #22304e; font-size: 14px;
}
.stat-row em { color: #7787a8; font-style: normal; letter-spacing: 2px; font-size: 11px; }

h2 { letter-spacing: 6px; margin-bottom: 8px; color: var(--bone); }

@media (max-width: 760px) {
  .brand h1 { font-size: 44px; letter-spacing: 8px; }
  #bannerText { font-size: 48px; }
  .controls-runes { grid-template-columns: 1fr 1fr; }
  #radar { display: none; }
}
