:root {
  --bg: #0d0f14;
  --bg2: #18111a;
  --ink: #f4eee9;
  --line: rgba(255, 112, 148, 0.38);
  --accent: #f64c70;
  --accent2: #00e5ff;
  --cursor-default: url("icons/cursor-retro.svg") 6 4, auto;
  --cursor-pointer: url("icons/cursor-retro-pointer.svg") 6 4, pointer;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Courier New", "Liberation Mono", monospace;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(246, 76, 112, 0.22), transparent 36%),
    radial-gradient(circle at 90% 20%, rgba(0, 229, 255, 0.16), transparent 34%),
    linear-gradient(145deg, var(--bg), var(--bg2));
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
  animation: scan 7s linear infinite;
}

.topbar {
  width: min(1180px, calc(100vw - 1.4rem));
  margin: 0.8rem auto 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(11, 11, 14, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  gap: 0.65rem;
}

.brand {
  margin: 0;
  font-size: 0.83rem;
  letter-spacing: 0.15em;
  color: #ffafc0;
}

nav,
.controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

a {
  text-decoration: none;
}

nav a,
button {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(20, 12, 18, 0.78);
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

nav a[aria-current="page"] {
  border-color: #ffc5d2;
  box-shadow: 0 0 18px rgba(246, 76, 112, 0.34);
}

label,
#camera-status {
  font-size: 0.82rem;
}

input[type="range"] {
  width: 160px;
  accent-color: var(--accent);
}

.scene {
  width: min(1180px, calc(100vw - 1.4rem));
  margin: 0.7rem auto;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.4vw, 2.7rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scene p {
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
  color: #d7d0cb;
}

.grid-zone {
  position: relative;
  height: calc(100vh - 14.8rem);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.9), rgba(17, 11, 16, 0.9));
  overflow: hidden;
}

.cam-tile {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 196, 215, 0.28);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
  background: #07080d;
}

.cam-tile video,
.cam-tile canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cam-tile video {
  object-fit: cover;
  filter: contrast(1.24) saturate(1.32) brightness(0.92);
}

.grid-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(246, 76, 112, 0.08), rgba(0, 229, 255, 0.08));
  mix-blend-mode: screen;
}

body.glitch .grid-zone::after {
  animation: jump 260ms steps(2) infinite;
}

@keyframes jump {
  0% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-6px);
  }
  66% {
    transform: translateX(7px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes scan {
  0% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(12px);
  }
}

@media (max-width: 700px) {
  .grid-zone {
    height: calc(100vh - 16rem);
  }

  .topbar {
    margin-top: 0.45rem;
  }
}

/* Desktop style for first page */
body.desktop-home {
  font-family: "Lucida Sans Typewriter", "Courier New", monospace;
  color: #f2f7ff;
  background-image: url("../icons/fundo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2f73de;
  image-rendering: auto;
  filter: saturate(0.9) contrast(0.95);
  cursor: var(--cursor-default);
  overflow-x: hidden;
  overflow-y: auto;
}

body.desktop-home * {
  cursor: var(--cursor-default);
}

body.desktop-home a,
body.desktop-home button,
body.desktop-home input,
body.desktop-home label,
body.desktop-home .storm-cell,
body.desktop-home .desktop-icon,
body.desktop-home .os-dock a {
  cursor: var(--cursor-pointer);
}

body.desktop-home::before {
  content: none;
}

body.desktop-home::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      70deg,
      rgba(255, 227, 121, 0.12) 0 1px,
      transparent 1px 10px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.06) 0 1px,
      transparent 1px 3px
    ),
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.28) 100%);
  mix-blend-mode: screen;
  opacity: 0.52;
}

body.desktop-overlay::before {
  content: none;
}

body.app-page {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(160deg, #06090f, #120b13);
  color: #f4eee9;
}

body.app-page::before {
  content: none;
}

.app-shell {
  height: 100dvh;
  padding: 0.6rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.45rem;
}

.app-shell h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vw, 1.7rem);
}

.app-shell > p {
  margin: 0;
  color: #d9d1cc;
  font-size: 0.86rem;
}

body.app-page .home-camera-window {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
}

body.app-page .grid-zone {
  height: 100%;
  border: 0;
}

body.desktop-overlay {
  background-image: url("fundo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2f73de;
  overflow: auto;
}

.popup-stage {
  min-height: 100dvh;
  padding: 1rem;
  display: grid;
  place-items: center;
}

.popup-window {
  width: min(1160px, calc(100vw - 1rem));
  height: min(760px, calc(100dvh - 1rem));
  min-width: 320px;
  min-height: 360px;
  max-width: calc(100vw - 0.5rem);
  max-height: calc(100dvh - 0.5rem);
  border: 1px solid rgba(198, 226, 255, 0.8);
  background: rgba(8, 13, 20, 0.74);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: auto;
  resize: both;
}

.popup-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.42rem 0.6rem;
  margin: 0;
  background: linear-gradient(180deg, rgba(35, 95, 180, 0.95), rgba(25, 66, 140, 0.95));
  border-bottom: 1px solid rgba(223, 239, 255, 0.45);
}

.popup-titlebar p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.window-actions a {
  text-decoration: none;
  color: #f7fbff;
  border: 1px solid rgba(236, 246, 255, 0.75);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(30, 84, 157, 0.6);
}

.desktop-overlay .topbar {
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 12, 16, 0.8);
}

.desktop-overlay .scene {
  width: 100%;
  margin: 0;
  padding: 0.8rem;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.desktop-overlay .grid-zone {
  height: 100%;
  min-height: 0;
}

.desktop-overlay .home-camera-window {
  grid-column: 1;
  grid-row: 3;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
}

.desktop-overlay .home-camera-window .grid-zone {
  border: 0;
}

.desktop-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.os-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.6rem;
  background: linear-gradient(180deg, rgba(22, 34, 47, 0.96), rgba(18, 26, 36, 0.95));
  border-bottom: 2px solid rgba(164, 186, 209, 0.45);
  font-size: 0.72rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
  letter-spacing: 0.01em;
}

.os-left,
.os-right {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e8f4ff;
  box-shadow: 0 0 10px rgba(236, 245, 255, 0.7);
}

.desktop-area {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
}

.icons-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.62rem;
  align-content: start;
}

.desktop-icon {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: #eef8ff;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
}

.desktop-icon:hover,
.desktop-icon[aria-current="page"] {
  background: transparent;
  transform: translateY(-1px);
}

.icon-box {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 2px solid rgba(225, 231, 238, 0.76);
  background: rgba(121, 141, 165, 0.45);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset -1px -1px 0 rgba(52, 61, 73, 0.5);
  font-size: 2rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.icon-box img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.icon-box img.icon-corrupta {
  transform: translateY(-4px) scale(1.16);
}

.desktop-icon span:last-child {
  font-size: 0.95rem;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.01em;
}

.desktop-note {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  margin-top: 0.4rem;
  margin-right: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(226, 240, 255, 0.5);
  background: rgba(20, 48, 80, 0.24);
  font-size: 0.8rem;
}

.desktop-note p {
  margin: 0;
}

.desktop-note {
  display: none;
}

.desktop-windows {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.app-window {
  position: fixed;
  border: 1px solid rgba(202, 230, 255, 0.72);
  background: rgba(8, 13, 20, 0.9);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  resize: both;
  min-width: 420px;
  min-height: 300px;
  max-width: 96vw;
  max-height: 92vh;
  pointer-events: auto;
}

.app-window[hidden] {
  display: none;
}

.app-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.38rem 0.5rem;
  background: linear-gradient(180deg, rgba(35, 95, 180, 0.95), rgba(25, 66, 140, 0.95));
  border-bottom: 1px solid rgba(223, 239, 255, 0.45);
  cursor: move;
  user-select: none;
}

.app-titlebar p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.app-controls {
  display: flex;
  gap: 0.35rem;
}

.app-controls button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 246, 255, 0.75);
  background: rgba(30, 84, 157, 0.62);
  color: #f7fbff;
  padding: 0;
}

.app-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #020306;
}

.home-camera-window {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
  border: 1px solid rgba(231, 244, 255, 0.72);
  background: rgba(6, 12, 20, 0.62);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.home-camera-title {
  margin: 0;
  padding: 0.42rem 0.55rem;
  background: linear-gradient(180deg, rgba(35, 95, 180, 0.95), rgba(25, 66, 140, 0.95));
  border-bottom: 1px solid rgba(223, 239, 255, 0.45);
}

.home-camera-title p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.home-controls {
  padding: 0.45rem 0.6rem;
  background: rgba(10, 16, 26, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.desktop-home .home-camera-window .grid-zone {
  height: 100%;
  min-height: 0;
  border: 0;
}

.os-dock {
  width: min(780px, calc(100vw - 0.9rem));
  margin: 0 auto 0.3rem;
  padding: 0.4rem 0.52rem;
  border: 2px solid rgba(229, 237, 246, 0.76);
  background: rgba(126, 147, 111, 0.82);
  backdrop-filter: blur(1px);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.os-dock a {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #f4fbff;
  font-size: 1.32rem;
  border: 2px solid rgba(216, 230, 244, 0.76);
  background: rgba(98, 122, 149, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.os-dock a img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.os-dock a img.icon-corrupta {
  transform: translateY(-2px) scale(1.12);
}

.os-dock a:hover,
.os-dock a[aria-current="page"] {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255, 255, 255, 0.33);
}

.desktop-icon.active,
.os-dock a.active {
  border-color: rgba(229, 244, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.desktop-icon.active .icon-box,
.desktop-icon:hover .icon-box {
  box-shadow: 0 0 0 2px rgba(241, 248, 255, 0.55);
}

@media (max-width: 720px) {
  .desktop-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .os-topbar {
    padding: 0.26rem 0.42rem;
    gap: 0.35rem;
    font-size: 0.66rem;
  }

  .os-left {
    gap: 0.45rem;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 72vw;
  }

  .os-right {
    gap: 0.35rem;
  }

  .packet-experience {
    padding: 0.35rem;
    place-items: stretch;
    overflow: auto;
  }

  .packet-window {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 7.2rem);
    max-height: none;
    overflow: auto;
  }

  .packet-controls {
    gap: 0.45rem;
  }

  .desktop-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 0.9rem;
    padding: 0.45rem 0.5rem;
  }

  .desktop-note {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-right: 0;
  }

  .desktop-windows {
    position: fixed;
    inset: 0;
  }

  .icons-column {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .icon-box {
    width: 78px;
    height: 78px;
  }

  .icon-box img {
    width: 56px;
    height: 56px;
  }

  .os-dock {
    width: calc(100vw - 0.35rem);
    margin: 0 auto 0.2rem;
    padding: 0.34rem;
    justify-content: flex-start;
    gap: 0.36rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .os-dock a {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
  }

  .os-dock a img {
    width: 40px;
    height: 40px;
  }

  .app-window {
    min-width: 0;
    min-height: 180px;
    max-width: 100vw;
    max-height: 100dvh;
    resize: none;
  }

  .popup-stage {
    padding: 0.45rem;
  }

  .popup-window {
    width: calc(100vw - 0.35rem);
    height: calc(100dvh - 0.35rem);
    max-height: calc(100dvh - 0.35rem);
    min-width: 0;
    min-height: 0;
    resize: none;
  }

  .desktop-overlay .grid-zone {
    height: 100%;
  }
}

.fake-news-page {
  background: radial-gradient(circle at 20% 0%, rgba(255, 70, 90, 0.2), transparent 34%), #0e0a10;
}

.fake-shell {
  grid-template-rows: auto auto 1fr auto;
  gap: 0.6rem;
}

.news-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  min-height: 0;
  align-items: stretch;
}

.news-card {
  border: 1px solid rgba(255, 140, 166, 0.5);
  background: linear-gradient(180deg, rgba(30, 10, 16, 0.86), rgba(16, 9, 13, 0.86));
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.news-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.news-card p {
  margin: 0;
  color: #d8cbcf;
  font-size: 0.84rem;
}

.tag {
  display: inline-block;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #ffb6c6;
}

.belief-btn {
  border: 1px solid rgba(255, 168, 188, 0.65);
  background: rgba(255, 89, 124, 0.2);
  color: #ffe5eb;
  font: inherit;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  margin-top: auto;
}

.belief-btn.checked {
  background: rgba(113, 209, 255, 0.2);
  border-color: rgba(137, 224, 255, 0.72);
}

.truth-strip {
  border: 1px dashed rgba(248, 212, 223, 0.58);
  padding: 0.45rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
}

.truth-strip p {
  margin: 0;
  font-size: 0.9rem;
}

.music-toggle {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 70;
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f1ecea, #bfb7b0);
  color: #22202a;
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
  padding: 0.24rem 0.52rem;
  font: inherit;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .news-wall {
    grid-template-columns: 1fr;
  }

  .music-toggle {
    right: 6px;
    bottom: 6px;
    font-size: 0.72rem;
  }
}

.top-link {
  color: #eef8ff;
  text-decoration: none;
  border: 2px solid rgba(230, 242, 255, 0.55);
  padding: 0.18rem 0.5rem;
  background: rgba(56, 81, 114, 0.62);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 0.22rem;
}

.packet-head .window-controls {
  position: absolute;
  top: 0.52rem;
  right: 0.58rem;
}

.wc-btn {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  color: #f6f8ff;
  border: 1px solid rgba(225, 238, 255, 0.72);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset -1px -1px 0 rgba(38, 46, 58, 0.7);
  background: linear-gradient(180deg, rgba(69, 94, 126, 0.95), rgba(45, 63, 88, 0.95));
}

.wc-close {
  border-color: rgba(255, 196, 202, 0.8);
  background: linear-gradient(180deg, rgba(173, 84, 101, 0.95), rgba(117, 45, 60, 0.95));
}

.packet-experience {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0.45rem;
  overflow: hidden;
}

.packet-window {
  position: relative;
  width: min(1100px, 100%);
  height: 100%;
  max-height: 100%;
  border: 3px solid rgba(225, 232, 241, 0.84);
  background: rgba(165, 155, 145, 0.76);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.5),
    inset 1px 1px 0 rgba(255, 255, 255, 0.4),
    inset -2px -2px 0 rgba(78, 79, 88, 0.5);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.fake-window {
  grid-template-rows: auto 1fr auto;
}

.packet-head {
  position: relative;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid rgba(170, 178, 190, 0.72);
  background: linear-gradient(180deg, rgba(244, 229, 224, 0.95), rgba(197, 181, 174, 0.95));
  color: #2a2530;
}

.packet-head h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.8vw, 1.8rem);
}

.packet-head p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #2f2b2d;
}

.packet-controls {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(164, 171, 182, 0.75);
  background: linear-gradient(180deg, rgba(224, 213, 207, 0.95), rgba(176, 164, 157, 0.95));
  color: #2a2630;
}

#packet-progress {
  width: 160px;
  height: 12px;
}

#packet-status {
  margin: 0;
  font-size: 0.82rem;
}

.packet-grid {
  position: relative;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  overflow: auto;
}

.packet-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, calc(var(--packet-noise, 35%) / 2200)) 0 1px,
    transparent 1px 3px
  );
}

.packet-card {
  text-align: left;
  border: 1px solid rgba(194, 223, 255, 0.5);
  background: rgba(13, 28, 47, 0.7);
  color: #eef7ff;
  padding: 0.55rem;
  display: grid;
  gap: 0.32rem;
  cursor: pointer;
}

.packet-card.is-corrupted {
  border-color: rgba(255, 147, 175, 0.78);
  background: rgba(57, 17, 28, 0.74);
}

.packet-card.active {
  border: 2px solid rgba(0, 0, 0, 0.74);
  background: rgba(56, 1, 1, 0.763);
  transform: scale(1.05);
}

.packet-id {
  font-size: 0.74rem;
  color: #c6dbf2;
}

.packet-code {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.packet-state {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: #d4cad0;
}

@media (max-width: 860px) {
  .packet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.storm-layout {
  min-height: 0;
  height: 100%;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0.65rem;
  overflow: hidden;
}
.virus-groupbox{
border:2px solid #9aa0a6;
padding:12px;
background:#e6e6e6;
margin-top:10px;
}

.virus-groupbox legend{
padding:0 6px;
font-weight:bold;
color:#333;
}

#virus-log{
color:#000;
font-family:monospace;
font-size:14px;
max-height:200px;
overflow:auto;
}

#virus-log p{
margin:2px 0;
}

.storm-board {
  min-height: 0;
  height: 100%;
  border: 3px solid rgba(132, 136, 145, 0.95);
  background: rgba(192, 194, 200, 0.9);
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
}

.storm-cell {
  border-top: 2px solid rgba(248, 251, 255, 0.9);
  border-left: 2px solid rgba(248, 251, 255, 0.9);
  border-right: 2px solid rgba(110, 115, 124, 0.95);
  border-bottom: 2px solid rgba(110, 115, 124, 0.95);
  background: rgba(212, 214, 220, 0.96);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
  color: #17213b;
  min-height: 0;
}

.storm-icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  margin: auto;
  pointer-events: none;
}

.storm-cell.clean:hover {
  border-color: rgba(116, 120, 130, 0.95);
}

.storm-cell.patch {
  background: linear-gradient(160deg, rgba(114, 229, 186, 0.85), rgba(23, 121, 88, 0.8));
  border-color: rgba(170, 244, 213, 0.88);
}

.storm-cell.corrupt {
  background: linear-gradient(160deg, rgba(255, 106, 133, 0.9), rgba(148, 22, 57, 0.92));
  border-color: rgba(255, 172, 193, 0.88);
  animation: pulse-corrupt 0.7s ease-in-out infinite alternate;
}

.storm-cell.clean {
  border-top: 1px solid rgba(169, 173, 181, 0.7);
  border-left: 1px solid rgba(169, 173, 181, 0.7);
  border-right: 1px solid rgba(169, 173, 181, 0.7);
  border-bottom: 1px solid rgba(169, 173, 181, 0.7);
  background: rgba(233, 234, 238, 0.98);
}

.storm-cell.core {
  box-shadow: inset 0 0 0 2px rgba(148, 211, 255, 0.8);
}

.storm-side {
  border: 2px solid rgba(153, 158, 170, 0.88);
  background: rgba(228, 220, 212, 0.78);
  padding: 0.6rem;
  font-size: 0.85rem;
  color: #2a2730;
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.storm-side p {
  margin: 0;
}

.storm-tip {
  margin-top: 0.35rem;
  color: #3e383f;
  line-height: 1.35;
}

body.desktop-home button,
body.desktop-home .packet-controls button {
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f1ecea, #bfb7b0);
  color: #22202a;
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

@keyframes pulse-corrupt {
  from {
    filter: brightness(0.95);
  }
  to {
    filter: brightness(1.2);
  }
}

@media (max-width: 900px) {
  .storm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .storm-board {
    min-height: 300px;
  }
}

.binary-stage {
  min-height: 0;
  height: 100%;
  border-top: 1px solid rgba(223, 239, 255, 0.35);
  background: #efefef;
  overflow: hidden;
}

#binary-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #efefef;
}

.narrative-layout {
  min-height: 0;
  height: 100%;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  gap: 0.72rem;
  overflow: hidden;
  padding-bottom: 4.2rem;
}

.narrative-editor,
.narrative-panel {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(226, 218, 209, 0.84);
  padding: 0.65rem;
  color: #2a2630;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-height: 0;
  overflow: auto;
}

.narrative-panel {
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.narrative-editor label {
  font-size: 0.83rem;
}

.narrative-editor textarea,
.narrative-editor select {
  width: 100%;
  border: 1px solid #7c7f87;
  background: #f7f2ef;
  color: #2a2630;
  font: inherit;
  padding: 0.35rem;
}

.narrative-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.narrative-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f3efec, #c8c1bb);
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
  display: inline-grid;
  place-content: center;
}

.narrative-check input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 120ms ease-in-out;
  background: linear-gradient(180deg, #5ea9e8, #2f6eb8);
}

.narrative-check input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.narrative-panel h2 {
  margin: 0;
  font-size: 0.95rem;
}

.narrative-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.83rem;
}

.rumor-preview {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(241, 236, 230, 0.88);
  padding: 0.5rem;
  display: grid;
  gap: 0.3rem;
}

.rumor-preview p {
  margin: 0;
  color: #2a2630;
}

.rumor-preview #rumor-headline {
  font-weight: 700;
}

#rumor-feedback {
  margin: 0;
}

#rumor-feed {
  margin: 0;
  padding: 0.2rem 0.1rem 0.2rem 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.publish-corner {
  min-width: 180px;
}

.boato-bottom-controls {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.boato-btn {
  border: 2px solid #6e6871;
  background:
    linear-gradient(180deg, rgba(255, 238, 229, 0.96), rgba(199, 186, 178, 0.95)),
    repeating-linear-gradient(90deg, rgba(25, 22, 29, 0.08) 0 1px, transparent 1px 3px);
  color: #241f29;
  box-shadow:
    inset 1px 1px 0 rgba(255, 250, 244, 0.95),
    inset -1px -1px 0 rgba(93, 87, 97, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.boato-btn:hover {
  filter: brightness(1.04) contrast(1.03);
}

.boato-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset -1px -1px 0 rgba(255, 250, 244, 0.65),
    inset 1px 1px 0 rgba(72, 67, 76, 0.9);
}

.boato-publish {
  min-width: 210px;
  border-color: #7f4d67;
  background:
    linear-gradient(180deg, rgba(255, 218, 229, 0.97), rgba(206, 162, 176, 0.95)),
    repeating-linear-gradient(90deg, rgba(58, 22, 40, 0.08) 0 1px, transparent 1px 3px);
}

.rumor-item {
  color: #4e2330;
}

.rumor-item-check {
  color: #174231;
}

.rumor-pop {
  border: 2px solid #8a8f99;
  background: linear-gradient(180deg, rgba(237, 231, 223, 0.98), rgba(224, 216, 206, 0.98));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.78),
    inset -1px -1px 0 rgba(93, 98, 110, 0.78),
    0 2px 0 rgba(72, 74, 84, 0.25);
}

.rumor-pop-title {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.75rem;
  padding: 0.28rem 0.52rem;
  color: #f2f7ff;
  border-bottom: 1px solid rgba(165, 186, 209, 0.7);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(73, 96, 132, 0.98), rgba(54, 72, 101, 0.98));
  letter-spacing: 0.02em;
}

.rumor-pop-title::after {
  content: "x";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 1px solid rgba(234, 240, 251, 0.85);
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  color: #f4f8ff;
  background: rgba(35, 54, 82, 0.7);
}

.rumor-pop-body {
  margin: 0;
  padding: 0.52rem 0.58rem 0.58rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

#rumor-feedback {
  min-height: 48px;
  display: grid;
  align-content: center;
}

.rumor-preview {
  min-height: 168px;
  align-content: start;
}

.rumor-item .rumor-pop-body {
  color: #5a2633;
}

.rumor-item-check .rumor-pop-body {
  color: #1e513b;
}

.narrative-layout .packet-controls,
.narrative-editor .packet-controls {
  border-top: 0;
}

.packet-window .packet-controls button,
.packet-window .packet-controls select,
.packet-window .packet-controls input[type="range"] {
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f1ecea, #bfb7b0);
  color: #22202a;
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.packet-window .packet-controls button:hover {
  filter: brightness(1.05);
}

.packet-window .packet-controls label {
  color: #f2f7ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.narrative-editor select,
.narrative-editor input[type="range"] {
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f3efec, #c8c1bb);
  color: #24212a;
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.narrative-editor select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #3a3540 50%),
    linear-gradient(135deg, #3a3540 50%, transparent 50%),
    linear-gradient(180deg, #f3efec, #c8c1bb);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 10px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

.narrative-editor input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  padding: 0;
}

.narrative-editor input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid #3f6e99;
  background: linear-gradient(90deg, rgba(97, 167, 227, 0.95), rgba(54, 117, 184, 0.92));
  border-radius: 999px;
}

.narrative-editor input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px;
  width: 20px;
  height: 20px;
  border: 2px solid #7d7b84;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2eeeb, #c7c0b9);
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.narrative-editor input[type="range"]::-moz-range-track {
  height: 10px;
  border: 1px solid #3f6e99;
  background: linear-gradient(90deg, rgba(97, 167, 227, 0.95), rgba(54, 117, 184, 0.92));
  border-radius: 999px;
}

.narrative-editor input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #7d7b84;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2eeeb, #c7c0b9);
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.echo-layout {
  min-height: 0;
  height: 100%;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0.6rem;
  overflow: hidden;
}

.echo-feed {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
}

.echo-card {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(228, 222, 214, 0.84);
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.echo-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #2a2630;
}

.echo-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #3d3640;
}

.echo-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.echo-shared {
  border-color: rgba(190, 101, 124, 0.9);
  background: rgba(214, 171, 178, 0.82);
}

.echo-checked {
  border-color: rgba(92, 142, 120, 0.9);
  background: rgba(171, 207, 184, 0.82);
}

.echo-panel {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(220, 212, 202, 0.84);
  padding: 0.6rem;
  color: #2a2630;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.echo-panel h2 {
  margin: 0;
  font-size: 0.95rem;
}

.echo-bar-wrap p {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
}

.echo-bar {
  width: 100%;
  height: 14px;
  border: 1px solid #6a6d73;
  background: #d9d8d8;
}

.echo-bar span {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #47627c, #7aa0c2);
}

.detector-window {
  grid-template-rows: auto auto 1fr;
}

.detector-status-line p {
  margin: 0;
}

.detector-layout {
  min-height: 0;
  height: 100%;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0.65rem;
  overflow: hidden;
  padding-bottom: 4.2rem;
}

.detector-editor,
.detector-panel {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(226, 218, 209, 0.84);
  padding: 0.6rem;
  color: #2a2630;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 0;
  overflow: auto;
}

.detector-editor input,
.detector-editor textarea {
  width: 100%;
  border: 2px solid #7d7b84;
  background: linear-gradient(180deg, #f3efec, #c8c1bb);
  color: #24212a;
  font: inherit;
  padding: 0.35rem;
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.detector-note {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #3a3540;
}

#detector-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
  min-height: 0;
  overflow: auto;
}

.detector-log-item {
  padding: 0.36rem 0.42rem;
  border: 1px solid rgba(136, 140, 151, 0.75);
  background: rgba(243, 239, 234, 0.9);
  font-size: 0.8rem;
}

.detector-ok {
  border-left: 4px solid rgba(66, 136, 98, 0.95);
}

.detector-warn {
  border-left: 4px solid rgba(169, 79, 100, 0.95);
}

.detector-bottom-controls {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.telepathy-modal {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  background: rgba(7, 11, 18, 0.52);
}

.telepathy-modal[hidden] {
  display: none !important;
}

.telepathy-box {
  width: min(540px, calc(100% - 1rem));
  border: 2px solid rgba(173, 188, 207, 0.9);
  background: rgba(226, 218, 209, 0.98);
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.45),
    inset 1px 1px 0 rgba(255, 255, 255, 0.45),
    inset -1px -1px 0 rgba(86, 93, 104, 0.6);
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
  color: #2a2530;
}

.telepathy-box h2,
.telepathy-box p {
  margin: 0;
}

.telepathy-meter {
  width: 100%;
  height: 18px;
  border: 2px solid #7d7b84;
  background: rgba(233, 231, 227, 0.9);
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.telepathy-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(74, 148, 210, 0.95), rgba(47, 103, 171, 0.92));
  transition: width 120ms linear;
}

.telepathy-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.radar-window {
  grid-template-rows: auto auto 1fr auto auto;
}

.radar-layout {
  min-height: 0;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0.6rem;
  overflow: hidden;
}

.radar-cam,
.radar-side,
.radar-claim,
.radar-log-wrap {
  border: 2px solid rgba(145, 150, 160, 0.9);
  background: rgba(226, 218, 209, 0.84);
  color: #2a2630;
}

.radar-cam {
  padding: 0.5rem;
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-height: 0;
}

.radar-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 2px solid #7d7b84;
  background: #0b1018;
  overflow: hidden;
}

.radar-frame video,
.radar-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.radar-tip {
  margin: 0;
  font-size: 0.8rem;
  color: #3a3540;
}

.radar-side {
  padding: 0.6rem;
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.radar-side h2,
.radar-claim h2,
.radar-log-wrap h2 {
  margin: 0;
}

.radar-meter {
  height: 16px;
  border: 2px solid #7d7b84;
  background: rgba(238, 235, 232, 0.9);
  box-shadow:
    inset 1px 1px 0 #fffaf4,
    inset -1px -1px 0 #67626a;
}

.radar-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(84, 167, 232, 0.95), rgba(46, 106, 178, 0.93));
  transition: width 140ms linear;
}

.radar-side p {
  margin: 0;
}

.radar-claim,
.radar-log-wrap {
  margin: 0 0.6rem;
  padding: 0.55rem;
}

.radar-claim {
  display: grid;
  gap: 0.35rem;
}

.radar-claim p {
  margin: 0;
}

.radar-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.radar-log-wrap {
  min-height: 0;
  margin-bottom: 0.6rem;
}

#radar-log {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  max-height: 120px;
  overflow: auto;
  font-size: 0.8rem;
}

#radar-log li {
  border: 1px solid rgba(140, 146, 158, 0.8);
  background: rgba(245, 241, 236, 0.9);
  padding: 0.3rem 0.38rem;
}

@media (max-width: 920px) {
  .packet-experience {
    place-items: stretch;
    overflow: auto;
  }

  .packet-window {
    height: auto;
    min-height: calc(100dvh - 8rem);
    max-height: none;
    overflow: auto;
  }

  .echo-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .narrative-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding-bottom: 4.8rem;
  }

  .detector-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding-bottom: 4.8rem;
  }

  .detector-bottom-controls {
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.55rem;
    justify-content: center;
  }

  .radar-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .radar-actions {
    justify-content: center;
  }

  .boato-bottom-controls {
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.55rem;
    justify-content: center;
  }

  #rumor-feed {
    max-height: 420px;
  }
}