/* ============================================================================
   Archmage Chess — UI styling
   ============================================================================ */
:root {
  --gold: #e8c66a;
  --rune: #9d7bff;
  --rune-bright: #c4a8ff;
  --frost: #6fd0ff;
  --crimson: #ff3a4a;
  --panel: rgba(14, 10, 28, 0.82);
  --panel-edge: rgba(157, 123, 255, 0.35);
  --text: #e9e3ff;
  --text-dim: #a99fce;
  --display: 'Cinzel', 'Spectral', Georgia, serif;
  --body: 'Spectral', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #08060f; }
body {
  font-family: var(--body);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

.hidden { display: none !important; }

/* ---------------- overlays ---------------- */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(40, 20, 80, 0.55), rgba(6, 4, 14, 0.92));
  backdrop-filter: blur(4px);
  z-index: 20;
}

/* The main menu is a self-contained start screen with its OWN cinematic
   background (assets/textures/menu_bg.webp) — fully decoupled from the 3D game,
   which it opaquely covers while shown and reveals untouched once hidden. */
#menu.menu-overlay { perspective: 1500px; overflow: hidden; backdrop-filter: none; }
.menu-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: #06040f center / cover no-repeat;
  background-image: url('../assets/textures/menu_bg.webp');
  transform-origin: center;
  animation: bgDrift 40s ease-in-out infinite alternate;
}
/* looping video sits over the still image (which stays as poster/fallback) */
.menu-video {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);                 /* hide any edge bleed from the encode */
}
.menu-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 68% at 50% 48%, rgba(6,4,16,0.58), transparent 72%),
    linear-gradient(180deg, rgba(6,4,16,0.55) 0%, rgba(6,4,16,0.12) 30%, rgba(6,4,16,0.45) 74%, rgba(3,2,10,0.88) 100%);
}
.menu-overlay .menu-card { z-index: 2; }

.menu-card {
  width: min(560px, 92vw);
  max-height: 92vh; overflow-y: auto;
  padding: 34px 38px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(120, 80, 220, 0.35), inset 0 0 40px rgba(120, 80, 220, 0.08);
}
.menu-card.center { text-align: center; }

/* ---------------- obsidian-glass spell tablet (main menu) ---------------- */
.menu-card.tablet {
  position: relative;
  width: min(600px, 94vw);
  padding: 38px 42px 32px;
  overflow-y: auto; overflow-x: hidden;       /* clip veins/dust to the radius */
  border: 1px solid rgba(204,172,118,0.32);
  border-radius: 20px;
  background:
    linear-gradient(158deg, rgba(30,21,54,0.82) 0%, rgba(15,10,30,0.88) 52%, rgba(9,6,20,0.92) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.62),
    0 0 72px rgba(120,80,220,0.30),
    inset 0 1px 0 rgba(255,240,210,0.20),       /* top rim light */
    inset 0 0 60px rgba(120,80,220,0.10),       /* inner bloom */
    inset 0 -26px 52px rgba(0,0,0,0.42);        /* base depth */
}
.menu-card.tablet::before {                     /* drifting internal arcane veins */
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(58% 44% at 18% 16%, rgba(157,123,255,0.22), transparent 60%),
    radial-gradient(54% 50% at 86% 82%, rgba(232,198,106,0.13), transparent 60%),
    radial-gradient(42% 36% at 72% 26%, rgba(111,208,255,0.10), transparent 60%);
  mix-blend-mode: screen;
  animation: veinDrift 16s ease-in-out infinite alternate;
}
.menu-card.tablet::after {                      /* gold inlay frame */
  content: ''; position: absolute; inset: 9px; border-radius: 13px;
  pointer-events: none; z-index: 1;
  border: 1px solid rgba(232,198,106,0.22);
  box-shadow: inset 0 0 22px rgba(232,198,106,0.06);
}
.tablet > * { position: relative; z-index: 2; }

.tablet-dust {                                  /* drifting glyph dust */
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 30%, rgba(232,198,106,0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(196,168,255,0.85), transparent 60%),
    radial-gradient(1px 1px at 40% 72%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 54%, rgba(232,198,106,0.7), transparent 60%),
    radial-gradient(1px 1px at 26% 88%, rgba(196,168,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 90% 78%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 52% 22%, rgba(232,198,106,0.6), transparent 60%);
  animation: dustDrift 17s ease-in-out infinite;
}

.emblem {                                       /* celestial sigil above the title */
  position: relative; z-index: 3;
  width: 50px; height: 50px; margin: -4px auto 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; color: #fff2cf;
  background: radial-gradient(circle, rgba(72,48,124,0.95), rgba(16,10,30,0.95));
  border: 1px solid rgba(232,198,106,0.6);
  text-shadow: 0 0 14px rgba(232,198,106,0.95);
  animation: emblemPulse 4.2s ease-in-out infinite;
}
.emblem::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(157,123,255,0.30); border-top-color: rgba(232,198,106,0.75);
  animation: ls-spin 9s linear infinite;
}

.title {
  position: relative;
  font-family: var(--display);
  font-size: 56px; letter-spacing: 9px; font-weight: 900;
  text-align: center; line-height: 1.0;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.85) 48%, transparent 58%) 250% 0 / 250% 100% no-repeat,
    linear-gradient(180deg, #fffdf6 0%, #ffe7a8 44%, var(--gold) 72%, #b07e2c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.30)) drop-shadow(0 0 26px rgba(232,198,106,0.32));
  animation: titleSheen 7.5s ease-in-out infinite;
}
.title span { display: block; font-size: 30px; letter-spacing: 14px; color: var(--rune-bright);
  background: linear-gradient(180deg, var(--rune-bright), var(--rune));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.title.small { font-size: 34px; letter-spacing: 5px; }
.subtitle { text-align: center; color: var(--text-dim); margin: 8px 0 22px; font-size: 14px; letter-spacing: 1px; }

.menu-section { margin-bottom: 18px; }
.menu-section h3 {
  font-family: var(--display); font-weight: 700;
  font-size: 13px; text-transform: uppercase; letter-spacing: 3px;
  color: var(--gold); margin-bottom: 8px; text-shadow: 0 0 10px rgba(232, 198, 106, 0.35);
}
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1 1 0; min-width: 120px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; cursor: pointer;
  background: rgba(40, 28, 70, 0.5);
  border: 1px solid rgba(157, 123, 255, 0.25);
  border-radius: 10px; color: var(--text);
  font-size: 14px; text-align: left;
  transition: all 0.18s ease;
}
.choice.small { flex-direction: row; justify-content: center; text-align: center; font-size: 13px; padding: 9px 10px; }
.choice:hover { border-color: var(--rune); background: rgba(60, 40, 100, 0.6); transform: translateY(-1px); }
.choice.selected {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(90, 60, 150, 0.7), rgba(60, 40, 100, 0.55));
  box-shadow: 0 0 18px rgba(232, 198, 106, 0.25);
}
.choice-name { font-weight: 700; letter-spacing: 0.5px; }
.choice-sub { font-size: 11px; color: var(--text-dim); }

/* ---- mode selection as fantasy cards ---- */
.choice-row.cards { gap: 12px; }
.choice.card {
  align-items: center; text-align: center; gap: 6px;
  padding: 16px 14px 14px;
  background: linear-gradient(180deg, rgba(42,29,72,0.55), rgba(22,15,42,0.5));
  transform-style: preserve-3d;
}
.choice.card .card-ico {
  font-size: 30px; line-height: 1; color: var(--gold);
  text-shadow: 0 0 16px rgba(232,198,106,0.5); transition: all 0.2s;
}
.choice.card:hover { transform: translateY(-3px) rotateX(7deg); }
.choice.card.selected .card-ico { color: #fff2cf; text-shadow: 0 0 24px rgba(232,198,106,0.95); }
.choice.card.selected::before {                 /* orbiting rune ring */
  content: ''; position: absolute; inset: -1px; border-radius: 11px; padding: 1px;
  background: conic-gradient(from var(--orbit,0deg), transparent 0 68%, rgba(232,198,106,0.95) 84%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: runeOrbit 5s linear infinite;
  pointer-events: none;
}

/* ---- allegiance factions ---- */
.choice.faction { align-items: center; text-align: center; gap: 2px; padding: 11px 12px; }
.choice.faction .fac-name { font-family: var(--display); font-weight: 700; letter-spacing: 1px; font-size: 14px; }
.choice.faction .fac-sub { font-size: 10.5px; color: var(--text-dim); letter-spacing: 1px; }
.choice.faction.dawn .fac-name { color: #ffe7a8; }
.choice.faction.void .fac-name { color: #c9b6ff; }
.choice.faction.dawn.selected {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(120,96,40,0.5), rgba(58,44,18,0.42));
  box-shadow: 0 0 22px rgba(232,198,106,0.38);
}
.choice.faction.void.selected {
  border-color: var(--rune);
  background: linear-gradient(180deg, rgba(74,42,134,0.62), rgba(34,18,68,0.5));
  box-shadow: 0 0 22px rgba(157,123,255,0.45);
}

.start-btn {
  display: block; width: 100%; margin-top: 14px;
  padding: 14px; cursor: pointer;
  font-family: var(--display);
  font-size: 16px; font-weight: 700; letter-spacing: 3px;
  color: #1a1030;
  background: linear-gradient(180deg, var(--gold), #c79a3e);
  border: none; border-radius: 12px;
  box-shadow: 0 0 26px rgba(232, 198, 106, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(232, 198, 106, 0.6); }
.start-btn.ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--panel-edge); box-shadow: none; margin-top: 10px; letter-spacing: 2px;
}
.start-btn.ghost:hover { color: var(--text); border-color: var(--rune); }

/* ---- ritual start button ---- */
.start-btn.ritual {
  position: relative; overflow: hidden;
  margin-top: 20px; padding: 17px;
  font-size: 19px; letter-spacing: 5px;
  color: #2a1806;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe9ad 0%, #e8c66a 38%, #c79a3e 70%, #a87b2c 100%);
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
  box-shadow:
    0 0 30px rgba(232,198,106,0.45),
    inset 0 1px 0 rgba(255,255,255,0.70),
    inset 0 -3px 9px rgba(120,80,20,0.5);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.start-btn.ritual .rb-label { position: relative; z-index: 2; }
.start-btn.ritual::before {                      /* travelling light sweep */
  content: ''; position: absolute; top: 0; left: -60%; width: 46%; height: 100%; z-index: 1;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: skewX(-18deg);
  animation: btnSweep 4.6s ease-in-out infinite;
}
.start-btn.ritual:hover {
  transform: translateY(-2px); filter: brightness(1.06);
  box-shadow:
    0 0 48px rgba(232,198,106,0.72),
    0 0 0 1px rgba(255,242,200,0.65),
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset 0 -3px 9px rgba(120,80,20,0.5);
}
.start-btn.ritual:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: inset 0 3px 11px rgba(80,50,10,0.6), 0 0 30px rgba(232,198,106,0.5);
}
.hint { text-align: center; color: var(--text-dim); font-size: 12px; margin-top: 14px; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--body); }
#hud button, #hud .spell-card, #hud canvas { pointer-events: auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 9px; cursor: pointer;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--panel-edge); font-size: 17px; transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--rune); color: var(--gold); }
.icon-btn.muted { opacity: 0.5; text-decoration: line-through; }
#corner-btns { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }

/* top-left: Aether + spell cards */
#left-panel { position: absolute; top: 16px; left: 18px; width: 270px; display: flex; flex-direction: column; gap: 12px; }
#aether-box {
  padding: 10px 14px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(10,18,34,0.85), rgba(6,10,22,0.8));
  border: 1px solid rgba(111,208,255,0.35); box-shadow: 0 0 22px rgba(58,176,255,0.18);
}
#aether-label { font-size: 17px; font-weight: 700; letter-spacing: 1px; color: #d6f2ff; text-shadow: 0 0 10px rgba(58,176,255,0.6); }
#aether-label .dim { color: #6f93b8; font-weight: 400; }
#mana-bar {
  margin-top: 7px; height: 14px; border-radius: 7px; overflow: hidden;
  background: rgba(10,20,40,0.9); border: 1px solid rgba(111,208,255,0.45);
  background-image: repeating-linear-gradient(90deg, transparent 0 18px, rgba(0,0,0,0.4) 18px 20px);
}
#mana-fill { height: 100%; width: 35%; border-radius: 6px;
  background: linear-gradient(90deg, #1f6fd0, #5fd6ff, #aef0ff); box-shadow: 0 0 14px var(--frost); transition: width 0.4s ease; }

#spell-cards { display: flex; flex-direction: column; gap: 10px; }
.spell-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; cursor: pointer; border-radius: 10px;
  background: linear-gradient(180deg, rgba(26,20,44,0.82), rgba(14,10,26,0.8));
  border: 1px solid rgba(157,123,255,0.3); transition: all 0.15s;
}
.spell-card .ico {
  width: 46px; height: 46px; flex: none; border-radius: 8px; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(90,60,150,0.7), rgba(30,20,50,0.7));
  border: 1px solid rgba(157,123,255,0.5); box-shadow: inset 0 0 12px rgba(157,123,255,0.3);
}
.spell-card .meta { display: flex; flex-direction: column; gap: 2px; }
.spell-card .nm { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; color: #ede7ff; }
.spell-card .st { font-size: 12px; color: #9b8fc4; }
.spell-card .st.ready { color: #7dffb0; }
.spell-card:hover:not(.disabled) { border-color: var(--gold); transform: translateX(3px); box-shadow: 0 0 18px rgba(157,123,255,0.35); }
.spell-card.armed { border-color: var(--gold); box-shadow: 0 0 24px var(--gold); background: linear-gradient(180deg, rgba(70,46,120,0.85), rgba(40,26,70,0.8)); }
.spell-card.disabled { opacity: 0.45; cursor: not-allowed; }
.spell-card .cd-badge {
  position: absolute; bottom: 6px; left: 40px;
  font-size: 11px; font-weight: 800; color: var(--frost);
}

/* top-right: minimap + turn */
#right-panel { position: absolute; top: 16px; right: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#minimap {
  width: 168px; height: 168px; border-radius: 8px;
  background: rgba(8,8,16,0.7); border: 1px solid var(--panel-edge);
  box-shadow: 0 0 22px rgba(0,0,0,0.5);
}
#turn-num { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: #d8d2f0; }
#turn-state {
  font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 3px; color: #7dffb0;
  text-shadow: 0 0 12px currentColor; padding: 4px 14px; margin-top: 2px;
  background: rgba(10, 8, 20, 0.7); border: 1px solid currentColor; border-radius: 13px;
  box-shadow: 0 0 14px rgba(125, 255, 176, 0.25);
}
#turn-state.enemy { color: var(--crimson); box-shadow: 0 0 14px rgba(255, 58, 74, 0.3); }

/* captured trays — vertical, mid-screen edges */
.captured-tray {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
}
.captured-tray.left { left: 8px; }
.captured-tray.right { right: 8px; }
.cap-slot {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(30, 22, 46, 0.82), rgba(16, 12, 26, 0.8));
  border: 1px solid rgba(157, 123, 255, 0.32); border-radius: 7px;
  box-shadow: 0 0 8px rgba(157, 123, 255, 0.14), inset 0 0 6px rgba(0, 0, 0, 0.4);
}
.cap-slot span { font-size: 20px; line-height: 1; color: var(--text); filter: drop-shadow(0 0 5px rgba(157, 123, 255, 0.4)); }

/* bottom-left: selected unit */
#unit-panel {
  position: absolute; bottom: 22px; left: 20px; width: 340px;
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border-radius: 12px; background: linear-gradient(180deg, rgba(18,14,30,0.92), rgba(10,8,18,0.9));
  border: 1px solid var(--panel-edge); box-shadow: 0 0 26px rgba(0,0,0,0.6);
}
#unit-desc {
  margin-top: 7px; font-size: 11.5px; line-height: 1.45; color: #b3a9d4;
  font-style: italic; max-width: 250px;
}
#unit-portrait {
  position: relative; width: 58px; height: 58px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  background: radial-gradient(circle, rgba(60,40,100,0.8), rgba(20,14,36,0.9));
  border: 1px solid var(--gold);
}
#unit-level {
  position: absolute; bottom: -6px; right: -6px; min-width: 22px; height: 22px;
  border-radius: 11px; background: var(--gold); color: #1a1030;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
#unit-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
#unit-name { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: 0.5px; color: #f0ebff; }
#unit-sub { font-size: 12px; color: #a99fce; letter-spacing: 0.5px; }
#unit-bar { height: 9px; border-radius: 5px; background: rgba(40,10,12,0.9); border: 1px solid rgba(255,90,80,0.4); overflow: hidden; margin-top: 2px; }
#unit-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #8a1620, #ff5a4a, #ff8a6a); box-shadow: 0 0 10px rgba(255,90,74,0.6); transition: width 0.3s; }

/* bottom-right: logo */
#game-logo { position: absolute; bottom: 20px; right: 22px; text-align: right; pointer-events: none; }
.logo-main { font-family: var(--display); font-size: 30px; font-weight: 900; letter-spacing: 4px; line-height: 1;
  background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(232,198,106,0.3); }
.logo-arena { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: 6px; color: var(--rune-bright); text-shadow: 0 0 16px rgba(157,123,255,0.5); margin-top: 2px; }
.logo-mode { font-size: 11px; letter-spacing: 3px; color: #b9aee0; margin-top: 3px; }

/* cinematic vignette */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 9;
  box-shadow: inset 0 0 240px 60px rgba(0,0,0,0.7);
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.35) 100%);
}

/* ---------------- toasts / banners ---------------- */
#toast {
  position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  padding: 10px 22px; border-radius: 22px;
  background: var(--panel); border: 1px solid var(--panel-edge);
  font-size: 14px; letter-spacing: 1px; opacity: 0; transition: opacity 0.3s;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

#check-banner {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: 80px; font-weight: 900; letter-spacing: 14px; color: var(--crimson);
  text-shadow: 0 0 40px var(--crimson); animation: checkpulse 0.7s ease;
  pointer-events: none;
}
@keyframes checkpulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

#spell-prompt {
  position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%);
  padding: 10px 22px; border-radius: 12px;
  background: rgba(60, 40, 110, 0.85); border: 1px solid var(--gold);
  font-size: 14px; letter-spacing: 1px;
}

/* ---------------- promotion ---------------- */
.promo-card { padding: 24px 30px; background: var(--panel); border: 1px solid var(--gold); border-radius: 16px; text-align: center; }
.promo-card h3 { margin-bottom: 14px; letter-spacing: 2px; }
#promo-row { display: flex; gap: 12px; }
.promo-opt {
  width: 70px; height: 70px; font-size: 38px; cursor: pointer;
  background: rgba(40,28,70,0.6); border: 1px solid var(--panel-edge); border-radius: 12px; color: var(--text);
  transition: all 0.15s;
}
.promo-opt:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 18px var(--gold); }

/* ---------------- first-load screen ---------------- */
#loading-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(circle at 50% 38%, #1a1033, #08060f 72%);
  transition: opacity 0.7s ease;
}
#loading-screen.done { opacity: 0; pointer-events: none; }
.ls-title {
  font-family: var(--display); font-size: 40px; letter-spacing: 9px; font-weight: 900; line-height: 1;
  text-align: center;
  background: linear-gradient(180deg, #fff, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 32px rgba(232, 198, 106, 0.3);
}
.ls-title span {
  display: block; font-size: 24px; letter-spacing: 14px; margin-top: 4px;
  background: linear-gradient(180deg, var(--rune-bright), var(--rune));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ls-ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid rgba(157, 123, 255, 0.15);
  border-top-color: var(--gold); border-right-color: var(--rune-bright);
  box-shadow: 0 0 26px rgba(157, 123, 255, 0.4);
  animation: ls-spin 1s linear infinite;
}
@keyframes ls-spin { to { transform: rotate(360deg); } }
.ls-text { font-family: var(--body); color: var(--text-dim); letter-spacing: 4px; font-size: 12px; text-transform: uppercase; animation: pulse 1.6s infinite; }

/* ---------------- loading ---------------- */
.loader { color: var(--gold); font-size: 18px; letter-spacing: 3px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

@media (max-width: 760px) {
  .title { font-size: 38px; letter-spacing: 5px; }
  .menu-card.tablet { padding: 30px 24px 26px; }
  #left-panel { width: 210px; }
  #minimap { width: 120px; height: 120px; }
  #unit-panel { width: 220px; }
  .logo-main { font-size: 22px; } .logo-arena { font-size: 16px; letter-spacing: 4px; }
  #check-banner { font-size: 52px; letter-spacing: 8px; }
}

/* ============================================================================
   Start-screen motion — arcane ambience
   ============================================================================ */
@property --orbit { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

@keyframes bgDrift {
  0%   { transform: scale(1.06) translate(-1%, -0.5%); }
  100% { transform: scale(1.12) translate(1%, 0.5%); }
}
@keyframes titleSheen {
  0%, 64% { background-position: 250% 0, 50% 0; }
  100%    { background-position: -150% 0, 50% 0; }
}
@keyframes veinDrift {
  0%   { transform: translate(0, 0) scale(1);          opacity: 0.6;  }
  100% { transform: translate(2.5%, -2.5%) scale(1.07); opacity: 0.95; }
}
@keyframes dustDrift {
  0%   { transform: translateY(9px);  opacity: 0.35; }
  50%  {                              opacity: 0.7;  }
  100% { transform: translateY(-9px); opacity: 0.35; }
}
@keyframes emblemPulse {
  0%, 100% { box-shadow: 0 0 22px rgba(232,198,106,0.42), inset 0 0 14px rgba(157,123,255,0.5); }
  50%      { box-shadow: 0 0 40px rgba(232,198,106,0.78), inset 0 0 18px rgba(157,123,255,0.72); }
}
@keyframes runeOrbit { to { --orbit: 360deg; } }
@keyframes btnSweep {
  0%, 55%   { left: -60%; }
  88%, 100% { left: 130%; }
}
