:root {
  --ink: #10212b;
  --ink-soft: #4a6576;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.97);
  --surface-card: rgba(255, 255, 255, 0.92);
  --line: rgba(20, 64, 84, 0.14);
  --line-strong: rgba(20, 64, 84, 0.22);
  --mint: #28d8bc;
  --sky: #63b9ff;
  --sun: #ffbe5f;
  --rose: #ff8d80;
  --good: #1fba6a;
  --bad: #d84f4f;
  --tone-auth: #46c2ff;
  --tone-steps: #28cfb3;
  --tone-provider: #8fa3ff;
  --tone-loot: #f3b246;
  --tone-inventory: #ad7cf8;
  --tone-events: #ff937e;
  --tone-wallet: #5ac57d;
  --shell-shadow: 0 18px 52px rgba(13, 33, 45, 0.14);
  --card-shadow: 0 12px 26px rgba(18, 45, 60, 0.11);
  --press-shadow: 0 6px 14px rgba(17, 36, 47, 0.12);
  --map-water: #d5e9f6;
  --dock-bg: rgba(255, 255, 255, 0.9);
  --dock-line: rgba(15, 54, 75, 0.16);
  --dock-active: rgba(38, 211, 184, 0.18);
  --console-bg: #0f2532;
  --console-ink: #c9f6f4;
  --aurora-a: rgba(74, 209, 255, 0.18);
  --aurora-b: rgba(48, 232, 190, 0.16);
  --aurora-c: rgba(255, 186, 105, 0.14);
}

body[data-theme="dark"] {
  --ink: #e8f2f8;
  --ink-soft: #9bb0bc;
  --surface: rgba(16, 26, 35, 0.72);
  --surface-strong: rgba(16, 26, 35, 0.92);
  --surface-card: rgba(13, 22, 31, 0.82);
  --line: rgba(137, 173, 195, 0.22);
  --line-strong: rgba(137, 173, 195, 0.38);
  --mint: #2cf4d2;
  --sky: #6ab7ff;
  --sun: #ffc56a;
  --rose: #ff8f87;
  --good: #49d888;
  --bad: #ff7373;
  --tone-auth: #61c2ff;
  --tone-steps: #28cfb3;
  --tone-provider: #95a6ff;
  --tone-loot: #f8be61;
  --tone-inventory: #ba90ff;
  --tone-events: #ff9c88;
  --tone-wallet: #6fd58f;
  --shell-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  --card-shadow: 0 14px 34px rgba(0, 0, 0, 0.33);
  --press-shadow: 0 10px 16px rgba(0, 0, 0, 0.36);
  --map-water: #162839;
  --dock-bg: rgba(8, 15, 22, 0.86);
  --dock-line: rgba(152, 186, 208, 0.3);
  --dock-active: rgba(44, 244, 210, 0.22);
  --console-bg: #061019;
  --console-ink: #bfeef0;
  --aurora-a: rgba(78, 160, 230, 0.24);
  --aurora-b: rgba(46, 210, 170, 0.22);
  --aurora-c: rgba(234, 157, 85, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Bricolage Grotesque", sans-serif;
  background:
    radial-gradient(1200px 600px at -10% -18%, rgba(99, 185, 255, 0.22), transparent 65%),
    radial-gradient(900px 560px at 106% -8%, rgba(255, 190, 95, 0.22), transparent 64%),
    radial-gradient(820px 360px at 54% 118%, rgba(40, 216, 188, 0.16), transparent 66%),
    linear-gradient(168deg, #f6fcff 0%, #fff3e7 52%, #fffdf8 100%);
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
  transition: background 280ms ease, color 240ms ease;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  overscroll-behavior-y: none;
}

body[data-theme="dark"] {
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(56, 126, 191, 0.34), transparent 64%),
    radial-gradient(900px 560px at 108% -10%, rgba(215, 129, 54, 0.22), transparent 64%),
    radial-gradient(820px 380px at 50% 120%, rgba(30, 147, 130, 0.2), transparent 66%),
    linear-gradient(165deg, #060d14 0%, #0b1722 48%, #101a28 100%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: radial-gradient(currentColor 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  color: rgba(20, 42, 56, 0.34);
  mix-blend-mode: soft-light;
}

body[data-theme="dark"] .grain {
  color: rgba(193, 217, 233, 0.22);
}

.noise-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(22, 61, 82, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 61, 82, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 36%, rgba(0, 0, 0, 0.65), transparent 80%);
}

body[data-theme="dark"] .noise-grid {
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(113, 161, 194, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 161, 194, 0.08) 1px, transparent 1px);
}

.halo {
  position: fixed;
  right: -130px;
  bottom: -130px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(40, 216, 188, 0.42), transparent 65%);
  filter: blur(1px);
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite;
}

.aurora-stream {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.75;
  mix-blend-mode: screen;
}

.aurora-a {
  width: 52vw;
  height: 34px;
  left: -12vw;
  top: 24vh;
  transform: rotate(-16deg);
  animation: auroraDriftA 22s ease-in-out infinite;
  background: linear-gradient(90deg, transparent 0%, var(--aurora-a) 34%, var(--aurora-b) 66%, transparent 100%);
}

.aurora-b {
  width: 46vw;
  height: 28px;
  right: -8vw;
  top: 62vh;
  transform: rotate(14deg);
  animation: auroraDriftB 24s ease-in-out infinite;
  animation-delay: 6s;
  background: linear-gradient(90deg, transparent 0%, var(--aurora-b) 36%, var(--aurora-c) 67%, transparent 100%);
}

.orb-a {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: 12%;
  background: radial-gradient(circle, rgba(99, 185, 255, 0.3), transparent 70%);
}

.orb-b {
  width: 320px;
  height: 320px;
  right: -120px;
  top: 18%;
  animation-delay: 2.6s;
  background: radial-gradient(circle, rgba(255, 141, 128, 0.24), transparent 72%);
}

.shell {
  width: min(1240px, calc(100% - 22px));
  margin: 12px auto 0;
  display: grid;
  gap: 14px;
  padding-top: env(safe-area-inset-top);
  position: relative;
}

.shell.shell-merged {
  gap: 0;
}

.shell.shell-merged .hud {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.shell.shell-merged .app-view.is-active .hero {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
}

.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 220px at 18% 0%, rgba(101, 184, 255, 0.08), transparent 72%),
    radial-gradient(680px 200px at 88% 100%, rgba(58, 210, 173, 0.08), transparent 72%);
  z-index: -1;
}

.hud {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 30;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(10px);
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.hud::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 0%, rgba(255, 255, 255, 0.2) 28%, transparent 56%);
  transform: translateX(-120%);
  animation: hudSheen 9s ease-in-out infinite;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.city-switch .view-switch-btn {
  min-height: 44px;
  font-size: 14px;
  font-weight: 900;
}

.view-switch-btn {
  border-radius: 14px;
  border: 1px solid var(--line);
  min-height: 38px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-family: "Bricolage Grotesque", sans-serif;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

body[data-theme="dark"] .view-switch-btn {
  background: rgba(10, 20, 30, 0.72);
}

.view-switch-btn.active {
  border-color: rgba(40, 216, 188, 0.62);
  background: rgba(40, 216, 188, 0.2);
  box-shadow: 0 0 0 1px rgba(40, 216, 188, 0.3), 0 10px 18px rgba(40, 216, 188, 0.18);
}

.app-view {
  display: none;
  gap: 14px;
}

.app-view.is-active {
  display: grid;
  animation: viewReveal 360ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

.app-view[data-view="map"] .territory-stage {
  min-height: calc(100svh - 210px);
}

.hud-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.hud-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hud-toggles {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  color: #093934;
  border: 1px solid rgba(18, 69, 69, 0.2);
  background: linear-gradient(135deg, rgba(40, 216, 188, 0.95), rgba(110, 215, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  flex: 0 0 auto;
}

body[data-theme="dark"] .brand-mark {
  color: #032f2a;
}

.menu-title {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
}

.menu-subtitle {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 36px;
  padding: 7px 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(236, 246, 255, 0.82));
  color: #15384a;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.theme-toggle.big {
  min-height: 50px;
  padding: 12px 16px;
  font-size: 14px;
  gap: 10px;
}

.theme-toggle.big .theme-toggle-icon {
  width: 28px;
  height: 28px;
}

.lang-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #15384a;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

body[data-theme="dark"] .lang-toggle {
  color: var(--ink);
  background: rgba(16, 27, 37, 0.88);
}

.lang-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 16px rgba(14, 39, 54, 0.14);
}

.lang-toggle:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: var(--press-shadow);
}

body[data-theme="dark"] .theme-toggle {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(27, 41, 55, 0.95), rgba(16, 27, 37, 0.88));
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 16px rgba(14, 39, 54, 0.16);
}

.theme-toggle:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: var(--press-shadow);
}

.theme-toggle-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] .theme-toggle-icon {
  background: rgba(255, 255, 255, 0.14);
}

.theme-toggle-label {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-btn {
  position: relative;
  overflow: hidden;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: #1e485c;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  font-family: "Bricolage Grotesque", sans-serif;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

body[data-theme="dark"] .settings-btn {
  color: #d8e9f4;
  background: rgba(16, 27, 37, 0.88);
}

.settings-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 16px rgba(14, 39, 54, 0.16);
}

.settings-btn:active {
  transform: translateY(1px) scale(0.98);
}

.settings-btn-ico {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.settings-btn-ico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-btn-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: #2f5568;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
}

body[data-theme="dark"] .menu-pill {
  color: #c7dbe7;
  background: rgba(20, 34, 46, 0.7);
}

.menu-pill.ok {
  border-color: rgba(31, 186, 106, 0.45);
  color: #1f754a;
  background: rgba(31, 186, 106, 0.14);
}

body[data-theme="dark"] .menu-pill.ok {
  color: #72e2ac;
}

.menu-pill.err {
  border-color: rgba(216, 79, 79, 0.5);
  color: #8e2f2f;
  background: rgba(216, 79, 79, 0.14);
}

body[data-theme="dark"] .menu-pill.err {
  color: #ff9f9f;
}

.section-target {
  scroll-margin-top: 16px;
}

.territory-stage,
.hero,
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--surface-strong), var(--surface-card));
  box-shadow: var(--shell-shadow);
  animation: lift 420ms ease;
}

.rent-card {
  padding: 11px;
}

.rent-card h2 {
  font-size: 18px;
  margin-top: 2px;
}

.rent-card .card-note {
  font-size: 12px;
  margin-bottom: 10px;
}

.rent-card .field-row {
  margin-bottom: 6px;
}

.rent-card input,
.rent-card select,
.rent-card textarea {
  padding: 9px 11px;
  min-width: 0;
}

.territory-stage {
  padding: 14px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.territory-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(340px 180px at 76% -10%, rgba(99, 185, 255, 0.22), transparent 72%),
    radial-gradient(320px 160px at -5% 108%, rgba(40, 216, 188, 0.16), transparent 74%);
}

.territory-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.territory-head h2 {
  margin: 4px 0 6px;
  font-size: clamp(24px, 4.6vw, 38px);
  line-height: 1.04;
}

.kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.territory-subtitle {
  margin: 0;
  font-size: 13px;
  max-width: 800px;
  color: var(--ink-soft);
}

.territory-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.territory-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px 12px;
  font-size: 12px;
  color: #2e5568;
}

body[data-theme="dark"] .territory-badge {
  color: #bfd8e7;
  background: rgba(12, 25, 35, 0.7);
}

.territory-badge strong {
  margin-left: 3px;
}

.territory-layout {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 12px;
}

.territory-map-wrap {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  min-height: 460px;
  background: var(--map-water);
  box-shadow: var(--card-shadow);
  position: relative;
  transition: box-shadow 260ms ease, border-color 260ms ease, transform 220ms ease;
}

.territory-map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 220ms ease;
}

.territory-map-wrap.is-tracking {
  border-color: rgba(40, 216, 188, 0.68);
  box-shadow:
    0 0 0 1px rgba(40, 216, 188, 0.35),
    0 0 26px rgba(40, 216, 188, 0.22),
    var(--card-shadow);
  transform: translateY(-1px);
}

.territory-map-wrap.is-tracking::after {
  opacity: 1;
  animation: map-pulse 1.7s ease-in-out infinite;
  background: radial-gradient(circle at 50% 35%, rgba(40, 216, 188, 0.24), transparent 66%);
}

.territory-map-wrap.capture-flash::after {
  opacity: 1;
  animation: capture-flash 700ms ease-out;
  background: radial-gradient(circle at 50% 50%, rgba(255, 190, 95, 0.34), rgba(40, 216, 188, 0.08) 56%, transparent 74%);
}

#territoryMap {
  width: 100%;
  min-height: 460px;
}

.territory-side {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}

body[data-theme="dark"] .territory-side {
  background: rgba(9, 18, 27, 0.7);
}

.loot-quick {
  --card-tone: var(--tone-loot);
  --card-tone-ring: rgba(243, 178, 70, 0.22);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(17, 40, 55, 0.14);
}

.territory-side .loot-quick h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.territory-stats {
  display: grid;
  gap: 7px;
}

.territory-stat {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

body[data-theme="dark"] .territory-stat {
  background: rgba(12, 24, 34, 0.76);
}

.territory-stat span {
  font-size: 12px;
  color: var(--ink-soft);
}

.territory-stat strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.territory-msg {
  margin: 0;
  min-height: 20px;
  font-size: 12px;
  color: var(--ink-soft);
}

.territory-msg.ok {
  color: var(--good);
}

.territory-msg.err {
  color: var(--bad);
}

.territory-faction-panel,
.territory-capture-panel {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  padding: 9px;
  display: grid;
  gap: 8px;
}

body[data-theme="dark"] .territory-faction-panel,
body[data-theme="dark"] .territory-capture-panel {
  background: rgba(10, 21, 31, 0.76);
}

.territory-faction-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.territory-faction-row .btn {
  min-width: 126px;
}

.territory-capture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.territory-capture-head strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.capture-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  background: rgba(99, 185, 255, 0.12);
}

.capture-chip.live {
  border-color: rgba(40, 216, 188, 0.62);
  background: rgba(40, 216, 188, 0.2);
  color: #0b6458;
}

body[data-theme="dark"] .capture-chip.live {
  color: #8af8e7;
}

.capture-chip.resolved {
  border-color: rgba(255, 190, 95, 0.6);
  background: rgba(255, 190, 95, 0.2);
}

.territory-capture-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  align-items: center;
}

.territory-capture-grid span {
  font-size: 11px;
  color: var(--ink-soft);
}

.territory-capture-grid strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.territory-capture-actions .btn {
  min-width: 0;
}

.territory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-soft);
}

.territory-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.mine {
  background: var(--mint);
}

.dot.enemy {
  background: var(--sky);
}

.hero {
  position: relative;
  padding: 18px;
  overflow: hidden;
}

.hero.hero-compact {
  padding: 12px 14px;
}

.hero.hero-compact h1 {
  font-size: clamp(22px, 4.2vw, 30px);
  margin: 4px 0 6px;
}

.hero.hero-compact .subtitle {
  margin: 0 0 8px;
  font-size: 12px;
  max-width: 720px;
}

.hero.hero-compact .metric {
  padding: 9px 11px;
}

.hero.hero-compact .metric-value {
  font-size: 20px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(99, 185, 255, 0.28), transparent 66%);
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 5.2vw, 48px);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 0 0 12px;
  color: var(--ink-soft);
  max-width: 880px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  border-radius: 999px;
  border: 1px solid rgba(40, 216, 188, 0.45);
  color: #155b52;
  background: rgba(40, 216, 188, 0.14);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

body[data-theme="dark"] .chip {
  color: #7ef2e0;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--card-shadow);
  padding: 11px 12px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), rgba(99, 185, 255, 0.75), transparent 78%);
  opacity: 0.62;
}

body[data-theme="dark"] .metric {
  background: rgba(12, 24, 34, 0.74);
}

.metric-label {
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  transition: transform 220ms ease, text-shadow 220ms ease;
}

.metric-value.value-flash,
.steps-stat strong.value-flash {
  animation: valueFlash 460ms ease;
}

.status {
  margin: 10px 0 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--ink-soft);
}

.status.ok {
  color: var(--good);
}

.status.err {
  color: var(--bad);
}

.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.overview-actions .btn {
  min-height: 36px;
  padding: 8px 11px;
}

.overview-quickstart {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(130deg, rgba(99, 185, 255, 0.14), rgba(40, 216, 188, 0.14));
}

body[data-theme="dark"] .overview-quickstart {
  background: linear-gradient(130deg, rgba(37, 78, 112, 0.28), rgba(21, 87, 78, 0.26));
}

.overview-quickstart-title {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.overview-live {
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.56);
  color: #2e5468;
  min-height: 34px;
}

body[data-theme="dark"] .overview-live {
  background: rgba(8, 17, 25, 0.68);
  color: #c6ddec;
}

.overview-live.ticker-flash {
  animation: tickerFlash 420ms ease;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.side-col {
  display: grid;
  gap: 12px;
  height: fit-content;
}

.hub-tab-card {
  display: none;
}

.hub-tab-card.is-active {
  display: block;
  animation: tabReveal 300ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

.card {
  --card-tone: var(--tone-auth);
  --card-tone-ring: rgba(70, 194, 255, 0.24);
  box-shadow: var(--card-shadow);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--card-tone), transparent 76%);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(320px 180px at 110% -10%, var(--card-tone-ring), transparent 72%);
  opacity: 0.85;
}

.card:hover {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 34px rgba(15, 37, 50, 0.2);
}

.ui-pop {
  animation: uiPop 420ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.card.ui-pop {
  animation: uiPop 420ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.tone-auth {
  --card-tone: var(--tone-auth);
  --card-tone-ring: rgba(70, 194, 255, 0.22);
}

.tone-steps {
  --card-tone: var(--tone-steps);
  --card-tone-ring: rgba(40, 207, 179, 0.22);
}

.tone-provider {
  --card-tone: var(--tone-provider);
  --card-tone-ring: rgba(143, 163, 255, 0.22);
}

.tone-loot {
  --card-tone: var(--tone-loot);
  --card-tone-ring: rgba(243, 178, 70, 0.22);
}

.tone-inventory {
  --card-tone: var(--tone-inventory);
  --card-tone-ring: rgba(173, 124, 248, 0.24);
}

.tone-events {
  --card-tone: var(--tone-events);
  --card-tone-ring: rgba(255, 147, 126, 0.22);
}

.tone-wallet {
  --card-tone: var(--tone-wallet);
  --card-tone-ring: rgba(90, 197, 125, 0.22);
}

.grid .card:nth-child(2) {
  animation-delay: 65ms;
}

.grid .card:nth-child(3) {
  animation-delay: 115ms;
}

.grid .card:nth-child(4) {
  animation-delay: 165ms;
}

.grid .card:nth-child(5) {
  animation-delay: 215ms;
}

.grid .card:nth-child(6) {
  animation-delay: 265ms;
}

.grid .card:nth-child(7) {
  animation-delay: 305ms;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-tone);
  box-shadow: 0 0 0 4px var(--card-tone-ring);
}

.card-note {
  margin: -2px 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.shop-hidden-select {
  display: none;
}

.shop-case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.shop-case-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(238, 248, 255, 0.6));
  box-shadow: 0 10px 18px rgba(13, 37, 49, 0.12);
  display: grid;
  gap: 10px;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.shop-case-card.ui-pop {
  animation: uiPop 380ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.shop-case-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.35), transparent 52%);
}

.shop-case-card::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -18%;
  width: 52%;
  height: 180%;
  pointer-events: none;
  transform: rotate(17deg) translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.54), transparent);
  transition: transform 420ms ease;
}

.shop-case-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 28px rgba(13, 36, 48, 0.2);
}

.shop-case-card:hover::after {
  transform: rotate(17deg) translateX(320%);
}

.shop-case-card.case-silver {
  box-shadow: 0 12px 22px rgba(116, 148, 170, 0.2);
}

.shop-case-card.case-gold {
  border-color: rgba(243, 178, 70, 0.48);
  box-shadow: 0 12px 22px rgba(202, 143, 43, 0.24);
}

.shop-case-card.case-platinum {
  border-color: rgba(170, 143, 255, 0.5);
  box-shadow: 0 12px 24px rgba(146, 107, 255, 0.24);
}

.shop-case-card.is-bought {
  animation: caseBought 840ms ease;
}

.shop-case-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.shop-case-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.shop-case-icon.case-icon-silver {
  background: linear-gradient(145deg, #e8f2fb, #bed1e1);
}

.shop-case-icon.case-icon-gold {
  background: linear-gradient(145deg, #ffe4ad, #ffbf54);
}

.shop-case-icon.case-icon-platinum {
  background: linear-gradient(145deg, #dfd4ff, #b792ff);
}

body[data-theme="dark"] .shop-case-icon {
  border-color: rgba(133, 170, 191, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.shop-case-head h3 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.shop-case-head p {
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.shop-case-odds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.odd-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
}

.odd-chip.rarity-common {
  border-color: rgba(164, 181, 193, 0.6);
  color: #5f7684;
  background: rgba(164, 181, 193, 0.16);
}

.odd-chip.rarity-rare {
  border-color: rgba(90, 184, 255, 0.62);
  color: #17659b;
  background: rgba(90, 184, 255, 0.18);
}

.odd-chip.rarity-epic {
  border-color: rgba(173, 124, 248, 0.66);
  color: #7a44d3;
  background: rgba(173, 124, 248, 0.2);
}

.odd-chip.rarity-legendary {
  border-color: rgba(243, 178, 70, 0.7);
  color: #8a5a14;
  background: rgba(243, 178, 70, 0.22);
}

body[data-theme="dark"] .odd-chip.rarity-common {
  color: #c3d3dd;
}

body[data-theme="dark"] .odd-chip.rarity-rare {
  color: #9dd6ff;
}

body[data-theme="dark"] .odd-chip.rarity-epic {
  color: #d3bcff;
}

body[data-theme="dark"] .odd-chip.rarity-legendary {
  color: #ffd79f;
}

.shop-case-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.shop-case-foot .btn {
  flex: 1 1 210px;
  justify-content: center;
}

.shop-price-chip {
  flex: 0 0 auto;
  align-self: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.7);
  color: #1f4458;
}

.shop-case-card.case-gold .shop-price-chip {
  border-color: rgba(243, 178, 70, 0.56);
}

.shop-case-card.case-platinum .shop-price-chip {
  border-color: rgba(170, 143, 255, 0.6);
}

.shop-buy {
  min-height: 34px;
  padding: 7px 10px;
}

.shop-open-inline {
  min-height: 34px;
  padding: 7px 10px;
}

body[data-theme="dark"] .shop-case-card {
  background: linear-gradient(145deg, rgba(9, 19, 29, 0.78), rgba(11, 22, 33, 0.84));
}

body[data-theme="dark"] .shop-price-chip {
  background: rgba(11, 22, 34, 0.8);
  color: #d2e7f4;
}

.inventory-subtitle {
  margin: 10px 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.inventory-list {
  display: grid;
  gap: 8px;
}

.inventory-cases {
  display: grid;
  gap: 8px;
}

.inventory-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.58);
}

body[data-theme="dark"] .inventory-empty {
  background: rgba(10, 20, 30, 0.66);
}

.inventory-item {
  --item-accent: #97b6c8;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  padding: 9px 10px;
  display: grid;
  gap: 5px;
  box-shadow: inset 0 0 0 1px rgba(151, 182, 200, 0.2);
  position: relative;
  overflow: hidden;
}

.inventory-item.ui-pop,
.inventory-case.ui-pop {
  animation: uiPop 380ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.inventory-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--item-accent), transparent 78%);
  pointer-events: none;
}

body[data-theme="dark"] .inventory-item {
  background: rgba(10, 20, 30, 0.72);
}

.inventory-item.rarity-epic {
  border-color: rgba(173, 124, 248, 0.62);
  box-shadow: inset 0 0 0 1px rgba(173, 124, 248, 0.22), 0 0 16px rgba(173, 124, 248, 0.16);
}

.inventory-item.rarity-rare {
  border-color: rgba(90, 184, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(90, 184, 255, 0.2), 0 0 14px rgba(90, 184, 255, 0.14);
}

.inventory-item.rarity-common {
  border-color: rgba(164, 181, 193, 0.5);
}

.inventory-item.rarity-legendary {
  border-color: rgba(243, 178, 70, 0.72);
  box-shadow: inset 0 0 0 1px rgba(243, 178, 70, 0.26), 0 0 18px rgba(243, 178, 70, 0.18);
}

.inventory-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.inventory-item-head strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.inventory-rarity-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-rarity-chip.rarity-epic {
  border-color: rgba(173, 124, 248, 0.62);
  color: #7a44d3;
  background: rgba(173, 124, 248, 0.2);
}

body[data-theme="dark"] .inventory-rarity-chip.rarity-epic {
  color: #d3bcff;
}

.inventory-rarity-chip.rarity-rare {
  border-color: rgba(90, 184, 255, 0.6);
  color: #17659b;
  background: rgba(90, 184, 255, 0.18);
}

body[data-theme="dark"] .inventory-rarity-chip.rarity-rare {
  color: #9dd6ff;
}

.inventory-rarity-chip.rarity-common {
  border-color: rgba(164, 181, 193, 0.54);
  color: #5f7684;
  background: rgba(164, 181, 193, 0.16);
}

body[data-theme="dark"] .inventory-rarity-chip.rarity-common {
  color: #c3d3dd;
}

.inventory-rarity-chip.rarity-legendary {
  border-color: rgba(243, 178, 70, 0.68);
  color: #8a5a14;
  background: rgba(243, 178, 70, 0.22);
}

body[data-theme="dark"] .inventory-rarity-chip.rarity-legendary {
  color: #ffd79f;
}

.inventory-item-meta,
.inventory-item-stats {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.inventory-item-meta {
  color: var(--ink-soft);
}

.inventory-item-stats {
  font-family: "IBM Plex Mono", monospace;
  color: #305161;
}

body[data-theme="dark"] .inventory-item-stats {
  color: #c3d9e6;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.inventory-action {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line);
  min-height: 30px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Bricolage Grotesque", sans-serif;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.inventory-action.main {
  background: linear-gradient(130deg, #1fd7bd, #94f3e2);
  color: #07342d;
}

.inventory-action.soft {
  background: linear-gradient(130deg, #dbf2ff, #f1f9ff);
  color: #224c61;
}

.inventory-action.alt {
  background: linear-gradient(130deg, #ffb64e, #ffd79d);
  color: #4f2a00;
}

.inventory-action.warn {
  background: linear-gradient(130deg, #ff9f92, #ffc7b0);
  color: #5b1e1a;
}

.inventory-action:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 16px rgba(15, 37, 49, 0.16);
}

.inventory-action:active {
  transform: translateY(1px) scale(0.985);
}

.inventory-action:disabled {
  opacity: 0.76;
  cursor: wait;
}

.inventory-action.is-loading::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spinMini 520ms linear infinite;
}

body[data-theme="dark"] .inventory-action.soft {
  color: #d2e7f4;
  background: linear-gradient(130deg, #18374a, #214a62);
  border-color: rgba(149, 186, 208, 0.28);
}

.inventory-case {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  padding: 9px 10px;
  display: grid;
  gap: 6px;
  box-shadow: inset 0 0 0 1px rgba(151, 182, 200, 0.18);
}

body[data-theme="dark"] .inventory-case {
  background: rgba(10, 20, 30, 0.72);
}

.inventory-case.is-opened {
  opacity: 0.85;
}

.inventory-case.case-silver {
  border-color: rgba(132, 165, 188, 0.5);
}

.inventory-case.case-gold {
  border-color: rgba(243, 178, 70, 0.6);
  box-shadow: inset 0 0 0 1px rgba(243, 178, 70, 0.2), 0 0 14px rgba(243, 178, 70, 0.12);
}

.inventory-case.case-platinum {
  border-color: rgba(177, 128, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(177, 128, 255, 0.2), 0 0 14px rgba(177, 128, 255, 0.14);
}

.inventory-case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inventory-case-head strong {
  font-size: 12px;
}

.inventory-case-status {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.42);
}

body[data-theme="dark"] .inventory-case-status {
  background: rgba(14, 27, 39, 0.66);
}

.provider-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.provider-link {
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #285369;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.provider-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 14px rgba(16, 39, 52, 0.12);
}

body[data-theme="dark"] .provider-link {
  color: #c8deeb;
  background: rgba(10, 20, 30, 0.7);
}

.field-row,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.field-row:last-child,
.btn-row:last-child {
  margin-bottom: 0;
}

.steps-card-ui {
  display: grid;
  gap: 10px;
}

.steps-input-wrap {
  display: grid;
  gap: 6px;
}

.steps-input-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.steps-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.steps-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 4px;
}

body[data-theme="dark"] .steps-stat {
  background: rgba(10, 20, 30, 0.72);
}

.steps-stat span {
  font-size: 11px;
  color: var(--ink-soft);
}

.steps-stat strong {
  font-size: 19px;
  line-height: 1.1;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  padding: 10px 12px;
  min-width: 130px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select {
  background: rgba(8, 17, 25, 0.88);
}

input:focus,
select:focus {
  border-color: rgba(40, 216, 188, 0.78);
  box-shadow: 0 0 0 3px rgba(40, 216, 188, 0.26);
}

.field-strong input,
.field-strong select {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.mini-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  padding: 7px 10px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.mini-action.geo-btn {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 13px;
}

.mini-action:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 18px rgba(11, 29, 41, 0.12);
}

.mini-action:active {
  transform: translateY(1px) scale(0.99);
}

body[data-theme="dark"] .mini-action {
  background: rgba(9, 19, 29, 0.74);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.auth-gate[aria-hidden="false"] {
  pointer-events: auto;
}

.auth-gate-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.1), transparent 60%), rgba(5, 11, 18, 0.54);
  opacity: 0;
  transition: opacity 220ms ease;
}

.auth-gate[aria-hidden="false"] .auth-gate-backdrop {
  opacity: 1;
}

.auth-gate-sheet {
  position: relative;
  width: min(560px, calc(100% - 18px));
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-strong), var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  padding: 16px;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.auth-gate[aria-hidden="false"] .auth-gate-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.auth-gate-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  align-items: end;
  pointer-events: none;
}

.sheet[aria-hidden="false"] {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.12), transparent 60%), rgba(5, 11, 18, 0.58);
  opacity: 0;
  transition: opacity 220ms ease;
}

.sheet[aria-hidden="false"] .sheet-backdrop {
  opacity: 1;
}

.sheet-panel {
  position: relative;
  width: min(560px, calc(100% - 18px));
  margin: 0 auto;
  border-radius: 22px 22px 18px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--surface-strong), var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  padding: 16px;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  max-height: calc(100svh - 90px);
  overflow: auto;
}

.sheet[aria-hidden="false"] .sheet-panel {
  transform: translateY(0);
  opacity: 1;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

body[data-theme="dark"] .sheet-close {
  background: rgba(10, 20, 30, 0.72);
}

.sheet-close:active {
  transform: translateY(1px) scale(0.98);
}

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 40px;
  padding: 10px 13px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition:
    transform 130ms ease,
    box-shadow 130ms ease,
    filter 130ms ease,
    border-color 130ms ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.32) 35%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 260ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 40, 54, 0.18);
}

.btn:hover::before {
  transform: translateX(105%);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: var(--press-shadow);
}

.btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  filter: saturate(0.82);
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: btn-sheen 900ms linear infinite;
}

.btn-main {
  color: #07342d;
  background: linear-gradient(130deg, #1fd7bd, #94f3e2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.btn-alt {
  color: #4f2a00;
  background: linear-gradient(130deg, #ffb64e, #ffd79d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.btn-soft {
  color: #224c61;
  background: linear-gradient(130deg, #dbf2ff, #f1f9ff);
  border-color: rgba(24, 72, 95, 0.2);
}

body[data-theme="dark"] .btn-soft {
  color: #d2e7f4;
  background: linear-gradient(130deg, #18374a, #214a62);
  border-color: rgba(149, 186, 208, 0.28);
}

.btn-warn {
  color: #581b17;
  background: linear-gradient(130deg, #ff9f92, #ffc7b0);
}

.btn-ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 580ms ease-out forwards;
}

.ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  flex: 0 0 auto;
}

body[data-theme="dark"] .ico {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.ico svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide {
  --card-tone: var(--tone-steps);
  --card-tone-ring: rgba(40, 207, 179, 0.22);
}

.legend {
  --card-tone: #9e88ff;
  --card-tone-ring: rgba(158, 136, 255, 0.22);
}

.legend-grid {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #2f5062;
}

body[data-theme="dark"] .legend-item {
  color: #bbd2df;
}

.legend-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.legend-main {
  background: linear-gradient(120deg, #1fd7bd, #8cf2df);
}

.legend-alt {
  background: linear-gradient(120deg, #ffb347, #ffd08f);
}

.legend-soft {
  background: linear-gradient(120deg, #d8f0ff, #eff9ff);
}

.steps-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #2d4f61;
}

body[data-theme="dark"] .steps-list {
  color: #bfd5e3;
}

.steps-list li {
  margin: 0 0 8px;
}

.mini-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.mini-note.ok {
  color: var(--good);
}

.mini-note.err {
  color: var(--bad);
}

.mini-link {
  color: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.mini-link:active {
  opacity: 0.85;
}

#stepsStatusNote {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.54);
  transition: border-color 200ms ease, background 200ms ease;
}

body[data-theme="dark"] #stepsStatusNote {
  background: rgba(8, 17, 25, 0.64);
}

#stepsStatusNote.ok {
  border-color: rgba(40, 216, 188, 0.46);
}

#stepsStatusNote.err {
  border-color: rgba(216, 79, 79, 0.54);
}

.journey {
  --card-tone: var(--tone-provider);
  --card-tone-ring: rgba(143, 163, 255, 0.22);
}

.journey-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(27, 52, 68, 0.13);
  margin-bottom: 10px;
  overflow: hidden;
}

.journey-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--mint), var(--sky));
  transition: width 260ms ease;
}

.journey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.journey-list li {
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: #35596b;
  background: rgba(255, 255, 255, 0.66);
}

body[data-theme="dark"] .journey-list li {
  background: rgba(9, 21, 31, 0.7);
}

.journey-list li::before {
  content: "○";
  margin-right: 8px;
  color: #90a8b4;
}

.journey-list li.active {
  border-color: rgba(99, 185, 255, 0.5);
  background: rgba(99, 185, 255, 0.12);
}

.journey-list li.active::before {
  content: "◐";
  color: var(--sky);
}

.journey-list li.done {
  border-color: rgba(31, 186, 106, 0.45);
  background: rgba(31, 186, 106, 0.12);
  color: #1f6a48;
}

body[data-theme="dark"] .journey-list li.done {
  color: #7ee2af;
}

.journey-list li.done::before {
  content: "✓";
  color: var(--good);
}

.console-wrap {
  --card-tone: var(--tone-events);
  --card-tone-ring: rgba(255, 147, 126, 0.22);
  position: sticky;
  top: 8px;
  height: fit-content;
}

.console {
  margin: 6px 0 0;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--console-bg);
  color: var(--console-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-x: auto;
}

.bottom-dock {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  width: auto;
  max-width: 1040px;
  margin-inline: auto;
  z-index: 60;
  border-radius: 18px;
  border: 1px solid var(--dock-line);
  background: linear-gradient(140deg, var(--dock-bg), rgba(255, 255, 255, 0.96));
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(7, 26, 37, 0.18);
  display: flex;
  gap: 4px;
  padding: 5px;
  overflow: hidden;
  isolation: isolate;
  scrollbar-width: none;
}

.bottom-dock,
.bottom-dock.ui-pop {
  transform: none !important;
  translate: none !important;
  animation: none !important;
}

.bottom-dock::-webkit-scrollbar {
  display: none;
}

.bottom-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(40, 216, 188, 0.08), rgba(99, 185, 255, 0.09), rgba(255, 179, 89, 0.09));
  background-size: 240% 240%;
  animation: dockFlow 12s linear infinite;
}

.menu-link {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #254b5e;
  padding: 5px 8px;
  min-width: 0;
  flex: 1 1 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.menu-link::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 180ms ease, transform 180ms ease;
  background: linear-gradient(90deg, var(--mint), var(--sky));
}

.menu-link:hover {
  transform: translateY(-1px);
  border-color: var(--line);
}

.menu-link:active {
  transform: translateY(1px) scale(0.985);
}

.menu-link.active {
  border-color: rgba(40, 216, 188, 0.55);
  background: var(--dock-active);
  color: var(--ink);
}

.menu-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.dock-ico {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(22, 60, 80, 0.1);
}

.dock-ico svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-link.active .dock-ico {
  background: rgba(40, 216, 188, 0.32);
  box-shadow: 0 0 0 1px rgba(40, 216, 188, 0.36), 0 8px 12px rgba(28, 108, 94, 0.2);
}

body[data-theme="dark"] .bottom-dock {
  background: linear-gradient(140deg, var(--dock-bg), rgba(7, 14, 22, 0.72));
}

body[data-theme="dark"] .menu-link {
  color: #c4dbea;
}

body[data-theme="dark"] .dock-ico {
  background: rgba(255, 255, 255, 0.14);
}

.dock-label {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

body[data-theme="dark"] .leaflet-control-zoom a,
body[data-theme="dark"] .leaflet-control-attribution {
  background: rgba(9, 18, 27, 0.85);
  color: #d5e6f1;
  border-color: rgba(136, 173, 194, 0.25);
}

.theme-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  pointer-events: none;
}

.theme-panel[aria-hidden="false"] {
  pointer-events: auto;
}

.theme-panel-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(5, 11, 18, 0.52);
  opacity: 0;
  transition: opacity 220ms ease;
}

.theme-panel[aria-hidden="false"] .theme-panel-backdrop {
  opacity: 1;
}

.theme-sheet {
  position: relative;
  width: min(620px, calc(100% - 14px));
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-strong), var(--surface));
  box-shadow: 0 -20px 44px rgba(7, 20, 29, 0.28);
  padding: 14px;
  transform: translateY(102%);
  transition: transform 260ms ease;
}

.theme-panel[aria-hidden="false"] .theme-sheet {
  transform: translateY(0);
}

.theme-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.theme-sheet-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.theme-sheet-close {
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

body[data-theme="dark"] .theme-sheet-close {
  background: rgba(9, 19, 29, 0.75);
}

.theme-sheet-subtitle {
  margin: 8px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-option {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 12px 10px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

body[data-theme="dark"] .theme-option {
  background: rgba(9, 19, 29, 0.72);
}

.theme-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(11, 29, 41, 0.17);
}

.theme-option.is-active {
  border-color: rgba(40, 216, 188, 0.65);
  background: rgba(40, 216, 188, 0.14);
}

.theme-option-title {
  font-size: 14px;
  font-weight: 800;
}

.theme-option-note {
  font-size: 12px;
  color: var(--ink-soft);
}

.theme-current {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.loot-open-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  pointer-events: none;
}

.loot-open-modal[aria-hidden="false"] {
  pointer-events: auto;
}

.loot-open-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: none;
  background: rgba(4, 8, 13, 0.66);
  opacity: 0;
  transition: opacity 220ms ease;
}

.loot-open-modal[aria-hidden="false"] .loot-open-backdrop {
  opacity: 1;
}

.loot-open-sheet {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 12px));
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-strong), var(--surface));
  box-shadow: 0 -20px 46px rgba(6, 15, 23, 0.42);
  padding: 14px;
  transform: translateY(102%);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
}

.loot-open-modal[aria-hidden="false"] .loot-open-sheet {
  transform: translateY(0);
  opacity: 1;
}

.loot-open-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.loot-open-head h3 {
  margin: 4px 0 8px;
  font-size: clamp(20px, 4vw, 30px);
}

.case-scene {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body[data-theme="dark"] .case-scene {
  background: rgba(8, 17, 25, 0.74);
}

.case-scene.is-spinning {
  animation: caseSpinPulse 620ms ease-in-out infinite;
}

.loot-open-modal[data-rarity="legendary"] .case-scene {
  box-shadow: 0 0 38px rgba(255, 190, 95, 0.34), inset 0 0 0 1px rgba(255, 210, 142, 0.36);
}

.loot-open-modal[data-rarity="epic"] .case-scene {
  box-shadow: 0 0 32px rgba(177, 128, 255, 0.34), inset 0 0 0 1px rgba(204, 176, 255, 0.28);
}

.case-reel-mask {
  width: min(700px, calc(100% - 12px));
  height: 136px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(220px 140px at 50% 40%, rgba(99, 185, 255, 0.26), transparent 72%),
    linear-gradient(180deg, rgba(6, 21, 31, 0.92), rgba(4, 15, 23, 0.98));
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(117, 155, 176, 0.16), 0 16px 24px rgba(2, 9, 15, 0.45);
}

.case-reel-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 8, 12, 0.95), transparent 18%, transparent 82%, rgba(2, 8, 12, 0.95));
  z-index: 3;
}

.case-reel-track {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  will-change: transform;
}

.case-reel-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 20px;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.case-reel-pointer::before,
.case-reel-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

.case-reel-pointer::before {
  top: 0;
  border-top: 14px solid rgba(255, 210, 126, 0.95);
}

.case-reel-pointer::after {
  bottom: 0;
  border-bottom: 14px solid rgba(255, 210, 126, 0.95);
}

.reel-item {
  width: 124px;
  min-width: 124px;
  border-radius: 12px;
  border: 1px solid rgba(150, 184, 202, 0.32);
  background: rgba(11, 26, 37, 0.86);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.reel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent 48%);
}

.reel-item-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.reel-item-name {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: #d7e8f4;
}

.reel-item.rarity-common {
  border-color: rgba(165, 188, 205, 0.46);
}

.reel-item.rarity-rare {
  border-color: rgba(97, 193, 255, 0.58);
  box-shadow: inset 0 0 18px rgba(97, 193, 255, 0.16);
}

.reel-item.rarity-epic {
  border-color: rgba(184, 142, 255, 0.7);
  box-shadow: inset 0 0 24px rgba(184, 142, 255, 0.2);
}

.reel-item.rarity-legendary {
  border-color: rgba(255, 199, 107, 0.78);
  box-shadow: inset 0 0 28px rgba(255, 199, 107, 0.26);
}

.reel-item.is-landed {
  animation: landedPulse 620ms ease-out;
}

.rarity-burst {
  position: absolute;
  inset: auto 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(136, 165, 183, 0.3);
  padding: 10px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8d8e4;
  background: rgba(8, 20, 28, 0.72);
  opacity: 0;
  transform: translateY(12px);
  transition: transform 260ms ease, opacity 260ms ease;
}

.rarity-burst.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rarity-burst.rarity-common {
  border-color: rgba(172, 192, 206, 0.62);
  color: #e4f0f8;
  background: linear-gradient(145deg, rgba(29, 43, 53, 0.92), rgba(20, 33, 42, 0.86));
  box-shadow: 0 0 18px rgba(165, 188, 205, 0.24);
}

.rarity-burst.rarity-rare {
  border-color: rgba(97, 193, 255, 0.74);
  color: #8fd8ff;
  background: linear-gradient(145deg, rgba(11, 50, 74, 0.92), rgba(8, 35, 56, 0.86));
  box-shadow: 0 0 24px rgba(90, 184, 255, 0.42);
}

.rarity-burst.rarity-epic {
  border-color: rgba(184, 142, 255, 0.78);
  color: #cfb4ff;
  background: linear-gradient(145deg, rgba(54, 25, 83, 0.92), rgba(35, 16, 59, 0.86));
  box-shadow: 0 0 26px rgba(177, 128, 255, 0.44);
}

.rarity-burst.rarity-legendary {
  border-color: rgba(255, 199, 107, 0.86);
  color: #ffd995;
  background: linear-gradient(145deg, rgba(92, 55, 15, 0.94), rgba(59, 35, 8, 0.88));
  box-shadow: 0 0 30px rgba(255, 190, 95, 0.52);
}

.drop-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  animation: dropSpark 1200ms cubic-bezier(0.08, 0.64, 0.28, 1) forwards;
}

.drop-spark.rarity-common {
  background: #d6e4ee;
  box-shadow: 0 0 10px rgba(189, 206, 218, 0.45);
}

.drop-spark.rarity-rare {
  background: #6ec8ff;
  box-shadow: 0 0 12px rgba(110, 200, 255, 0.6);
}

.drop-spark.rarity-epic {
  background: #be9cff;
  box-shadow: 0 0 14px rgba(190, 156, 255, 0.66);
}

.drop-spark.rarity-legendary {
  background: #ffd38a;
  box-shadow: 0 0 16px rgba(255, 211, 138, 0.7);
}

.loot-open-result {
  margin: 10px 2px 2px;
  min-height: 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

body[data-theme="dark"] .loot-open-result {
  background: rgba(8, 17, 25, 0.66);
}

.loot-open-result.rarity-common {
  color: #bcd2e2;
  border-color: rgba(171, 191, 205, 0.5);
  box-shadow: 0 0 14px rgba(171, 191, 205, 0.2);
}

.loot-open-result.rarity-rare {
  color: #63c4ff;
  border-color: rgba(90, 184, 255, 0.58);
  box-shadow: 0 0 18px rgba(90, 184, 255, 0.28);
}

.loot-open-result.rarity-epic {
  color: #bd9dff;
  border-color: rgba(177, 128, 255, 0.62);
  box-shadow: 0 0 20px rgba(177, 128, 255, 0.34);
}

.loot-open-result.rarity-legendary {
  color: #ffc56a;
  border-color: rgba(255, 190, 95, 0.72);
  box-shadow: 0 0 24px rgba(255, 190, 95, 0.38);
}

.toast-stack {
  position: fixed;
  right: 12px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 95;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 200px;
  max-width: min(340px, calc(100vw - 20px));
  border-radius: 12px;
  border: 1px solid rgba(121, 155, 176, 0.44);
  background: linear-gradient(150deg, rgba(9, 24, 35, 0.94), rgba(6, 16, 23, 0.96));
  color: #d7e8f3;
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: 0 12px 22px rgba(4, 12, 18, 0.45);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.ok {
  border-color: rgba(47, 210, 161, 0.56);
}

.toast.warn {
  border-color: rgba(255, 190, 95, 0.7);
}

.toast.err {
  border-color: rgba(236, 120, 120, 0.64);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 1100px) {
  .territory-layout {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .console-wrap {
    position: static;
  }

  .side-col {
    order: 2;
  }

  .console {
    min-height: 260px;
  }
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .app-view[data-view="map"] .territory-stage {
    min-height: calc(100svh - 196px);
  }

  .shop-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .theme-toggle-label {
    display: none;
  }

  .territory-map-wrap,
  #territoryMap {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .aurora-stream {
    opacity: 0.42;
  }

  .shell {
    width: calc(100% - 12px);
    margin: 8px auto 0;
    gap: 10px;
  }

  .hud {
    padding: 10px;
    gap: 8px;
  }

  .app-view[data-view="map"] .territory-stage {
    min-height: calc(100svh - 174px);
  }

  .menu-subtitle {
    max-width: 210px;
  }

  .loot-open-sheet {
    padding: 10px;
    border-radius: 16px;
  }

  .case-scene {
    min-height: 190px;
  }

  .case-reel-mask {
    height: 118px;
  }

  .reel-item {
    width: 104px;
    min-width: 104px;
  }

  .rarity-burst {
    font-size: 16px;
    padding: 8px;
  }

  .territory-stage,
  .hero,
  .card {
    border-radius: 18px;
    padding: 12px;
  }

  .territory-map-wrap,
  #territoryMap {
    min-height: 300px;
  }

  .btn,
  input,
  select {
    width: 100%;
    justify-content: center;
  }

  .field-row,
  .btn-row {
    align-items: stretch;
  }

  .territory-faction-row {
    grid-template-columns: 1fr;
  }

  .shop-case-grid {
    grid-template-columns: 1fr;
  }

  .steps-stats-grid {
    grid-template-columns: 1fr;
  }

  .shop-case-foot,
  .inventory-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-link {
    min-width: 0;
    padding: 4px 6px;
  }

  .toast-stack {
    right: 8px;
    left: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .toast {
    max-width: none;
  }
}

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

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes btn-sheen {
  from {
    left: -40%;
  }
  to {
    left: 110%;
  }
}

@keyframes spinMini {
  to {
    transform: rotate(360deg);
  }
}

@keyframes landedPulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 rgba(255, 199, 107, 0);
  }
  40% {
    transform: scale(1.02);
    box-shadow: inset 0 0 24px rgba(255, 199, 107, 0.42);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 rgba(255, 199, 107, 0);
  }
}

@keyframes dockFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 240% 50%;
  }
}

@keyframes ripple {
  from {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(16);
  }
}

@keyframes map-pulse {
  0% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.45;
    transform: scale(1);
  }
}

@keyframes capture-flash {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  28% {
    opacity: 1;
    transform: scale(1.01);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes caseBought {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 18px rgba(13, 37, 49, 0.12);
  }
  30% {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(40, 216, 188, 0.4), 0 14px 24px rgba(40, 216, 188, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 18px rgba(13, 37, 49, 0.12);
  }
}

@keyframes caseSpinPulse {
  0% {
    transform: scale(1);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.008);
    filter: saturate(1.08);
  }
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes dropSpark {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.4);
  }
  18% {
    opacity: 1;
    transform: translate3d(calc(var(--drift-x) * 0.15), calc(var(--drift-y) * 0.2), 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x), var(--drift-y), 0) scale(0.25);
  }
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(16px, -10px) scale(1.03);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes auroraDriftA {
  0% {
    transform: translate3d(0, 0, 0) rotate(-12deg);
    opacity: 0.55;
  }
  40% {
    transform: translate3d(4vw, -2vh, 0) rotate(-7deg);
    opacity: 0.82;
  }
  70% {
    transform: translate3d(-2vw, 2vh, 0) rotate(-14deg);
    opacity: 0.62;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(-12deg);
    opacity: 0.55;
  }
}

@keyframes auroraDriftB {
  0% {
    transform: translate3d(0, 0, 0) rotate(14deg);
    opacity: 0.52;
  }
  40% {
    transform: translate3d(-3vw, 2vh, 0) rotate(10deg);
    opacity: 0.8;
  }
  70% {
    transform: translate3d(2vw, -1vh, 0) rotate(16deg);
    opacity: 0.62;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(14deg);
    opacity: 0.52;
  }
}

@keyframes hudSheen {
  0%,
  58% {
    transform: translateX(-120%);
  }
  75% {
    transform: translateX(22%);
  }
  100% {
    transform: translateX(160%);
  }
}

@keyframes viewReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tabReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes uiPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes valueFlash {
  0% {
    transform: translateY(0) scale(1);
    text-shadow: none;
  }
  45% {
    transform: translateY(-2px) scale(1.04);
    text-shadow: 0 0 14px rgba(44, 244, 210, 0.4);
  }
  100% {
    transform: translateY(0) scale(1);
    text-shadow: none;
  }
}

@keyframes tickerFlash {
  0% {
    transform: translateY(0);
    border-color: var(--line);
  }
  40% {
    transform: translateY(-1px);
    border-color: rgba(99, 185, 255, 0.52);
  }
  100% {
    transform: translateY(0);
    border-color: var(--line);
  }
}

/* Scooter Rent UI (product rewrite) */
.field {
  display: grid;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field-row-2 {
  align-items: stretch;
}

.addons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.addon-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

body[data-theme="dark"] .addon-pill {
  background: rgba(10, 20, 30, 0.72);
}

.addon-pill:active {
  transform: translateY(1px) scale(0.99);
}

.addon-pill input {
  min-width: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
}

.addon-pill.addon-qty {
  cursor: default;
  padding-right: 8px;
}

.addon-pill .addon-qty-select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-radius: 14px;
  padding: 6px 10px;
  font-weight: 900;
  font-family: "Bricolage Grotesque", sans-serif;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] .addon-pill .addon-qty-select {
  background: rgba(8, 17, 25, 0.84);
}

.addon-pill .addon-qty-select:focus {
  border-color: rgba(40, 216, 188, 0.78);
  box-shadow: 0 0 0 3px rgba(40, 216, 188, 0.2);
}

.catalog,
.bookings {
  display: grid;
  gap: 10px;
}

.scooter-card,
.booking-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  padding: 12px;
  display: grid;
  gap: 10px;
}

body[data-theme="dark"] .scooter-card,
body[data-theme="dark"] .booking-card {
  background: rgba(10, 20, 30, 0.72);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.scooter-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.scooter-photo {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  flex: 0 0 auto;
  background:
    radial-gradient(60px 60px at 20% 20%, rgba(99, 185, 255, 0.35), transparent 65%),
    radial-gradient(70px 60px at 80% 70%, rgba(40, 216, 188, 0.26), transparent 65%),
    rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] .scooter-photo {
  background:
    radial-gradient(60px 60px at 20% 20%, rgba(99, 185, 255, 0.22), transparent 65%),
    radial-gradient(70px 60px at 80% 70%, rgba(40, 216, 188, 0.18), transparent 65%),
    rgba(8, 17, 25, 0.82);
}

.scooter-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scooter-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.scooter-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.scooter-desc {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.3;
}

.spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 96px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

body[data-theme="dark"] .spark-bars {
  background: rgba(8, 17, 25, 0.62);
}

.spark-bar {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(40, 216, 188, 0.92), rgba(99, 185, 255, 0.46));
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.14);
  transform-origin: bottom;
  animation: sparkGrow 520ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.spark-bar-warm {
  background: linear-gradient(180deg, rgba(255, 190, 95, 0.92), rgba(255, 141, 128, 0.42));
}

@keyframes sparkGrow {
  from {
    transform: scaleY(0.2);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 0.95;
  }
}

.scooter-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.68);
}

body[data-theme="dark"] .chip {
  background: rgba(8, 17, 25, 0.82);
}

.booking-detail {
  display: grid;
  gap: 10px;
}

.bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  z-index: 80;
  pointer-events: none;
}

.bottom-nav {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid var(--dock-line);
  background: var(--dock-bg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.bottom-nav-btn {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 9px 8px;
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  gap: 4px;
  place-items: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.bottom-nav-btn:active {
  transform: translateY(1px) scale(0.99);
}

.bottom-nav-btn.is-active {
  background: var(--dock-active);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(44, 244, 210, 0.22);
}

.bottom-nav-ico {
  font-size: 18px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 11px;
  line-height: 1;
}
