:root {
  color-scheme: dark;
  --blue: #0719c7;
  --blue-dark: #03076b;
  --pink: #ff32bb;
  --yellow: #fff044;
  --green: #16ff55;
  --danger: #ff274f;
  --ink: #040404;
  --chrome: #d6d2c8;
  --chrome-dark: #85817b;
  --shadow: 0 18px 0 rgb(0 0 0 / 0.28), 0 18px 45px rgb(0 0 0 / 0.48);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; background: #000; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 20; background: repeating-linear-gradient(180deg, rgb(255 255 255 / .06) 0 1px, transparent 1px 4px); mix-blend-mode: overlay; }
button { font: inherit; min-height: 44px; cursor: pointer; touch-action: manipulation; }

.desktop {
  min-height: 100dvh;
  padding-bottom: 52px;
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 12%, #fff 0 0.7rem, transparent 0.75rem),
    linear-gradient(#1797ff 0%, #67c8ff 48%, #14904d 49%, #0e6f38 100%);
  isolation: isolate;
}

.wallpaper { position: absolute; inset: 0; z-index: -1; }
.cloud { position: absolute; width: 11rem; height: 3.8rem; border-radius: 999px; background: rgb(255 255 255 / .9); filter: drop-shadow(0 10px 0 rgb(0 0 0 / .08)); }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 5rem; height: 5rem; left: 1.5rem; top: -2rem; }
.cloud::after { width: 6rem; height: 6rem; right: 1.2rem; top: -2.8rem; }
.cloud--one { left: 4vw; top: 14vh; }
.cloud--two { right: 7vw; top: 28vh; transform: scale(.82); }
.bolt { position: absolute; right: 12vw; top: 7vh; font-size: clamp(3rem, 10vw, 8rem); filter: drop-shadow(4px 5px 0 #000); }
.dolphin { position: absolute; left: 61vw; bottom: 18vh; font-size: clamp(3rem, 11vw, 8rem); transform: rotate(-10deg); }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: max(.75rem, env(safe-area-inset-top)) .85rem .65rem;
  align-items: center;
}
.brand { line-height: .8; text-shadow: 3px 3px 0 #000, 0 0 10px white; }
.brand__defend { display: block; font-weight: 950; letter-spacing: -.08em; font-size: clamp(1.4rem, 7vw, 4rem); color: #d9f7ff; }
.brand__hack { display: block; font-weight: 950; letter-spacing: -.08em; font-size: clamp(1.8rem, 9vw, 5.4rem); color: var(--pink); }
.stats { display: grid; grid-template-columns: repeat(2, max-content); gap: .25rem .7rem; justify-items: end; color: var(--yellow); font: 700 clamp(.72rem, 2.5vw, 1rem) "Courier New", monospace; text-shadow: 2px 2px 0 #000; }
.stats strong { color: #fff; }

.browser-shell {
  width: min(92vw, 740px);
  margin: clamp(.5rem, 2vh, 2rem) auto;
  color: #000;
  border: 3px solid #fff;
  border-right-color: #555;
  border-bottom-color: #555;
  background: var(--chrome);
  box-shadow: var(--shadow);
}
.browser-bar, .popup__bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 34px; padding: .28rem .45rem;
  background: linear-gradient(90deg, #0611a8, #1789ff);
  color: #fff; font-weight: 800; font-size: .88rem;
}
.browser-buttons { display: flex; gap: 4px; }
.browser-buttons i, .window-button { width: 28px; height: 28px; min-height: 28px; border: 2px outset #fff; background: var(--chrome); color: #111; display: grid; place-items: center; font-style: normal; }
.toolbar { display: flex; gap: .25rem; padding: .35rem; overflow-x: auto; border-bottom: 2px inset #fff; }
.toolbar button, .fake-secondary, .fake-primary, .start-button { border: 2px outset #fff; background: var(--chrome); color: #000; font-weight: 800; padding: .45rem .7rem; }
.toolbar button:disabled { opacity: .55; }
.address { margin: .25rem; padding: .35rem; border: 2px inset #fff; background: #fff; font: 700 .82rem "Courier New", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.address span { color: #063dbd; }
.page { padding: clamp(.8rem, 4vw, 1.35rem); background: #fff; min-height: 190px; }
.page h1 { margin: 0 0 .45rem; font-size: clamp(1.35rem, 7vw, 3.2rem); line-height: .9; color: #0611a8; text-transform: uppercase; }
.page p { font-size: clamp(.95rem, 3.5vw, 1.2rem); }
.mission-board { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .8rem 0; font: 900 .82rem "Courier New", monospace; }
.mission-board span { border: 2px inset #bbb; background: #eef2ff; padding: .45rem; }
.mission-board strong { color: #0611a8; }
.meter { height: 24px; border: 3px inset #bbb; background: #111; overflow: hidden; }
.meter span { display: block; height: 100%; width: 12%; background: var(--green); transition: width .2s, background .2s; }
[data-panic="warning"] .meter span { width: 45%; background: var(--yellow); }
[data-panic="danger"] .meter span { width: 75%; background: #ff8b00; }
[data-panic="critical"] .meter span { width: 100%; background: var(--danger); }
.modem { font-family: "Courier New", monospace; font-weight: 900; color: #088326; }
.event-log { margin: .7rem 0 0; padding: .6rem .8rem .6rem 1.7rem; min-height: 74px; border: 3px inset #bbb; background: #050505; color: var(--green); font: 800 .78rem "Courier New", monospace; }
.event-log li { margin: .12rem 0; }

.popup-layer { position: absolute; inset: 0; pointer-events: none; z-index: 9; }
.popup {
  pointer-events: auto;
  position: absolute;
  left: var(--x); top: var(--y);
  width: min(86vw, 330px);
  transform: rotate(var(--r));
  background: var(--chrome);
  color: #000;
  border: 3px solid #fff;
  border-right-color: #555;
  border-bottom-color: #555;
  box-shadow: var(--shadow);
  animation: spawn .18s steps(2) both;
}
.popup__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup__body { padding: .75rem; font-size: .95rem; }
.popup__body strong { display: inline-block; margin-bottom: .4rem; color: #fff; background: var(--danger); padding: .18rem .35rem; }
.popup__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.fake-primary { background: var(--yellow); flex: 1; }
.fake-secondary { background: #fff; flex: 1; }
.popup--assistant .popup__bar { background: linear-gradient(90deg, #6b20c8, #ff32bb); }
.popup--download .popup__bar { background: linear-gradient(90deg, #0c7d22, #16ff55); color: #001b08; }

.start-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgb(0 0 0 / .38); backdrop-filter: blur(2px); }
.start-overlay[hidden] { display: none; }
.start-card {
  width: min(92vw, 520px);
  border: 4px solid #fff;
  border-right-color: #555;
  border-bottom-color: #555;
  background: #02006c;
  color: #fff;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 5vw, 2rem);
  text-align: center;
}
.badge { display: inline-block; background: var(--yellow); color: #000; padding: .35rem .55rem; font: 900 .8rem "Courier New", monospace; transform: rotate(-2deg); }
.start-card h2 { margin: .8rem 0 .3rem; font-size: clamp(2rem, 11vw, 4.5rem); line-height: .85; color: var(--pink); text-shadow: 3px 3px 0 #000, 0 0 10px white; }
.start-card p { font-size: clamp(1rem, 4vw, 1.25rem); }
.start-button { background: var(--green); font-size: 1.15rem; width: min(100%, 280px); }
.start-card small { display: block; margin-top: .8rem; color: #bce5ff; }

.bsod { position: absolute; inset: 0; z-index: 5; display: grid; align-content: center; gap: 1rem; padding: 2rem; background: #0500aa; color: #fff; font-family: "Courier New", monospace; }
.bsod h2 { font-size: clamp(1.8rem, 9vw, 5rem); margin: 0; }
.bsod p { font-size: clamp(1rem, 4vw, 1.6rem); }

.taskbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; min-height: 46px; display: flex; align-items: center; gap: .35rem; padding: .3rem max(.45rem, env(safe-area-inset-left)) max(.3rem, env(safe-area-inset-bottom)); background: var(--chrome); border-top: 3px solid #fff; color: #000; font: 900 .85rem Arial, sans-serif; }
.start-menu, .taskbar__item, .taskbar__clock { border: 2px outset #fff; background: #d6d2c8; color: #000; min-height: 34px; display: inline-flex; align-items: center; padding: .25rem .55rem; }
.start-menu { font-weight: 950; }
.taskbar__item { min-width: min(44vw, 220px); background: #ece9df; }
.taskbar__spacer { flex: 1; }
.taskbar__clock { font-family: "Courier New", monospace; }

@keyframes spawn { from { transform: scale(.85) rotate(var(--r)); opacity: .3; } to { transform: scale(1) rotate(var(--r)); opacity: 1; } }

@media (max-width: 620px) {
  html, body { overflow: auto; }
  .desktop { min-height: 100svh; overflow: hidden; }
  .topbar { align-items: flex-start; }
  .brand__defend { font-size: clamp(1.2rem, 6vw, 2.4rem); }
  .brand__hack { font-size: clamp(1.5rem, 8vw, 3rem); }
  .stats { grid-template-columns: 1fr; gap: .1rem; font-size: .72rem; }
  .browser-shell { width: calc(100vw - 1rem); margin-top: .25rem; }
  .toolbar button { flex: 0 0 auto; }
  .page { min-height: 160px; }
  .popup { width: min(92vw, 350px); }
  .popup__body { font-size: 1rem; }
  .popup__actions button { flex-basis: 100%; }
  .mission-board { grid-template-columns: 1fr; }
  .event-log { min-height: 58px; font-size: .72rem; }
  .taskbar__item { display: none; }
  .dolphin { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
