@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600;800;900&display=swap');

:root {
  --white:#f8fbff;
  --blue:#3b82f6;
  --blue2:#60a5fa;
  --blue3:#8ed8ff;
  --green:#7cffb2;
  --red:#ff4358;
  --black:#02040a;
  --panel:rgba(5,13,31,.88);
  --menu:#123b7a;
}

* { box-sizing:border-box; }
html, body { margin:0; min-height:100%; background:var(--black); color:var(--white); font-family:Inter,Arial,sans-serif; overflow:hidden; cursor:none; }
button,a { font:inherit; cursor:none; }
.cursor { position:fixed; z-index:1000; width:18px; height:18px; pointer-events:none; transform:translate(-50%,-50%); background:var(--blue3); clip-path:polygon(0 0,100% 50%,0 100%,22% 50%); filter:drop-shadow(0 0 10px rgba(142,216,255,.8)); }
.crt,.noise { position:fixed; inset:0; pointer-events:none; z-index:100; }
.crt { opacity:.18; background:radial-gradient(circle at center,transparent 48%,rgba(0,0,0,.38) 100%), repeating-linear-gradient(to bottom,rgba(255,255,255,.08) 0 1px,transparent 1px 4px); mix-blend-mode:screen; }
.noise { opacity:.045; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.wipe { position:fixed; inset:0; z-index:80; opacity:0; pointer-events:none; background:repeating-linear-gradient(to bottom,rgba(96,165,250,.92) 0 3px,rgba(10,19,36,.94) 3px 8px); transform:scaleY(0); }
.wipe.on { animation:wipe .42s steps(8); }
@keyframes wipe { 0%{opacity:0;transform:scaleY(0)} 35%{opacity:.85;transform:scaleY(.08)} 65%{opacity:.8;transform:scaleY(1)} 100%{opacity:0;transform:scaleY(0)} }

.app,.scene { height:100vh; width:100vw; position:relative; }
.scene { position:absolute; inset:0; visibility:hidden; opacity:0; transition:opacity .35s steps(5), visibility .35s; }
.scene.active { visibility:visible; opacity:1; }
.bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; filter:brightness(.52) contrast(1.15); transform:scale(1.04); }
.bg.dim { filter:brightness(.32) contrast(1.1); }
.shade { position:absolute; inset:0; background:linear-gradient(90deg,rgba(0,0,0,.86),rgba(0,0,0,.28),rgba(0,0,0,.65)), linear-gradient(0deg,rgba(0,0,0,.92),transparent 45%,rgba(0,0,0,.34)); }
.shade.heavy { background:rgba(0,0,0,.64); }
.rain { position:absolute; inset:-20%; opacity:.24; background-image:repeating-linear-gradient(110deg,transparent 0 30px,rgba(100,220,255,.24) 31px 32px); animation:rain .7s steps(5) infinite; }
@keyframes rain { from{transform:translate(-30px,-30px)} to{transform:translate(30px,30px)} }
.ash { position:absolute; inset:-20%; opacity:0; background-image:radial-gradient(circle,rgba(255,255,255,.55) 1px,transparent 2px),radial-gradient(circle,rgba(142,216,255,.35) 1px,transparent 2px); background-size:90px 90px,140px 140px; animation:ash 12s linear infinite; transition:opacity .35s; pointer-events:none; }
.ash.active { opacity:.26; }
@keyframes ash { from{transform:translateY(-80px)} to{transform:translateY(80px)} }

.boot { display:grid; place-items:center; background:radial-gradient(circle at center,rgba(59,130,246,.16),transparent 42%),#02040a; }
.boot-box { width:min(760px,88vw); padding:34px; border:3px solid white; background:rgba(5,13,31,.9); box-shadow:0 0 0 5px rgba(0,0,0,.5),0 0 50px rgba(96,165,250,.2); font-family:"Press Start 2P",monospace; color:var(--blue3); font-size:.72rem; line-height:2; text-shadow:2px 2px #000; }
.loadbar { height:26px; padding:4px; border:2px solid white; margin:24px 0; }
.loadbar span { display:block; width:0%; height:100%; background:linear-gradient(90deg,var(--blue),var(--blue3)); transition:width .25s steps(8); }
#bootSub { color:var(--green); }

.moon { position:absolute; z-index:5; top:24px; right:26px; width:46px; height:46px; border:3px solid white; background:rgba(18,59,122,.8); color:white; font-family:"Press Start 2P"; box-shadow:0 0 0 5px rgba(0,0,0,.45); }
.title-ui { position:relative; z-index:4; height:100%; display:grid; place-items:center; align-content:center; text-align:center; padding:28px; }
.system { font-family:"Press Start 2P"; color:var(--green); font-size:clamp(.52rem,1.2vw,.8rem); line-height:2; text-shadow:3px 3px #000; }
.title h1 { position:relative; margin:20px 0; font-family:"Press Start 2P"; font-size:clamp(2.4rem,8.5vw,8.6rem); line-height:1.2; letter-spacing:-.06em; text-shadow:6px 6px #000,-4px 0 var(--red),4px 0 var(--blue3),0 0 44px rgba(96,165,250,.48); animation:pulse 2.4s steps(4) infinite; }
.title h1:before,.title h1:after { content:attr(data-text); position:absolute; inset:0; opacity:.45; }
.title h1:before { color:var(--red); transform:translateX(-5px); animation:g1 2.8s steps(3) infinite; }
.title h1:after { color:var(--blue3); transform:translateX(5px); animation:g2 3.2s steps(3) infinite; }
@keyframes pulse { 50%{filter:brightness(1.2)} }
@keyframes g1 { 0%,86%,100%{clip-path:inset(0)} 88%{clip-path:inset(12% 0 70% 0);transform:translate(-12px,-3px)} 93%{clip-path:inset(70% 0 8% 0);transform:translate(8px,2px)} }
@keyframes g2 { 0%,82%,100%{clip-path:inset(0)} 84%{clip-path:inset(40% 0 35% 0);transform:translate(10px,3px)} 90%{clip-path:inset(4% 0 80% 0);transform:translate(-8px,-2px)} }
.tag { font-family:"Press Start 2P"; color:var(--blue3); font-size:clamp(.72rem,1.45vw,1.18rem); line-height:2; text-shadow:3px 3px #000; }
.press,.btn { border:3px solid white; color:white; background:var(--menu); box-shadow:0 0 0 5px rgba(0,0,0,.55), inset 0 -9px rgba(0,0,0,.22),0 0 24px rgba(96,165,250,.2); font-family:"Press Start 2P"; text-decoration:none; text-shadow:2px 2px #000; }
.press { margin-top:28px; padding:18px 24px; font-size:clamp(.65rem,1.2vw,.95rem); animation:blink 1s steps(2) infinite; }
@keyframes blink { 50%{opacity:.6;transform:translateY(3px)} }
.press:hover,.btn:hover,.moon:hover { background:var(--blue); }

.os { display:grid; grid-template-columns:270px minmax(0,1fr); gap:26px; padding:5vh 5vw; align-items:center; }
.main-menu { position:relative; z-index:5; padding:24px 18px; background:rgba(2,4,10,.78); border:3px solid white; box-shadow:0 0 0 5px rgba(0,0,0,.48),0 0 34px rgba(96,165,250,.22); }
.menu-button { position:relative; width:100%; padding:16px 8px 16px 36px; border:0; background:transparent; color:white; text-align:left; font-family:"Press Start 2P"; font-size:.72rem; line-height:1.4; text-shadow:2px 2px #000; }
.menu-button.active,.menu-button:hover { color:var(--blue3); }
.menu-button.active:before,.menu-button:hover:before { content:"▶"; position:absolute; left:5px; color:var(--blue2); animation:cursor .7s steps(2) infinite; }
@keyframes cursor { 50%{opacity:.2} }

.panel { position:relative; z-index:5; display:none; min-height:78vh; max-height:86vh; overflow:auto; background:var(--panel); border:3px solid white; box-shadow:0 0 0 5px rgba(0,0,0,.55),0 0 48px rgba(96,165,250,.18); }
.panel.active { display:block; animation:windowIn .26s steps(4); }
@keyframes windowIn { from{opacity:0;transform:translateX(24px)} to{opacity:1;transform:translateX(0)} }
.panel header { position:sticky; top:0; z-index:3; padding:16px 20px; background:#0f3574; border-bottom:3px solid white; font-family:"Press Start 2P"; font-size:.78rem; color:var(--blue3); text-shadow:2px 2px #000; }
.panel-body { min-height:calc(78vh - 56px); padding:30px; }
.center { display:grid; align-items:center; }
.two { grid-template-columns:minmax(0,1fr) 280px; gap:28px; }
h2 { margin:0 0 20px; font-family:"Press Start 2P"; font-size:clamp(1rem,2.3vw,2.1rem); line-height:1.55; text-shadow:3px 3px #000; }
p { color:#d4deef; line-height:1.8; font-size:1rem; }
.btn { display:inline-block; margin-top:16px; padding:15px 18px; font-size:.65rem; }
.save { border:3px solid white; background:rgba(0,0,0,.5); padding:20px; box-shadow:inset 0 -10px rgba(255,255,255,.04); }
.save span,.save strong { display:block; font-family:"Press Start 2P"; line-height:1.7; }
.save span { color:var(--green); font-size:.55rem; }
.save strong { color:var(--blue3); font-size:.82rem; margin:16px 0; }

.echoes-body { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr); gap:26px; align-items:center; }
.stage {
  position: relative;
  min-height: 520px;
  border: 3px solid white;
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35);
  overflow: hidden;
}
.stage:after { content:""; position:absolute; left:8%; right:8%; bottom:74px; height:3px; background:rgba(255,255,255,.55); box-shadow:0 0 22px rgba(96,165,250,.5); }
.party-stage { position:absolute; inset:0; }
.actor { position:absolute; width:64px; height:64px; background-repeat:no-repeat; image-rendering:pixelated; transform-origin:center bottom; filter:drop-shadow(0 0 16px rgba(142,216,255,.45)); }
.actor.selected { filter:drop-shadow(0 0 26px rgba(142,216,255,.9)); }
.actor-label { position:absolute; top:-22px; left:50%; transform:translateX(-50%); font-family:"Press Start 2P"; font-size:6px; color:var(--blue3); text-shadow:2px 2px #000; opacity:0; }
.actor.selected .actor-label { opacity:1; }
.profile { border:3px solid white; background:rgba(0,0,0,.5); padding:28px; min-height:520px; display:grid; align-content:center; box-shadow:0 0 0 4px rgba(0,0,0,.35); }
.profile > p:first-child { color:var(--green); font-family:"Press Start 2P"; font-size:.58rem; }
.char-menu { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin-top:20px; }
.char-menu button { border:2px solid white; background:rgba(18,59,122,.7); color:white; padding:10px 6px; font-family:"Press Start 2P"; font-size:.48rem; }
.char-menu button.active,.char-menu button:hover { background:var(--blue); }

.world-body { grid-template-columns:minmax(300px,.75fr) minmax(0,1.25fr); gap:26px; }
.map { position:relative; min-height:480px; border:3px solid white; background:linear-gradient(rgba(96,165,250,.12) 2px,transparent 2px),linear-gradient(90deg,rgba(96,165,250,.12) 2px,transparent 2px),radial-gradient(circle at 40% 60%,rgba(59,130,246,.18),transparent 45%),rgba(0,0,0,.45); background-size:40px 40px,40px 40px,auto,auto; box-shadow:0 0 0 4px rgba(0,0,0,.35); }
.node { position:absolute; left:var(--x); top:var(--y); transform:translate(-50%,-50%); border:0; background:transparent; color:var(--blue3); font-family:"Press Start 2P"; font-size:1.2rem; text-shadow:0 0 14px rgba(142,216,255,.7),3px 3px #000; }
.node span { display:block; margin-top:8px; font-size:.48rem; color:white; }
.node.active,.node:hover { color:var(--green); }
.area { display:none; border:3px solid white; background:rgba(0,0,0,.5); box-shadow:0 0 0 4px rgba(0,0,0,.35); }
.area.active { display:block; animation:windowIn .22s steps(4); }
.area img { width:100%; aspect-ratio:16/8.5; object-fit:cover; display:block; }
.area span { display:inline-block; margin:18px 18px 8px; color:var(--green); font-family:"Press Start 2P"; font-size:.55rem; }
.area h3 { margin:0 18px 8px; color:var(--blue3); font-family:"Press Start 2P"; font-size:1rem; line-height:1.5; }
.area p { padding:0 18px 18px; margin:0; }

.element-panel { background:radial-gradient(circle at 20% 10%,rgba(59,130,246,.25),transparent 32%),radial-gradient(circle at 80% 15%,rgba(142,216,255,.2),transparent 30%),rgba(4,10,25,.9); }
.element-body { grid-template-columns:1.15fr .85fr; gap:24px; }
.element-body img { width:100%; border:3px solid white; box-shadow:0 0 0 4px rgba(0,0,0,.38); }
.cart { grid-column:1/-1; display:none; text-align:center; font-family:"Press Start 2P"; color:var(--blue3); }
.cart.active { display:block; }
.cart div { height:34px; margin:18px auto 0; max-width:440px; border:3px solid white; padding:5px; }
.cart span { display:block; width:0; height:100%; background:linear-gradient(90deg,var(--blue),var(--blue3)); }
.cart.active span { animation:cart 1.1s steps(10) forwards; }
@keyframes cart { to{width:100%} }

.gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.gallery img { width:100%; aspect-ratio:16/9; object-fit:cover; border:3px solid white; box-shadow:0 0 0 4px rgba(0,0,0,.35); }
.secret { color:var(--green); font-family:"Press Start 2P"; font-size:.64rem; }

.lightbox { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:34px; background:rgba(0,0,0,.86); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .18s steps(4),visibility .18s; }
.lightbox.open { opacity:1; visibility:visible; pointer-events:auto; }
.lightbox > div { width:min(92vw,1280px); max-height:86vh; padding:14px; background:rgba(5,13,31,.96); border:3px solid white; box-shadow:0 0 0 5px rgba(0,0,0,.55),0 0 48px rgba(96,165,250,.28); animation:preview .22s steps(4); }
.lightbox img { display:block; width:100%; max-height:72vh; object-fit:contain; background:#02040a; border:2px solid rgba(255,255,255,.7); }
.lightbox p { color:var(--blue3); font-family:"Press Start 2P"; font-size:.66rem; text-align:center; }
#lightboxClose { position:fixed; top:22px; right:26px; z-index:121; width:48px; height:48px; border:3px solid white; background:var(--menu); color:white; font-family:"Press Start 2P"; font-size:1.35rem; box-shadow:0 0 0 5px rgba(0,0,0,.55); }
@keyframes preview { from{transform:scale(.94);opacity:0} to{transform:scale(1);opacity:1} }

.secret-room { position:fixed; inset:0; z-index:150; display:none; place-items:center; background:repeating-linear-gradient(to bottom,rgba(96,165,250,.08) 0 2px,transparent 2px 8px),rgba(0,0,0,.9); }
.secret-room.open { display:grid; }
.secret-room > div { width:min(700px,90vw); padding:32px; border:3px solid white; background:rgba(5,13,31,.96); box-shadow:0 0 0 5px rgba(0,0,0,.5),0 0 60px rgba(96,165,250,.28); }

@media (max-width:1120px) {
  html,body { overflow:auto; cursor:auto; }
  button,a { cursor:pointer; }
  .cursor { display:none; }
  .os { position:relative; min-height:100vh; grid-template-columns:1fr; padding:24px; }
  .main-menu { display:grid; grid-template-columns:repeat(3,1fr); }
  .menu-button { padding:14px 8px; text-align:center; }
  .menu-button:before { display:none; }
  .panel { min-height:70vh; max-height:none; }
  .panel-body { min-height:auto; }
  .two,.echoes-body,.world-body,.element-body,.gallery { grid-template-columns:1fr; }
  .stage { min-height:420px; }
}

/* v2.1 fixes */
.party-stage .actor {
  transition: filter .18s steps(3);
}

.party-stage .actor.selected {
  z-index: 5;
}

.map-cade {
  position: absolute;
  z-index: 4;
  width: 64px;
  height: 64px;
  left: calc(43% - 32px);
  top: calc(64% - 38px);
  background-image: url("assets/sprites/cade_idle.png");
  background-repeat: no-repeat;
  background-size: 128px auto;
  background-position: 0 -128px;
  image-rendering: pixelated;
  transform: scale(1.8);
  transform-origin: center bottom;
  filter: drop-shadow(0 0 14px rgba(142,216,255,.72));
  pointer-events: none;
}

.jarek-actor {
  z-index: 4;
}
.iyana-actor {
  z-index: 3;
}

/* v2.7 cleaner party staging */
.stage {
  position: relative;
  min-height: 520px;
  border: 3px solid white;
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35);
  overflow: hidden;
}

.stage:before {
  content:"THE ECHOES";
  position:absolute;
  left:50%;
  top:28px;
  transform:translateX(-50%);
  font-family:"Press Start 2P", monospace;
  font-size:.7rem;
  color:var(--blue3);
  text-shadow:3px 3px #000, 0 0 18px rgba(142,216,255,.75);
  z-index:1;
}

.stage:after {
  content:"";
  position:absolute;
  left:12%;
  right:12%;
  bottom:70px;
  height:2px;
  background:rgba(142,216,255,.42);
  box-shadow:0 0 18px rgba(96,165,250,.45);
}

.actor::after {
  content:"";
  position:absolute;
  left:50%;
  bottom:-8px;
  width:30px;
  height:8px;
  transform:translateX(-50%);
  border-radius:50%;
  background:rgba(0,0,0,.48);
  filter:blur(2px);
  z-index:-1;
}

.actor.selected::after {
  background:rgba(59,130,246,.34);
  box-shadow:0 0 16px rgba(142,216,255,.55);
}

.cade-actor.selected {
  z-index:8;
}

/* v2.10 Echoes party screen */
.actor {
  transition: filter .18s steps(3), opacity .18s steps(3);
}

.party-stage:has(.actor.selected) .actor:not(.selected) {
  opacity: .72;
  filter: drop-shadow(0 0 10px rgba(142,216,255,.22));
}

.actor.selected {
  opacity: 1;
  filter: drop-shadow(0 0 28px rgba(142,216,255,.9));
}

.char-menu {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stage:after {
  bottom: 66px;
}

/* v2.11 rebuilt Echoes party scene */
.stage {
  position: relative;
  min-height: 520px;
  border: 3px solid white;
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35);
  overflow: hidden;
}

.stage:before {
  content:"THE ECHOES";
  position:absolute;
  left:50%;
  top:28px;
  transform:translateX(-50%);
  font-family:"Press Start 2P", monospace;
  font-size:.7rem;
  color:var(--blue3);
  text-shadow:3px 3px #000, 0 0 18px rgba(142,216,255,.75);
  z-index:1;
}

.stage:after {
  content:"";
  position:absolute;
  left:13%;
  right:13%;
  bottom:70px;
  height:2px;
  background:rgba(142,216,255,.38);
  box-shadow:0 0 18px rgba(96,165,250,.35);
}

.actor {
  position:absolute;
  width:64px;
  height:64px;
  background-repeat:no-repeat;
  image-rendering:pixelated;
  transform-origin:center bottom;
  filter:drop-shadow(0 0 16px rgba(142,216,255,.42));
  transition:filter .18s steps(3), opacity .18s steps(3);
}

.actor::after {
  content:"";
  position:absolute;
  left:50%;
  bottom:-8px;
  width:30px;
  height:8px;
  transform:translateX(-50%);
  border-radius:50%;
  background:rgba(0,0,0,.48);
  filter:blur(2px);
  z-index:-1;
}

.actor.selected {
  opacity:1;
  filter:drop-shadow(0 0 28px rgba(142,216,255,.9));
}

.party-stage:has(.actor.selected) .actor:not(.selected) {
  opacity:.72;
  filter:drop-shadow(0 0 10px rgba(142,216,255,.22));
}

.actor-label {
  position:absolute;
  top:-22px;
  left:50%;
  transform:translateX(-50%);
  font-family:"Press Start 2P";
  font-size:6px;
  color:var(--blue3);
  text-shadow:2px 2px #000;
  opacity:0;
}

.actor.selected .actor-label {
  opacity:1;
}

/* v2.12 Echoes fixes */
.actor.selected {
  transform-origin: center bottom;
}

.actor.selected .actor-label {
  opacity: 1;
}

.party-stage:has(.actor.selected) .actor:not(.selected) {
  opacity: .78;
}

/* v2.13 Echoes restoration */
.actor {
  filter: drop-shadow(0 0 12px rgba(96,165,250,.25));
  transition: filter .18s steps(3), opacity .18s steps(3);
}

.actor.selected {
  opacity: 1;
  filter: drop-shadow(0 0 26px rgba(142,216,255,.85)) drop-shadow(0 0 8px rgba(96,165,250,.65));
}

.actor::after {
  content:"";
  position:absolute;
  left:50%;
  bottom:-8px;
  width:30px;
  height:8px;
  transform:translateX(-50%);
  border-radius:50%;
  background:rgba(0,0,0,.42);
  filter:blur(2px);
  z-index:-1;
}

.actor.selected::after {
  width:38px;
  height:10px;
  background:rgba(96,165,250,.30);
  box-shadow:0 0 18px rgba(142,216,255,.68);
}

.party-stage:has(.actor.selected) .actor:not(.selected) {
  opacity:.78;
  filter: drop-shadow(0 0 8px rgba(96,165,250,.18));
}

.actor-label {
  opacity:0;
}

.actor.selected .actor-label {
  opacity:1;
}

/* v2.14 final Echoes polish */
.actor {
  filter: drop-shadow(0 0 11px rgba(96,165,250,.26)) !important;
  opacity: 1;
}

.actor.selected {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 30px rgba(142,216,255,.95))
    drop-shadow(0 0 12px rgba(96,165,250,.80)) !important;
}

.party-stage:has(.actor.selected) .actor:not(.selected) {
  opacity: .82 !important;
  filter: drop-shadow(0 0 9px rgba(96,165,250,.22)) !important;
}

.actor::after {
  background: rgba(0,0,0,.42) !important;
  box-shadow: none !important;
}

.actor.selected::after {
  width: 44px !important;
  height: 12px !important;
  background: rgba(96,165,250,.36) !important;
  box-shadow:
    0 0 22px rgba(142,216,255,.78),
    0 0 8px rgba(96,165,250,.7) !important;
}

.actor.selected .actor-label {
  opacity: 1 !important;
}

/* v2.15 selected glow hard-fix */
.party-stage .actor[data-selected="false"] {
  opacity: .82 !important;
  filter: drop-shadow(0 0 9px rgba(96,165,250,.22)) !important;
}

.party-stage .actor[data-selected="false"]::after {
  width: 30px !important;
  height: 8px !important;
  background: rgba(0,0,0,.42) !important;
  box-shadow: none !important;
}

.party-stage .actor[data-selected="true"] {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 30px rgba(142,216,255,.95))
    drop-shadow(0 0 12px rgba(96,165,250,.80)) !important;
}

.party-stage .actor[data-selected="true"]::after {
  width: 44px !important;
  height: 12px !important;
  background: rgba(96,165,250,.36) !important;
  box-shadow:
    0 0 22px rgba(142,216,255,.78),
    0 0 8px rgba(96,165,250,.7) !important;
}

.party-stage .actor[data-selected="true"] .actor-label {
  opacity: 1 !important;
}

.party-stage .actor[data-selected="false"] .actor-label {
  opacity: 0 !important;
}

/* v2.16 final Echoes highlight fix */

/* Remove the old static blue stage spotlight that sat near Cade. */
.stage {
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
}

/* Every character gets a name label, selected one is brighter. */
.party-stage .actor .actor-label {
  opacity: .95 !important;
  color: var(--blue3);
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.7);
}

.party-stage .actor[data-selected="true"] .actor-label {
  opacity: 1 !important;
  color: #ffffff;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.95);
}

/* Normal uniform character glow. */
.party-stage .actor[data-selected="false"],
.party-stage .actor:not([data-selected="true"]) {
  opacity: .86 !important;
  filter: drop-shadow(0 0 8px rgba(96,165,250,.20)) !important;
}

/* Selected character glow only. */
.party-stage .actor[data-selected="true"] {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 32px rgba(142,216,255,.95))
    drop-shadow(0 0 14px rgba(96,165,250,.85)) !important;
}

/* Normal floor shadow under every character. */
.party-stage .actor[data-selected="false"]::after,
.party-stage .actor:not([data-selected="true"])::after {
  width: 30px !important;
  height: 8px !important;
  background: rgba(0,0,0,.42) !important;
  box-shadow: none !important;
}

/* Brighter floor glow only under selected character. */
.party-stage .actor[data-selected="true"]::after {
  width: 46px !important;
  height: 12px !important;
  background: rgba(96,165,250,.40) !important;
  box-shadow:
    0 0 24px rgba(142,216,255,.86),
    0 0 10px rgba(96,165,250,.75) !important;
}

/* v2.17 true selected-glow fix */
.echoes-body .stage {
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
}

/* Put the glow on the actor itself, behind the sprite. */
.party-stage .actor::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 112px;
  transform: translate(-50%, -45%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.16), transparent 70%);
  opacity: .45;
  z-index: -2;
  pointer-events: none;
}

.party-stage .actor[data-selected="true"]::before {
  width: 130px;
  height: 150px;
  background: radial-gradient(circle, rgba(142,216,255,.46), rgba(96,165,250,.22) 38%, transparent 72%);
  opacity: 1;
}

.party-stage .actor[data-selected="false"]::before,
.party-stage .actor:not([data-selected="true"])::before {
  width: 88px;
  height: 112px;
  background: radial-gradient(circle, rgba(96,165,250,.12), transparent 70%);
  opacity: .38;
}

/* Name labels always visible. */
.party-stage .actor .actor-label {
  opacity: .95 !important;
  color: var(--blue3) !important;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.68) !important;
}

.party-stage .actor[data-selected="true"] .actor-label {
  color: #fff !important;
  text-shadow: 2px 2px #000, 0 0 15px rgba(142,216,255,.95) !important;
}

/* Selected floor glow moves with selected actor only. */
.party-stage .actor[data-selected="true"]::after {
  width: 46px !important;
  height: 12px !important;
  background: rgba(96,165,250,.42) !important;
  box-shadow:
    0 0 24px rgba(142,216,255,.86),
    0 0 10px rgba(96,165,250,.75) !important;
}

.party-stage .actor[data-selected="false"]::after,
.party-stage .actor:not([data-selected="true"])::after {
  width: 30px !important;
  height: 8px !important;
  background: rgba(0,0,0,.42) !important;
  box-shadow: none !important;
}

.party-stage .actor {
  isolation: isolate;
}

/* v2.18 rollback oversized glow; keep clean party readability */
.echoes-body .stage,
.stage {
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
}

.party-stage .actor::before,
.party-stage .actor[data-selected="true"]::before,
.party-stage .actor[data-selected="false"]::before,
.party-stage .actor:not([data-selected="true"])::before {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  background: none !important;
}

/* All names visible. */
.party-stage .actor .actor-label {
  opacity: .95 !important;
  color: var(--blue3) !important;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.65) !important;
}

.party-stage .actor[data-selected="true"] .actor-label {
  color: #fff !important;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.95) !important;
}

/* Uniform normal character glow. */
.party-stage .actor,
.party-stage .actor[data-selected="false"],
.party-stage .actor:not([data-selected="true"]) {
  opacity: .92 !important;
  filter: drop-shadow(0 0 9px rgba(96,165,250,.22)) !important;
}

/* Selected character gets only a modest brighter outline/shadow, not a giant spotlight. */
.party-stage .actor[data-selected="true"] {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 18px rgba(142,216,255,.72))
    drop-shadow(0 0 7px rgba(96,165,250,.5)) !important;
}

/* Floor shadows stay subtle and character-local. */
.party-stage .actor::after,
.party-stage .actor[data-selected="false"]::after,
.party-stage .actor:not([data-selected="true"])::after {
  width: 30px !important;
  height: 8px !important;
  background: rgba(0,0,0,.42) !important;
  box-shadow: none !important;
}

.party-stage .actor[data-selected="true"]::after {
  width: 38px !important;
  height: 9px !important;
  background: rgba(96,165,250,.24) !important;
  box-shadow: 0 0 12px rgba(142,216,255,.45) !important;
}

/* v2.19 hard reset for Echoes stage glow and labels */
.echoes-body .stage,
.panel #partyStage,
.stage {
  background:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px),
    rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px, auto !important;
}

/* No stage-level spotlight, ever. */
.echoes-body .stage::before {
  content: "THE ECHOES" !important;
  position: absolute !important;
  left: 50% !important;
  top: 28px !important;
  transform: translateX(-50%) !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: .7rem !important;
  color: var(--blue3) !important;
  text-shadow: 3px 3px #000, 0 0 18px rgba(142,216,255,.75) !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  opacity: 1 !important;
}

.echoes-body .stage::after {
  content: "" !important;
  position: absolute !important;
  left: 13% !important;
  right: 13% !important;
  bottom: 70px !important;
  height: 2px !important;
  background: rgba(142,216,255,.38) !important;
  box-shadow: 0 0 18px rgba(96,165,250,.35) !important;
}

/* Show every name, not just selected. */
.party-stage .actor .actor-label,
.actor .actor-label {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: var(--blue3) !important;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.72) !important;
}

.party-stage .actor[data-selected="true"] .actor-label {
  color: #fff !important;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.95) !important;
}

/* Clean normal actor glow. */
.party-stage .actor {
  filter: drop-shadow(0 0 9px rgba(96,165,250,.22)) !important;
  opacity: .92 !important;
}

.party-stage .actor[data-selected="true"] {
  filter:
    drop-shadow(0 0 20px rgba(142,216,255,.75))
    drop-shadow(0 0 8px rgba(96,165,250,.55)) !important;
  opacity: 1 !important;
}

/* Local shadow only, no giant spotlight. */
.party-stage .actor::before {
  display: none !important;
  content: none !important;
}

.party-stage .actor::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -8px !important;
  width: 30px !important;
  height: 8px !important;
  transform: translateX(-50%) !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.42) !important;
  filter: blur(2px) !important;
  box-shadow: none !important;
  z-index: -1 !important;
}

.party-stage .actor[data-selected="true"]::after {
  width: 40px !important;
  height: 10px !important;
  background: rgba(96,165,250,.30) !important;
  box-shadow: 0 0 14px rgba(142,216,255,.55) !important;
}

/* =========================================================
   v2.20 HARD RESET: Echoes labels + moving selection highlight
   ========================================================= */

/* Kill every old stage glow/spotlight by forcing the stage to plain grid only. */
body .echoes-body .stage,
body .stage {
  background-image:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px) !important;
  background-color: rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px !important;
  background-position: 0 0, 0 0 !important;
}

/* Remove all old actor glow pseudo-elements. */
body .party-stage .actor::before {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Keep only small local shadows under every sprite. */
body .party-stage .actor::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -8px !important;
  width: 30px !important;
  height: 8px !important;
  transform: translateX(-50%) !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.42) !important;
  filter: blur(2px) !important;
  box-shadow: none !important;
  z-index: -1 !important;
}

/* Selected actor gets a modest local floor glow only. */
body .party-stage .actor.selected::after,
body .party-stage .actor[data-selected="true"]::after {
  width: 40px !important;
  height: 10px !important;
  background: rgba(96,165,250,.32) !important;
  box-shadow: 0 0 14px rgba(142,216,255,.55) !important;
}

/* All actor names are visible all the time. */
body .party-stage .actor .actor-label,
body .actor .actor-label {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--blue3) !important;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.72) !important;
  pointer-events: none !important;
}

/* Selected name is brighter. */
body .party-stage .actor.selected .actor-label,
body .party-stage .actor[data-selected="true"] .actor-label {
  color: #ffffff !important;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.95) !important;
}

/* Normal sprite glow is uniform. */
body .party-stage .actor {
  opacity: .92 !important;
  filter: drop-shadow(0 0 7px rgba(96,165,250,.22)) !important;
}

/* Selected sprite gets brighter outline only, no large background glow. */
body .party-stage .actor.selected,
body .party-stage .actor[data-selected="true"] {
  opacity: 1 !important;
  filter:
    drop-shadow(0 0 18px rgba(142,216,255,.72))
    drop-shadow(0 0 7px rgba(96,165,250,.55)) !important;
}

.party-name {
  position: absolute;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: var(--blue3);
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.72);
  pointer-events: none;
  z-index: 80;
}

.party-name.selected {
  color: #fff;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.95);
}

.selection-glow {
  position: absolute;
  width: 74px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.35), rgba(96,165,250,.12) 42%, transparent 72%);
  box-shadow: 0 0 22px rgba(142,216,255,.55);
  transform: translate(-50%, 50%);
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

/* v2.22 stable cleanup: no character names, no glow, no spotlights */
body .party-name,
body .party-name.selected,
body .party-stage .actor .actor-label,
body .actor .actor-label {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Hide movable glow if older markup/scripts try to create/use it. */
body .selection-glow {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Plain grid stage. No radial spotlight. */
body .echoes-body .stage,
body .stage {
  background-image:
    linear-gradient(rgba(96,165,250,.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.09) 2px, transparent 2px) !important;
  background-color: rgba(0,0,0,.45) !important;
  background-size: 40px 40px, 40px 40px !important;
  background-position: 0 0, 0 0 !important;
}

/* Preserve only the stage title and floor line. */
body .echoes-body .stage::before,
body .stage::before {
  content: "THE ECHOES" !important;
  position: absolute !important;
  left: 50% !important;
  top: 28px !important;
  transform: translateX(-50%) !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: .7rem !important;
  color: var(--blue3) !important;
  text-shadow: 3px 3px #000, 0 0 18px rgba(142,216,255,.75) !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  opacity: 1 !important;
}

body .echoes-body .stage::after,
body .stage::after {
  content: "" !important;
  position: absolute !important;
  left: 13% !important;
  right: 13% !important;
  bottom: 70px !important;
  height: 2px !important;
  background: rgba(142,216,255,.38) !important;
  box-shadow: none !important;
}

/* Remove all actor glow and pseudo glow/shadow effects. */
body .party-stage .actor,
body .party-stage .actor.selected,
body .party-stage .actor[data-selected="true"],
body .party-stage .actor[data-selected="false"],
body .party-stage .actor:not([data-selected="true"]) {
  opacity: 1 !important;
  filter: none !important;
}

body .party-stage .actor::before,
body .party-stage .actor::after,
body .party-stage .actor.selected::before,
body .party-stage .actor.selected::after,
body .party-stage .actor[data-selected="true"]::before,
body .party-stage .actor[data-selected="true"]::after,
body .party-stage .actor[data-selected="false"]::before,
body .party-stage .actor[data-selected="false"]::after {
  display: none !important;
  content: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

/* v2.25 Echoes selected-character chevron */
.party-chevron {
  position: absolute;
  z-index: 90;
  left: 16%;
  bottom: 180px;
  transform: translateX(-50%);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: 1.05rem;
  line-height: 1;
  text-shadow:
    2px 2px #000,
    0 0 10px rgba(142,216,255,.85),
    0 0 18px rgba(96,165,250,.55);
  pointer-events: none;
  transition:
    left .22s steps(5),
    bottom .22s steps(5);
  animation: chevronBob .8s steps(2) infinite, chevronFlicker 3.2s steps(4) infinite;
}

@keyframes chevronBob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 5px; }
}

@keyframes chevronFlicker {
  0%, 91%, 100% { opacity: 1; }
  94% { opacity: .55; }
  97% { opacity: .9; }
}

/* v2.28 fixed parking-spot chevrons */
.party-chevron.fixed {
  position: absolute;
  z-index: 90;
  transform: translateX(-50%);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: 1.05rem;
  line-height: 1;
  text-shadow:
    2px 2px #000,
    0 0 10px rgba(142,216,255,.85),
    0 0 18px rgba(96,165,250,.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s steps(2), visibility .12s steps(2);
  animation: chevronBob .8s steps(2) infinite, chevronFlicker 3.2s steps(4) infinite;
}

/* These match the approved parking spots from the character config. */
.party-chevron.fixed[data-char="cade"]  { left: 16%; bottom: 238px; }
.party-chevron.fixed[data-char="iyana"] { left: 34%; bottom: 238px; }
.party-chevron.fixed[data-char="jarek"] { left: 52%; bottom: 238px; }
.party-chevron.fixed[data-char="elias"] { left: 70%; bottom: 238px; }
.party-chevron.fixed[data-char="evie"]  { left: 88%; bottom: 238px; }

.party-chevron.fixed.active {
  opacity: 1;
  visibility: visible;
}

/* v2.29 fixed chevron hard state */
.party-chevron.fixed {
  opacity: 0 !important;
  visibility: hidden !important;
}

.party-chevron.fixed.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* v2.32 World Terminal */
.terminal-world {
  grid-template-columns: minmax(380px, .84fr) minmax(0, 1.16fr);
  gap: 26px;
}

.world-terminal-map {
  position: relative;
  min-height: 520px;
  border: 3px solid white;
  background:
    linear-gradient(rgba(96,165,250,.12) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.12) 2px, transparent 2px),
    rgba(0,0,0,.48);
  background-size: 40px 40px, 40px 40px, auto;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), inset 0 0 34px rgba(96,165,250,.08);
  overflow: hidden;
  outline: none;
}

.world-terminal-map:focus {
  box-shadow:
    0 0 0 4px rgba(0,0,0,.35),
    0 0 28px rgba(96,165,250,.24),
    inset 0 0 34px rgba(96,165,250,.1);
}

.world-boot {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background:
    repeating-linear-gradient(to bottom, rgba(96,165,250,.08) 0 2px, transparent 2px 8px),
    rgba(2,4,10,.92);
  font-family: "Press Start 2P", monospace;
  font-size: .62rem;
  line-height: 1.8;
  color: var(--blue3);
  text-align: center;
  text-shadow: 2px 2px #000;
  transition: opacity .35s steps(4), visibility .35s steps(4);
}

.world-boot.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.world-boot-bar {
  width: min(360px, 76%);
  height: 26px;
  border: 3px solid white;
  padding: 4px;
  background: rgba(0,0,0,.4);
  box-shadow: 0 0 18px rgba(96,165,250,.22);
}

.world-boot-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue3));
  animation: worldBootFill 2.1s steps(12) forwards;
}

@keyframes worldBootFill {
  to { width: 100%; }
}

.world-instructions {
  position: absolute;
  left: 14px;
  top: 14px;
  right: 14px;
  z-index: 12;
  padding: 10px 12px;
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(5,13,31,.78);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .5rem;
  line-height: 1.75;
  text-shadow: 2px 2px #000;
  transition: opacity .35s steps(4), visibility .35s steps(4);
}

.world-instructions.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Terrain texture zones */
.terrain {
  position: absolute;
  opacity: .42;
  pointer-events: none;
  filter: blur(.2px);
}

.terrain-grove {
  left: 4%;
  top: 25%;
  width: 30%;
  height: 34%;
  border-radius: 55% 45% 50% 40%;
  background: radial-gradient(circle, rgba(124,255,178,.22), transparent 62%);
}

.terrain-meadow {
  left: 20%;
  top: 50%;
  width: 34%;
  height: 35%;
  border-radius: 50%;
  background: repeating-linear-gradient(35deg, rgba(124,255,178,.10) 0 8px, transparent 8px 16px);
}

.terrain-city {
  left: 40%;
  top: 18%;
  width: 25%;
  height: 28%;
  background:
    linear-gradient(90deg, transparent, rgba(142,216,255,.18), transparent),
    repeating-linear-gradient(90deg, rgba(142,216,255,.12) 0 10px, transparent 10px 18px);
}

.terrain-dunes {
  left: 58%;
  top: 44%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, rgba(255,210,120,.16) 0 9px, transparent 9px 18px);
}

.terrain-swamp {
  left: 66%;
  top: 65%;
  width: 32%;
  height: 30%;
  border-radius: 48%;
  background: radial-gradient(circle, rgba(85,170,130,.16), transparent 60%);
}

.terrain-snow {
  left: 26%;
  top: 6%;
  width: 32%;
  height: 25%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,245,255,.18), transparent 62%);
}

.terrain-flats {
  left: 76%;
  top: 14%;
  width: 22%;
  height: 28%;
  background: repeating-linear-gradient(-35deg, rgba(255,67,88,.10) 0 8px, transparent 8px 16px);
}

/* Landmarks */
.world-site {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 6;
  width: 84px;
  min-height: 70px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  color: white;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s steps(4), visibility .22s steps(4), filter .18s steps(3);
}

.world-site.revealed {
  opacity: 1;
  visibility: visible;
}

.world-site.near .landmark-icon,
.world-site.active .landmark-icon {
  filter: brightness(1.28) drop-shadow(0 0 10px rgba(142,216,255,.65));
}

.site-name {
  display: block;
  margin-top: 5px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s steps(3), transform .18s steps(3);
  font-family: "Press Start 2P", monospace;
  font-size: .43rem;
  line-height: 1.35;
  color: #fff;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.72);
}

.world-site.near .site-name,
.world-site.active .site-name {
  opacity: 1;
  transform: translateY(0);
}

.landmark-icon {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 38px;
  image-rendering: pixelated;
}

/* Helix Grove: forest shrine */
.grove-icon::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 2px;
  width: 15px;
  height: 22px;
  background: #77e6a1;
  clip-path: polygon(50% 0, 100% 42%, 78% 42%, 100% 78%, 0 78%, 22% 42%, 0 42%);
  box-shadow: -13px 5px #3fae72, 13px 6px #58c989;
  animation: treeSway 2.4s steps(2) infinite;
}

.grove-icon i {
  position: absolute;
  left: 16px;
  bottom: 0;
  width: 10px;
  height: 12px;
  background: #7780a8;
  border: 2px solid rgba(255,255,255,.55);
  box-shadow: 0 0 10px rgba(124,255,178,.35);
}

@keyframes treeSway {
  50% { transform: translateX(1px); }
}

/* Pulse Meadows: field/wind */
.meadow-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 16px;
  background: repeating-linear-gradient(90deg, #79e38f 0 4px, #4fb76e 4px 8px);
  border-radius: 12px 12px 0 0;
  animation: meadowWave 1.8s steps(3) infinite;
}

.meadow-icon i {
  position: absolute;
  left: 18px;
  bottom: 14px;
  width: 5px;
  height: 18px;
  background: #d8ecff;
}

.meadow-icon b {
  position: absolute;
  left: 13px;
  bottom: 25px;
  width: 15px;
  height: 15px;
  border: 3px solid #d8ecff;
  transform: rotate(45deg);
  animation: windTurn 3s linear infinite;
}

@keyframes meadowWave {
  50% { transform: translateY(-1px); }
}

@keyframes windTurn {
  to { transform: rotate(405deg); }
}

/* Luminara Glade: tech city */
.city-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 1px;
  width: 8px;
  height: 30px;
  background: #8ed8ff;
  box-shadow:
    10px -8px #5aa8ff,
    20px -3px #b7edff,
    30px 5px #3b82f6;
  animation: cityBlink 1.6s steps(2) infinite;
}

.city-icon i {
  position: absolute;
  left: 9px;
  bottom: 10px;
  width: 30px;
  height: 3px;
  background: rgba(255,255,255,.65);
  box-shadow: 0 -10px rgba(255,255,255,.35);
}

@keyframes cityBlink {
  50% { filter: brightness(1.45); }
}

/* Ember Dunes: Sahara dunes and pyramid */
.dunes-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 2px;
  width: 38px;
  height: 16px;
  background: #e8c16d;
  border-radius: 50% 50% 0 0;
  box-shadow: 12px -4px #d8a84f;
  animation: sandShift 2.8s steps(2) infinite;
}

.dunes-icon i {
  position: absolute;
  left: 14px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  background: #c98f3f;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  box-shadow: inset -6px 0 rgba(0,0,0,.18);
}

.dunes-icon b {
  position: absolute;
  left: 2px;
  bottom: 26px;
  width: 28px;
  height: 2px;
  background: rgba(255,230,160,.55);
  animation: heatLine 1.2s steps(2) infinite;
}

@keyframes sandShift {
  50% { transform: translateX(1px); }
}

@keyframes heatLine {
  50% { transform: translateX(4px); opacity: .3; }
}

/* Sentience Swamps */
.swamp-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 4px;
  width: 30px;
  height: 9px;
  background: #2f7f6f;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(124,255,178,.22);
}

.swamp-icon i {
  position: absolute;
  left: 20px;
  bottom: 12px;
  width: 5px;
  height: 25px;
  background: #3c5a46;
  transform: rotate(6deg);
  box-shadow: -9px 9px #3c5a46;
}

.swamp-icon b {
  position: absolute;
  left: 10px;
  bottom: 9px;
  width: 5px;
  height: 5px;
  border: 1px solid #8ed8ff;
  border-radius: 50%;
  animation: swampBubble 1.8s steps(3) infinite;
}

@keyframes swampBubble {
  50% { transform: translateY(-5px); opacity: .45; }
}

/* Snowdrift Hollow */
.snow-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 4px;
  width: 28px;
  height: 16px;
  background: #9db6ce;
  clip-path: polygon(0 45%, 50% 0, 100% 45%, 100% 100%, 0 100%);
  box-shadow: inset 0 5px #f8fbff;
}

.snow-icon i {
  position: absolute;
  left: 29px;
  bottom: 3px;
  width: 10px;
  height: 25px;
  background: #e8f7ff;
  clip-path: polygon(50% 0, 100% 38%, 78% 38%, 100% 72%, 0 72%, 22% 38%, 0 38%);
}

.snow-icon b {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 3px;
  height: 3px;
  background: white;
  box-shadow: 15px 7px white, 30px 3px white;
  animation: snowFall 2.4s steps(4) infinite;
}

@keyframes snowFall {
  to { transform: translateY(9px); opacity: .4; }
}

/* Scoriax Flats */
.flats-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 2px;
  width: 34px;
  height: 16px;
  background: #2c2f3d;
  clip-path: polygon(0 100%, 20% 35%, 35% 100%, 50% 20%, 70% 100%, 88% 45%, 100% 100%);
}

.flats-icon i {
  position: absolute;
  left: 17px;
  bottom: 8px;
  width: 10px;
  height: 22px;
  background: #ff4358;
  clip-path: polygon(50% 0, 100% 70%, 70% 100%, 30% 100%, 0 70%);
  animation: lavaPulse 1s steps(2) infinite;
}

.flats-icon b {
  position: absolute;
  left: 22px;
  bottom: 31px;
  width: 7px;
  height: 7px;
  background: rgba(180,180,180,.45);
  border-radius: 50%;
  animation: smokeRise 2.2s steps(4) infinite;
}

@keyframes lavaPulse {
  50% { filter: brightness(1.8); }
}

@keyframes smokeRise {
  to { transform: translateY(-10px) scale(1.5); opacity: 0; }
}

/* Explorer */
.world-explorer {
  position: absolute;
  z-index: 20;
  width: 64px;
  height: 64px;
  left: calc(18% - 32px);
  top: calc(42% - 42px);
  background-repeat: no-repeat;
  background-size: 128px auto;
  background-position: 0 -128px;
  image-rendering: pixelated;
  transform: scale(1.85);
  transform-origin: center bottom;
  pointer-events: none;
}

/* Card polish */
.terminal-world .area {
  min-height: 480px;
}

.terminal-world .area img {
  filter: saturate(.95) contrast(1.05);
}

@media (max-width:1120px) {
  .terminal-world {
    grid-template-columns: 1fr;
  }
  .world-terminal-map {
    min-height: 420px;
  }
}

/* v2.39 Echoes selected character visual indicator */
.selected-character-preview {
  width: 132px;
  height: 118px;
  margin: 12px 0 12px;
  border: 2px solid rgba(255,255,255,.78);
  background:
    linear-gradient(rgba(96,165,250,.08) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.08) 2px, transparent 2px),
    rgba(0,0,0,.34);
  background-size: 18px 18px, 18px 18px, auto;
  display: grid;
  place-items: end center;
  box-shadow: inset 0 0 18px rgba(96,165,250,.12);
}

.profile-sprite {
  width: 64px;
  height: 64px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  transform: scale(1.75);
  transform-origin: center bottom;
  margin-bottom: 16px;
  background-size: 128px auto;
  background-position: 0 -128px;
}

.profile-sprite::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 30px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  filter: blur(2px);
}

.cade-profile-sprite { background-image: url("assets/sprites/cade_idle.png"); }
.iyana-profile-sprite { background-image: url("assets/sprites/iyana_idle.png"); }
.jarek-profile-sprite { background-image: url("assets/sprites/jarek_idle.png"); }
.elias-profile-sprite { background-image: url("assets/sprites/elias_idle.png"); }
.evie-profile-sprite { background-image: url("assets/sprites/evie_idle.png"); }

/* v2.39 hide unreliable Echoes chevrons */
.party-chevron.fixed,
.echoes-chevron {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* v2.40 Echoes: always-visible names, no chevrons or profile preview */
.selected-character-preview,
.profile-sprite,
.party-chevron.fixed,
.echoes-chevron {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Always show the built-in actor labels above each sprite. */
.party-stage .actor .actor-label,
.actor .actor-label {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  top: -23px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-family: "Press Start 2P", monospace !important;
  font-size: 6px !important;
  color: var(--blue3) !important;
  text-shadow:
    2px 2px #000,
    0 0 10px rgba(142,216,255,.72) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

/* Selected character name is slightly brighter. */
.party-stage .actor.selected .actor-label,
.party-stage .actor[data-selected="true"] .actor-label {
  color: #fff !important;
  text-shadow:
    2px 2px #000,
    0 0 14px rgba(142,216,255,.95) !important;
}

/* v2.41 fixed Echoes name labels */
.echoes-name-label {
  position: absolute;
  z-index: 120;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: var(--blue3);
  text-shadow:
    2px 2px #000,
    0 0 10px rgba(142,216,255,.72);
  white-space: nowrap;
  pointer-events: none;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.echoes-name-label[data-char="cade"]  { left: 16%; bottom: 214px; }
.echoes-name-label[data-char="iyana"] { left: 34%; bottom: 214px; }
.echoes-name-label[data-char="jarek"] { left: 52%; bottom: 214px; }
.echoes-name-label[data-char="elias"] { left: 70%; bottom: 214px; }
.echoes-name-label[data-char="evie"]  { left: 88%; bottom: 214px; }

.char-menu button.active[data-char="cade"] ~ .nothing {
  display: none;
}

/* Do not show the old internal actor labels, only the fixed labels above. */
.party-stage .actor .actor-label,
.actor .actor-label {
  display: none !important;
}

/* v2.43 mobile World Terminal controls */
.world-dpad {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  display: none;
  grid-template-columns: 42px 42px 42px;
  grid-template-rows: 42px 42px 42px;
  gap: 4px;
  opacity: .88;
}

.world-dpad button {
  border: 2px solid rgba(255,255,255,.82);
  background: rgba(5,13,31,.78);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .72rem;
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.72);
  box-shadow: inset 0 0 10px rgba(96,165,250,.10);
  touch-action: none;
  user-select: none;
}

.world-dpad button:active,
.world-dpad button.pressed {
  background: rgba(96,165,250,.24);
  color: #fff;
}

.world-dpad button[data-dir="up"] { grid-column: 2; grid-row: 1; }
.world-dpad button[data-dir="left"] { grid-column: 1; grid-row: 2; }
.world-dpad button[data-dir="down"] { grid-column: 2; grid-row: 3; }
.world-dpad button[data-dir="right"] { grid-column: 3; grid-row: 2; }

@media (max-width: 760px), (pointer: coarse) {
  .world-dpad {
    display: grid;
  }

  .world-instructions {
    font-size: .46rem;
    right: 12px;
  }

  .world-terminal-map {
    min-height: 430px;
  }

  .world-site {
    width: 74px;
  }

  .site-name {
    font-size: .38rem;
  }
}

/* v2.44 World Terminal screenshot polish */
.terminal-world .world-feed {
  position: relative;
  overflow: hidden;
}

.feed-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid rgba(255,255,255,.82);
  margin-bottom: 18px;
  overflow: hidden;
  background: rgba(0,0,0,.45);
  box-shadow:
    inset 0 0 28px rgba(0,0,0,.55),
    0 0 18px rgba(96,165,250,.12);
}

.feed-image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 1px, transparent 1px 5px),
    radial-gradient(circle at center, transparent 48%, rgba(0,0,0,.45) 100%);
  mix-blend-mode: screen;
  opacity: .42;
}

.feed-image-wrap::after {
  content: "SATELLITE FEED";
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  font-family: "Press Start 2P", monospace;
  font-size: .45rem;
  color: var(--blue3);
  text-shadow: 2px 2px #000, 0 0 10px rgba(142,216,255,.7);
  opacity: .85;
}

.world-feed img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) contrast(1.08) brightness(.9);
  transform: scale(1.01);
  transition: opacity .35s steps(5), transform .45s steps(8), filter .35s steps(5);
}

.world-feed.active img {
  opacity: 1;
  transform: scale(1.015);
}

.region-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 18px;
}

.region-meta div {
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(14,44,91,.26);
  padding: 10px 8px;
  min-height: 58px;
}

.region-meta b,
.region-meta em {
  display: block;
  font-style: normal;
}

.region-meta b {
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .45rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.region-meta em {
  color: #fff;
  font-size: .76rem;
  line-height: 1.35;
}

.world-feed.feed-switching .feed-image-wrap::before {
  animation: feedFlicker .42s steps(4);
}

.world-feed.feed-switching img {
  opacity: .42;
  filter: saturate(.65) contrast(1.4) brightness(.72);
}

.world-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 18%;
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(142,216,255,.24), transparent);
}

.world-terminal-map.scanning .world-scanline {
  opacity: 1;
  animation: worldScanSweep .55s steps(10);
}

@keyframes worldScanSweep {
  from { top: -20%; }
  to { top: 110%; }
}

@keyframes feedFlicker {
  0%, 100% { opacity: .42; }
  25% { opacity: .75; }
  50% { opacity: .25; }
  75% { opacity: .65; }
}

@media (max-width: 760px) {
  .region-meta {
    grid-template-columns: 1fr;
  }
}

/* v2.45 World Terminal UX */
.world-nav-panel {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 12;
  width: min(280px, calc(100% - 28px));
  padding: 12px;
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(5,13,31,.82);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .48rem;
  line-height: 1.55;
  text-shadow: 2px 2px #000;
  box-shadow:
    inset 0 0 16px rgba(96,165,250,.10),
    0 0 18px rgba(96,165,250,.10);
}

.world-nav-panel > span {
  display: block;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: .08em;
}

.world-nav-panel div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 7px;
}

.world-nav-panel b,
.world-nav-panel em {
  font-style: normal;
}

.world-nav-panel b {
  color: var(--green);
}

.world-nav-panel em {
  color: var(--blue3);
}

.world-boot {
  animation: bootMicroFlicker .95s steps(3) 1;
}

.world-boot .world-ready {
  color: #fff;
  text-shadow:
    2px 2px #000,
    0 0 16px rgba(142,216,255,.95);
}

.world-boot-bar span {
  animation: worldBootFill .9s steps(12) forwards !important;
}

@keyframes bootMicroFlicker {
  0%, 100% { filter: brightness(1); }
  38% { filter: brightness(1.25); }
  64% { filter: brightness(.8); }
  72% { filter: brightness(1.35); }
}

@media (max-width: 760px), (pointer: coarse) {
  .world-nav-panel {
    font-size: .43rem;
    width: min(250px, calc(100% - 28px));
  }

  .world-nav-panel div {
    grid-template-columns: 68px 1fr;
  }
}

/* v2.46 World Terminal navigation layout polish */
.world-nav-panel {
  left: auto !important;
  right: 14px !important;
  top: 14px !important;
  width: 230px !important;
  padding: 10px 11px !important;
  font-size: .43rem !important;
}

.world-nav-panel > span {
  margin-bottom: 8px !important;
}

.world-nav-panel div {
  grid-template-columns: 62px 1fr !important;
  gap: 7px !important;
  margin-top: 6px !important;
}

/* Keep Snowdrift Hollow readable by nudging only the panel, not the map. */
@media (max-width: 760px), (pointer: coarse) {
  .world-nav-panel {
    left: 12px !important;
    right: 12px !important;
    top: 12px !important;
    width: auto !important;
    font-size: .4rem !important;
  }

  .world-nav-panel div {
    grid-template-columns: 58px 1fr !important;
  }
}

/* v2.47 New Game / OS Dashboard Redesign */
.site-boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(to bottom, rgba(96,165,250,.07) 0 2px, transparent 2px 8px),
    #02040a;
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  text-align: left;
  text-shadow: 2px 2px #000;
  transition: opacity .35s steps(4), visibility .35s steps(4);
}

.site-boot.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-boot-inner {
  width: min(680px, 86vw);
  border: 3px solid rgba(255,255,255,.82);
  padding: 28px;
  background: rgba(5,13,31,.72);
  box-shadow:
    0 0 0 4px rgba(0,0,0,.35),
    0 0 38px rgba(96,165,250,.18);
  animation: bootMicroFlicker .95s steps(3) 1;
}

.site-boot-inner p {
  margin: 0 0 14px;
  font-size: .72rem;
  line-height: 1.7;
}

.boot-lines {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  font-size: .55rem;
  line-height: 1.7;
}

.boot-lines span {
  opacity: 0;
  animation: bootLineIn .12s steps(2) forwards;
}

.boot-lines span:nth-child(1) { animation-delay: .12s; }
.boot-lines span:nth-child(2) { animation-delay: .28s; }
.boot-lines span:nth-child(3) { animation-delay: .44s; }
.boot-lines span:nth-child(4) { animation-delay: .60s; }

.site-boot-bar {
  height: 24px;
  border: 3px solid white;
  padding: 4px;
  background: rgba(0,0,0,.4);
  margin: 22px 0 14px;
}

.site-boot-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue3));
  animation: siteBootFill .85s steps(14) forwards;
}

.boot-ready {
  color: #fff;
  text-shadow: 2px 2px #000, 0 0 16px rgba(142,216,255,.95);
}

@keyframes bootLineIn { to { opacity: 1; } }
@keyframes siteBootFill { to { width: 100%; } }

.os-home {
  grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
  gap: 28px;
  align-items: stretch;
}

.os-hero {
  min-height: 560px;
}

.os-hero-screen {
  position: relative;
  height: 100%;
  min-height: 560px;
  border: 3px solid white;
  background: rgba(0,0,0,.35);
  box-shadow:
    0 0 0 4px rgba(0,0,0,.35),
    inset 0 0 42px rgba(0,0,0,.55);
  overflow: hidden;
}

.os-hero-image {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.62)),
    url("assets/hero.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(.95) contrast(1.08) brightness(.82);
  transform: scale(1.04);
  animation: heroDrift 22s ease-in-out infinite alternate;
}

.os-hero-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.045) 0 1px, transparent 1px 5px),
    radial-gradient(circle at center, transparent 50%, rgba(0,0,0,.45) 100%);
  pointer-events: none;
}

@keyframes heroDrift {
  from { transform: scale(1.04) translate(-.7%, -.5%); }
  to { transform: scale(1.07) translate(.8%, .6%); }
}

.os-scan-readout {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(5,13,31,.78);
  font-family: "Press Start 2P", monospace;
  text-shadow: 2px 2px #000;
}

.os-scan-readout span {
  color: var(--blue3);
  font-size: .55rem;
}

.os-scan-readout b {
  color: var(--green);
  font-size: .5rem;
}

.os-dashboard {
  display: grid;
  gap: 18px;
  align-content: stretch;
}

.terminal-card {
  border: 3px solid white;
  background:
    linear-gradient(rgba(96,165,250,.07) 2px, transparent 2px),
    linear-gradient(90deg, rgba(96,165,250,.07) 2px, transparent 2px),
    rgba(5,13,31,.74);
  background-size: 22px 22px, 22px 22px, auto;
  box-shadow:
    0 0 0 4px rgba(0,0,0,.35),
    inset 0 0 22px rgba(96,165,250,.08);
  padding: 22px;
}

.card-kicker {
  display: block;
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .55rem;
  line-height: 1.5;
  margin-bottom: 14px;
  text-shadow: 2px 2px #000;
}

.system-card h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: .95;
  letter-spacing: .03em;
  text-shadow:
    4px 4px #000,
    0 0 28px rgba(142,216,255,.36);
}

.tagline {
  margin: 16px 0 0;
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .7rem;
  line-height: 1.8;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.system-grid div {
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(14,44,91,.24);
  padding: 11px 10px;
}

.system-grid b,
.system-grid em {
  display: block;
  font-style: normal;
}

.system-grid b {
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .45rem;
  margin-bottom: 8px;
}

.system-grid em {
  color: #fff;
  font-size: .82rem;
}

.briefing-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.briefing-card p {
  color: rgba(255,255,255,.84);
  line-height: 1.65;
}

.action-card {
  display: grid;
  gap: 10px;
}

.terminal-action {
  display: block;
  width: 100%;
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(0,0,0,.24);
  color: var(--blue3);
  padding: 12px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: .56rem;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.terminal-action:hover,
.terminal-action:focus {
  color: #fff;
  background: rgba(96,165,250,.18);
  box-shadow: 0 0 18px rgba(96,165,250,.18);
}

@media (max-width:1120px) {
  .os-home {
    grid-template-columns: 1fr;
  }

  .os-hero,
  .os-hero-screen {
    min-height: 420px;
  }
}

@media (max-width:760px) {
  .system-grid {
    grid-template-columns: 1fr;
  }

  .site-boot-inner {
    padding: 20px;
  }

  .site-boot-inner p {
    font-size: .56rem;
  }

  .boot-lines {
    font-size: .44rem;
  }
}

/* v2.48 New Game surveillance layout */
.os-home {
  grid-template-columns: 1fr !important;
  gap: 20px !important;
}

.os-hero {
  min-height: 330px !important;
}

.os-hero-screen {
  min-height: 330px !important;
  height: 330px !important;
}

.os-hero-image {
  display: none !important;
}

.os-feed-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #02040a;
}

.os-feed-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(.9) contrast(1.08) brightness(.78);
  transform: scale(1.04);
  transition: opacity .65s steps(8), transform 8s linear;
}

.os-feed-slides img.active {
  opacity: 1;
  transform: scale(1.08);
}

.os-dashboard {
  grid-template-columns: minmax(300px, .75fr) minmax(380px, 1fr);
  grid-template-areas:
    "system briefing"
    "actions briefing";
  gap: 18px !important;
}

.system-card { grid-area: system; }
.briefing-card { grid-area: briefing; }
.action-card { grid-area: actions; }

.system-card h1 {
  font-size: clamp(2rem, 4vw, 4rem) !important;
}

.terminal-card {
  padding: 20px !important;
}

.action-card {
  align-content: start;
}

.os-scan-readout {
  min-width: 215px;
}

.os-scan-readout b {
  color: #fff !important;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.9);
}

@media (max-width:1120px) {
  .os-dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "system"
      "briefing"
      "actions";
  }

  .os-hero,
  .os-hero-screen {
    min-height: 300px !important;
    height: 300px !important;
  }
}

@media (max-width:760px) {
  .os-hero,
  .os-hero-screen {
    min-height: 240px !important;
    height: 240px !important;
  }

  .os-scan-readout {
    left: 12px;
    bottom: 12px;
    min-width: 0;
  }

  .os-scan-readout span {
    font-size: .45rem;
  }

  .os-scan-readout b {
    font-size: .43rem;
  }
}

/* v2.50d Element Zero Cartridge Launcher - clean integration */
.cartridge-body {
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, .92fr);
  gap: 28px;
  align-items: center;
}

.cartridge-art-frame {
  border: 3px solid white;
  background: rgba(0,0,0,.36);
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), inset 0 0 34px rgba(96,165,250,.12);
  overflow: hidden;
  min-height: 330px;
  display: grid;
  place-items: center;
}

.cartridge-art-frame img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  filter: saturate(.95) contrast(1.08) brightness(.86);
}

.cartridge-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  min-height: 330px;
}

.cartridge-copy h1 {
  margin: 0;
  font-size: clamp(2.15rem, 4.6vw, 4rem);
  line-height: 1.12;
  letter-spacing: .025em;
  text-shadow: 4px 4px #000, 0 0 26px rgba(142,216,255,.24);
}

.cartridge-copy p {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.86);
  line-height: 1.75;
  font-size: clamp(.95rem, 1.25vw, 1.12rem);
}

.cartridge-copy strong {
  color: var(--green);
  font-weight: 900;
}

.launch-cartridge-btn {
  border: 3px solid rgba(255,255,255,.9);
  background: linear-gradient(180deg, rgba(37,99,235,.86), rgba(14,44,91,.88));
  color: #fff;
  padding: 14px 20px;
  min-width: 230px;
  font-family: "Press Start 2P", monospace;
  font-size: .62rem;
  line-height: 1.4;
  text-shadow: 2px 2px #000;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(0,0,0,.3), inset 0 0 18px rgba(142,216,255,.18);
}

.launch-cartridge-btn:hover,
.launch-cartridge-btn:focus {
  background: linear-gradient(180deg, rgba(96,165,250,.96), rgba(37,99,235,.9));
  box-shadow: 0 0 0 4px rgba(0,0,0,.3), 0 0 24px rgba(142,216,255,.32), inset 0 0 22px rgba(142,216,255,.24);
}

.launch-cartridge-btn.loading {
  pointer-events: none;
  filter: brightness(.85);
}

.cartridge-status {
  border: 2px solid rgba(255,255,255,.76);
  background: rgba(5,13,31,.78);
  padding: 11px 13px;
  min-width: 230px;
  display: grid;
  gap: 8px;
  font-family: "Press Start 2P", monospace;
  text-shadow: 2px 2px #000;
}

.cartridge-status span {
  color: var(--green);
  font-size: .45rem;
}

.cartridge-status b {
  color: var(--blue3);
  font-size: .54rem;
}

.cartridge-loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  place-items: center;
  background: repeating-linear-gradient(to bottom, rgba(96,165,250,.07) 0 2px, transparent 2px 8px), rgba(2,4,10,.96);
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  text-shadow: 2px 2px #000;
}

.cartridge-loader.active {
  display: grid;
}

.cartridge-loader-inner {
  width: min(720px, 86vw);
  border: 3px solid rgba(255,255,255,.86);
  background: rgba(5,13,31,.82);
  padding: 28px;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 0 40px rgba(96,165,250,.22);
}

.cartridge-loader-inner p {
  margin: 0 0 14px;
  font-size: .68rem;
  line-height: 1.7;
}

.cartridge-loader-lines {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  font-size: .52rem;
  line-height: 1.7;
}

.cartridge-loader-lines span {
  opacity: 0;
  animation: cartridgeLineIn .12s steps(2) forwards;
}

.cartridge-loader.active .cartridge-loader-lines span:nth-child(1) { animation-delay: .12s; }
.cartridge-loader.active .cartridge-loader-lines span:nth-child(2) { animation-delay: .38s; }
.cartridge-loader.active .cartridge-loader-lines span:nth-child(3) { animation-delay: .64s; }
.cartridge-loader.active .cartridge-loader-lines span:nth-child(4) { animation-delay: .90s; }

.cartridge-loader-bar {
  height: 24px;
  border: 3px solid white;
  padding: 4px;
  background: rgba(0,0,0,.42);
  margin: 22px 0 14px;
}

.cartridge-loader-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue3));
}

.cartridge-loader.active .cartridge-loader-bar span {
  animation: cartridgeFill 1.25s steps(18) forwards;
}

.cartridge-loader-ready {
  color: #fff;
  text-shadow: 2px 2px #000, 0 0 18px rgba(142,216,255,.95);
}

body.cartridge-busy .menu-button {
  opacity: .35;
  pointer-events: none;
}

body.cartridge-busy .menu-button[data-panel="element"] {
  opacity: 1;
  pointer-events: none;
}

@keyframes cartridgeLineIn { to { opacity: 1; } }
@keyframes cartridgeFill { to { width: 100%; } }

@media (max-width:1120px) {
  .cartridge-body { grid-template-columns: 1fr; }
  .cartridge-copy { min-height: auto; }
}

@media (max-width:760px) {
  .cartridge-art-frame, .cartridge-art-frame img { min-height: 220px; }
  .cartridge-copy h1 { font-size: 2rem; }
  .cartridge-loader-inner { padding: 20px; }
  .cartridge-loader-inner p { font-size: .52rem; }
  .cartridge-loader-lines { font-size: .42rem; }
}

/* v2.50e: initial Waterwood OS boot fail-safe only */
.site-boot.site-boot-safe {
  animation: siteBootSafeDismiss .35s steps(4) 1.45s forwards !important;
}

@keyframes siteBootSafeDismiss {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.site-boot.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* v2.50g: overlay dismissal class only */
.world-boot.world-boot-complete {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* v2.50h: World Terminal overlay class fallback */
.world-boot.world-boot-complete {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* v2.51 Archive Database */
.archive-body {
  grid-template-columns: minmax(330px, .72fr) minmax(520px, 1.28fr);
  gap: 24px;
  align-items: stretch;
}

.archive-grid-panel,
.archive-viewer {
  min-height: 540px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.archive-thumb {
  border: 2px solid rgba(255,255,255,.62);
  background: rgba(0,0,0,.28);
  padding: 7px;
  cursor: pointer;
  text-align: left;
  color: white;
  transition: border-color .18s steps(3), filter .18s steps(3), transform .18s steps(3);
}

.archive-thumb:hover,
.archive-thumb.active {
  border-color: var(--blue3);
  filter: brightness(1.12);
}

.archive-thumb.active {
  box-shadow: 0 0 18px rgba(142,216,255,.22);
}

.archive-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(.9) contrast(1.06) brightness(.84);
}

.archive-thumb span {
  display: block;
  margin-top: 7px;
  font-family: "Press Start 2P", monospace;
  font-size: .42rem;
  line-height: 1.35;
  color: var(--blue3);
  text-shadow: 2px 2px #000;
}

.archive-viewer {
  position: relative;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 18px;
  overflow: hidden;
}

.archive-preview {
  position: relative;
  border: 3px solid rgba(255,255,255,.82);
  background: rgba(0,0,0,.35);
  min-height: 360px;
  overflow: hidden;
  box-shadow: inset 0 0 34px rgba(0,0,0,.36);
}

.archive-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  filter: saturate(.92) contrast(1.05) brightness(.86);
  transition: opacity .22s steps(4), filter .22s steps(4);
}

.archive-viewer.loading .archive-preview img {
  opacity: .35;
  filter: saturate(.45) contrast(1.1) brightness(.58);
}

.archive-loading {
  position: absolute;
  inset: 22px;
  z-index: 5;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  background:
    repeating-linear-gradient(to bottom, rgba(96,165,250,.07) 0 2px, transparent 2px 8px),
    rgba(2,4,10,.86);
  border: 2px solid rgba(255,255,255,.72);
  font-family: "Press Start 2P", monospace;
  color: var(--blue3);
  text-shadow: 2px 2px #000;
}

.archive-viewer.loading .archive-loading {
  display: grid;
}

.archive-loading span {
  font-size: .58rem;
}

.archive-loading b {
  display: block;
  width: min(320px, 70%);
  height: 20px;
  border: 3px solid white;
  padding: 3px;
  background: rgba(0,0,0,.4);
}

.archive-loading b::before {
  content: "";
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue3));
  animation: archiveOpenFill .32s steps(8) forwards;
}

@keyframes archiveOpenFill {
  to { width: 100%; }
}

.archive-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.archive-meta .card-kicker {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.archive-meta div {
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(14,44,91,.22);
  padding: 12px;
}

.archive-meta b,
.archive-meta em {
  display: block;
  font-style: normal;
}

.archive-meta b {
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .42rem;
  line-height: 1.45;
  margin-bottom: 8px;
}

.archive-meta em {
  color: rgba(255,255,255,.86);
  line-height: 1.45;
}

@media (max-width:1120px) {
  .archive-body {
    grid-template-columns: 1fr;
  }

  .archive-grid-panel,
  .archive-viewer {
    min-height: auto;
  }
}

@media (max-width:760px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-preview,
  .archive-preview img {
    min-height: 240px;
  }

  .archive-meta {
    grid-template-columns: 1fr;
  }
}

/* v2.51a Archive layout refinement */
.archive-body{
display:grid;
grid-template-columns:1fr !important;
grid-template-areas:
"viewer"
"thumbs";
}
.archive-viewer{grid-area:viewer;}
.archive-grid-panel{grid-area:thumbs;min-height:auto;}
.archive-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
@media (max-width:900px){.archive-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:600px){.archive-grid{grid-template-columns:1fr;}}

/* v2.53 System Information */
.system-info-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "hero hero"
    "profile apps"
    "developer updates"
    "legal legal"
    "footer footer";
  gap: 22px;
  align-items: stretch;
}

.system-info-body .terminal-card {
  min-height: auto;
}

.system-hero { grid-area: hero; }
.system-specs { grid-area: profile; }
.installed-apps { grid-area: apps; }
.developer-info { grid-area: developer; }
.system-updates { grid-area: updates; }
.legal-notice { grid-area: legal; }
.system-footer { grid-area: footer; }

.system-hero {
  display: grid;
  gap: 18px;
  align-content: center;
}

.system-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 1;
  text-shadow: 5px 5px #000, 0 0 30px rgba(142,216,255,.28);
}

.system-version-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.system-version-strip div,
.system-spec-grid div,
.developer-grid div {
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(14,44,91,.22);
  padding: 13px;
}

.system-version-strip b,
.system-spec-grid b,
.developer-grid b {
  display: block;
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .42rem;
  line-height: 1.45;
  margin-bottom: 9px;
  text-shadow: 2px 2px #000;
}

.system-version-strip em,
.system-spec-grid em,
.developer-grid em {
  display: block;
  color: rgba(255,255,255,.9);
  font-style: normal;
  line-height: 1.45;
}

.system-spec-grid,
.developer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.installed-list {
  display: grid;
  gap: 10px;
}

.installed-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(14,44,91,.22);
  padding: 12px;
  opacity: 0;
  transform: translateY(6px);
}

.system-info-panel.active .installed-list div {
  animation: moduleVerify .22s steps(4) forwards;
}

.system-info-panel.active .installed-list div:nth-child(1) { animation-delay: .05s; }
.system-info-panel.active .installed-list div:nth-child(2) { animation-delay: .13s; }
.system-info-panel.active .installed-list div:nth-child(3) { animation-delay: .21s; }
.system-info-panel.active .installed-list div:nth-child(4) { animation-delay: .29s; }
.system-info-panel.active .installed-list div:nth-child(5) { animation-delay: .37s; }
.system-info-panel.active .installed-list div:nth-child(6) { animation-delay: .45s; }

@keyframes moduleVerify {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.installed-list span {
  color: rgba(255,255,255,.92);
  font-weight: 800;
}

.installed-list b {
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .42rem;
  line-height: 1.45;
  text-align: right;
  text-shadow: 2px 2px #000;
}

.update-log {
  display: grid;
  gap: 12px;
}

.update-log div {
  border-left: 3px solid var(--blue3);
  background: rgba(14,44,91,.22);
  padding: 12px 14px;
}

.update-log b {
  display: block;
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .46rem;
  margin-bottom: 8px;
  text-shadow: 2px 2px #000;
}

.update-log span {
  color: rgba(255,255,255,.86);
  line-height: 1.5;
}

.legal-notice p {
  color: rgba(255,255,255,.86);
  line-height: 1.75;
  margin: 0 0 14px;
}

.legal-notice p:last-child {
  margin-bottom: 0;
}

.legal-notice strong {
  color: #fff;
  text-shadow: 2px 2px #000, 0 0 14px rgba(142,216,255,.36);
}

.system-footer {
  text-align: center;
  display: grid;
  gap: 9px;
  justify-items: center;
}

.system-footer span {
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: .5rem;
  text-shadow: 2px 2px #000;
}

.system-footer b {
  color: var(--blue3);
  font-family: "Press Start 2P", monospace;
  font-size: .8rem;
  text-shadow: 2px 2px #000, 0 0 18px rgba(142,216,255,.7);
}

.system-footer em {
  color: rgba(255,255,255,.78);
  font-style: normal;
  line-height: 1.5;
}

@media (max-width:1120px) {
  .system-info-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "profile"
      "apps"
      "developer"
      "updates"
      "legal"
      "footer";
  }
}

@media (max-width:760px) {
  .system-version-strip,
  .system-spec-grid,
  .developer-grid {
    grid-template-columns: 1fr;
  }

  .installed-list div {
    grid-template-columns: 1fr;
  }

  .installed-list b {
    text-align: left;
  }
}

/* v2.54 Mobile Menu */
.mobile-menu-toggle {
  display: none;
  border: 3px solid rgba(255,255,255,.86);
  background: rgba(5,13,31,.86);
  color: var(--blue3);
  padding: 12px 14px;
  width: 100%;
  font-family: "Press Start 2P", monospace;
  font-size: .58rem;
  line-height: 1.45;
  text-align: left;
  text-shadow: 2px 2px #000;
  box-shadow: 0 0 0 4px rgba(0,0,0,.3), inset 0 0 18px rgba(96,165,250,.12);
  cursor: pointer;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  color: #fff;
  background: rgba(37,99,235,.28);
}

@media (max-width: 760px) {
  .mobile-menu-toggle {
    display: block;
    margin: 0 0 12px;
    position: relative;
    z-index: 100;
  }

  #mainMenu,
  nav.menu,
  .menu {
    display: none;
  }

  body.mobile-menu-open #mainMenu,
  body.mobile-menu-open nav.menu,
  body.mobile-menu-open .menu {
    display: grid;
  }

  body.mobile-menu-open .mobile-menu-toggle {
    color: #fff;
    border-color: var(--blue3);
    box-shadow: 0 0 0 4px rgba(0,0,0,.3), 0 0 22px rgba(142,216,255,.26);
  }
}

/* v2.55 Mobile menu fix: dedicated mobile navigation */
.mobile-menu-panel {
  display: none;
}

@media (max-width: 760px) {
  .mobile-menu-panel {
    position: relative;
    z-index: 101;
    display: none;
    gap: 8px;
    margin: 0 0 14px;
    border: 3px solid rgba(255,255,255,.82);
    background: rgba(5,13,31,.92);
    padding: 10px;
    box-shadow: 0 0 0 4px rgba(0,0,0,.3), inset 0 0 18px rgba(96,165,250,.12);
  }

  body.mobile-menu-open .mobile-menu-panel {
    display: grid !important;
  }

  .mobile-menu-item {
    border: 2px solid rgba(255,255,255,.64);
    background: rgba(14,44,91,.34);
    color: var(--blue3);
    padding: 12px 10px;
    font-family: "Press Start 2P", monospace;
    font-size: .5rem;
    line-height: 1.45;
    text-align: left;
    text-shadow: 2px 2px #000;
    cursor: pointer;
  }

  .mobile-menu-item:hover,
  .mobile-menu-item:focus {
    color: #fff;
    border-color: var(--blue3);
    background: rgba(37,99,235,.34);
  }
}

/* v3.00 Final Polish: mobile compatibility notice */
.mobile-compat-notice {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  background:
    repeating-linear-gradient(to bottom, rgba(96,165,250,.07) 0 2px, transparent 2px 8px),
    rgba(2,4,10,.92);
  color: var(--blue3);
  text-shadow: 2px 2px #000;
  pointer-events: none;
}

.mobile-compat-notice.active {
  display: grid;
  animation: mobileCompatFade .35s steps(4) 2.15s forwards;
}

.mobile-compat-inner {
  width: min(520px, 86vw);
  border: 3px solid rgba(255,255,255,.86);
  background: rgba(5,13,31,.86);
  box-shadow:
    0 0 0 4px rgba(0,0,0,.35),
    0 0 30px rgba(96,165,250,.2),
    inset 0 0 24px rgba(96,165,250,.12);
  padding: 22px;
  font-family: "Press Start 2P", monospace;
  text-align: left;
}

.mobile-compat-inner span {
  display: block;
  color: var(--green);
  font-size: .52rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.mobile-compat-inner p {
  margin: 0 0 12px;
  color: rgba(255,255,255,.88);
  font-size: .5rem;
  line-height: 1.9;
}

.mobile-compat-inner p:last-child {
  margin-bottom: 0;
  color: var(--blue3);
}

@keyframes mobileCompatFade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (min-width: 761px) {
  .mobile-compat-notice {
    display: none !important;
  }
}
