:root {
  --bg: #081018;
  --panel: rgba(10, 21, 34, 0.8);
  --panel-border: rgba(121, 189, 255, 0.22);
  --text: #eef6ff;
  --muted: #8ca4bf;
  --accent: #79bdff;
  --accent-2: #9effcc;
  --danger: #ff8a72;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #7fa8d7;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  overflow: hidden;
}

body {
  position: relative;
}

#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#crosshair,
#hit-marker,
#banner {
  position: fixed;
  pointer-events: none;
  z-index: 20;
}

body[data-state="menu"] #crosshair,
body[data-state="menu"] #hit-marker,
body[data-state="menu"] #banner,
body[data-state="menu"] .hud,
body[data-state="menu"] .footer-bar {
  display: none;
}

#crosshair {
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

#crosshair::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

#crosshair::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

#hit-marker {
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 120ms ease;
}

#hit-marker::before,
#hit-marker::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  width: 2px;
  height: 32px;
  background: rgba(255, 138, 114, 0.95);
}

#hit-marker::before {
  transform: rotate(45deg);
}

#hit-marker::after {
  transform: rotate(-45deg);
}

#hit-marker.flash {
  opacity: 1;
}

#banner {
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  border: 1px solid var(--panel-border);
  background: rgba(7, 14, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

#banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  pointer-events: none;
  padding: 1rem;
}

.topbar,
.hud,
.footer-bar,
.panel {
  pointer-events: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.eyebrow {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 0.25rem;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ghost-link,
.ghost-button {
  border: 1px solid var(--panel-border);
  background: rgba(7, 12, 18, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.panel {
  align-self: center;
  justify-self: center;
  width: min(980px, calc(100vw - 2rem));
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  padding: 1.25rem;
  transition: opacity 180ms ease, transform 180ms ease;
}

.panel.hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

body[data-state="menu"] .panel {
  background: rgba(10, 21, 34, 0.72);
  box-shadow: 0 28px 72px rgba(12, 20, 31, 0.26);
}

body[data-state="menu"] #shell {
  grid-template-rows: auto 1fr;
}

.panel-copy p {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

#settings-details {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.9rem;
}

#settings-details summary {
  cursor: pointer;
  color: var(--accent);
}

.settings-body {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
}

.mode-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(11, 20, 30, 0.82);
  color: var(--text);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mode-card:hover,
.mode-card.active {
  border-color: var(--accent-2);
  transform: translateY(-2px);
  background: rgba(18, 31, 46, 0.9);
}

.mode-card strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 0.35rem;
}

.mode-card p {
  margin-top: 0.55rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-self: end;
  margin-bottom: 0.75rem;
  transition: opacity 160ms ease;
}

.hud-card,
.footer-bar {
  background: rgba(7, 14, 22, 0.78);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hud-card {
  padding: 0.8rem 1rem;
}

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

.hud-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.3rem;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  transition: opacity 160ms ease;
}

.legend {
  color: var(--muted);
}

#profile-widget {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

@media (max-width: 900px) {
  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-bar {
    flex-direction: column;
  }
}
