:root {
  --ink: #eef8ff;
  --ink-dim: #a5d9ea;
  --panel: rgba(5, 16, 24, 0.7);
  --panel-strong: rgba(8, 22, 33, 0.92);
  --line: rgba(100, 220, 255, 0.18);
  --cyan: #5df0ff;
  --teal: #16d6c0;
  --gold: #ffd25e;
  --orange: #ff8f59;
  --red: #ff5666;
  --lime: #8cf564;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
  --display: "Arial Black", "Impact", sans-serif;
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--body);
  background: #08101c;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.screen-shader,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.screen-shader {
  background:
    radial-gradient(circle at 16% 82%, rgba(255, 86, 102, 0.3), transparent 22%),
    radial-gradient(circle at 82% 16%, rgba(140, 245, 100, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 25%, rgba(0, 0, 0, 0.2));
}

.scanlines {
  opacity: 0.16;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
}

.arcade-ui {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr minmax(290px, 380px);
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.hud-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-cluster,
.meter-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand,
.chip,
.ticker,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  color: white;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fcffff, #9ff5ff 58%, #fdfefb);
  box-shadow: inset 0 -4px 8px rgba(93, 240, 255, 0.24), 0 0 0 3px rgba(255, 210, 94, 0.28);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  bottom: 7px;
  border-radius: 50%;
  background: inherit;
}

.brand-mark::before {
  left: 4px;
  width: 16px;
  height: 16px;
}

.brand-mark::after {
  right: 4px;
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: grid;
  text-align: left;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.brand-copy small {
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticker,
.chip {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticker {
  min-width: min(34vw, 420px);
  color: var(--cyan);
}

.side,
.center-overlay {
  min-height: 0;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.left-rail,
.right-rail {
  min-height: calc(100vh - 92px);
}

.panel {
  border-radius: 8px;
  padding: 16px;
}

.panel h1,
.panel h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 0.92;
  text-transform: uppercase;
}

.panel h1 {
  max-width: 10ch;
  font-size: 44px;
}

.panel h2 {
  font-size: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subline,
.forecast {
  margin: 10px 0 0;
  color: var(--ink-dim);
  line-height: 1.35;
}

.forecast {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

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

.rank-chip {
  border: 1px solid rgba(255, 210, 94, 0.28);
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 210, 94, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rank-chip.neutral {
  color: var(--cyan);
  border-color: rgba(93, 240, 255, 0.18);
  background: rgba(93, 240, 255, 0.08);
}

.rank-chip.danger {
  color: #ff92a1;
  border-color: rgba(255, 86, 102, 0.22);
  background: rgba(255, 86, 102, 0.08);
}

.adopt-form {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.adopt-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.adopt-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(93, 240, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  background: rgba(12, 28, 40, 0.88);
  outline: none;
}

.adopt-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(93, 240, 255, 0.18);
}

.primary-action,
.secondary-action,
.action-grid button {
  border: 0;
  color: white;
  background: var(--panel-strong);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  min-height: 50px;
  border-radius: 8px;
  font-weight: 900;
  background: linear-gradient(90deg, #ff6b58, #ffcf5c);
  color: #071018;
  box-shadow: 0 10px 28px rgba(255, 143, 89, 0.26);
}

.primary-action:hover,
.secondary-action:hover,
.action-grid button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.secondary-action {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(93, 240, 255, 0.12);
  border: 1px solid rgba(93, 240, 255, 0.14);
}

.secondary-action.ghost {
  background: rgba(255, 255, 255, 0.06);
}

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

.action-grid button {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(93, 240, 255, 0.15), rgba(22, 214, 192, 0.35));
}

.action-grid button:nth-child(2n) {
  background: linear-gradient(135deg, rgba(140, 245, 100, 0.22), rgba(22, 214, 192, 0.34));
}

.action-grid button:nth-child(3n) {
  background: linear-gradient(135deg, rgba(255, 210, 94, 0.2), rgba(255, 86, 102, 0.34));
}

.bar-stack,
.stat-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.metric {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.metric-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.track span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
}

.track.hot span {
  background: linear-gradient(90deg, var(--lime), var(--gold), var(--red));
}

.track.aqua span {
  background: linear-gradient(90deg, var(--cyan), #7d8bff);
}

.track.gold span {
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--red));
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.telemetry div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.telemetry span {
  color: var(--ink-dim);
}

.control-strip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.control-hint {
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.45;
}

.center-overlay {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

.arena-banner {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(93, 240, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 16, 24, 0.46);
  backdrop-filter: blur(12px);
  color: white;
  box-shadow: var(--shadow);
}

.banner-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(93, 240, 255, 0.14);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

#comboReadout {
  color: var(--gold);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#statusReadout {
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 800;
}

.journal {
  display: grid;
  gap: 9px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.journal-entry {
  border-left: 3px solid var(--teal);
  padding: 1px 0 1px 9px;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.25;
}

.journal-entry strong {
  color: white;
}

.lost-sky {
  display: grid;
  gap: 8px;
  max-height: 132px;
  overflow: auto;
  color: var(--ink-dim);
  font-size: 13px;
}

.lost-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  max-width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(93, 240, 255, 0.18);
  border-radius: 999px;
  padding: 12px 18px;
  color: white;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  font-weight: 900;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  #sky,
  .screen-shader,
  .scanlines {
    position: fixed;
  }

  .arcade-ui {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    min-height: auto;
    padding: 12px;
  }

  .hud-row {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-cluster,
  .meter-cluster {
    flex-wrap: wrap;
  }

  .ticker {
    min-width: 0;
  }

  .panel h1 {
    max-width: 11ch;
    font-size: 34px;
  }

  .center-overlay {
    justify-content: stretch;
  }

  .arena-banner {
    width: 100%;
    flex-wrap: wrap;
    border-radius: 14px;
  }
}

@media (max-width: 520px) {
  .arcade-ui {
    gap: 12px;
  }

  .panel {
    padding: 14px;
  }

  .brand {
    width: 100%;
  }

  .action-grid,
  .stat-grid,
  .telemetry {
    grid-template-columns: 1fr;
  }

  .control-strip {
    flex-direction: column;
  }
}
