:root {
  color-scheme: dark;
  --bg: #050507;
  --panel: rgba(12, 13, 17, 0.82);
  --panel-border: rgba(255, 255, 255, 0.16);
  --text: #f4f2ea;
  --muted: rgba(244, 242, 234, 0.68);
  --accent: #c7ff63;
  --error: #ff6e63;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-view="world"] {
  background: #05070b;
}

button,
textarea,
input {
  font: inherit;
}

.stage-shell,
.unicorn-scene {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.stage-shell {
  position: relative;
  isolation: isolate;
  background: #050507;
  opacity: 1;
  transition:
    opacity 560ms ease,
    visibility 0ms linear 0ms;
}

.unicorn-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 50% 50%;
  transition:
    filter 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Unicorn also creates transparent DOM text for its canvas-rendered layers.
   Keep every fallback copy indivisible even if the runtime refreshes inline styles. */
.unicorn-scene [data-us-text] {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

.brand-hotspot {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 48px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.brand-hotspot:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.82);
  outline-offset: 8px;
}

body[data-scene-ready="true"][data-view="landing"] .brand-hotspot {
  pointer-events: auto;
}

body[data-view="world"] .stage-shell {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 560ms ease,
    visibility 0ms linear 560ms;
}

body[data-view="world"] .brand-hotspot {
  display: none;
}

.loader-panel {
  position: absolute;
  z-index: 2;
  left: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 3rem);
  width: min(31rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(22px);
}

.loader-panel[hidden] {
  display: none;
}

.boot-screen {
  position: fixed;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  background: #050507;
  color: rgba(244, 242, 234, 0.78);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: lowercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}

body[data-booting="true"][data-view="landing"] .boot-screen {
  opacity: 1;
}

body[data-room-loading="true"][data-view="world"] .boot-screen {
  opacity: 1;
}

.boot-screen[hidden] {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.loader-panel__status {
  display: grid;
  gap: 0.5rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
}

.loader-panel__status h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

code {
  color: var(--text);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.loader-panel[data-mode="error"] #status-line {
  color: var(--error);
}

.loader-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.file-action,
button {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.file-action:hover,
button:hover {
  border-color: rgba(99, 185, 255, 0.72);
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.paste-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.paste-form[hidden] {
  display: none;
}

textarea {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.36);
  color: var(--text);
  padding: 0.8rem;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

textarea:focus,
button:focus-visible,
.file-action:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.world-page {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  visibility: hidden;
  background: #050507 var(--asset-world-poster, none) center center / cover no-repeat;
  color: #eaf8f5;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 620ms ease,
    visibility 0ms linear 620ms;
}

/* Film grain canvas — mounted by world-grain.js, redrawn ~24fps with
   random noise so it moves like the Unicorn landing grain. */
.world-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 520ms ease;
}

body[data-view="world"] .world-page {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 620ms ease,
    visibility 0ms linear 0ms;
}

body[data-view="world"] .world-grain {
  opacity: 0.46;
}

.world-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  background: #050507;
}

.world-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

body[data-desktop-mode="active"] .world-canvas,
body[data-desktop-mode="entering"] .world-canvas,
body[data-desktop-mode="preparing"] .world-canvas,
body[data-game-mode="active"] .world-canvas,
body[data-game-mode="entering"] .world-canvas,
body[data-room-state="pc-moving"] .world-canvas,
body[data-room-state="os-entering"] .world-canvas,
body[data-room-state="os-exiting"] .world-canvas,
body[data-room-state="tv-moving"] .world-canvas,
body[data-room-state="game-entering"] .world-canvas,
body[data-room-state="game-exiting"] .world-canvas,
body[data-room-state="returning-room"] .world-canvas {
  pointer-events: none;
}

.world-device-controls {
  position: fixed;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.world-device-controls button {
  position: fixed;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.world-device-controls button:focus-visible {
  bottom: 1.25rem;
  width: auto;
  height: auto;
  min-height: 2.6rem;
  overflow: visible;
  clip-path: none;
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

#pc-device-control:focus-visible {
  left: 1.25rem;
}

#tv-device-control:focus-visible {
  left: 5.6rem;
}

.world-error {
  position: fixed;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 0.8rem;
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 7, 11, 0.92);
  transform: translate(-50%, -50%);
  text-align: center;
}

.world-error[hidden] {
  display: none;
}

.world-error a {
  color: rgba(234, 248, 245, 0.9);
  text-underline-offset: 0.25em;
}

.world-error a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.mobile-world-scene {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 39%, rgba(255, 255, 255, 0.08), transparent 14rem),
    radial-gradient(circle at 26% 78%, rgba(58, 150, 118, 0.16), transparent 13rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
}

body[data-mobile-world="true"][data-view="world"] .world-canvas {
  display: none;
}

body[data-mobile-world="true"][data-view="world"] .mobile-world-scene {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-pc-rig {
  --mobile-screen-x: 4.6627%;
  --mobile-screen-y: 5.5699%;
  --mobile-screen-w: 63.8188%;
  --mobile-screen-h: 70.159%;
  --mobile-screen-cx: 36.5721%;
  --mobile-screen-cy: 40.6494%;
  --mobile-screen-focus-x: -36.5721%;
  --mobile-screen-focus-y: -40.6494%;
  position: absolute;
  top: 43%;
  left: 50%;
  width: min(94vw, 620px);
  aspect-ratio: 1548 / 856;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: center center;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.44));
  transition:
    top 760ms cubic-bezier(0.22, 0.74, 0.22, 1),
    left 760ms cubic-bezier(0.22, 0.74, 0.22, 1),
    width 760ms cubic-bezier(0.22, 0.74, 0.22, 1),
    transform 760ms cubic-bezier(0.22, 0.74, 0.22, 1),
    filter 760ms ease;
}

.mobile-pc-screen {
  position: absolute;
  top: var(--mobile-screen-y);
  left: var(--mobile-screen-x);
  z-index: 1;
  width: var(--mobile-screen-w);
  height: var(--mobile-screen-h);
  overflow: hidden;
  background: #000;
}

.mobile-pc-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.mobile-screen-welcome,
.mobile-zoom-welcome {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mobile-screen-welcome {
  opacity: 0;
}

.mobile-pc-hit,
.mobile-screen-hit {
  all: unset;
  position: absolute;
  cursor: pointer;
  touch-action: manipulation;
}

.mobile-pc-hit {
  inset: 0;
  z-index: 3;
}

.mobile-screen-hit {
  top: var(--mobile-screen-y);
  left: var(--mobile-screen-x);
  z-index: 4;
  width: var(--mobile-screen-w);
  height: var(--mobile-screen-h);
}

.mobile-pc-hit:focus-visible,
.mobile-screen-hit:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.88);
  outline-offset: 4px;
}

.mobile-screen-zoom {
  position: fixed;
  z-index: 7;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #59aca6;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition:
    top 680ms cubic-bezier(0.22, 0.74, 0.22, 1),
    left 680ms cubic-bezier(0.22, 0.74, 0.22, 1),
    width 680ms cubic-bezier(0.22, 0.74, 0.22, 1),
    height 680ms cubic-bezier(0.22, 0.74, 0.22, 1),
    opacity 180ms ease;
}

.mobile-screen-zoom[data-visible="true"] {
  opacity: 1;
}

.desktop-shell {
  --desktop-x: 0px;
  --desktop-y: 0px;
  --desktop-scale-x: 1;
  --desktop-scale-y: 1;
  --desktop-crt-opacity: 0;
  --desktop-screen-filter: none;
  --crt-scanline: 0.2;
  --crt-noise-level: 0.9;
  --crt-phosphor: 0.1;
  --crt-retrace: 0.03;
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: 1fr 28px;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #59aca6;
  color: #ffffff;
  font-family: Tahoma, "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--desktop-x), var(--desktop-y), 0)
    scale(var(--desktop-scale-x), var(--desktop-scale-y));
  transform-origin: 0 0;
  filter: var(--desktop-screen-filter);
  transition:
    opacity 280ms ease;
  isolation: isolate;
  will-change: opacity, transform;
}

.desktop-shell::before,
.desktop-shell::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: var(--desktop-crt-opacity);
  transition: opacity 900ms ease;
}

/* Scanlines — visible raster lines, drifting slowly like a live tube. */
.desktop-shell::before {
  z-index: 1000000;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, var(--crt-scanline)) 0px,
      rgba(0, 0, 0, var(--crt-scanline)) 1px,
      transparent 1px,
      transparent 3px
    );
  background-size: 100% 3px;
  mix-blend-mode: multiply;
  animation: crt-scanline-drift 7s linear infinite;
}

/* Broadcast noise — SVG turbulence grain, jittered in coarse steps. */
.desktop-shell::after {
  z-index: 1000001;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: calc(var(--desktop-crt-opacity) * var(--crt-noise-level));
  animation: crt-noise-jitter 340ms steps(3, end) infinite;
}

/*
 * CRT glass overlay — injected by os/crt.js inside #desktop-shell.
 * Element: curved bezel corners, edge falloff, vignette, glare.
 * ::before — vertical retrace band.  ::after — RGB phosphor mask + flicker.
 */
.crt-overlay {
  position: absolute;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--desktop-crt-opacity);
  transition: opacity 900ms ease;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.07), transparent 42%),
    radial-gradient(115% 115% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.38) 100%);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
}

.crt-overlay::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -35%;
  height: 30%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.55) 50%,
    transparent
  );
  mix-blend-mode: overlay;
  opacity: var(--crt-retrace);
  animation: crt-retrace 6.5s linear infinite;
}

.crt-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 62, 62, 0.55) 0 1px,
    rgba(56, 255, 96, 0.55) 1px 2px,
    rgba(66, 100, 255, 0.55) 2px 3px
  );
  mix-blend-mode: overlay;
  opacity: var(--crt-phosphor);
  animation: crt-flicker 126ms steps(2, end) infinite;
}

/* Chromatic aberration pass over the live desktop DOM (filter injected
   by os/crt.js). */
body[data-desktop-mode="active"] .desktop-shell .os-root,
body[data-desktop-mode="expanding"] .desktop-shell .os-root {
  filter: var(--gwos-crt-warp, none);
}

/* Occasional vertical-hold twitch. */
body[data-desktop-mode="active"] .desktop-shell .os-root {
  animation: crt-vsync 13s linear infinite;
}

body[data-desktop-mode="entering"] .desktop-shell {
  opacity: 1;
}

body[data-desktop-mode="expanding"] .desktop-shell {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 280ms ease,
    transform 620ms cubic-bezier(0.22, 0.74, 0.22, 1);
}

body[data-desktop-mode="active"] .desktop-shell {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

body[data-desktop-mode="active"] .desktop-shell,
body[data-desktop-mode="expanding"] .desktop-shell {
  --desktop-crt-opacity: 1;
  --desktop-screen-filter: none;
}

body[data-desktop-mode="collapsing"] .desktop-shell {
  --desktop-crt-opacity: 0.72;
  opacity: 1;
  pointer-events: none;
}

body[data-desktop-mode="exiting"] .desktop-shell {
  --desktop-crt-opacity: 0;
  opacity: 0;
  transition:
    opacity 520ms ease 90ms,
    transform 620ms cubic-bezier(0.45, 0, 0.7, 1);
}

.game-shell {
  position: fixed;
  z-index: 6;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #020303;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
  will-change: opacity;
}

.game-shell[hidden] {
  display: none;
}

.game-shell__loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  background: transparent;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.game-shell__loading-backdrop {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-shell__loading-case {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: block;
  width: min(66vw, 62dvh, 32rem);
  max-height: calc(100dvh - 1rem);
  aspect-ratio: 1;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, 100vh);
  filter: drop-shadow(0 1.1rem 2.4rem rgba(0, 0, 0, 0.72));
  will-change: opacity, transform;
}

body[data-room-state="game-entering"][data-game-mode="preparing"]
  .game-shell__loading-case {
  animation: game-case-slide-up 620ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

@keyframes game-case-slide-up {
  from {
    opacity: 0;
    transform: translate(-50%, 100vh);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.game-shell__loading-blackout {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
  will-change: opacity;
}

.game-shell__host,
.game-shell__host iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #020303;
}

.game-shell__host {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.game-shell__host iframe {
  display: block;
  opacity: 0;
  transition: opacity 420ms ease;
}

body[data-game-mode] .desktop-shell {
  display: none;
}

body[data-game-mode="preparing"] .game-shell,
body[data-game-mode="blackout"] .game-shell,
body[data-game-mode="revealing"] .game-shell {
  opacity: 1;
}

body[data-room-state="game-entering"][data-game-mode="preparing"]
  .game-shell__loading,
body[data-room-state="game-entering"][data-game-mode="blackout"]
  .game-shell__loading,
body[data-room-state="game-entering"][data-game-mode="revealing"]
  .game-shell__loading {
  opacity: 1;
}

body[data-game-mode="blackout"] .game-shell__loading-case {
  opacity: 1;
  transform: translate(-50%, -50%);
}

body[data-game-mode="blackout"] .game-shell__loading-blackout {
  opacity: 1;
}

body[data-game-mode="revealing"] .game-shell__loading-backdrop,
body[data-game-mode="revealing"] .game-shell__loading-case {
  opacity: 0;
}

body[data-game-mode="active"] .game-shell {
  opacity: 1;
  pointer-events: auto;
}

body[data-game-mode="revealing"] .game-shell__host iframe,
body[data-game-mode="active"] .game-shell__host iframe {
  opacity: 1;
}

body[data-game-mode="hiding"] .game-shell {
  opacity: 0;
  transition-duration: 220ms;
}

body[data-game-mode="hiding"] .game-shell__host iframe {
  opacity: 0;
  transition-duration: 220ms;
}

@keyframes crt-scanline-drift {
  to {
    background-position: 0 3px;
  }
}

@keyframes crt-noise-jitter {
  0%,
  100% {
    background-position: 0 0;
  }

  33% {
    background-position: -53px 41px;
  }

  66% {
    background-position: 37px -29px;
  }
}

@keyframes crt-retrace {
  to {
    transform: translateY(450%);
  }
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: var(--crt-phosphor);
  }

  50% {
    opacity: calc(var(--crt-phosphor) * 0.82);
  }
}

@keyframes crt-vsync {
  0%,
  96.4%,
  97.6%,
  100% {
    transform: translateY(0);
  }

  96.8% {
    transform: translateY(2px);
  }

  97.2% {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-shell::before,
  .desktop-shell::after,
  .crt-overlay::before,
  .crt-overlay::after,
  body[data-desktop-mode="active"] .desktop-shell .os-root {
    animation: none;
  }

  .game-shell {
    transition-duration: 1ms !important;
  }

  .game-shell__loading {
    transition-duration: 1ms !important;
    animation: none !important;
  }

  .game-shell__loading-case {
    opacity: 1;
    transform: translate(-50%, -50%);
    animation: none !important;
  }

  .game-shell__loading-blackout {
    transition-duration: 1ms !important;
  }
}

/* ------------------------------------------------------------ workspace */

.gwos-workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.gwos-icons {
  position: absolute;
  top: clamp(0.9rem, 2.5vw, 1.8rem);
  left: clamp(0.9rem, 2.5vw, 1.8rem);
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.gwos-icon {
  display: grid;
  width: 5.6rem;
  justify-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #ffffff;
  min-height: 0;
  padding: 0.4rem 0.25rem;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 400;
  cursor: pointer;
}

.gwos-icon:hover,
.gwos-icon:focus-visible {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(42, 107, 201, 0.35);
  outline: none;
}

.gwos-glyph {
  position: relative;
  display: block;
  width: 3rem;
  height: 3rem;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.35));
}

.gwos-glyph--computer::before {
  position: absolute;
  inset: 0.15rem 0.2rem 0.8rem;
  border: 3px solid #4d6fa7;
  background: linear-gradient(180deg, #cdeaff, #78aee3);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  content: "";
}

.gwos-glyph--computer::after {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.3rem;
  height: 0.42rem;
  background: #becde0;
  box-shadow: 0 -0.32rem 0 -0.08rem #879dba;
  content: "";
}

.gwos-glyph--folder::before {
  position: absolute;
  inset: 0.65rem 0.15rem 0.35rem;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd875, #d58b24);
  content: "";
}

.gwos-glyph--folder::after {
  position: absolute;
  top: 0.42rem;
  left: 0.22rem;
  width: 1.4rem;
  height: 0.65rem;
  border-radius: 3px 3px 0 0;
  background: #f1bd45;
  content: "";
}

.gwos-glyph--bin::before {
  position: absolute;
  left: 0.6rem;
  top: 0.66rem;
  width: 1.85rem;
  height: 2.15rem;
  clip-path: polygon(8% 0, 92% 0, 76% 100%, 24% 100%);
  background: linear-gradient(180deg, #f3fbff, #7ea9c4);
  content: "";
}

.gwos-glyph--bin::after {
  position: absolute;
  left: 0.44rem;
  top: 0.42rem;
  width: 2.16rem;
  height: 0.3rem;
  background: #9bc2da;
  content: "";
}

/* -------------------------------------------------------------- windows */

.gwos-window-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gwos-window {
  position: absolute;
  width: min(26rem, calc(100vw - 1.5rem));
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid #21615d;
  border-radius: 8px 8px 3px 3px;
  background: #ece9d8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 1rem 2.6rem rgba(0, 0, 0, 0.42);
  color: #1c2536;
}

.gwos-window--minimized {
  display: none;
}

.gwos-window--max {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100%;
  border-radius: 0;
}

.gwos-window--dragging {
  opacity: 0.94;
  cursor: grabbing;
}

.gwos-window__titlebar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.9rem;
  background: linear-gradient(
    180deg,
    #0a6cf1 0%,
    #0f61e4 8%,
    #0353cf 42%,
    #024bc2 88%,
    #013fae 100%
  );
  color: #ffffff;
  padding: 0.2rem 0.28rem 0.2rem 0.5rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.gwos-window--inactive .gwos-window__titlebar {
  background: linear-gradient(180deg, #7ba1e4 0%, #7195d4 45%, #6488c7 100%);
}

.gwos-window__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  filter: none;
}

.gwos-window__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}

.gwos-window__controls {
  display: flex;
  flex: none;
  gap: 2px;
}

.gwos-window__button {
  width: 1.45rem;
  min-height: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 3px;
  background: linear-gradient(180deg, #3a81f2, #1f5cd4 45%, #1a51c4);
  color: #ffffff;
  padding: 0;
  position: relative;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.gwos-window__button:hover {
  filter: brightness(1.18);
  border-color: rgba(255, 255, 255, 0.85);
}

.gwos-window__button--min::after,
.gwos-window__button--max::after {
  position: absolute;
  content: "";
}

.gwos-window__button--min::after {
  left: 4px;
  bottom: 4px;
  width: 8px;
  height: 3px;
  background: #ffffff;
}

.gwos-window__button--max::after {
  left: 4px;
  top: 4px;
  width: 11px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top-width: 3px;
}

.gwos-window__button--close {
  background: linear-gradient(180deg, #ee9270, #dc5936 45%, #c33f18);
}

.gwos-window__body {
  min-height: 8.5rem;
  border-top: 1px solid #b8b4a2;
  background: #ffffff;
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.06);
  padding: 1rem 1.1rem;
}

.gwos-copy {
  color: #253147;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
}

/* -------------------------------------------------------------- taskbar */

.gwos-taskbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.5rem;
  height: 40px;
  background: linear-gradient(180deg, #3079f2 0%, #245edb 6%, #1d47ab 86%, #15398f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.gwos-start {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 0;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #7ece5c 0%, #48a234 42%, #2d7d20 100%);
  color: #ffffff;
  padding: 0 1.05rem 0 0.6rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    2px 0 6px rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-size: 1.14rem;
  font-style: italic;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.gwos-start--open,
.gwos-start:active {
  filter: brightness(0.86);
}

.gwos-start__orb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: conic-gradient(
    #e34f2c 0 90deg,
    #7fba28 90deg 180deg,
    #ffb900 180deg 270deg,
    #2e9fd8 270deg 360deg
  );
  box-shadow:
    inset 0 0 3px rgba(255, 255, 255, 0.8),
    0 0 4px rgba(0, 0, 0, 0.4);
}

.gwos-taskbar__tasks {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 0;
}

.gwos-task {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 11.5rem;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(9, 26, 68, 0.4);
  border-radius: 3px;
  background: linear-gradient(180deg, #4a90f5, #2c6ce0 45%, #2258c4);
  color: #ffffff;
  padding: 0 0.7rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 400;
  cursor: pointer;
}

.gwos-task .gwos-glyph {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  filter: none;
}

.gwos-task__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gwos-task--active {
  background: linear-gradient(180deg, #1a48ae, #16409c 55%, #12367f);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.gwos-tray {
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(9, 26, 68, 0.65);
  background: linear-gradient(180deg, #21615d 0%, #74c9c2 8%, #59aca6 55%, #327b77 100%);
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.28);
  padding: 0 0.9rem 0 1.1rem;
}

.gwos-clock {
  color: #ffffff;
  font-family: inherit;
  font-size: 0.76rem;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

/* ----------------------------------------------------------- start menu */

.gwos-start-menu {
  position: absolute;
  left: 0;
  bottom: 40px;
  z-index: 35;
  width: min(24rem, calc(100vw - 1rem));
  overflow: hidden;
  border: 1px solid #21615d;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  box-shadow: 2px -2px 14px rgba(0, 0, 0, 0.45);
  color: #1c2536;
}

.gwos-start-menu[hidden] {
  display: none;
}

.gwos-start-menu__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(180deg, #1b62d6 0%, #0f52c4 50%, #0a45ab 100%);
  color: #ffffff;
  padding: 0.55rem 0.7rem;
}

.gwos-start-menu__avatar {
  width: 2.2rem;
  height: 2.2rem;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, #ffe680, #f5b93f 65%, #d78f1f);
}

.gwos-start-menu__user {
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
}

.gwos-start-menu__columns {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  min-height: 13rem;
}

.gwos-start-menu__programs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #ffffff;
  padding: 0.5rem 0.35rem;
}

.gwos-start-menu__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #1c2536;
  padding: 0.42rem 0.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.gwos-start-menu__item:hover {
  background: #21615d;
  color: #ffffff;
}

.gwos-start-menu__item .gwos-glyph {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  filter: none;
}

.gwos-start-menu__tagline {
  margin-top: auto;
  color: #8b90a0;
  padding: 0.6rem 0.5rem 0.2rem;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
}

.gwos-start-menu__places {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-left: 1px solid #95bdee;
  background: #d3e5fa;
  color: #14336e;
  padding: 0.7rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.gwos-start-menu__places hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #95bdee;
  margin: 0.15rem 0;
}

.gwos-start-menu__place {
  cursor: default;
}

.gwos-start-menu__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  background: linear-gradient(180deg, #1b62d6 0%, #0f52c4 60%, #0a45ab 100%);
  padding: 0.42rem 0.6rem;
}

.gwos-start-menu__power {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #ffffff;
  padding: 0.32rem 0.5rem;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
}

.gwos-start-menu__power:hover {
  background: rgba(255, 255, 255, 0.18);
}

.gwos-power-glyph {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  flex: none;
}

.gwos-power-glyph--logoff {
  background: radial-gradient(circle at 34% 32%, #ffd98a, #e9a03b 70%);
}

.gwos-power-glyph--shutdown {
  background: radial-gradient(circle at 34% 32%, #ff9d80, #d84322 70%);
}

.world-hint {
  appearance: none;
  position: fixed;
  z-index: 7;
  bottom: clamp(1rem, 3vw, 2rem);
  left: 50%;
  margin: 0;
  border: 0;
  padding: 0;
  background: none;
  transform: translateX(-50%);
  font: inherit;
  color: rgba(234, 248, 245, 0.62);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 480ms ease;
}

body[data-view="world"] .world-hint[data-visible="true"] {
  opacity: 1;
}

@media (max-width: 640px), (pointer: coarse) {
  body:not([data-mobile-world="true"]) .world-hint {
    top: max(0.8rem, env(safe-area-inset-top));
    bottom: auto;
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(5, 8, 10, 0.48);
    color: rgba(240, 248, 246, 0.76);
    font-size: 0.68rem;
    letter-spacing: 0.055em;
    text-align: center;
    backdrop-filter: blur(8px);
  }

  body:not([data-mobile-world="true"]) .world-hint[data-actionable="true"] {
    cursor: pointer;
    pointer-events: auto;
  }

  body:not([data-mobile-world="true"]) .world-hint[data-actionable="true"]:active {
    transform: translateX(-50%) scale(0.97);
  }
}

.transition-wash {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: block;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition:
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.transition-wash::before,
.transition-wash::after {
  content: "";
  display: none;
}

body[data-transition="covering"] .transition-wash {
  opacity: 1;
  pointer-events: none;
  transform: scale(1.02);
}

body[data-transition="covering"][data-view="landing"] .unicorn-scene {
  filter: brightness(1.32) blur(1.5px);
  transform: scale(1.12);
}

body[data-transition="revealing"] .transition-wash {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .stage-shell,
  .world-page,
  .transition-wash {
    transition-duration: 1ms;
  }

  .transition-wash::before {
    animation: none;
  }
}

@media (max-width: 640px) {
  body {
    overflow: hidden;
  }

  .stage-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  /* Give the Unicorn scene a desktop-like landscape canvas on portrait
     phones (center-cropped) so the goudaworld text lays out correctly
     instead of collapsing in a narrow canvas. */
  .unicorn-scene {
    left: 50%;
    right: auto;
    width: max(100vw, 152svh);
    height: 100dvh;
    min-height: 100dvh;
    transform: translateX(-50%);
  }

  body[data-transition="covering"][data-view="landing"] .unicorn-scene {
    transform: translateX(-50%) scale(1.65);
  }

  .loader-panel {
    right: 1rem;
    bottom: 1rem;
  }

  .brand-hotspot {
    width: min(46vw, 180px);
    height: 48px;
  }

  .world-bg-video {
    display: none;
  }

  body[data-mobile-world-state="focused"] .mobile-pc-rig {
    top: 50%;
    left: 50%;
    width: min(145vw, 880px);
    transform: translate3d(
      var(--mobile-screen-focus-x),
      var(--mobile-screen-focus-y),
      0
    );
    filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.48));
  }

  body[data-mobile-world-state="focused"] .mobile-pc-hit {
    pointer-events: none;
  }

  body[data-mobile-world="true"][data-view="world"][data-mobile-world-state="zooming"]
    .mobile-world-scene,
  body[data-mobile-world="true"][data-view="world"][data-mobile-world-state="desktop"]
    .mobile-world-scene {
    opacity: 0;
    pointer-events: none;
  }

  body[data-mobile-world-state="zooming"] .mobile-screen-welcome,
  body[data-mobile-world-state="desktop"] .mobile-screen-welcome {
    opacity: 1;
  }

  .gwos-icon {
    width: 4.6rem;
    font-size: 0.68rem;
  }

  .gwos-glyph {
    width: 2.5rem;
    height: 2.5rem;
  }

  .gwos-window {
    width: calc(100vw - 1rem);
  }

  .gwos-start {
    font-size: 0.98rem;
    padding: 0 0.8rem 0 0.5rem;
  }

  .gwos-start-menu__columns {
    grid-template-columns: 1fr;
  }

  .gwos-start-menu__places {
    display: none;
  }
}
