/* Kingdom Defense — fantasy battle theme */
:root {
  --gold: #f6c453;
  --gold-deep: #c9962a;
  --parchment: #efe2c4;
  --ink: #1a140b;
  --stone: #2a2018;
  --stone-light: #3a2e22;
  --blood: #c0392b;
  --hp-good: #57c84d;
  --hp-warn: #f2b705;
  --hp-crit: #e23b2e;
  --heal: #3ad29f;
  --magic: #8e6cf0;
  --sky-top: #1b2340;
  --sky-bot: #4a2c4f;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Cinzel', 'Times New Roman', serif;
}

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

body {
  font-family: var(--font);
  color: var(--parchment);
  background: #0d0a07;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Battlefield backdrop ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(142,108,240,0.25), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 55%, #2a1c18 100%);
  overflow: hidden;
}
.stars { position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1px 1px at 40% 60%, #ffe9b0, transparent),
    radial-gradient(1px 1px at 85% 45%, #fff, transparent),
    radial-gradient(1px 1px at 55% 12%, #fff, transparent),
    radial-gradient(1px 1px at 10% 70%, #ffe9b0, transparent);
  opacity: 0.5; animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.6; } }
.ground { position: absolute; bottom: 0; left: 0; right: 0; height: 22%;
  background: linear-gradient(180deg, #3a2a1c, #20150d);
  box-shadow: inset 0 8px 24px rgba(0,0,0,0.5); }
/* parallax mountain silhouettes for depth */
.hills { position: absolute; bottom: 18%; left: 0; right: 0; height: 38%; pointer-events: none; opacity: 0.8;
  background:
    radial-gradient(120px 80px at 12% 100%, #241a2e 0 99%, transparent 100%),
    radial-gradient(180px 120px at 30% 100%, #1d1526 0 99%, transparent 100%),
    radial-gradient(160px 110px at 55% 100%, #281c33 0 99%, transparent 100%),
    radial-gradient(220px 150px at 78% 100%, #1a1322 0 99%, transparent 100%),
    radial-gradient(140px 90px at 94% 100%, #2a1e36 0 99%, transparent 100%); }
.fog { position: absolute; bottom: 16%; left: -10%; right: -10%; height: 16%; pointer-events: none;
  background: radial-gradient(60% 80% at 50% 100%, rgba(180,170,210,0.10), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
/* vignette + atmosphere */
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(0,0,0,0.55) 100%); }

/* castle flag + torches */
.flag { position: absolute; top: -6px; left: 50%; font-size: 26px; transform-origin: bottom left;
  animation: wave 2.2s ease-in-out infinite; }
@keyframes wave { 0%,100%{ transform: rotate(-6deg) skewX(0deg);} 50%{ transform: rotate(4deg) skewX(-8deg);} }
.torch { position: absolute; font-size: 24px; animation: flicker 0.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #ff8a3d); }
.torch.l { left: -6px; bottom: 40px; } .torch.r { right: -6px; bottom: 40px; }
@keyframes flicker { from { opacity: 0.8; transform: scale(1) translateY(0);} to { opacity: 1; transform: scale(1.12) translateY(-1px);} }

/* always-visible sound toggle (top-right) */
.soundtoggle { position: fixed; top: 12px; right: 14px; z-index: 90; width: 46px; height: 46px;
  border-radius: 50%; border: 2px solid var(--gold); background: rgba(20,14,8,0.92); color: var(--gold);
  font-size: 21px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center; transition: 0.2s; }
.soundtoggle:hover { background: var(--gold); color: var(--ink); transform: scale(1.08); }
.soundtoggle.off { border-color: #8a7a5a; color: #9a8a6a; }

/* LIVE badge */
.stat.live .label { color: #ff7a6b; display: flex; align-items: center; gap: 5px; justify-content: center; }
.stat.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 8px #ff3b30;
  animation: livepulse 1.1s ease-in-out infinite; }
@keyframes livepulse { 0%,100%{ opacity: 1; transform: scale(1);} 50%{ opacity: 0.4; transform: scale(0.7);} }

/* castle muzzle flash when firing */
.figure.fire { animation: muzzle 0.3s ease; }
@keyframes muzzle { 0%{ filter: brightness(1);} 30%{ filter: brightness(1.8) drop-shadow(0 0 14px #ffb74d);} 100%{ filter: brightness(1);} }

/* speech bubbles (shoutouts) — centred above each figure */
.speech { position: absolute; top: -10px; left: 50%; z-index: 12; width: max-content; max-width: 230px;
  padding: 8px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; opacity: 0;
  transform: translateX(-50%) scale(0.7); pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,0.4); text-align: center; }
.speech.show { animation: bubble 2.6s ease forwards; }
@keyframes bubble {
  0%{opacity:0; transform:translateX(-50%) scale(0.6)} 10%{opacity:1; transform:translateX(-50%) scale(1.05)}
  18%{transform:translateX(-50%) scale(1)} 82%{opacity:1} 100%{opacity:0; transform:translateX(-50%) scale(1)} }
.castle-speech { background: #f3e7c6; color: #3a2a12; border: 2px solid var(--gold-deep); }
.castle-speech::after { content:""; position:absolute; bottom:-9px; left:50%; margin-left:-8px; border:8px solid transparent; border-top-color: var(--gold-deep); }
.boss-speech { background: #2a1020; color: #ffd0d0; border: 2px solid var(--blood); }
.boss-speech::after { content:""; position:absolute; bottom:-9px; left:50%; margin-left:-8px; border:8px solid transparent; border-top-color: var(--blood); }

/* day selector on the live-day page */
.ldselect { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.ldselect .pvlabel { color: #ff9f93; font-size: 13px; }
.ldbtn { cursor: pointer; font-family: var(--font); font-size: 13px; color: var(--parchment);
  background: rgba(0,0,0,0.3); border: 1px solid rgba(246,196,83,0.35); border-radius: 8px; padding: 6px 14px; transition: 0.2s; }
.ldbtn:hover { border-color: var(--gold); color: var(--gold); }
.ldbtn.on { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }

/* 24-hour timeline */
.timeline { position: relative; z-index: 5; padding: 8px 22px 4px; }
.tlbar { height: 10px; background: rgba(0,0,0,0.45); border: 1px solid rgba(246,196,83,0.3); border-radius: 6px; overflow: hidden; }
.tlbar > span { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #2b3a6b, #6c4ea0, var(--gold)); transition: width 0.2s linear; }
.tllabel { display: flex; justify-content: space-between; font-size: 11px; color: #cbb994; margin-top: 4px; }

/* attack projectile + impact sparks */
.projectile { position: fixed; z-index: 9; font-size: 26px; pointer-events: none;
  filter: drop-shadow(0 0 6px #ffd34d); }
.spark { position: fixed; z-index: 9; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff, #ffae2b 60%, transparent); animation: sparkfly 0.6s ease-out forwards; }
@keyframes sparkfly { to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); } }
.screenflash { position: fixed; inset: 0; z-index: 18; background: #fff; opacity: 0; pointer-events: none; }
.screenflash.go { animation: flashfade 0.5s ease-out; }
@keyframes flashfade { 0% { opacity: 0.65; } 100% { opacity: 0; } }

/* ---------- Top HUD ---------- */
.hud {
  position: relative; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(20,14,8,0.92), rgba(20,14,8,0.6));
  border-bottom: 2px solid var(--gold-deep);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
a.brand:hover .crest { transform: scale(1.1); transition: transform 0.2s; }
.brand .crest { font-size: 28px; filter: drop-shadow(0 0 6px var(--gold)); }
.brand h1 { font-family: var(--font-head); font-size: 20px; color: var(--gold);
  letter-spacing: 1px; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.brand small { display: block; font-size: 11px; color: #cbb994; letter-spacing: 2px; font-weight: 400; }

.hud-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: rgba(0,0,0,0.35); border: 1px solid rgba(246,196,83,0.35);
  border-radius: 10px; padding: 6px 14px; text-align: center; min-width: 92px;
}
.stat .label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #cbb994; }
.stat .value { font-family: var(--font-head); font-size: 19px; color: var(--gold); font-weight: 700; }
.stat.pot .value { color: #ffe08a; }
.stat .value.flash { animation: statflash 0.6s ease; }
@keyframes statflash { 0% { transform: scale(1.4); color: #fff; } 100% { transform: scale(1); } }

/* ---------- Day banner / progress ---------- */
.dayband { position: relative; z-index: 5; padding: 10px 22px 0; }
.daybar { height: 8px; background: rgba(0,0,0,0.4); border-radius: 6px; overflow: hidden;
  border: 1px solid rgba(246,196,83,0.25); }
.daybar > span { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width 0.5s ease; }
.daylabel { display: flex; justify-content: space-between; font-size: 12px; color: #cbb994; margin-top: 5px; }
/* castle doom meter (drains toward 0 = the kingdom falls) */
.doomtop { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #cbb994;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.daybar.doom { height: 16px; }
.daybar.doom > span { background: linear-gradient(90deg, #3a7a2e, var(--hp-good)); transition: width 0.6s ease, background 0.4s; }
.daybar.doom.warn > span { background: linear-gradient(90deg, #b07d05, var(--hp-warn)); }
.daybar.doom.crit > span { background: linear-gradient(90deg, #7a1d14, var(--hp-crit)); animation: critpulse 0.9s ease-in-out infinite; }

/* boss stat block */
.bossstats { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 22px; margin-top: 12px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(192,57,43,0.4); border-radius: 10px; padding: 12px 18px; }
.bossstats > div { display: flex; flex-direction: column; }
.bossstats .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #cbb994; }
.bossstats .v { font-family: var(--font-head); font-size: 16px; color: var(--parchment); }
.bossstats .v.crit { color: #ff7a6b; }

/* castle-damage floater (red, the boss hurting the castle) */
.floater.castledmg { color: #ff6b5b; }

/* ---------- Arena ---------- */
.arena {
  position: relative; z-index: 4; flex: 1;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 10px;
  align-items: end; padding: 24px 28px 90px;
}
.side { display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; }
.side .figure { font-size: 120px; line-height: 1; filter: drop-shadow(0 12px 18px rgba(0,0,0,0.55)); position: relative; }
.boss .figure { animation: bossIdle 3s ease-in-out infinite; }
@keyframes bossIdle { 0%,100%{ transform: translateY(0) scale(1);} 50%{ transform: translateY(-12px) scale(1.03);} }
.boss .figure.spawn { animation: bossSpawn 0.6s ease; }
@keyframes bossSpawn { 0%{ transform: scale(0.2) rotate(-30deg); opacity: 0; filter: brightness(3);} 60%{ transform: scale(1.15);} 100%{ transform: scale(1); opacity: 1;} }
.castle .figure { font-size: 130px; }
.castle.shake { animation: shake 0.4s; }
.boss.hit { animation: bosshit 0.35s; }
.boss.dying { animation: bossdie 0.9s forwards; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
@keyframes bosshit { 0%{transform:translateX(0) scale(1)} 30%{transform:translateX(14px) scale(1.04); filter:brightness(2)} 100%{transform:translateX(0) scale(1)} }
@keyframes bossdie { 0%{transform:scale(1) rotate(0); opacity:1} 50%{transform:scale(1.3) rotate(8deg); filter:brightness(3)} 100%{transform:scale(0.2) rotate(40deg); opacity:0} }

.nameplate { font-family: var(--font-head); font-size: 22px; color: var(--parchment);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7); text-align: center; }
.nameplate .bounty { display: inline-block; margin-left: 8px; font-size: 13px; color: var(--ink);
  background: var(--gold); padding: 2px 9px; border-radius: 20px; font-family: var(--font); font-weight: 700; }
.lore { font-size: 12px; color: #d8c9a6; font-style: italic; text-align: center; max-width: 360px; min-height: 16px; }

/* ---------- HP bars ---------- */
.hpwrap { width: 100%; max-width: 420px; }
.hpwrap .hptop { display: flex; justify-content: space-between; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; color: #cbb994; margin-bottom: 4px; }
.hpbar { height: 22px; border-radius: 12px; background: rgba(0,0,0,0.5);
  border: 2px solid rgba(0,0,0,0.6); overflow: hidden; position: relative; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }
/* trailing "ghost" bar (a div behind the coloured fill span) showing damage just taken */
.hpbar > .ghost { position: absolute; top: 0; left: 0; height: 100%; width: 100%;
  background: rgba(255,255,255,0.5); transition: width 0.9s ease 0.25s; z-index: 1; }
.hpbar > span { display: block; height: 100%; width: 100%; transition: width 0.45s cubic-bezier(.4,0,.2,1); position: relative; z-index: 2; }
.hpbar .hptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.9); z-index: 3; }
.castle .hpbar > span { background: linear-gradient(90deg, var(--hp-good), #9fe88a); }
.castle.warn .hpbar > span { background: linear-gradient(90deg, var(--hp-warn), #ffd86b); }
.castle.crit .hpbar > span { background: linear-gradient(90deg, var(--hp-crit), #ff7a5e); animation: critpulse 0.9s ease-in-out infinite; }
@keyframes critpulse { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.5)} }
.boss .hpbar > span { background: linear-gradient(90deg, #8e1f17, var(--blood)); }
/* castle HP bar states when toggled directly on the bar (live-day view) */
.hpbar.castle.warn > span { background: linear-gradient(90deg, var(--hp-warn), #ffd86b); }
.hpbar.castle.crit > span { background: linear-gradient(90deg, var(--hp-crit), #ff7a5e); animation: critpulse 0.9s ease-in-out infinite; }
.projectile.bossatk { filter: drop-shadow(0 0 6px #e23b2e); }

/* ---------- floating damage / heal numbers ---------- */
.floater { position: absolute; z-index: 8; font-family: var(--font-head); font-weight: 700;
  font-size: 30px; pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  animation: floatup 1.3s ease-out forwards; }
.floater.dmg { color: #ffd34d; }
.floater.heal { color: var(--heal); }
@keyframes floatup { 0%{opacity:0; transform:translateY(0) scale(0.6)} 20%{opacity:1; transform:translateY(-20px) scale(1.1)} 100%{opacity:0; transform:translateY(-90px) scale(1)} }

/* ---------- Event banner (kills / heals) ---------- */
.bigbanner { position: absolute; top: 28%; left: 50%; transform: translateX(-50%) scale(0.7);
  z-index: 20; text-align: center; opacity: 0; pointer-events: none; }
.bigbanner.show { animation: bannerpop 2.4s ease forwards; }
@keyframes bannerpop { 0%{opacity:0; transform:translateX(-50%) scale(0.6)} 12%{opacity:1; transform:translateX(-50%) scale(1.08)} 20%{transform:translateX(-50%) scale(1)} 85%{opacity:1} 100%{opacity:0; transform:translateX(-50%) scale(1)} }
.bigbanner .title { font-family: var(--font-head); font-size: 46px; color: var(--gold);
  text-shadow: 0 0 24px rgba(246,196,83,0.7), 0 4px 10px rgba(0,0,0,0.8); letter-spacing: 2px; }
.bigbanner .sub { font-size: 22px; color: #fff; margin-top: 6px; }
.bigbanner.kill .title { color: #ffd34d; }
.bigbanner.heal .title { color: var(--heal); text-shadow: 0 0 24px rgba(58,210,159,0.7); }

/* ---------- Event feed ---------- */
.feed { position: absolute; right: 18px; top: 150px; z-index: 6; width: 250px;
  max-height: 46vh; overflow: hidden; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.feed .item { background: rgba(10,7,4,0.78); border-left: 3px solid var(--gold-deep);
  border-radius: 8px; padding: 7px 11px; font-size: 12.5px; color: #e8dcc0;
  animation: feedin 0.5s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.feed .item.kill { border-left-color: #ffd34d; }
.feed .item.heal { border-left-color: var(--heal); }
.feed .item.milestone { border-left-color: var(--magic); }
.feed .item b { color: var(--gold); }
@keyframes feedin { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Boss roster ---------- */
.roster { position: relative; z-index: 5; display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap; padding: 10px 22px 16px; background: linear-gradient(0deg, rgba(20,14,8,0.95), transparent); }
.roster .chip { position: relative; width: 50px; height: 50px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: rgba(0,0,0,0.4); border: 2px solid rgba(246,196,83,0.25); transition: 0.3s; }
.roster .chip .num { position: absolute; top: -7px; left: -7px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--stone-light); border: 1px solid var(--gold-deep);
  font-size: 10px; display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font); }
.roster .chip.active { border-color: var(--gold); box-shadow: 0 0 14px rgba(246,196,83,0.6); transform: translateY(-4px) scale(1.08); }
.roster .chip.dead { opacity: 0.35; filter: grayscale(1); }
.roster .chip.dead::after { content: "✓"; position: absolute; bottom: -4px; right: -4px;
  background: var(--hp-good); color: #07210a; width: 16px; height: 16px; border-radius: 50%;
  font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ---------- Controls ---------- */
.controls { position: relative; z-index: 7; display: flex; gap: 12px; align-items: center;
  justify-content: center; flex-wrap: wrap; padding: 14px 22px;
  background: rgba(20,14,8,0.95); border-top: 2px solid var(--gold-deep); }
.btn { font-family: var(--font-head); font-size: 15px; letter-spacing: 1px; cursor: pointer;
  border: 2px solid var(--gold-deep); background: linear-gradient(180deg, var(--stone-light), var(--stone));
  color: var(--gold); padding: 9px 20px; border-radius: 10px; transition: 0.2s; }
.btn:hover { background: var(--gold); color: var(--ink); transform: translateY(-2px); }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.speed { display: flex; align-items: center; gap: 8px; color: #cbb994; font-size: 13px; }
.speed input { accent-color: var(--gold); }

/* ---------- Finale overlay ---------- */
.finale { position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(60,40,90,0.96), rgba(8,6,4,0.98)); }
.finale.show { display: flex; animation: fadein 0.6s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.finale .card { max-width: 760px; width: 100%; text-align: center; }
.finale h2 { font-family: var(--font-head); font-size: 44px; color: var(--gold);
  text-shadow: 0 0 30px rgba(246,196,83,0.7); margin-bottom: 6px; }
.finale.defeat { background: radial-gradient(circle at 50% 30%, rgba(90,20,20,0.96), rgba(8,4,4,0.98)); }
.finale.defeat h2 { color: #ff6b5b; text-shadow: 0 0 30px rgba(226,59,46,0.7); }
.finale .potline .ofmax { font-family: var(--font); font-size: 15px; color: #b9a982; }
.finale .victory-sub { color: #e8dcc0; font-size: 18px; margin-bottom: 4px; }
.finale .potline { font-family: var(--font-head); font-size: 34px; color: #ffe08a; margin: 16px 0 8px; }
.split { margin-top: 18px; background: rgba(0,0,0,0.4); border: 1px solid rgba(246,196,83,0.3);
  border-radius: var(--radius); overflow: hidden; }
.split .row { display: grid; grid-template-columns: 1.4fr 1fr 0.7fr 1fr; gap: 6px;
  padding: 10px 16px; font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,0.06); align-items: center; }
.split .row.head { background: rgba(246,196,83,0.12); color: var(--gold); font-weight: 700;
  text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.split .row .rw { color: #ffe08a; font-weight: 700; font-family: var(--font-head); }
.split .row span:first-child { text-align: left; }
.finale .note { font-size: 12px; color: #b9a982; margin-top: 14px; }
.finale .btn { margin-top: 20px; }

/* confetti */
.confetti { position: fixed; inset: 0; z-index: 49; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; opacity: 0.9;
  animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }

/* intro */
.intro { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(60,40,90,0.97), rgba(8,6,4,0.99)); }
.intro.hide { display: none; }
.intro .crest { font-size: 90px; filter: drop-shadow(0 0 24px var(--gold)); }
.intro h1 { font-family: var(--font-head); font-size: 52px; color: var(--gold);
  text-shadow: 0 0 30px rgba(246,196,83,0.6); margin: 8px 0; letter-spacing: 2px; }
.intro p { color: #e0d3b4; max-width: 620px; line-height: 1.6; margin-bottom: 8px; }
.intro .tag { color: #cbb994; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 18px; }
.intro .meta { display: flex; gap: 26px; margin: 14px 0 26px; flex-wrap: wrap; justify-content: center; }
.intro .meta div { text-align: center; }
.intro .meta .v { font-family: var(--font-head); font-size: 26px; color: var(--gold); }
.intro .meta .k { font-size: 11px; color: #cbb994; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Landing / how-to-play pages ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: rgba(13,10,7,0.92); border-bottom: 2px solid var(--gold-deep); backdrop-filter: blur(6px); }
.nav .links a { color: var(--parchment); text-decoration: none; margin-left: 18px; font-size: 14px; }
.nav .links a:hover { color: var(--gold); }
.nav .links a.cta { background: var(--gold); color: var(--ink); padding: 7px 14px; border-radius: 8px; font-weight: 700; }
.hero { text-align: center; padding: 60px 20px 30px; position: relative; }
.hero h1 { font-family: var(--font-head); font-size: 52px; color: var(--gold);
  text-shadow: 0 0 30px rgba(246,196,83,0.5); letter-spacing: 2px; }
.hero .lede { color: #e0d3b4; max-width: 680px; margin: 14px auto 0; line-height: 1.6; font-size: 17px; }
.hero .ctas { margin-top: 26px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.livegrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 34px auto; }
.livegrid .stat { padding: 16px; }
.livegrid .stat .value { font-size: 24px; }
.section { padding: 30px 0; }
.section h2 { font-family: var(--font-head); color: var(--gold); font-size: 28px; text-align: center; margin-bottom: 8px; }
.section .sub { text-align: center; color: #cbb994; margin-bottom: 26px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.card-tile { background: rgba(0,0,0,0.35); border: 1px solid rgba(246,196,83,0.3); border-radius: var(--radius); padding: 22px; }
.card-tile .ico { font-size: 34px; }
.card-tile h3 { font-family: var(--font-head); color: var(--gold); margin: 8px 0; font-size: 18px; }
.card-tile p { color: #d8c9a6; font-size: 14px; line-height: 1.55; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.step .n { flex: 0 0 38px; height: 38px; border-radius: 50%; background: linear-gradient(180deg,var(--gold),var(--gold-deep));
  color: var(--ink); font-family: var(--font-head); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.step h3 { color: var(--gold); font-size: 17px; margin-bottom: 4px; }
.step p { color: #d8c9a6; font-size: 14px; line-height: 1.55; }
/* live preview day selector */
.daypreview { max-width: 760px; margin: 6px auto 0; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: center; padding: 12px 16px;
  background: rgba(142,108,240,0.12); border: 1px solid rgba(142,108,240,0.4); border-radius: var(--radius); }
.daypreview .pvlabel { color: #cbb7ff; font-size: 13px; margin-right: 4px; }
.pvbtn { cursor: pointer; font-family: var(--font); font-size: 13px; color: var(--parchment);
  background: rgba(0,0,0,0.3); border: 1px solid rgba(246,196,83,0.35); border-radius: 8px; padding: 7px 14px; transition: 0.2s; }
.pvbtn:hover { border-color: var(--gold); color: var(--gold); }
.pvbtn.on { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.pvbtn.live { text-decoration: none; border-color: var(--blood); color: #ff9f93; }
.pvbtn.live:hover { background: var(--blood); color: #fff; }
.bosscard.active { border-color: var(--gold); box-shadow: 0 0 14px rgba(246,196,83,0.5); transform: translateY(-3px); }
.bossgrid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; }
.bosscard { background: rgba(0,0,0,0.35); border: 1px solid rgba(246,196,83,0.25); border-radius: 12px; padding: 14px; text-align: center; }
.bosscard.dead { opacity: 0.45; filter: grayscale(0.6); }
.bosscard .e { font-size: 40px; }
.bosscard .bn { font-family: var(--font-head); color: var(--parchment); margin: 6px 0 2px; }
.bosscard .meta { font-size: 11.5px; color: #cbb994; }
.bosscard .meta.cdmg { color: #ff8a7a; }
.bosscard .rw { color: var(--gold); font-weight: 700; font-size: 13px; }
/* ---------- Leaderboard / search ---------- */
.search-box { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 18px; flex-wrap: wrap; justify-content: center; }
.search-box input { flex: 1; min-width: 220px; padding: 12px 16px; border-radius: 10px; font-size: 15px;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(246,196,83,0.4); color: var(--parchment); }
.search-box input::placeholder { color: #9a8a6a; }
.search-result { max-width: 720px; margin: 0 auto 20px; }
.search-result.found .yourrank { display: flex; align-items: center; gap: 18px; background: rgba(246,196,83,0.12);
  border: 1px solid var(--gold); border-radius: var(--radius); padding: 18px 22px; }
.search-result .big { font-family: var(--font-head); font-size: 44px; color: var(--gold); }
.search-result .you { font-size: 16px; color: var(--parchment); margin-bottom: 8px; }
.search-result .ystats { display: flex; gap: 22px; flex-wrap: wrap; }
.search-result .ystats span { display: flex; flex-direction: column; }
.search-result .ystats b { font-family: var(--font-head); font-size: 18px; color: #ffe08a; }
.search-result .ystats i { font-size: 11px; color: #cbb994; font-style: normal; text-transform: uppercase; letter-spacing: 1px; }
.search-result .ystats .rwx b { color: var(--heal); }
.search-result.miss p { background: rgba(192,57,43,0.15); border: 1px solid var(--blood); border-radius: 10px; padding: 14px 18px; color: #f0d0cc; text-align: center; }
.lbstatus { text-align: center; color: #cbb994; font-size: 13px; margin-bottom: 12px; }
.lbtable { max-width: 860px; margin: 0 auto; border: 1px solid rgba(246,196,83,0.25); border-radius: var(--radius); overflow: hidden; }
.lbrow { display: grid; grid-template-columns: 56px 1.8fr 1fr 0.7fr 1fr; gap: 8px; align-items: center;
  padding: 11px 16px; font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.lbrow.head { background: rgba(246,196,83,0.12); color: var(--gold); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; position: sticky; top: 56px; }
.lbrow .rk { font-family: var(--font-head); color: var(--gold); font-size: 16px; text-align: center; }
.lbrow .nm { display: flex; flex-direction: column; color: var(--parchment); }
.lbrow .nm small { color: #9a8a6a; font-size: 11px; }
.lbrow .num { text-align: right; color: #d8c9a6; }
.lbrow .num.rw { color: #ffe08a; font-weight: 700; }
.lbrow:nth-child(odd) { background: rgba(255,255,255,0.02); }
.lbrow.hit { background: rgba(246,196,83,0.22); border: 1px solid var(--gold); box-shadow: 0 0 14px rgba(246,196,83,0.4); }
.lbscroll { max-height: 60vh; overflow-y: auto; }
@media (max-width: 720px) {
  .lbrow { grid-template-columns: 40px 1.5fr 1fr 1fr; font-size: 12px; }
  .lbrow span:nth-child(4) { display: none; } /* hide Share on mobile, keep Damage + Reward */
}

.foot { text-align: center; padding: 30px 20px; color: #9a8a6a; font-size: 13px; border-top: 1px solid rgba(246,196,83,0.2); margin-top: 30px; }
.ticker { overflow: hidden; white-space: nowrap; padding: 10px 0; opacity: 0.6; }
.ticker span { display: inline-block; animation: scroll 40s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 720px) {
  .hero h1 { font-size: 34px; }
  .livegrid { grid-template-columns: repeat(2,1fr); }
  .arena { grid-template-columns: 1fr; gap: 24px; padding-bottom: 60px; }
  .feed { display: none; }
  .side .figure { font-size: 84px; }
  .brand h1 { font-size: 16px; }
  .intro h1 { font-size: 34px; }
  .bigbanner .title { font-size: 30px; }
  .split .row { grid-template-columns: 1.3fr 1fr; }
  .split .row span:nth-child(2), .split .row span:nth-child(3) { display: none; }
}
