/* Arcane Ascendancy — carved gold on the void, matching astrelorn.com */
:root {
  --void: #05060a;
  --deep: #0b0c13;
  --panel: rgba(14, 13, 19, .86);
  --line: rgba(110, 87, 50, .45);
  --line-soft: rgba(110, 87, 50, .22);
  --bone: #ddd2b9;
  --bone-dim: #9a9080;
  --gold: #c9a45c;
  --gold-hi: #f1d898;
  --gold-lo: #6e5732;
  --ember: #e2662a;
  --blood: #6d1210;
  --hud: #8fbfe0;
  --good: #9cc58a;
  --bad: #e07a5f;
  --pyre: #e2662a;
  --radiance: #f1e6c4;
  --umbra: #a28bb3;
  --thornwild: #8fb36a;
  --aether: #7fb2dc;
  --pad: clamp(16px, 3vw, 36px);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Cormorant Garamond", Garamond, Georgia, serif;
  --mono: "Share Tech Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--void);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--blood); color: var(--gold-hi); }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 32% at 78% 12%, rgba(109, 18, 16, .28), transparent 70%),
    radial-gradient(36% 30% at 12% 18%, rgba(30, 58, 80, .22), transparent 72%),
    radial-gradient(60% 50% at 50% 110%, rgba(226, 102, 42, .10), transparent 70%),
    url(../img/stars.svg) 0 0 / 400px 400px repeat,
    var(--void);
}

a { color: var(--hud); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .06em; color: var(--gold); margin: 0 0 .6em; }
h2 { font-size: clamp(18px, 2vw, 22px); display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
h3 { font-size: 16px; margin-top: 1.2em; }
p { margin: 0 0 .6em; }

.hud {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.muted { color: var(--bone-dim); }
.small { font-size: 15px; }
.warn { color: var(--ember); }
.pos { color: var(--good); }
.neg { color: var(--bad); }

/* ---------- header and footer ---------- */
.top, .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--pad);
}
.top { border-bottom: 1px solid var(--line-soft); }
.top__home { color: var(--gold); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.top__title { margin: 0; font-family: var(--display); color: var(--gold-hi); letter-spacing: .12em; text-transform: uppercase; font-size: 15px; }
.top__tag { color: var(--hud); }
.foot { border-top: 1px solid var(--line-soft); margin-top: 32px; }

/* ---------- ornament ---------- */
.carve {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 42%, #8a6a35 58%, #c9a45c 76%, #5a4526 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .9)) drop-shadow(0 0 24px rgba(226, 102, 42, .2));
}
.rule { display: flex; align-items: center; gap: 14px; width: min(460px, 80%); margin: 18px 0; }
.rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), var(--gold-lo)); }
.rule span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.rule i { width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid var(--gold); background: var(--blood); box-shadow: 0 0 12px rgba(226, 102, 42, .5); }

/* ---------- art: icons and school emblems (drawn in tools/arcane-art.mjs) ---------- */
/* Icons are single-colour SVG masks, so they take carved gold here or any colour via --ico. */
.ico {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  margin-right: .45em;
  vertical-align: -.25em;
  background: var(--ico, linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)));
  -webkit-mask: center / contain no-repeat;
          mask: center / contain no-repeat;
}
.ico--season { -webkit-mask-image: url(../img/icons/season.svg); mask-image: url(../img/icons/season.svg); }
.ico--gold { -webkit-mask-image: url(../img/icons/gold.svg); mask-image: url(../img/icons/gold.svg); }
.ico--mana { -webkit-mask-image: url(../img/icons/mana.svg); mask-image: url(../img/icons/mana.svg); }
.ico--people { -webkit-mask-image: url(../img/icons/people.svg); mask-image: url(../img/icons/people.svg); }
.ico--land { -webkit-mask-image: url(../img/icons/land.svg); mask-image: url(../img/icons/land.svg); }
.ico--power { -webkit-mask-image: url(../img/icons/power.svg); mask-image: url(../img/icons/power.svg); }
.ico--realm { -webkit-mask-image: url(../img/icons/realm.svg); mask-image: url(../img/icons/realm.svg); }
.ico--build { -webkit-mask-image: url(../img/icons/build.svg); mask-image: url(../img/icons/build.svg); }
.ico--army { -webkit-mask-image: url(../img/icons/army.svg); mask-image: url(../img/icons/army.svg); }
.ico--magic { -webkit-mask-image: url(../img/icons/magic.svg); mask-image: url(../img/icons/magic.svg); }
.ico--items { -webkit-mask-image: url(../img/icons/items.svg); mask-image: url(../img/icons/items.svg); }
.ico--war { -webkit-mask-image: url(../img/icons/war.svg); mask-image: url(../img/icons/war.svg); }
.ico--log { -webkit-mask-image: url(../img/icons/log.svg); mask-image: url(../img/icons/log.svg); }
.ico--farm { -webkit-mask-image: url(../img/icons/farm.svg); mask-image: url(../img/icons/farm.svg); }
.ico--town { -webkit-mask-image: url(../img/icons/town.svg); mask-image: url(../img/icons/town.svg); }
.ico--workshop { -webkit-mask-image: url(../img/icons/workshop.svg); mask-image: url(../img/icons/workshop.svg); }
.ico--barracks { -webkit-mask-image: url(../img/icons/barracks.svg); mask-image: url(../img/icons/barracks.svg); }
.ico--node { -webkit-mask-image: url(../img/icons/node.svg); mask-image: url(../img/icons/node.svg); }
.ico--guild { -webkit-mask-image: url(../img/icons/guild.svg); mask-image: url(../img/icons/guild.svg); }
.ico--fortress { -webkit-mask-image: url(../img/icons/fortress.svg); mask-image: url(../img/icons/fortress.svg); }
.ico--barrier { -webkit-mask-image: url(../img/icons/barrier.svg); mask-image: url(../img/icons/barrier.svg); }
.ico--melee { -webkit-mask-image: url(../img/icons/melee.svg); mask-image: url(../img/icons/melee.svg); }
.ico--ranged { -webkit-mask-image: url(../img/icons/ranged.svg); mask-image: url(../img/icons/ranged.svg); }
.ico--fire { -webkit-mask-image: url(../img/icons/fire.svg); mask-image: url(../img/icons/fire.svg); }
.ico--holy { -webkit-mask-image: url(../img/icons/holy.svg); mask-image: url(../img/icons/holy.svg); }
.ico--death { -webkit-mask-image: url(../img/icons/death.svg); mask-image: url(../img/icons/death.svg); }
.ico--magic-type { -webkit-mask-image: url(../img/icons/magic-type.svg); mask-image: url(../img/icons/magic-type.svg); }
.emblem { display: inline-block; width: 1.6em; height: 1.6em; margin-right: .4em; vertical-align: middle; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .8)); }
.emblem--md { width: 44px; height: 44px; margin-right: 4px; align-self: center; }

/* ---------- controls ---------- */
.btn {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--gold-lo);
  background: linear-gradient(180deg, rgba(40, 30, 18, .9), rgba(16, 12, 10, .9));
  color: var(--gold-hi);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.btn:hover, .btn:focus-visible { border-color: var(--gold); box-shadow: 0 0 14px rgba(201, 164, 92, .25); outline: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn--primary { border-color: var(--gold); background: linear-gradient(180deg, #5a1612, #2a0a09); }
.btn--danger { border-color: var(--bad); color: var(--bone); background: linear-gradient(180deg, #3a0d0b, #1a0605); }
.btn--danger:hover, .btn--danger:focus-visible { border-color: var(--ember); box-shadow: 0 0 14px rgba(224, 122, 95, .3); }
.profile .danger { margin-top: 36px; }
.profile .danger h2 { margin-top: 0; }
.account__notice { margin: 8px 0 0; }
.account__notice a { color: var(--gold); text-underline-offset: 3px; }
.btn--small { min-height: 44px; padding: 6px 12px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--bone-dim); font: inherit; cursor: pointer; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ember); }

input, select {
  min-height: 44px;
  padding: 6px 10px;
  background: rgba(5, 6, 10, .8);
  border: 1px solid var(--gold-lo);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 15px;
  max-width: 100%;
}
input:focus-visible, select:focus-visible { outline: 1px solid var(--gold); outline-offset: 1px; }
.num { width: 6.5em; }
.num--wide { width: 8em; }
progress { width: 100%; height: 10px; accent-color: var(--ember); display: block; margin: 6px 0; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.row label { display: flex; flex-direction: column; gap: 4px; }

/* ---------- intro ---------- */
/* The vista keeps the art's own 1920 × 760 shape on wide screens so nothing is cropped;
   on narrow screens it keeps a minimum height and trims the sides instead. */
.intro { --vista-h: max(300px, min(100vw, 1600px) * .3958); position: relative; max-width: 980px; margin: 0 auto; padding: calc(var(--pad) * 1.4) var(--pad); }
.intro > * { position: relative; }
.intro > .vista {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: 100vw;
  max-width: 1600px;
  height: var(--vista-h);
  transform: translateX(-50%);
  background: url(../img/vista.svg) center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(180deg, #000 72%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(180deg, #000 72%, transparent);
          mask-composite: intersect;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .intro > .vista { -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
}
.intro__title { font-weight: 800; font-size: clamp(34px, 7vw, 76px); line-height: 1; text-transform: uppercase; margin: 0; }
/* On the game page the title sits just under the banner, overlapping its faded lower edge. */
.vista + .intro__title { padding-top: calc(var(--vista-h) - var(--pad) * 1.4 - clamp(24px, 4vw, 56px)); text-shadow: 0 2px 18px #05060a; }
.intro__lede { text-shadow: 0 1px 10px #05060a; }
.intro__lede { font-style: italic; font-size: clamp(20px, 2.4vw, 26px); max-width: 40ch; }
.newgame { margin-top: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; max-width: 380px; }
.schools { border: 0; padding: 0; margin: 24px 0; }
.schools legend { margin-bottom: 10px; }
.schools__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.school { position: relative; display: block; cursor: pointer; }
.school input { position: absolute; opacity: 0; }
.school__body {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 14px; border: 1px solid var(--line); background: var(--panel);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.school input:checked + .school__body { border-color: var(--school); box-shadow: inset 0 0 0 1px var(--school), 0 0 18px -4px var(--school); }
.school input:focus-visible + .school__body { outline: 1px solid var(--gold); outline-offset: 3px; }
.school__name { font-family: var(--display); font-size: 20px; color: var(--school); letter-spacing: .08em; }
.school__emblem { width: 84px; height: 84px; margin: 2px 0 6px; transition: transform .25s ease, filter .25s ease; filter: saturate(.75) brightness(.85); }
.school:hover .school__emblem, .school input:checked + .school__body .school__emblem { filter: drop-shadow(0 0 10px var(--school)); transform: scale(1.04); }
.school__theme { font-size: 16px; }
.school__troops { font-size: 14px; color: var(--bone-dim); }
.school--pyre { --school: var(--pyre); }
.school--radiance { --school: var(--radiance); }
.school--umbra { --school: var(--umbra); }
.school--thornwild { --school: var(--thornwild); }
.school--aether { --school: var(--aether); }
.school-tag { color: var(--school); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.account { margin-top: 26px; }
.account__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.account__fields .field { max-width: none; }
#account-msg:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold); }
.account__email { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.account__email summary { font-size: 16px; overflow-wrap: anywhere; }
.account__form .account__links { margin-top: 8px; }
.account__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; }
.account__links a, .top__account a, .who { color: var(--gold); text-underline-offset: 3px; }
.account__links a, .top__account a { min-height: 44px; display: inline-flex; align-items: center; }
.top { flex-wrap: wrap; }
.top__account { display: flex; align-items: center; gap: 14px; }
.top__account a:hover, .who:hover { color: var(--ember); }

/* ---------- leaderboards and profile ---------- */
.boards { margin-top: 28px; }
.boards__title, .profile h2 { font-family: var(--display); color: var(--gold); letter-spacing: .06em; font-weight: 500; }
.boards__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.boards h3, .profile h3 { margin: 0 0 4px; font-family: var(--display); color: var(--gold-hi); font-weight: 500; letter-spacing: .04em; }
.who { display: inline-flex; align-items: center; min-height: 44px; }
.you { color: var(--hud); font-size: 11px; }
.sch--pyre { color: var(--pyre); }
.sch--radiance { color: var(--radiance); }
.sch--umbra { color: var(--umbra); }
.sch--thornwild { color: var(--thornwild); }
.sch--aether { color: var(--aether); }
.profile { max-width: 980px; margin: 0 auto; padding: 24px var(--pad); }
.profile__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.profile__stats .stat b { display: block; font-family: var(--mono); font-size: 20px; color: var(--gold-hi); }
.profile section { margin-top: 24px; }
#account-msg.bad { color: var(--bad); }
.howto { margin-top: 28px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.howto summary, details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; font-family: var(--display); color: var(--gold); letter-spacing: .06em; }

/* ---------- game ---------- */
.game { max-width: 1200px; margin: 0 auto; padding: 16px var(--pad) 0; }
.hudbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat { padding: 10px 12px; border-right: 1px solid var(--line-soft); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .hud { display: flex; align-items: center; }
.stat .ico { width: 16px; height: 16px; margin-right: 6px; }
.stat b { display: block; font-family: var(--mono); font-weight: 400; color: var(--hud); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dispatch { min-height: 1.5em; margin: 12px 0; font-style: italic; font-size: 19px; color: var(--gold-hi); }
.dispatch--bad { color: var(--bad); }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab {
  flex: 0 0 auto; min-height: 44px; padding: 8px 16px;
  background: none; border: 1px solid transparent; border-bottom: 0;
  color: var(--bone-dim); font-family: var(--display); font-size: 14px; letter-spacing: .08em; cursor: pointer;
}
.tab:hover, .tab:focus-visible { color: var(--gold-hi); outline: none; }
.tab .ico { --ico: var(--bone-dim); width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.tab:hover .ico, .tab:focus-visible .ico, .tab[aria-current="page"] .ico { --ico: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.tab[aria-current="page"] { color: var(--gold-hi); border-color: var(--line); background: var(--panel); position: relative; top: 1px; }

.panel { padding: 16px 0; display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  min-width: 0;
}
.card::before, .card::after { content: ""; position: absolute; width: 30px; height: 30px; background: url(../img/corner.svg) 0 0 / contain no-repeat; pointer-events: none; }
.card::before { top: -2px; left: -2px; }
.card::after { bottom: -2px; right: -2px; transform: rotate(180deg); }
.note { border-left: 2px solid var(--ember); padding-left: 10px; color: var(--gold-hi); font-size: 16px; }

.scroll { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 16px; }
.t th, .t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-dim); font-weight: 400; }
.t tbody th { font-weight: 400; }
.t th b { display: block; font-weight: 500; }
.t td { font-family: var(--mono); font-size: 14px; color: var(--bone); }
.t .muted.small { display: block; font-family: var(--serif); }
.t tr.self th, .t tr.self td { color: var(--gold-hi); }
.t tr.known th b { color: var(--gold-hi); }
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rel { text-transform: capitalize; }
.rel--own { color: var(--good); }
.rel--opposite { color: var(--bad); }

.action { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.action:last-child { border-bottom: 0; }
.action p { margin: 0; font-size: 15px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.item { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.item p { margin: 0; }

.school-block { border-top: 1px solid var(--line-soft); }
.school-block summary .emblem { width: 34px; height: 34px; margin-right: 0; }
.spells { list-style: none; margin: 0 0 10px; padding: 0; }
.spell { display: grid; grid-template-columns: minmax(0, 1fr) 11em auto; gap: 6px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.spell__text b { display: block; font-weight: 500; }
.spell__text--icon { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
.spell__text--icon .ico { grid-row: span 2; width: 34px; height: 34px; margin: 0; align-self: start; }
.spell__text--icon > :not(.ico, .spell__art) { grid-column: 2; }
.spell__art { grid-row: span 2; width: 44px; height: 55px; align-self: start; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
.spell:not(.spell--known) .spell__art { filter: grayscale(.55) brightness(.75); }
.spell__art--lg { float: left; width: 64px; height: 79px; margin: 0 14px 6px 0; }
.study::after { content: ""; display: block; clear: both; }
.t tbody th .ico { width: 22px; height: 22px; }
.spell__text .small { display: block; }
.spell--known .spell__text b { color: var(--gold-hi); }
.spell .cell-actions { justify-content: flex-end; }
.modes { border: 0; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.modes legend { margin-bottom: 8px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line-soft); cursor: pointer; min-height: 44px; }
.mode input { min-height: 0; margin-top: 6px; accent-color: var(--ember); }
.mode b { display: block; }
.mode .small { display: block; }
.item > div > .small { display: block; }
.speeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lvl { font-family: var(--mono); font-size: .8em; color: var(--gold); margin-left: 6px; letter-spacing: .04em; }
.eta { font-family: var(--mono); color: var(--hud); white-space: nowrap; }

.report--won { border-color: var(--good); }
.report--lost { border-color: var(--bad); }

.chronicle { list-style: none; margin: 0; padding: 0; }
.chronicle li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
.chronicle .hud { display: inline-block; min-width: 4.5em; color: var(--gold-lo); }
.tone--war { color: #e8b4a0; }
.tone--world { color: var(--gold-hi); }
.tone--bad { color: var(--bad); }
.tone--good { color: var(--good); }

abbr { text-decoration: underline dotted var(--gold-lo); cursor: help; }

/* ---------- ending ---------- */
.ending { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: var(--pad); background: rgba(5, 6, 10, .82); }
.ending__card { max-width: 520px; border: 1px solid var(--gold); background: var(--deep); padding: 28px; text-align: center; display: grid; gap: 12px; }
.ending__emblem { width: 120px; height: 120px; margin: -88px auto 0; filter: drop-shadow(0 0 22px rgba(226, 102, 42, .35)); }
.ending__card { margin-top: 60px; }
.ending__title { font-size: clamp(26px, 5vw, 38px); margin: 0; color: var(--gold-hi); }
.ending__text { font-size: 19px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .hudbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .modes, .speeds { grid-template-columns: 1fr; }
  .spell { grid-template-columns: minmax(0, 1fr) auto; }
  .spell__meta { grid-column: 1; }
  .spell .cell-actions { grid-column: 2; grid-row: 1 / span 2; }
  .spell .cell-actions:has(select) { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  .top__tag { display: none; }
  .card { padding: 14px; }
  .action { grid-template-columns: 1fr auto; }
  .action > div { grid-column: 1 / -1; }
  .hudbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-right: 1px solid var(--line-soft) !important; border-bottom: 1px solid var(--line-soft); }
  .stat:nth-child(2n) { border-right: 0 !important; }
  .stat:nth-child(n+5) { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
