:root {
  color-scheme: dark;
  --ink: #07080b;
  --ink-2: #101218;
  --panel: rgba(19, 22, 28, 0.86);
  --panel-2: #1a1e27;
  --line: rgba(244, 240, 230, 0.14);
  --ivory: #f4f0e6;
  --muted: #b7b1a6;
  --faint: #8d877c;
  --gold: #c6a36a;
  --gold-2: #ead7ad;
  --ember: #e08a56;
  --olive: #a8c0a4;
  --clay: #e0a090;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body.app {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(198, 163, 106, 0.22), transparent 55%),
    var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
body.app::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 0;
}
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}
.shell, .wrap, .auth, .top { position: relative; z-index: 2; }
a { color: var(--gold-2); text-underline-offset: 0.18em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
::selection { background: rgba(198, 163, 106, 0.35); }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}
.mark { color: inherit; text-decoration: none; display: inline-flex; gap: 0.7rem; align-items: center; }
.seal { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; flex: none; }
.hero-bleed { position: relative; min-height: 88vh; display: grid; align-items: end; overflow: hidden; }
img.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-bleed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.15) 10%, rgba(7, 8, 11, 0.2) 40%, rgba(7, 8, 11, 0.92) 100%);
}
.hero-copy { position: relative; z-index: 1; padding: 18vh 0 3.5rem; }
.hero-copy h1 span { color: var(--gold-2); }
img.card-art { flex: 1 0 100%; width: 100%; height: 280px; object-fit: cover; object-position: center 20%; display: block; }
img.profile-art { height: 360px; max-width: 520px; margin-bottom: 1rem; }
img.zone-art { width: 100%; height: min(46vw, 320px); object-fit: cover; display: block; margin: 0 0 0.8rem; border: 1px solid var(--line); }
img.item-art { width: min(100%, 280px); height: 280px; object-fit: cover; flex: none; border: 1px solid var(--line); }
img.banner-art { width: min(100%, 520px); height: 360px; object-fit: cover; display: block; margin-bottom: 1rem; border: 1px solid var(--line); }
.cinema { position: relative; min-height: 320px; overflow: hidden; padding-top: 1.4rem; }
img.cinema-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; pointer-events: none; }
.cinema::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.15), rgba(7, 8, 11, 0.78));
  z-index: 0;
}
.protocol li { text-shadow: 0 1px 10px #000; }
.cinema .kicker, .cinema .verdict, .cinema .protocol { position: relative; z-index: 1; }
.empty { display: flex; gap: 0.8rem; align-items: center; margin: 1rem 0; }
.empty img { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--line); }
.mark strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.mark span {
  display: block;
  margin-top: 0.15rem;
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.nav-inline { display: flex; gap: 0.6rem; align-items: center; }
h1, h2, .verdict { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 0.98; margin: 0.25rem 0 0.8rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.2rem 0 0.4rem; }
.lede { max-width: 38rem; color: var(--muted); font-size: 1.05rem; }
.kicker { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; margin: 0; }
.hero-bleed .hero-copy { animation: rise 0.8s ease both; }
.panel, .choice, .cinema, .map-node {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.panel { padding: 1.25rem; }
.power {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 8vw, 5rem);
  line-height: 0.9;
  color: var(--gold-2);
  margin: 0.35rem 0;
  font-variant-numeric: tabular-nums;
}
.grid-3 { display: grid; gap: 0.8rem; margin-top: 2rem; }
@media (min-width: 800px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-3 article {
  padding: 1.3rem;
  border: 1px solid var(--line);
  background: rgba(8, 9, 12, 0.55);
  animation: rise 0.7s ease both;
}
.grid-3 article:nth-child(2) { animation-delay: 0.08s; }
.grid-3 article:nth-child(3) { animation-delay: 0.16s; }

.btn, button.btn, button {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.05rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #f7f3ea, #e7d7b4);
  color: #14120e;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(198, 163, 106, 0.18); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: transparent; color: var(--ivory); border-color: var(--line); box-shadow: none; }
.btn.secondary:hover { border-color: var(--gold); color: var(--gold-2); }
.btn:disabled, .btn.is-busy { opacity: 0.45; cursor: progress; transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
label { display: block; }
input[type="email"], input[type="password"], input[type="text"], input[type="number"] {
  width: 100%;
  min-height: 3.1rem;
  border: 1px solid var(--line);
  background: rgba(8, 9, 12, 0.65);
  color: var(--ivory);
  padding: 0.45rem 0.75rem;
  transition: border-color 0.18s ease;
}
input:focus { border-color: var(--gold); }
.field { margin: 0 0 1rem; flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.error { color: var(--clay); }
.ok { color: var(--olive); }

.shell { min-height: 100vh; }
.side { display: none; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem 1.4rem;
    border-right: 1px solid var(--line);
    background: rgba(7, 8, 11, 0.72);
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .side nav { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 1.8rem; }
  .side a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-left: 2px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  }
  .side a:hover { color: var(--ivory); }
  .side a.active { color: var(--gold-2); border-left-color: var(--gold); background: rgba(198, 163, 106, 0.08); }
  .tabbar, .mobile-only { display: none !important; }
}
.main { padding: 1.2rem 1rem calc(6.4rem + env(safe-area-inset-bottom)); animation: rise 0.45s ease both; }
.main.is-enter { animation: slideIn 0.34s ease both; }
.main.is-loading { animation: shimmer 1s linear infinite; }
.main.is-loading > * { opacity: 0.45; }
@media (min-width: 960px) { .main { padding: 1.8rem 2.2rem 2.5rem; } }
.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(7, 8, 11, 0.8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.hud { margin-left: auto; text-align: right; text-decoration: none; color: inherit; min-width: 9rem; }
.hud strong, .hud .faint { display: block; }
.meter { display: block; height: 4px; margin-top: 0.35rem; background: #0c0e13; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold-2)); transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar a strong { font-family: var(--serif); font-weight: 560; }

.choices { display: grid; gap: 0.75rem; }
@media (min-width: 720px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice {
  text-align: left;
  color: inherit;
  padding: 1rem;
  cursor: pointer;
  min-height: 2.85rem;
  display: block;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.choice:hover { transform: translateY(-2px); border-color: rgba(234, 215, 173, 0.45); }
.choice.on, .choice:has(input:checked) { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(198, 163, 106, 0.35); }
.choice strong { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 560; }
.choice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.choice input { accent-color: var(--gold); }
.choice strong, .choice .muted, .choice .faint { flex: 1 1 calc(100% - 88px); }
.stats { display: grid; gap: 0.8rem; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.track { height: 6px; background: #0c0e13; margin-top: 0.75rem; overflow: hidden; }
.track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ember), var(--gold-2));
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.list, .protocol { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.list li, .duel-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.protocol li {
  opacity: 0;
  transform: translateY(6px);
  animation: line 0.45s ease forwards;
  animation-delay: calc(var(--i, 0) * 110ms);
  padding: 0.35rem 0 0.35rem 0.8rem;
  border-left: 1px solid rgba(198, 163, 106, 0.45);
  margin-bottom: 0.35rem;
}
.cinema {
  margin: 1rem 0 1.4rem;
  padding: 1.2rem 1.1rem 1rem;
  position: relative;
  overflow: hidden;
}
.cinema::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(224, 138, 86, 0.22), transparent 70%);
  pointer-events: none;
}
.cinema.win { box-shadow: inset 0 0 0 1px rgba(168, 192, 164, 0.35), var(--shadow); }
.cinema.loss { box-shadow: inset 0 0 0 1px rgba(224, 160, 144, 0.4), var(--shadow); }
.verdict { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 0.95; margin: 0.2rem 0 0.8rem; }
.cinema.win .verdict { color: var(--olive); }
.cinema.loss .verdict { color: var(--clay); }
.cinema.draw .verdict { color: var(--gold-2); }

.map { display: flex; flex-direction: column; margin-top: 0.5rem; }
.map-node {
  margin: 0;
  padding: 1rem 1rem 1rem 1.1rem;
  border-left: 3px solid rgba(244, 240, 230, 0.16);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
  background: transparent;
  animation: rise 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.map-node.here { border-left-color: var(--gold); background: rgba(198, 163, 106, 0.06); }

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.94);
  z-index: 8;
  backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab, .tabbar summary.tab {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.15rem;
  line-height: 1.15;
  cursor: pointer;
  list-style: none;
}
.tabbar summary::-webkit-details-marker { display: none; }
.tabbar .tab.active, .tabbar summary.active { color: var(--gold-2); box-shadow: inset 0 2px 0 var(--gold); }
.more { position: static; }
.more[open] > summary { color: var(--gold-2); }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(4.6rem + env(safe-area-inset-bottom));
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.8rem;
  background: rgba(12, 14, 19, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45);
}
.more:not([open]) .sheet { display: none; }
.sheet a, .sheet button { min-height: 3.25rem; }
.sheet a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ivory);
  border: 1px solid var(--line);
}
.sheet a.active { color: var(--gold-2); border-color: var(--gold); }
.rail-label { margin: 1.1rem 0 0.2rem; color: var(--faint); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; }
.hub { display: grid; gap: 0.8rem; margin-top: 1.2rem; }
@media (min-width: 720px) { .hub { grid-template-columns: repeat(3, 1fr); } }
.hub-card { display: block; color: inherit; text-decoration: none; border: 1px solid var(--line); background: rgba(12, 14, 19, 0.8); overflow: hidden; min-height: 220px; }
.hub-card img, img.hub-art { width: 100%; height: 150px; object-fit: cover; display: block; }
.hub-copy { display: block; padding: 0.75rem 0.85rem 0.9rem; }
.vest { display: grid; gap: 0.8rem; margin: 0.6rem 0 1rem; }
@media (min-width: 720px) { .vest { grid-template-columns: 220px 1fr; align-items: center; } }
.mission-grid { display: grid; gap: 0.8rem; }
@media (min-width: 800px) { .mission-grid { grid-template-columns: 1fr 1fr; } }
.mission { margin: 0; overflow: hidden; }
img.mission-art, img.log-art { width: 100%; height: 160px; object-fit: cover; display: block; margin: 0 0 0.75rem; }
.log-card { margin-top: 0.7rem; overflow: hidden; }
.clan-board { margin-top: 0.4rem; }
.clan-row { align-items: center; }
.clan-row.here { border-left: 2px solid var(--gold); padding-left: 0.6rem; }
.rank-no { font-family: var(--serif); color: var(--gold-2); min-width: 2.2rem; }
.clan-power { text-align: right; color: var(--gold-2); }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { min-height: 3.1rem; }
.side a { min-height: 2.75rem; }
.foot { color: var(--faint); font-size: 0.78rem; max-width: 46rem; padding: 2.2rem 0 3rem; }
.auth { width: min(30rem, calc(100% - 2rem)); margin: 10vh auto 4rem; animation: rise 0.55s ease both; }
.break { overflow-wrap: anywhere; }
.toast {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(5.4rem + env(safe-area-inset-bottom));
  z-index: 24;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(16, 18, 24, 0.96);
  animation: toastIn 0.35s ease both;
  box-shadow: var(--shadow);
}
@media (min-width: 960px) {
  .toast { left: auto; right: 2rem; width: min(24rem, 36vw); bottom: 1.4rem; }
}
.note { margin: 0 0 1rem; padding: 0.8rem 0.9rem; border: 1px solid rgba(168, 192, 164, 0.45); }
.toast.ok { border-color: rgba(168, 192, 164, 0.45); color: var(--olive); }
.toast.error { border-color: rgba(224, 160, 144, 0.5); color: var(--clay); }
.hint { font-size: 0.82rem; color: var(--faint); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes line {
  to { opacity: 1; transform: none; }
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.splash { display: none; }
html.js .splash {
  display: grid;
  place-items: end center;
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    radial-gradient(500px 280px at 50% 30%, rgba(198, 163, 106, 0.2), transparent 60%),
    #07080b;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
html.js.booted .splash { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-card { text-align: center; padding-bottom: 18vh; }
.splash-card strong { display: block; font-family: var(--serif); font-size: 2.4rem; margin-top: 0.8rem; }
.splash-card span { display: block; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); font-size: 0.72rem; }
.splash-seal { width: 84px; height: 84px; }

.quota-low { animation: quotaPulse 1.6s ease-in-out infinite; }
.map-node { overflow: hidden; transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease; }
.map-node img.zone-art { transform: scale(1.04); transition: transform 0.35s ease; }
.map-node.depart { opacity: 0.35; transform: translateX(-16px); }
.map-node.here.arrive { animation: arrive 0.7s ease; }
body.tension .zone-art { transform: scale(1.08); filter: saturate(0.75) brightness(0.72); transition: 0.7s ease; }
body.tension::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 12;
  pointer-events: none;
}
body.impact::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(244, 240, 230, 0.55), transparent 58%);
  animation: flash 0.48s ease forwards;
}
.protocol.live li { animation: none; opacity: 0; }
.protocol.live li.on { opacity: 1; transform: none; }
.banner-enter { animation: bannerIn 0.7s ease both; }
.rank-list li { animation: rankIn 0.45s ease both; animation-delay: calc(var(--i, 0) * 50ms); }
.burst { position: fixed; left: 50%; top: 38%; width: 0; height: 0; z-index: 26; pointer-events: none; }
.burst i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-2);
  animation: burst 0.7s ease forwards;
}
.gear-form.just-used { box-shadow: inset 3px 0 0 var(--gold); }
.btn:active, .tabbar .tab:active, .side a:active { transform: scale(0.96); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes quotaPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px transparent; }
  50% { box-shadow: inset 0 0 0 1px rgba(224, 138, 86, 0.75); }
}
@keyframes arrive {
  from { background: rgba(198, 163, 106, 0.28); }
  to { background: rgba(198, 163, 106, 0.06); }
}
@keyframes flash { to { opacity: 0; } }
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rankIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes burst {
  to { transform: translate(var(--x), var(--y)) scale(0.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .protocol li, .protocol.live li { opacity: 1; transform: none; }
  .splash, html.js .splash { display: none !important; }
}
