@font-face { font-family:"Rubezh Display"; src:url("assets/display.woff") format("woff"); font-weight:900; font-display:swap }
:root {
  color-scheme: dark;
  --bg:#100f0e; --panel:#191714; --panel-raised:#211c18; --line:#3a322b;
  --ink:#f6f1e9; --muted:#bdb2a8; --flare:#ef7439; --flare-bright:#ff8f52;
  --heading: "Rubezh Display", "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  --body: "Rubezh Text", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing:border-box }
html { scroll-behavior:smooth }
body { margin:0; background:var(--bg); color:var(--ink); font:1rem/1.6 var(--body); min-height:100dvh }
[hidden] { display:none !important }
a { color:inherit; text-decoration:none }
button,input { font:inherit }
button { color:inherit; cursor:pointer }
img { max-width:100%; display:block }
h1,h2,h3,p { margin:0 }
h1,h2,h3,.brand { font-family:var(--heading); font-weight:900; line-height:1; text-transform:uppercase }
h2 { font-size:clamp(2.2rem,5vw,4rem); letter-spacing:-.035em }
h3 { font-size:clamp(1.6rem,3.2vw,2.4rem); letter-spacing:-.025em }
.wrap { width:min(100% - 5rem, 1240px); margin-inline:auto }
:focus-visible { outline:2px solid var(--flare-bright); outline-offset:4px }
.site-header { background:linear-gradient(105deg,#100e0d,#1c1512 75%,#100e0d); border-bottom:1px solid #493123; position:relative; z-index:2 }
.header-inner { width:min(100% - 5rem, 1340px); min-height:72px; margin:auto; display:flex; align-items:center; justify-content:space-between; gap:1rem }
.brand { display:inline-flex; align-items:center; gap:.7rem; font-size:1.08rem; letter-spacing:.025em }
.brand img { flex:none }
.brand b { color:var(--flare-bright); font-weight:inherit }
.main-nav { display:flex; gap:clamp(1rem,3vw,3.2rem); color:var(--muted); font-size:.92rem; font-weight:650 }
.main-nav a:hover,.text-link:hover { color:var(--flare-bright) }
.button { display:inline-flex; align-items:center; justify-content:center; gap:.65rem; padding:.86rem 1.45rem; min-height:51px; border:1px solid var(--flare); background:var(--flare); color:#170d08; font-size:.9rem; font-weight:900; text-transform:uppercase; letter-spacing:.045em; line-height:1.2; text-align:center; transition:background .18s,border-color .18s; }
.button:hover { background:#ff9259; border-color:#ff9259 }
.button-outline { color:var(--ink); background:#17130f9c; border-color:#766355 }
.button-outline:hover { color:var(--flare-bright); background:#241b16; border-color:var(--flare) }
.button-small { min-height:40px; padding:.6rem .95rem; font-size:.81rem }
.hero-actions .button:first-child,.profile-form .button { position:relative; overflow:hidden; box-shadow:0 5px 25px #ef743933 }
.hero-actions .button:first-child::after,.profile-form .button::after {
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(108deg,transparent 33%,#fff0d572 50%,transparent 67%);
  pointer-events:none;
  transform:translateX(-135%);
  transition:transform .75s ease-out;
}
.hero-actions .button:first-child:is(:hover,:focus-visible)::after,.profile-form .button:is(:hover,:focus-visible)::after { transform:translateX(135%) }
.play-icon { display:block; width:0; height:0; border-block:6px solid transparent; border-left:9px solid currentColor }
.hero { position:relative; display:grid; min-height:clamp(510px,63vw,696px); isolation:isolate; align-items:center; background:#19110e; border-bottom:1px solid #54402e; overflow:hidden }
.hero::before,.hero::after { content:""; position:absolute; inset:0; z-index:-1 }
.hero::before {
  z-index:-3;
  background:url("assets/hero.webp") 62% top/cover no-repeat;
}
.hero::after { background:linear-gradient(90deg,#100e0df2 0%,#100e0dd4 20%,#100e0d68 43%,#100e0d05 70%),linear-gradient(0deg,#100f0efc,transparent 27%) }
.atmosphere { position:absolute; inset:0; z-index:-2; overflow:hidden; pointer-events:none }
.atmosphere::before,.atmosphere::after { content:""; position:absolute; inset:0 }
.atmosphere::before {
  background:radial-gradient(ellipse at 77% 81%,#f477393e,transparent 39%),radial-gradient(ellipse at 49% 92%,#edaa6142,transparent 35%);
  opacity:.38;
  animation:settle-light 4.8s ease-out;
}
.atmosphere::after {
  inset:18% -6% -12%;
  background:
    radial-gradient(circle at 20% 74%,#fa9b50 0 1px,transparent 3px),
    radial-gradient(circle at 35% 63%,#f5c58d 0 1px,transparent 3px),
    radial-gradient(circle at 46% 83%,#ffa560 0 1.2px,transparent 3px),
    radial-gradient(circle at 57% 59%,#ff9d52 0 1px,transparent 3px),
    radial-gradient(circle at 62% 77%,#fd713b 0 1.4px,transparent 4px),
    radial-gradient(circle at 72% 69%,#ffdfb0 0 1px,transparent 3px),
    radial-gradient(circle at 76% 90%,#ff9f52 0 1.9px,transparent 4px),
    radial-gradient(circle at 84% 53%,#ff9853 0 1.1px,transparent 3px),
    radial-gradient(circle at 90% 83%,#ffb87d 0 1.6px,transparent 4px);
  opacity:0;
  animation:drift-embers 4.8s ease-out;
}
@keyframes settle-light {
  0% { opacity:0; transform:translate3d(4%,4%,0) }
  46% { opacity:.78 }
  100% { opacity:.38; transform:translate3d(0,0,0) }
}
@keyframes drift-embers {
  0% { opacity:0; transform:translate3d(1%,15%,0) }
  35% { opacity:.77 }
  75% { opacity:.38 }
  100% { opacity:0; transform:translate3d(-3%,-16%,0) }
}
.hero-copy { padding-block:5rem 5.6rem }
.kicker { margin:0 0 .8rem; color:#f2884c; font:750 .82rem/1.3 var(--body); text-transform:uppercase; letter-spacing:.17em }
.hero h1 { font-size:clamp(4rem,9.1vw,9rem); line-height:.83; letter-spacing:-.055em }
.hero h1 em { color:var(--flare-bright); font-style:normal }
@supports (background-clip:text) {
  .hero h1 em { background:linear-gradient(175deg,#ffc08a 9%,#ff8d50 57%,#e36a3a 91%); background-clip:text; color:transparent }
}
.hero-description { max-width:34rem; margin:1.65rem 0 1.7rem; color:#e0d6cc; font-size:clamp(1rem,1.4vw,1.19rem) }
.hero-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem }
.hero-caption { position:absolute; bottom:1.1rem; left:0; right:0; display:flex; justify-content:space-between; gap:1rem; color:#d5aa90; font-size:.77rem; font-weight:750; letter-spacing:.14em; text-transform:uppercase; border-top:1px solid #ad795a4d; padding-top:.55rem }
.section { padding-block:clamp(3rem,6vw,6rem); scroll-margin-top:1rem }
.section-head { display:flex; justify-content:space-between; align-items:end; gap:1.1rem 2rem; margin-bottom:1.6rem }
.section-head > p { max-width:23rem; color:var(--muted) }
.class-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem }
.class-card { --accent:#f99755; position:relative; min-height:clamp(285px,30vw,405px); display:flex; align-items:end; isolation:isolate; overflow:hidden; border:1px solid var(--line); text-align:left; background:var(--panel); padding:1.2rem; transition:border-color .18s,box-shadow .25s; width:100%; }
.class-card:hover,.class-card:focus-visible { border-color:var(--accent); box-shadow:0 10px 26px color-mix(in srgb,var(--accent) 14%,transparent) }
.class-card img { width:100%; height:100%; object-fit:cover; object-position:50% 20%; position:absolute; inset:0; z-index:-2; transition:transform .35s }
.class-card:hover img { transform:scale(1.045) }
.class-card::after { content:""; z-index:-1; position:absolute; inset:0; background:linear-gradient(0deg,#14110ffb 2%,#14110fec 19%,#14110fa0 39%,transparent 70%) }
.class-card .kind { display:block; color:var(--accent); text-transform:uppercase; font-size:.8rem; letter-spacing:.11em; font-weight:850; margin-bottom:.42rem }
.class-card p { color:#e0d7ce; line-height:1.4; margin-top:.5rem }
.class-card .skill-label { color:var(--accent); font-size:.87rem; margin-top:.85rem }
.portrait-card { flex-direction:column; align-items:stretch; min-height:0; padding:0 }
.portrait-card img { position:static; z-index:auto; height:auto; aspect-ratio:2/3; object-fit:contain; object-position:center; background:#110f0e }
.portrait-card:hover img { transform:none }
.portrait-card::after { content:none }
.portrait-card > div {
  flex:1;
  border-top:1px solid var(--line);
  padding:clamp(.85rem,2vw,1.2rem);
  background:linear-gradient(150deg,color-mix(in srgb,var(--accent) 11%,#1b1714),#191614 56%);
}
.region { background:#161310; border-block:1px solid #3e3027 }
.map-story { border:1px solid #574135; background:#1d1915 }
.map-detail { min-height:24rem; display:flex; align-items:end; position:relative; isolation:isolate; overflow:hidden }
.map-frames { position:absolute; inset:0; z-index:-2 }
.map-frames img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  opacity:0;
  transition:opacity .6s ease;
}
.map-frames img.current { opacity:1 }
.map-detail::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,#0f0d0ce8,#0f0d0c8a 45%,transparent 92%),linear-gradient(0deg,#0f0d0cf2,transparent 74%) }
.map-copy { padding:clamp(1.05rem,4vw,2.4rem); max-width:39rem }
.map-frame-title { margin-top:.75rem; color:#ffac7b; font-weight:800 }
.map-frame-caption { margin-top:.28rem; color:#eee2d9; min-height:3.2em }
.map-controls {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:.65rem;
  padding:.75rem clamp(.75rem,3vw,1.3rem);
  border-top:1px solid #574135;
}
#map-frame-position { color:var(--muted); font-size:.86rem; font-weight:750 }
.map-actions { display:flex; flex-wrap:wrap; gap:.4rem }
.map-actions .button { min-height:42px }
#map-play { min-width:7.1rem }
.map-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; margin-top:.65rem }
.map-choice { display:flex; align-items:center; text-align:left; gap:.65rem; min-height:64px; background:#1e1915; border:1px solid #463831; padding:.5rem; font-weight:750; line-height:1.21; width:100%; }
.map-choice img { width:66px; height:45px; object-fit:cover }
.map-choice[aria-pressed="true"] { border-color:var(--flare); background:#302016 }
.map-choice:hover { border-color:var(--flare-bright) }
.enemy { display:grid; grid-template-columns:1fr 1fr; gap:clamp(1rem,5vw,5rem); align-items:center }
.enemy-art { aspect-ratio:1.5; background:linear-gradient(0deg,#17120e8c,transparent 70%),url("assets/enemy-amber.webp") center/cover; border:1px solid #624636 }
.enemy-copy p:not(.kicker),.enemy-copy ul { margin-top:.85rem; color:var(--muted) }
.enemy-copy ul { padding-left:1.15rem; margin-bottom:1.3rem }
.enemy-copy li { margin-bottom:.25rem }
.enemy-copy strong { color:var(--ink) }
.platform-panel {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.65fr);
  gap:.65rem;
  margin-bottom:clamp(1rem,2.5vw,2rem);
}
.platform-card {
  padding:.7rem .85rem;
  border:1px solid #524137;
  border-top-color:#9b593b;
  background:linear-gradient(110deg,#2b2019,#1c1916 42%,#151412);
}
.platform-card h2 {
  margin-bottom:.45rem;
  font-size:clamp(1.35rem,2.4vw,1.65rem);
  letter-spacing:-.015em;
}
.platform-marks {
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
  margin:0;
  padding:0;
  list-style:none;
}
.platform-link {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  min-height:44px;
  padding:.35rem .6rem;
  border:1px solid #5a493e;
  background:linear-gradient(150deg,#2a231d,#1b1815);
  box-shadow:inset 0 1px #fff1e112;
  font-size:.875rem;
  font-weight:750;
  transition:background .18s,border-color .18s;
}
.platform-link:hover,.platform-link:focus-visible { border-color:var(--flare); background:#34241b }
.platform-link img { flex:none; object-fit:contain }
.community-marks .platform-link { width:8rem; justify-content:center }
.site-footer { border-top:1px solid var(--line); background:#14110f; padding-block:1.4rem; }
.footer-inner { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:1rem }
.footer-inner p { color:var(--muted); font-size:.875rem }
.footer-support { display:inline-flex; flex-wrap:wrap; align-items:center; align-content:center; gap:.2rem .65rem; min-height:44px; max-width:100% }
.footer-support-label { color:var(--flare-bright); font:900 1.08rem/1 var(--heading); text-transform:uppercase }
.footer-support-address { color:var(--muted); font-size:.875rem; overflow-wrap:anywhere }
.footer-support:is(:hover,:focus-visible) .footer-support-label { text-decoration:underline; text-underline-offset:.2em }
.text-link { color:var(--muted); font-weight:750; font-size:.9rem; text-underline-offset:.2em; text-decoration:underline }
.play-view { position:relative; isolation:isolate }
.play-view::before {
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:min(46rem,100%);
  z-index:-3;
  background:linear-gradient(0deg,#100f0e 0%,#100f0e1f 72%),linear-gradient(90deg,#100e0df2 5%,#100e0da6 52%,#100e0d70 100%),url("assets/fallen-ship.webp") center 38%/cover;
}
.play-view:has(.profile-split)::before {
  background:radial-gradient(ellipse at 75% 14%,#6b382648,transparent 66%);
}
.play-view .atmosphere { height:min(33rem,100%); opacity:.56 }
.play-wrap { min-height:calc(100dvh - 147px); padding-block:1.2rem 4rem }
.wizard-top { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.6rem 1rem; margin-bottom:clamp(1.5rem,4vw,3rem) }
#steps { display:flex; gap:.45rem 1rem; flex-wrap:wrap; color:#aaa097; font-size:.87rem }
#steps [aria-current] { color:var(--flare-bright); font-weight:750 }
#steps a { text-decoration:underline; text-underline-offset:3px }
.wizard-banner { margin-bottom:1.35rem }
.wizard-banner h1 { font-size:clamp(2.25rem,6vw,4.6rem); letter-spacing:-.045em }
.wizard-banner > p:not(.kicker) { color:var(--muted); margin-top:.65rem }
.profile-split { display:grid; grid-template-columns:1fr 1.2fr; border:1px solid var(--line); min-height:400px; background:var(--panel) }
.profile-body { padding:clamp(1rem,4vw,2.8rem); align-self:center }
.profile-art { background:linear-gradient(90deg,#191714,transparent 32%),url("assets/fallen-ship.webp") center 43%/cover; min-height:12rem }
.profile-form { display:grid; gap:.65rem; }
.profile-form label { font-weight:750 }
.profile-form input { color:var(--ink); background:#11100f; border:1px solid #685649; padding:.7rem .8rem; width:100%; border-radius:0 }
.profile-form p { color:var(--muted); font-size:.92rem }
.profile-form button { justify-self:start; margin-top:.6rem }
.account-form { gap:.85rem }
.account-field { display:grid; gap:.28rem }
.account-form .account-error,.account-form .account-notice { color:#ffc3aa }
.account-form [aria-invalid="true"] { border-color:#eb9676 }
.account-error:empty { display:none }
.account-notice:empty { margin:0; height:0 }
.account-notice:not(:empty) { padding:.6rem .75rem; border-left:2px solid var(--flare); background:#2b1d16 }
.account-links { display:grid; gap:.35rem; margin-top:1rem; color:var(--muted); font-size:.92rem }
.account-links button { border:0; background:none; padding:.2rem 0; color:var(--flare-bright) }
.account-selection { position:relative; isolation:isolate; overflow:hidden; display:grid; align-content:end; min-height:18rem; background:#191714; padding:clamp(1rem,3vw,1.8rem) }
.account-selection img,.account-selection::after { position:absolute; inset:0; width:100%; height:100% }
.account-selection img { z-index:-2; object-fit:cover; object-position:center top }
.account-selection::after { content:""; z-index:-1; background:linear-gradient(0deg,#100f0e 0%,#100f0eaf 18%,transparent 65%) }
.account-selection h2 { font-size:clamp(1.55rem,3.5vw,2.75rem) }
.account-selection p { color:#f3ded2 }
.fighter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-width:740px; gap:1rem }
.wizard-actions { margin-top:1.2rem; display:flex; flex-wrap:wrap; gap:.65rem }
.sector-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem }
.sector-card { min-height:clamp(190px,24vw,300px) }
.sector-card img { object-position:center }
.battle-view { width:min(100% - 2.5rem,1360px); margin:auto; padding:1.1rem 0 1.8rem }
.battle-top { display:flex; align-items:center; justify-content:space-between; gap:.8rem; margin:0 0 .65rem }
.battle-top h1 { font-size:clamp(1.7rem,4vw,3.2rem) }
#battle-status { color:var(--muted); margin-top:.3rem }
#arena-frame { position:relative; isolation:isolate; overflow:hidden; border:1px solid #604a3b; background:#181612 }
#arena { display:block; width:100%; height:clamp(340px,68dvh,720px); outline-offset:-3px; touch-action:none }
.battle-hud { position:absolute; top:.55rem; left:.55rem; right:.55rem; display:grid; gap:.5rem; grid-template-columns:minmax(7rem,14rem) auto; justify-content:space-between; pointer-events:none; color:var(--ink); font-size:.84rem; z-index:1; line-height:1.2 }
.hud-block { border:1px solid #8a6e5c; padding:.55rem .65rem; background:#15100de8; min-width:0; }
.hud-health { display:flex; justify-content:space-between; gap:.5rem; margin-bottom:.35rem; font-weight:800 }
.hud-track { height:6px; background:#613a2b; overflow:hidden }
.hud-track i { display:block; width:100%; height:100%; background:var(--flare-bright); }
.hud-stats { display:flex; gap:.35rem 1rem; align-items:center; flex-wrap:wrap }
.hud-boss { grid-column:1/-1; max-width:26rem; width:min(65%,26rem); justify-self:center; text-align:center; color:#ffd7e9 }
.hud-boss .hud-track i { background:#ff638f }
.battle-controls { color:var(--muted); font-size:.89rem; padding-top:.6rem }
kbd { border:1px solid #685649; padding:0 .22rem; background:#282019; color:var(--ink) }
.mobile-help,.touch-controls { display:none }
.game-overlay { position:absolute; inset:0; z-index:4; display:grid; place-items:center; background:#100d0ce6; padding:1rem; overflow:auto }
.overlay-card { border:1px solid #8e5840; background:#1b1612; max-width:29rem; width:100%; padding:clamp(1rem,4vw,2rem); }
.overlay-card p { color:var(--muted); margin-top:.75rem }
body.in-battle .site-header,body.in-battle .site-footer { display:none }
@media(max-width:850px) {
  .wrap,.header-inner { width:calc(100% - 2.2rem) }
  .map-grid { grid-template-columns:repeat(2,minmax(0,1fr)) }
}
@media(max-width:620px) {
  .wrap,.header-inner { width:calc(100% - 1.7rem) }
  .header-inner { min-height:60px; flex-wrap:wrap; gap:0 .4rem; padding-top:.25rem }
  .brand { font-size:.96rem; gap:.35rem }
  .brand img { width:31px; height:31px }
  .main-nav { order:3; width:100%; justify-content:space-between; padding:.43rem 0; border-top:1px solid #2d241e; margin-top:.3rem; gap:.6rem }
  .platform-panel { grid-template-columns:1fr }
  .hero { min-height:570px; align-items:end }
  .hero::before { background-position:66% center; background-size:auto 100% }
  .hero::after { background:linear-gradient(0deg,#100f0e 0%,#100f0ee0 28%,#100e0d3b 72%,#100e0d10),linear-gradient(90deg,#100e0d5c,transparent 62%) }
  .hero-copy { padding-block:4.1rem 4.25rem }
  .hero h1 { font-size:clamp(3.2rem,14vw,5.2rem); line-height:.83; letter-spacing:-.055em }
  .hero-description { margin:1rem 0 1.15rem }
  .hero-actions .button { padding-inline:.85rem }
  .section-head { display:block }
  .section-head > p { margin-top:.6rem }
  .class-grid,.enemy,.profile-split { grid-template-columns:1fr }
  .enemy-art { order:2 }
  .map-detail { min-height:19rem }
  .map-detail::after { background:linear-gradient(0deg,#0f0d0cf7,#0f0d0cd6 25%,transparent 79%) }
  .map-frames img { object-position:65% center }
  .map-actions { width:100%; display:grid; grid-template-columns:1fr 1fr 1.3fr }
  .map-actions .button { padding-inline:.4rem }
  #map-play { min-width:0 }
  .map-choice { font-size:.88rem }
  .map-choice img { width:43px; height:39px }
  .profile-art { background-image:linear-gradient(180deg,#191714,transparent 22%),url("assets/fallen-ship.webp"); background-position:center 40% }
  .fighter-grid,.sector-grid { gap:.55rem }
  .sector-card { min-height:335px; padding:.65rem }
  .fighter-grid h3,.sector-card h3 { font-size:1.25rem }
  .battle-view { width:calc(100% - .7rem); padding-top:.45rem }
  .battle-top { min-height:60px }
  .battle-top .kicker { margin-bottom:.3rem; font-size:.67rem }
  #battle-status { font-size:.8rem }
  #arena { height:clamp(310px,73dvh,670px) }
  .hud-block { padding:.35rem .42rem; font-size:.78rem }
  .hud-stats { gap:.3rem .55rem }
}
@media(pointer:coarse) {
  .desktop-help { display:none }
  .mobile-help { display:inline }
  .touch-controls { display:flex; position:absolute; pointer-events:none; justify-content:space-between; align-items:end; gap:.5rem; inset:auto .65rem .65rem; z-index:2 }
  .touch-zone { display:grid; place-items:center; pointer-events:auto; touch-action:none; width:86px; height:86px; border-radius:50%; border:1px solid #ffd3ae80; background:#2a1c14a8 }
  #stick-knob { width:38px; height:38px; border-radius:50%; border:1px solid #ffc798; background:#bc7449aa; pointer-events:none }
  .touch-actions { display:flex; align-items:end; gap:.38rem }
  .touch-actions button { pointer-events:auto; touch-action:none; border-radius:50%; border:1px solid #ffc79a; background:#452817de; width:58px; height:58px; font-size:.82rem; font-weight:800 }
  #fire-touch { width:69px; height:69px; background:#723a22e6 }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important }
}
@media(forced-colors:active) {
  .hero h1 em { background:none; color:CanvasText }
}
