:root {
  --app-height: 100vh;
  --bg: #050b11;
  --panel: rgba(10, 23, 34, 0.92);
  --panel-soft: rgba(13, 31, 45, 0.72);
  --line: rgba(111, 224, 255, 0.18);
  --line-strong: rgba(111, 224, 255, 0.42);
  --text: #eefbff;
  --muted: #7892a2;
  --cyan: #66e7ff;
  --cyan-bright: #a9f4ff;
  --violet: #9d7bff;
  --gold: #ffc967;
  --danger: #ff6585;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 5%, rgba(44, 155, 197, 0.16), transparent 34rem),
    linear-gradient(180deg, #071019 0%, #03070b 100%);
}

body {
  min-height: var(--app-height);
  overflow-x: hidden;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: var(--app-height);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-block {
  min-width: 0;
}

.brand-kicker,
.eyebrow,
.hud-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.brand-block h1 span {
  color: var(--cyan);
}

.build-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 22, 31, 0.8);
  color: var(--cyan-bright);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.build-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.game-frame {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(9, 23, 34, 0.95), rgba(5, 13, 20, 0.97));
  box-shadow: var(--shadow);
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 11, 18, 0.56);
}

.hud-item {
  display: grid;
  gap: 2px;
}

.hud-item--center {
  text-align: center;
}

.hud-item--right {
  text-align: right;
}

.hud-item strong {
  color: var(--cyan-bright);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.battlefield {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(28px, 5vw, 70px);
  isolation: isolate;
}

.battlefield::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(86, 188, 220, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 188, 220, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
}

.battlefield::after {
  content: "";
  position: absolute;
  width: 55%;
  aspect-ratio: 1;
  right: -12%;
  top: 8%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 224, 255, 0.09), transparent 67%);
}

.lane-preview {
  position: absolute;
  inset: 8% 8% 10%;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  opacity: 0.42;
  pointer-events: none;
}

.lane-preview span {
  border-left: 1px dashed rgba(99, 220, 255, 0.16);
}

.lane-preview span:last-child {
  border-right: 1px dashed rgba(99, 220, 255, 0.16);
}

.foundation-copy {
  max-width: 440px;
}

.foundation-copy h2 {
  margin: 7px 0 12px;
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.foundation-copy p {
  max-width: 46ch;
  margin: 0;
  color: #92a9b7;
  line-height: 1.65;
  font-size: 0.94rem;
}

.core-node {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 66px;
  height: 66px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(9, 24, 34, 0.8);
  box-shadow: 0 0 42px rgba(102, 231, 255, 0.14);
}

.core-node__ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: inherit;
  box-shadow: inset 0 0 24px rgba(102, 231, 255, 0.08);
}

.core-node__center {
  color: var(--cyan);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.board-preview {
  width: min(100%, 390px);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.7vw, 14px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(4, 13, 20, 0.5);
  box-shadow: inset 0 0 50px rgba(71, 203, 240, 0.03);
}

.board-preview__slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(105, 221, 255, 0.18);
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 42%, rgba(101, 225, 255, 0.08), transparent 52%),
    rgba(12, 29, 40, 0.72);
}

.board-preview__slot::after {
  content: attr(data-slot);
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: rgba(153, 224, 242, 0.25);
  font-size: 0.55rem;
  font-weight: 800;
}

.control-dock {
  display: grid;
  grid-template-columns: 1fr minmax(190px, 260px);
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(3, 10, 16, 0.78);
}

.environment-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.environment-status strong {
  color: #bcd5df;
}

.environment-status strong[data-status="ok"] {
  color: var(--cyan);
}

.environment-status strong[data-status="limited"] {
  color: var(--gold);
}

.primary-action {
  width: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(101, 225, 255, 0.14);
  border-radius: 14px;
  background: rgba(38, 102, 118, 0.16);
  color: rgba(203, 242, 250, 0.46);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.primary-action span {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 101, 133, 0.35);
  border-radius: 12px;
  background: #1b0d13;
  color: #ffd7df;
  text-align: center;
}
