:root {
  --bg: #07111f;
  --panel: rgba(7, 17, 31, 0.72);
  --panel-strong: rgba(13, 28, 51, 0.92);
  --line: rgba(151, 179, 217, 0.18);
  --text: #e8f0ff;
  --muted: #8da2c5;
  --gold: #ffd166;
  --cyan: #45f0df;
  --red: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Dosis", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(69, 240, 223, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.18), transparent 30%),
    linear-gradient(180deg, #09101d 0%, #050a14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.dashboard {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.topbar,
.home-section,
.system-panel,
.sector-section {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 14px 18px;
  border-radius: 24px;
  overflow-x: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-family: "Dosis", sans-serif;
  font-weight: 800;
  color: #06111d;
  background: linear-gradient(135deg, var(--gold), #fff0b3);
}

.eyebrow,
.section-tag,
.wallet-label,
.section-note,
.sector-state,
.card-footer span,
.stat-card span {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand h1,
.hero h2,
.section-head h3,
.sector-card h4 {
  margin: 0;
  font-family: "Dosis", sans-serif;
}

.brand p,
.hero-copy,
.section-note,
.sector-card p {
  margin: 0;
}

.menu {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 0 0 auto;
}

.menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
}

.menu-icon {
  font-size: 1rem;
  line-height: 1;
}

.menu-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-stats {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex: 0 0 auto;
}

.admin-entry-button {
  align-self: stretch;
  min-width: 96px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.topbar-pill,
.wallet-box {
  min-width: auto;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.topbar-pill {
  min-width: 110px;
}

.topbar-pill span,
.wallet-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-pill strong,
.wallet-box strong {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1.1;
}

.topbar-pill.warning {
  border-color: rgba(255, 107, 107, 0.28);
}

.topbar-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(69, 240, 223, 0.22);
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(69, 240, 223, 0.18), rgba(255, 209, 102, 0.14)),
    rgba(13, 28, 51, 0.96);
  white-space: nowrap;
}

.topbar-login-button[hidden] {
  display: none;
}

.topbar-profile-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(69, 240, 223, 0.12)),
    rgba(13, 28, 51, 0.96);
}

.topbar-profile-button[hidden] {
  display: none;
}

.topbar-profile-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #06111d;
  background: linear-gradient(135deg, #fff0b3, #ffd166);
}

.topbar-profile-label {
  margin-top: 4px;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.wallet-box {
  text-align: right;
}

.balance-box {
  border-color: rgba(255, 209, 102, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(69, 240, 223, 0.14)),
    rgba(13, 28, 51, 0.96);
}

.wallet-box strong {
  font-size: 1.05rem;
}

.home-section {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 24px;
}

.main-home-section {
  margin-bottom: 0;
}

.home-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.home-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.95fr);
  gap: 18px;
  width: 100%;
  align-items: stretch;
}

.home-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-title-icon {
  font-size: 2.2rem;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.28);
}

.home-title-copy {
  margin: 8px 0 0;
  max-width: 56ch;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #c6d3ec;
}

.home-roles {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(7, 16, 31, 0.8);
}

.home-roles-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-roles-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #f3f7ff;
}

.home-roles-list li + li {
  margin-top: 8px;
}

.home-head h2 {
  margin: 4px 0 0;
  font-size: 1.55rem;
  line-height: 1;
}

.home-note {
  margin: 0;
  max-width: 34ch;
  font-size: 0.88rem;
  color: #c6d3ec;
  text-align: right;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rules-grid > .rule-card {
  min-height: 112px;
}

.rules-grid > .rule-card:first-child {
  display: flex;
  flex-direction: column;
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.profile-card {
  display: grid;
  gap: 12px;
}

.profile-field {
  display: grid;
  gap: 6px;
}

.profile-field span {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(151, 179, 217, 0.18);
  color: var(--text);
  background: rgba(7, 17, 31, 0.72);
}

.profile-actions {
  display: flex;
  justify-content: flex-start;
}

.profile-google {
  display: grid;
  gap: 10px;
}

.profile-google-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#google-login-button {
  width: 100%;
}

.profile-note {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #c6d3ec;
}

.ev-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rule-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.14), rgba(69, 240, 223, 0.1)),
    rgba(13, 28, 51, 0.96);
}

.rule-index {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.module-inline .rule-index,
.module-card .rule-index {
  line-height: 1.15;
  white-space: normal;
  max-width: 5ch;
}

.rule-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 1rem;
  color: #07111f;
  background: linear-gradient(135deg, var(--gold), #fff0b3);
}

.rule-mainline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.rule-card strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.rule-cost {
  margin-left: auto;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.combined-rule-card {
  display: grid;
  gap: 12px;
}

.module-frame {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(151, 179, 217, 0.14);
  background: rgba(7, 17, 31, 0.42);
}

.module-card .module-frame:first-child,
.combined-rule-card .module-frame:first-child {
  min-height: 170px;
  display: flex;
  flex-direction: column;
}

.module-card .module-frame:last-child,
.combined-rule-card .module-frame:last-child {
  min-height: 248px;
}

.rule-row + .rule-row {
  padding-top: 12px;
  border-top: 1px solid rgba(151, 179, 217, 0.14);
}

.module-inline strong {
  margin-top: 10px;
}

.ptc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.module-level {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(69, 240, 223, 0.18);
  background:
    linear-gradient(135deg, rgba(69, 240, 223, 0.14), rgba(255, 209, 102, 0.08)),
    rgba(10, 23, 42, 0.82);
}

.module-level-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.module-level strong {
  margin-top: 6px;
  font-size: 1.6rem;
  line-height: 1;
}

.module-level p {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #c6d3ec;
}

.ptc-button {
  width: 100%;
  justify-self: stretch;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(151, 179, 217, 0.18);
}

.ptc-button:disabled {
  cursor: not-allowed;
  color: #c6d3ec;
  background: rgba(7, 17, 31, 0.92);
  border-color: rgba(69, 240, 223, 0.24);
}

.module-card strong {
  margin-top: 10px;
}

.module-card {
  display: grid;
  gap: 12px;
}

.module-rule {
  margin-top: 0;
}

.module-rule strong {
  margin-top: 8px;
  font-size: 1rem;
}

.mining-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 14px;
}

.mining-unit {
  flex: 0 0 calc((100% - 30px) / 7);
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(151, 179, 217, 0.18);
  background:
    linear-gradient(180deg, rgba(69, 240, 223, 0.08), transparent 55%),
    rgba(8, 18, 33, 0.96);
  display: grid;
  place-items: center;
  padding: 3px;
}

.mining-unit::before {
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%),
    rgba(16, 34, 59, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -8px 12px rgba(0, 0, 0, 0.18);
}

.mining-unit::after {
  content: "\26CF";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: rgba(198, 211, 236, 0.48);
  text-shadow: 0 0 10px rgba(198, 211, 236, 0.08);
}

.mining-unit.is-active::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 209, 102, 0.12), rgba(16, 34, 59, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 10px rgba(255, 209, 102, 0.12);
}

.mining-unit.is-active::after {
  color: rgba(255, 209, 102, 0.82);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.22);
}

.mining-unit.is-powered::before {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 209, 102, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(69, 240, 223, 0.42), rgba(16, 34, 59, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 18px rgba(69, 240, 223, 0.22);
}

.mining-unit.is-powered::after {
  color: #ffd166;
  text-shadow:
    0 0 14px rgba(255, 209, 102, 0.34),
    0 0 22px rgba(69, 240, 223, 0.18);
}

.mining-info {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(151, 179, 217, 0.14);
  font-family: "Consolas", "Courier New", monospace;
  background: rgba(7, 16, 29, 0.38);
}

.mining-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(151, 179, 217, 0.12);
}

.mining-row:last-child {
  border-bottom: 0;
}

.mining-info strong,
.mining-info span {
  display: block;
}

.mining-info strong {
  font-size: 0.92rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #f4f7ff;
}

.mining-info span {
  font-size: 0.78rem;
  line-height: 1.15;
  color: #c6d3ec;
}

.mining-info-label {
  margin-bottom: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rule-subline {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.92rem;
  color: var(--gold);
}

.ev-modules {
  display: grid;
  gap: 12px;
}

.module-card strong {
  margin-top: 10px;
}

.module-card .rule-subline {
  color: #c6d3ec;
}

.task-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.98rem;
  line-height: 1.35;
  color: #e8f0ff;
}

.task-list li + li {
  margin-top: 6px;
}

.task-list li.is-complete {
  color: var(--cyan);
}

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

.level-briefing-copy {
  margin: auto 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #c6d3ec;
}

.banner-card {
  align-content: center;
  overflow: hidden;
}

.ranking-card {
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(69, 240, 223, 0.18), transparent 34%),
    linear-gradient(155deg, rgba(8, 18, 36, 0.98), rgba(12, 26, 52, 0.96));
  border: 1px solid rgba(69, 240, 223, 0.18);
}

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

.ranking-symbol {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.ranking-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(118, 255, 168, 0.22);
  background: rgba(118, 255, 168, 0.1);
  color: #9bffbc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ranking-board {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(7, 16, 31, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ranking-slider-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ranking-arrow {
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.35);
}

.ranking-icon {
  font-size: 1.1rem;
}

.ranking-arrow-right {
  color: #45f0df;
  text-shadow: 0 0 12px rgba(69, 240, 223, 0.35);
}

.ranking-card strong {
  display: inline-block;
  min-width: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  white-space: nowrap;
  will-change: transform, opacity;
}

.ranking-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ranking-tape span {
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b7c7e7;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.ranking-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ranking-metric {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ranking-metric span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ranking-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  color: #f3f7ff;
}

.ranking-card #global-ranking-title.is-sliding {
  animation: ranking-slide 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ranking-slide {
  from {
    opacity: 0;
    transform: translateX(26px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ranking-copy {
  margin: 0;
  max-width: 34ch;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #c6d3ec;
}

.system-panel {
  padding: 18px 16px;
  border-radius: 24px;
  align-self: start;
}

.system-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.system-item {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.system-highlight {
  grid-column: 1 / -1;
  border-color: rgba(69, 240, 223, 0.3);
  background:
    linear-gradient(135deg, rgba(69, 240, 223, 0.2), rgba(118, 255, 168, 0.16)),
    rgba(13, 28, 51, 0.96);
}

.system-item span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.system-item strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
  line-height: 1;
}

.cycle-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 23, 42, 0.76);
}

.cycle-timer {
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(69, 240, 223, 0.2);
  background:
    linear-gradient(135deg, rgba(69, 240, 223, 0.14), rgba(255, 209, 102, 0.08)),
    rgba(13, 28, 51, 0.96);
}

.cycle-timer strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
}

.cycle-timer span {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.control-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 23, 42, 0.76);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-family: "Consolas", "Courier New", monospace;
}

.control-row + .control-row {
  border-top: 1px solid rgba(151, 179, 217, 0.12);
}

.control-row span {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.control-row strong {
  font-size: 0.9rem;
  color: #f4f7ff;
}

.control-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.control-actions button {
  width: 100%;
}

.control-actions button:disabled {
  cursor: not-allowed;
  color: #c6d3ec;
  background: rgba(7, 17, 31, 0.92);
  border: 1px solid rgba(151, 179, 217, 0.18);
}

.control-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #c6d3ec;
}

.sector-section {
  padding: 22px;
  border-radius: 30px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sector-card {
  min-height: 178px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(9, 19, 34, 0.9);
  transition: transform 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.sector-card.active {
  position: relative;
  overflow: hidden;
  border-color: rgba(69, 240, 223, 0.45);
  background:
    linear-gradient(180deg, rgba(69, 240, 223, 0.1), transparent 40%),
    rgba(9, 19, 34, 0.96);
}

.sector-card.unlocked {
  opacity: 1;
  border-color: rgba(255, 209, 102, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.08), transparent 40%),
    rgba(9, 19, 34, 0.94);
}

.sector-card.active::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% 40%;
  height: 100px;
  background: radial-gradient(circle, rgba(69, 240, 223, 0.24), transparent 68%);
  pointer-events: none;
}

.sector-card.locked {
  opacity: 0.46;
  filter: grayscale(0.2);
}

.sector-card:hover {
  transform: translateY(-4px);
}

.card-top,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sector-id {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}

.sector-state.live {
  color: var(--cyan);
}

.sector-card h4 {
  margin-top: 12px;
  font-size: 1rem;
}

.sector-card p {
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #c6d3ec;
}

.card-footer {
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.card-footer span,
.sector-state {
  font-size: 0.7rem;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  color: #06111d;
  background: linear-gradient(135deg, var(--cyan), #96fff5);
  cursor: pointer;
}

.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 15, 0.72);
  backdrop-filter: blur(10px);
}

.admin-panel-card {
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(69, 240, 223, 0.08), transparent 24%),
    rgba(9, 19, 34, 0.98);
  box-shadow: var(--shadow);
}

.admin-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel-head h3 {
  margin: 4px 0 0;
}

.admin-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(151, 179, 217, 0.18);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.admin-close-button {
  min-width: 44px;
  padding: 8px;
  font-size: 1.15rem;
}

.admin-auth,
.admin-editor {
  margin-top: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(151, 179, 217, 0.16);
  background: rgba(7, 17, 31, 0.46);
  position: sticky;
  top: 18px;
}

.admin-main {
  display: grid;
  gap: 16px;
}

.admin-tab-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(151, 179, 217, 0.16);
  color: #dbe8ff;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.admin-tab-button:hover {
  transform: translateX(3px);
  border-color: rgba(69, 240, 223, 0.24);
}

.admin-tab-button.is-active {
  background: linear-gradient(135deg, var(--cyan), #96fff5);
  color: #04101d;
  border-color: rgba(69, 240, 223, 0.7);
  box-shadow:
    0 0 0 1px rgba(69, 240, 223, 0.18),
    0 12px 28px rgba(69, 240, 223, 0.18);
}

.admin-tab-panel {
  display: grid;
  gap: 16px;
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(151, 179, 217, 0.16);
  background: rgba(7, 17, 31, 0.46);
}

.admin-card h3,
.admin-card p {
  margin: 0;
}

.admin-db-status {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(151, 179, 217, 0.16);
  background: rgba(7, 17, 31, 0.58);
  color: #c6d3ec;
}

.admin-db-status[data-state="loading"] {
  border-color: rgba(255, 209, 102, 0.38);
  color: #ffe7a0;
}

.admin-db-status[data-state="success"] {
  border-color: rgba(118, 255, 168, 0.34);
  color: #baffd0;
}

.admin-db-status[data-state="error"] {
  border-color: rgba(255, 120, 120, 0.34);
  color: #ffb4b4;
}

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

.admin-field {
  display: grid;
  gap: 8px;
}

.admin-field span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-field input,
.admin-editor textarea {
  width: 100%;
  border: 1px solid rgba(151, 179, 217, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(7, 17, 31, 0.8);
}

#admin-db-sql-output {
  min-height: 280px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.admin-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-editor-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(151, 179, 217, 0.16);
  background: rgba(7, 17, 31, 0.5);
}

.admin-editor-label {
  display: block;
  padding-top: 10px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #e8f0ff;
}

.admin-editor textarea {
  min-height: 72px;
  resize: vertical;
}

.admin-offer-grid {
  display: grid;
  gap: 12px;
}

.admin-offer-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 120px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(151, 179, 217, 0.16);
  background: rgba(7, 17, 31, 0.5);
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-size: 0.84rem;
  color: #e8f0ff;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-sidebar-actions {
  margin-top: 10px;
}

.admin-status-message {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: #c6d3ec;
}

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

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

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-note {
    text-align: left;
  }

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

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

  .topbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .topbar-stats {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-editor-grid {
    grid-template-columns: 1fr;
  }

  .admin-editor-card {
    grid-template-columns: 1fr;
  }

  .admin-editor-label {
    padding-top: 0;
  }

  .admin-card-head,
  .admin-offer-card {
    grid-template-columns: 1fr;
  }

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

  .admin-sidebar {
    position: static;
  }

  .menu {
    flex-wrap: wrap;
  }

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

  .home-overview {
    grid-template-columns: 1fr;
  }

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

  .ranking-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    margin-top: 10px;
  }

  .topbar,
  .home-section,
  .system-panel,
  .sector-section {
    padding: 18px;
    border-radius: 22px;
  }

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

  .control-actions {
    grid-template-columns: 1fr;
  }

  .system-highlight {
    grid-column: auto;
  }

  .topbar-pill,
  .wallet-box {
    width: 100%;
  }

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

  .ranking-market-head,
  .ranking-slider-shell {
    align-items: start;
    flex-direction: column;
  }

  .ranking-arrow-right {
    display: none;
  }
}
