:root {
  --night: #090b1a;
  --night-2: #111735;
  --panel: #161d3f;
  --purple: #7c3aed;
  --violet: #a78bfa;
  --gold: #facc15;
  --cyan: #22d3ee;
  --mint: #34d399;
  --coral: #fb7185;
  --cream: #fff7d6;
  --white: #fff;
  --ink: #101426;
  --pixel-shadow: 6px 6px 0 #050712;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; color: var(--cream); background: var(--night); font-family: "Courier New", ui-monospace, monospace; line-height: 1.55; image-rendering: pixelated; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.05; }
.skip-link { position: fixed; z-index: 999; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); color: var(--ink); background: var(--gold); border: 3px solid var(--white); }
.skip-link:focus { transform: none; }

.topbar { position: sticky; z-index: 100; top: 0; min-height: 74px; padding: 0 max(24px,calc((100vw - 1240px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(9,11,26,.94); border-bottom: 4px solid var(--purple); box-shadow: 0 4px 0 #050712; backdrop-filter: blur(8px); }
.pixel-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: .78rem; letter-spacing: .08em; }
.pixel-logo span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--ink); background: var(--gold); border: 3px solid var(--white); box-shadow: 4px 4px 0 var(--purple); font-weight: 900; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { text-decoration: none; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--gold); }

.hero { position: relative; min-height: 760px; padding: 100px max(28px,calc((100vw - 1240px)/2)); display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: center; overflow: hidden; background: linear-gradient(#161d47 0 62%,#32205c 62% 64%,#111735 64%); }
.hero::before { content: ""; position: absolute; inset: auto 0 0; height: 160px; opacity: .22; background: repeating-linear-gradient(90deg,transparent 0 70px,var(--cyan) 70px 73px),repeating-linear-gradient(0deg,transparent 0 38px,var(--cyan) 38px 41px); }
.starfield { position: absolute; inset: 0; opacity: .45; background-image: radial-gradient(circle,var(--white) 0 2px,transparent 2px),radial-gradient(circle,var(--cyan) 0 1px,transparent 1px); background-position: 0 0,35px 27px; background-size: 90px 90px,70px 70px; }
.hero-copy { position: relative; z-index: 2; max-width: 780px; }
.system-line, .section-title > p, .final-cta > div > p { color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
h1 { margin-bottom: 26px; font-size: clamp(3.2rem,7vw,6.7rem); letter-spacing: -.08em; text-shadow: 5px 5px 0 #050712; }
h1 span { display: block; color: var(--gold); font-size: .53em; letter-spacing: .02em; }
.hero-lede { max-width: 680px; color: #dbeafe; font-family: system-ui,sans-serif; font-size: 1.15rem; }
.hero-actions, .cta-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 30px 0; }
.pixel-button { min-height: 52px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: var(--white); background: var(--panel); border: 3px solid var(--white); box-shadow: var(--pixel-shadow); text-decoration: none; font-size: .76rem; font-weight: 900; transition: transform .1s,box-shadow .1s; }
.pixel-button.primary { color: var(--ink); background: var(--gold); }
.pixel-button:hover, .pixel-button:focus-visible { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #050712; }
.pixel-button:active { transform: translate(4px,4px); box-shadow: 2px 2px 0 #050712; }
.control-hint { color: var(--violet); font-size: .63rem; }
.hero-avatar-wrap { position: relative; z-index: 2; height: 590px; display: grid; place-items: end center; }
.hero-avatar-wrap img { position: relative; z-index: 2; max-height: 560px; width: auto; filter: drop-shadow(12px 12px 0 #050712); }
.avatar-glow { position: absolute; width: 420px; height: 420px; top: 80px; background: var(--purple); border: 8px solid var(--gold); box-shadow: 0 0 0 12px #3b236c,0 0 60px #8b5cf6; border-radius: 50%; }
.status-card { position: absolute; z-index: 3; left: 0; bottom: 38px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: var(--cream); background: var(--panel); border: 3px solid var(--white); box-shadow: var(--pixel-shadow); }
.status-card small,.status-card strong { display: block; }
.status-card small { color: var(--violet); font-size: .56rem; }
.status-card strong { font-size: .72rem; }
.online-dot { width: 14px; height: 14px; background: var(--mint); box-shadow: 0 0 0 4px #164e3d; animation: blink 1.5s steps(2,end) infinite; }

.game-section { padding: 100px 24px; color: var(--cream); background: #070916; }
.section-title { width: min(1160px,100%); margin: 0 auto 46px; }
.section-title h2,.final-cta h2 { margin-bottom: 14px; font-size: clamp(2.3rem,5vw,4.5rem); letter-spacing: -.06em; }
.section-title > span { max-width: 760px; display: block; color: #94a3b8; font-family: system-ui,sans-serif; }
.game-shell { width: min(1240px,100%); margin: auto; background: #0c1028; border: 4px solid var(--white); box-shadow: 12px 12px 0 var(--purple); }
.hud { min-height: 76px; padding: 12px 18px; display: grid; grid-template-columns: repeat(4,1fr) auto; align-items: center; gap: 16px; background: var(--night); border-bottom: 4px solid var(--white); }
.hud div { padding-right: 18px; border-right: 2px solid #334155; }
.hud small,.hud strong { display: block; }
.hud small { color: var(--violet); font-size: .52rem; }
.hud strong { color: var(--gold); font-size: .78rem; }
.soundless { padding: 8px 10px; color: var(--cream); background: transparent; border: 2px solid #475569; font: 700 .62rem "Courier New"; cursor: pointer; }
.soundless:hover { border-color: var(--gold); color: var(--gold); }
.game-viewport { position: relative; height: 480px; overflow-x: auto; overflow-y: hidden; outline: none; scrollbar-color: var(--purple) var(--night); }
.game-viewport:focus-visible { box-shadow: inset 0 0 0 5px var(--gold); }
.game-world { position: relative; width: 3100px; height: 100%; overflow: hidden; background: linear-gradient(#182454 0 58%,#24335d 58% 60%,#0b132b 60%); }
.sky-layer { position: absolute; inset: 0; }
.moon { position: absolute; right: 420px; top: 55px; width: 70px; height: 70px; background: var(--cream); box-shadow: 8px 8px 0 var(--violet); border-radius: 50%; }
.cloud { position: absolute; width: 120px; height: 24px; background: #7986b5; box-shadow: 24px -20px 0 #7986b5,56px -8px 0 #7986b5; opacity: .4; }
.cloud-a { left: 340px; top: 85px; }.cloud-b { left: 1260px; top: 130px; }.cloud-c { left: 2300px; top: 70px; }
.city-layer { position: absolute; left: 0; right: 0; bottom: 114px; height: 155px; display: flex; gap: 22px; align-items: flex-end; opacity: .58; }
.city-layer span { width: 170px; height: 80px; background: #151c3d; border-top: 4px solid #334155; box-shadow: inset 18px 16px 0 #1e2b50,inset 50px 16px 0 #1e2b50,inset 82px 16px 0 #1e2b50,inset 114px 16px 0 #1e2b50; }
.city-layer span:nth-child(2n) { height: 130px; }.city-layer span:nth-child(3n) { height: 105px; }
.network-lines { position: absolute; inset: 0 0 105px; opacity: .15; background: linear-gradient(90deg,transparent 49.8%,var(--cyan) 50%,transparent 50.2%),linear-gradient(transparent 49.8%,var(--cyan) 50%,transparent 50.2%); background-size: 130px 80px; }
.ground { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 108px; background: repeating-linear-gradient(90deg,#18233e 0 62px,#111a31 62px 66px),linear-gradient(#1d3151,#0b132b); border-top: 6px solid var(--cyan); box-shadow: inset 0 13px 0 #0e7490; }
.player { position: absolute; z-index: 20; left: 0; bottom: 86px; width: 78px; height: 140px; transform: translate3d(100px,0,0); transform-origin: center bottom; will-change: transform; }
.player img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.65)); }
.player.facing-right img { transform: scaleX(-1); }
.player.running img { animation: run .25s steps(2,end) infinite; }
.player.jumping img { transform: rotate(-4deg); }
.player.facing-right.jumping img { transform: scaleX(-1) rotate(-4deg); }
.player-shadow { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: -3px; height: 12px; background: rgba(0,0,0,.45); border-radius: 50%; }
.data-shard { position: absolute; z-index: 10; left: var(--x); bottom: 150px; width: 28px; height: 36px; background: var(--cyan); border: 4px solid var(--white); box-shadow: 5px 5px 0 var(--purple); transform: rotate(45deg); animation: float 1.2s steps(3,end) infinite; }
.data-shard.high { bottom: 240px; }
.data-shard.collected { opacity: 0; transform: scale(2) rotate(120deg); transition: .25s; }
.milestone { position: absolute; z-index: 12; left: var(--x); bottom: 108px; width: 128px; height: 170px; padding: 0; color: var(--cream); background: none; border: 0; cursor: pointer; font-family: "Courier New"; }
.beacon-icon { position: absolute; left: 33px; top: 25px; width: 62px; height: 62px; display: grid; place-items: center; color: var(--ink); background: var(--gold); border: 4px solid var(--white); box-shadow: 6px 6px 0 var(--purple); font-weight: 900; }
.milestone strong { position: absolute; left: 0; right: 0; bottom: 10px; padding: 5px 2px; color: var(--cream); background: #0c1028; border: 2px solid var(--violet); font-size: .62rem; }
.beacon-pulse { position: absolute; left: 18px; top: 10px; width: 92px; height: 92px; border: 3px solid var(--cyan); animation: beacon 1.6s steps(3,end) infinite; }
.milestone:hover .beacon-icon,.milestone:focus-visible .beacon-icon,.milestone.reached .beacon-icon { background: var(--mint); transform: translateY(-6px); }
.milestone.major .beacon-icon { color: var(--white); background: var(--purple); }
.milestone.major strong { border-color: var(--gold); }
.world-label { position: absolute; z-index: 8; left: var(--x); bottom: 120px; padding: 12px; text-align: center; color: var(--cream); background: var(--panel); border: 3px solid var(--white); box-shadow: 5px 5px 0 var(--purple); }
.world-label span,.world-label small { display: block; }.world-label span { color: var(--gold); font-size: .7rem; font-weight: 900; }.world-label small { font-size: .5rem; }
.touch-controls { padding: 14px; display: none; justify-content: center; gap: 16px; background: #090b1a; border-top: 4px solid var(--white); }
.touch-controls button { width: 62px; height: 52px; color: var(--cream); background: var(--panel); border: 3px solid var(--white); box-shadow: 4px 4px 0 var(--purple); font: 900 1rem monospace; touch-action: none; }
.touch-controls button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--purple); }
.mission-panel { min-height: 190px; padding: 24px; display: grid; grid-template-columns: 90px 1fr; gap: 24px; align-items: start; background: #111735; border-top: 4px solid var(--white); }
.mission-index { width: 76px; height: 76px; display: grid; place-items: center; color: var(--ink); background: var(--gold); border: 4px solid var(--white); box-shadow: 6px 6px 0 var(--purple); font-weight: 900; }
.mission-panel > div:last-child > p:first-child { margin-bottom: 5px; color: var(--cyan); font-size: .62rem; font-weight: 900; }
.mission-panel h3 { margin-bottom: 8px; font-size: 1.35rem; }
.mission-panel h3 + p { margin-bottom: 14px; color: #cbd5e1; font-family: system-ui,sans-serif; font-size: .86rem; }
.mission-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.mission-tags span { padding: 4px 8px; color: var(--violet); border: 1px solid #475569; font-size: .58rem; }

.quest-log { padding: 110px max(24px,calc((100vw - 1160px)/2)); color: var(--ink); background: var(--cream); }
.section-title.light p { color: var(--purple); }.section-title.light > span { color: #475569; }
.log-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 24px; align-items: start; }
.log-card { position: relative; min-height: 480px; padding: 30px; background: var(--white); border: 4px solid var(--ink); box-shadow: 8px 8px 0 #d1c7a1; }
.log-card.featured { box-shadow: 10px 10px 0 var(--purple); }
.log-level { position: absolute; right: 18px; top: -18px; padding: 7px 10px; color: var(--white); background: var(--purple); border: 3px solid var(--ink); font-size: .62rem; font-weight: 900; }
.company-mark { min-height: 54px; margin: 4px 0 25px; display: inline-flex; align-items: center; gap: 10px; font-family: Arial,sans-serif; }
.company-mark span { display: grid; place-items: center; font-weight: 900; }
.company-mark strong { font-size: 1.08rem; letter-spacing: -.04em; }
.meta-mark { color: #0866ff; }.meta-mark span { font-size: 2.65rem; line-height: .7; }.meta-mark strong { color: #111827; font-size: 1.38rem; }
.athena-mark { color: #6d28d9; }.athena-mark span { width: 34px; height: 34px; color: var(--white); background: #65a30d; border-radius: 50% 50% 12% 50%; transform: rotate(-18deg); }.athena-mark strong { color: #54268f; }
.td-mark span { width: 38px; height: 38px; color: var(--white); background: #34a344; font-size: .86rem; }.td-mark strong { color: #176b35; }
.log-meta { color: var(--purple); font-size: .62rem; font-weight: 900; }
.log-card h3 { font-size: 1.5rem; }.log-card > p:not(.log-meta),.log-card li { font-family: system-ui,sans-serif; font-size: .85rem; }
.log-card ul { padding-left: 19px; }.log-card li { margin-bottom: 7px; }

.inventory { padding: 110px max(24px,calc((100vw - 1160px)/2)); background: #10152f; }
.inventory-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.inventory-grid article { padding: 24px; background: var(--panel); border: 3px solid var(--white); box-shadow: 6px 6px 0 #050712; }
.slot-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--ink); background: var(--gold); border: 3px solid var(--white); box-shadow: 4px 4px 0 var(--purple); font-size: 1.35rem; font-weight: 900; }
.inventory-grid article:nth-child(2) .slot-icon { background: var(--cyan); }.inventory-grid article:nth-child(3) .slot-icon { background: var(--mint); }.inventory-grid article:nth-child(4) .slot-icon { background: var(--coral); }
.inventory-grid h3 { margin-top: 24px; font-size: 1rem; }.inventory-grid p { color: #cbd5e1; font-family: system-ui,sans-serif; font-size: .78rem; }
.final-cta { padding: 80px max(24px,calc((100vw - 1160px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 48px; color: var(--ink); background: var(--gold); border-block: 6px solid var(--white); }
.final-cta > div > p { color: var(--purple); }.final-cta h2 { margin: 0; }.final-cta .pixel-button { border-color: var(--ink); }.final-cta .pixel-button.primary { color: var(--white); background: var(--purple); }
footer { padding: 30px max(24px,calc((100vw - 1160px)/2)); display: flex; justify-content: space-between; gap: 20px; color: #64748b; background: #050712; font-size: .55rem; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 35%,#26205a,#090b1a 55%); }
.error-card { width: min(720px,100%); padding: 48px; text-align: center; background: var(--panel); border: 4px solid var(--white); box-shadow: 12px 12px 0 var(--purple); }
.error-card > p:first-child { color: var(--cyan); font-size: .7rem; font-weight: 900; }.error-card h1 { color: var(--gold); font-size: clamp(2.6rem,8vw,5rem); }.error-card > p:not(:first-child) { color: #cbd5e1; font-family: system-ui,sans-serif; }.error-card .pixel-button { margin-top: 22px; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes float { 50% { translate: 0 -8px; } }
@keyframes beacon { 50% { transform: scale(1.18); opacity: .25; } }
@keyframes run { 50% { translate: 0 -3px; } }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 80px; }
  .hero-avatar-wrap { height: 480px; }.hero-avatar-wrap img { max-height: 460px; }.avatar-glow { width: 340px; height: 340px; }
  .log-grid { grid-template-columns: 1fr 1fr; }.log-card.featured { grid-column: 1 / -1; }
  .inventory-grid { grid-template-columns: 1fr 1fr; }
  .touch-controls { display: flex; }
}
@media (max-width: 700px) {
  .topbar { min-height: 66px; padding-inline: 14px; }.pixel-logo strong { display: none; }.topbar nav { gap: 10px; }.topbar nav a:nth-child(2),.topbar nav a:nth-child(3) { display: none; }
  .hero { padding: 70px 20px; }.hero-avatar-wrap { height: 420px; }.hero-avatar-wrap img { max-height: 400px; }.avatar-glow { width: 290px; height: 290px; }.status-card { left: 10px; }
  h1 { font-size: clamp(2.8rem,15vw,4.6rem); }
  .hud { grid-template-columns: 1fr 1fr; }.hud div:nth-child(2),.hud div:nth-child(4) { display: none; }.soundless { justify-self: end; }
  .game-viewport { height: 430px; }.mission-panel { grid-template-columns: 1fr; }.mission-index { width: 60px; height: 60px; }
  .log-grid,.inventory-grid { grid-template-columns: 1fr; }.log-card.featured { grid-column: auto; }
  .final-cta { align-items: flex-start; flex-direction: column; }.cta-actions { margin: 0; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
