:root {
  --bg: #080a0f;
  --panel: #11151c;
  --panel-2: #181e28;
  --cream: #fff2c7;
  --muted: #b8bdc9;
  --blue: #2f9cff;
  --gold: #ffd15a;
  --pink: #ff6b92;
  --green: #58d68d;
  --border: rgba(255,255,255,.14);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #151b28 0%, var(--bg) 50%, #050609 100%);
  color: var(--cream);
  font-family: "Courier New", ui-monospace, monospace;
  overflow-x: hidden;
}

button { font: inherit; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .14;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0,0,0,.25) 4px
  );
}

.stars,
.stars::before,
.stars::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(47,156,255,.8) 0 1px, transparent 1.5px);
  background-size: 95px 95px, 145px 145px;
  background-position: 20px 10px, 80px 60px;
  animation: drift 34s linear infinite;
  opacity: .28;
}
.stars::before { transform: scale(1.25); opacity: .18; animation-duration: 55s; }
.stars::after { transform: scale(.8); opacity: .12; animation-duration: 80s; }
@keyframes drift { to { background-position: 20px 810px, 80px 760px; } }

main { min-height: 100vh; position: relative; z-index: 2; }
.screen { min-height: 100vh; }
.hidden { display: none; }

.start-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}
.console-frame {
  width: min(780px, 100%);
  text-align: center;
  padding: clamp(28px, 6vw, 64px);
  background: linear-gradient(180deg, rgba(17,21,28,.96), rgba(7,9,13,.96));
  border: 4px solid var(--cream);
  outline: 7px solid #1f2733;
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(47,156,255,.35);
  animation: boot .6s steps(2, end);
}
@keyframes boot { 0% { opacity: 0; filter: brightness(4); transform: scaleY(.02); } 100% { opacity: 1; filter: brightness(1); transform: scaleY(1); } }
.eyebrow { margin: 0 0 8px; color: var(--gold); letter-spacing: .45em; font-weight: 800; }
h1 {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 5.8rem);
  line-height: .88;
  letter-spacing: -.06em;
  text-shadow: 5px 5px 0 #111, 8px 8px 0 var(--blue);
}
h1 span { color: var(--gold); }
.character-banner {
  width: min(440px, 92%);
  margin: 28px auto 20px;
  display: block;
  border-radius: 22px;
  border: 2px solid rgba(255,255,255,.14);
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
}
.tagline { font-size: clamp(.95rem, 2.5vw, 1.2rem); line-height: 1.7; color: var(--muted); }
.start-button,
.quest-button {
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--cream);
  font-weight: 900;
  letter-spacing: .12em;
}
.start-button { margin-top: 18px; font-size: clamp(1rem, 3vw, 1.35rem); animation: blink 1.1s steps(2, end) infinite; }
.start-button:hover { color: var(--gold); }
.cursor { color: var(--pink); }
@keyframes blink { 50% { opacity: .45; } }
.tiny { margin-top: 28px; color: #7f8795; font-size: .72rem; letter-spacing: .18em; }

.universe { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 36px; animation: reveal .7s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } }
.hero { text-align: center; max-width: 850px; margin: 0 auto 30px; }
.status { display: inline-block; margin: 0 0 18px; padding: 8px 12px; border: 2px solid var(--green); color: var(--green); background: rgba(88,214,141,.08); font-size: .78rem; letter-spacing: .15em; }
.status span { color: var(--pink); }
h2 { margin: 0; font-size: clamp(2.2rem, 7vw, 5rem); line-height: 1; text-shadow: 4px 4px 0 rgba(47,156,255,.55); }
.welcome { max-width: 760px; margin: 20px auto 0; color: var(--muted); line-height: 1.8; }

.loading-tip,
.quest-box {
  border: 2px solid var(--border);
  background: rgba(17,21,28,.84);
  box-shadow: var(--shadow);
}
.loading-tip { max-width: 760px; margin: 28px auto 34px; padding: 20px 24px; text-align: center; }
.label { color: var(--gold); font-size: .72rem; letter-spacing: .17em; font-weight: 800; }
.loading-tip p { margin: 10px 0 0; font-size: 1rem; }

.world-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.world-card {
  position: relative;
  min-height: 250px;
  padding: 26px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(24,30,40,.96), rgba(11,14,20,.96));
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.world-card:hover { transform: translateY(-5px); border-color: rgba(47,156,255,.75); }
.world-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -50px;
  bottom: -55px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47,156,255,.22), transparent 70%);
}
.world-card.featured { border-color: rgba(255,209,90,.48); }
.icon { display: block; font-size: 2.5rem; margin-bottom: 20px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.45)); }
.nerd-character-frame {
  display: block;
  width: 120px;
  height: 76px;
  margin-bottom: 14px;
  overflow: hidden;
}
.nerd-character-art {
  display: block;
  width: 204px;
  max-width: none;
  height: 76px;
  object-fit: cover;
  object-position: left center;
}
.world-card h3 { margin: 0 0 12px; font-size: 1.25rem; }
.world-card p { margin: 0; max-width: 420px; color: var(--muted); line-height: 1.65; }
.badge { position: absolute; left: 26px; bottom: 24px; color: var(--blue); font-size: .72rem; letter-spacing: .14em; font-weight: 900; }

.quest-box { margin: 22px 0 28px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quest-box p { margin: 8px 0 0; color: var(--cream); }
.quest-button { flex: 0 0 auto; padding: 12px 14px; border: 2px solid var(--pink); color: var(--pink); }
.quest-button:hover { background: var(--pink); color: #111; }

footer { text-align: center; padding: 34px 0 0; color: #858d9a; }
.players { display: flex; justify-content: center; align-items: center; gap: 28px; margin-bottom: 18px; }
.players div:not(.heart) { display: grid; gap: 6px; }
.players span { font-size: .67rem; letter-spacing: .13em; }
.players strong { color: var(--cream); }
.heart { color: var(--pink); font-size: 1.4rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }
footer p { font-size: .82rem; }

.fade-out { animation: fadeOut .45s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(.98); } }

@media (max-width: 700px) {
  .console-frame { border-width: 3px; outline-width: 4px; }
  .world-grid { grid-template-columns: 1fr; }
  .world-card { min-height: 230px; }
  .quest-box { align-items: stretch; flex-direction: column; }
  .quest-button { width: 100%; }
  .players { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
