:root {
  color-scheme: dark;
  --bg: #101417;
  --panel: rgba(20, 24, 27, 0.86);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5f7f8;
  --muted: #a9b2b9;
  --green: #7ee28b;
  --cyan: #77c7ff;
  --amber: #f2c365;
  --rose: #ff8b8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.launch-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.launch-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(16, 20, 23, 0.96), rgba(16, 20, 23, 0.54)),
    radial-gradient(circle at 70% 20%, rgba(119, 199, 255, 0.2), transparent 36%),
    #101417;
}

.launch-media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  opacity: 0.58;
  transform: scale(1.02);
}

.launch-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launch-media img:first-child {
  grid-row: span 2;
}

.launch-panel {
  position: relative;
  width: min(680px, 100%);
  margin-right: auto;
  padding: 0;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 620px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
}

.login-form {
  width: min(520px, 100%);
  margin-top: 28px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.login-row input {
  min-width: 0;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.login-row input:focus {
  border-color: var(--cyan);
}

.login-row button,
.world-card button {
  height: 52px;
  border-radius: 8px;
  background: var(--green);
  color: #07100a;
  padding: 0 20px;
  font-weight: 900;
}

.selector {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(28, 34, 39, 0.96), rgba(10, 12, 14, 1)),
    #101417;
}

.selector-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto 22px;
}

.selector-header h2 {
  font-size: clamp(28px, 4vw, 52px);
}

.ghost-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0 14px;
  font-weight: 800;
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.world-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.world-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
  background: #15181b;
}

.world-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.world-card h3 {
  margin: 0;
  font-size: 20px;
}

.world-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.world-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.world-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.flight {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050607;
}

#splatFrame,
#gameCanvas,
.scene-backdrop,
.shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#splatFrame {
  border: 0;
  opacity: 0.9;
}

.scene-backdrop {
  z-index: 1;
  background-position: center;
  background-size: cover;
  opacity: 0.48;
  transform: scale(1.04);
  filter: saturate(1.12) contrast(1.06);
  mix-blend-mode: screen;
}

#gameCanvas,
.shade,
.hud,
.fly,
.toast {
  z-index: 2;
}

#gameCanvas,
.shade,
.hud,
.fly,
.toast {
  pointer-events: none;
}

.shade {
  background:
    linear-gradient(180deg, rgba(2, 4, 5, 0.58), transparent 22%, transparent 72%, rgba(2, 4, 5, 0.64)),
    linear-gradient(90deg, rgba(2, 4, 5, 0.42), transparent 24%, transparent 76%, rgba(2, 4, 5, 0.42));
}

.hud {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: start;
  gap: 10px;
}

.hud-block,
.hud-stats,
.toast {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 12, 14, 0.68);
  backdrop-filter: blur(12px);
}

.hud-block {
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
}

.hud-block span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hud-block strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.hud-stats {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  white-space: nowrap;
}

.hud-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hud-stats strong {
  color: var(--text);
}

.icon-button {
  pointer-events: auto;
}

.fly {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 58px;
  height: 38px;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%);
}

.fly .body {
  width: 18px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, #f5f7f8 0 18%, transparent 19%),
    linear-gradient(180deg, var(--green), rgba(20, 23, 26, 0.95));
}

.fly .wing {
  width: 25px;
  height: 22px;
  border: 1px solid rgba(245, 247, 248, 0.72);
  background: rgba(180, 231, 255, 0.2);
  transform-origin: center right;
  animation: wingbeat 120ms infinite alternate ease-in-out;
}

.fly .wing-left {
  border-radius: 90% 30% 70% 30%;
  transform: rotate(-18deg);
}

.fly .wing-right {
  border-radius: 30% 90% 30% 70%;
  transform-origin: center left;
  animation-name: wingbeatRight;
}

@keyframes wingbeat {
  from { transform: rotate(-32deg) scaleY(0.75); }
  to { transform: rotate(4deg) scaleY(1.08); }
}

@keyframes wingbeatRight {
  from { transform: rotate(32deg) scaleY(0.75); }
  to { transform: rotate(-4deg) scaleY(1.08); }
}

.toast {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 44px;
  padding: 12px 14px;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 760px) {
  .launch-screen,
  .selector {
    padding: 18px;
  }

  .launch-media {
    grid-template-columns: 1fr;
  }

  .launch-media img:not(:first-child) {
    display: none;
  }

  .login-row,
  .hud {
    grid-template-columns: 1fr;
  }

  .hud {
    right: 10px;
    left: 10px;
  }

  .hud-stats {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .selector-header {
    display: grid;
  }
}
