/* ==========================================================================
   Retro desktop memecoin site — styles
   ========================================================================== */

:root {
  --face: #c0c0c0;
  --light: #ffffff;
  --hi: #dfdfdf;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --green: #39ff14;
  --tb: 30px; /* taskbar height */

  --ui: Tahoma, Verdana, "Segoe UI", Geneva, sans-serif;
  --mono: "VT323", "Courier New", ui-monospace, monospace;
  --block: "Luckiest Guy", "Lilita One", Impact, "Arial Black", sans-serif;

  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
  --pressed: inset -1px -1px var(--light), inset 1px 1px var(--dark), inset -2px -2px var(--hi), inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px var(--light), inset 1px 1px var(--shadow), inset -2px -2px var(--hi), inset 2px 2px var(--dark);
  --checker: repeating-conic-gradient(#ffffff 0 25%, #c0c0c0 0 50%) 0 0 / 2px 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #000;
  color: #000;
  font: 12px/1.3 var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Win98 primitives ---------- */
.w98-sunken { box-shadow: var(--sunken); }

.w98-btn {
  display: inline-block;
  background: var(--face);
  border: 0;
  border-radius: 0;
  box-shadow: var(--raised);
  padding: 4px 12px;
  color: #000;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.w98-btn:active, .w98-btn.is-down {
  box-shadow: var(--pressed);
  padding-top: 5px; padding-bottom: 3px; padding-left: 13px; padding-right: 11px;
}
.w98-btn[aria-pressed="true"] {
  box-shadow: var(--pressed);
  background: var(--checker);
}
.w98-btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.w98-btn.tiny { font: bold 11px var(--ui); padding: 2px 7px; }
.w98-btn.tiny:active { padding: 3px 6px 1px 8px; }

/* range slider */
input.w98-range {
  -webkit-appearance: none; appearance: none;
  background: transparent; height: 24px; margin: 0; cursor: pointer;
}
input.w98-range:focus { outline: none; }
input.w98-range:focus-visible { outline: 1px dotted #000; }
input.w98-range::-webkit-slider-runnable-track {
  height: 4px; background: var(--face);
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px var(--hi);
}
input.w98-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 21px; margin-top: -9px;
  background: var(--face); border: 0; border-radius: 0; box-shadow: var(--raised);
}
input.w98-range::-moz-range-track {
  height: 4px; background: var(--face); border: 0;
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px var(--hi);
}
input.w98-range::-moz-range-thumb {
  width: 11px; height: 21px; background: var(--face); border: 0; border-radius: 0; box-shadow: var(--raised);
}

/* Win98-ish scrollbars (WebKit/Blink) */
.desktop ::-webkit-scrollbar, .desktop::-webkit-scrollbar { width: 16px; height: 16px; }
.desktop ::-webkit-scrollbar-track, .desktop::-webkit-scrollbar-track { background: var(--checker); }
.desktop ::-webkit-scrollbar-thumb, .desktop::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
.desktop::-webkit-scrollbar-track { background: rgba(0,0,0,.4); }
.desktop::-webkit-scrollbar-thumb { background: rgba(57,255,20,.25); box-shadow: none; }

/* ---------- Block-letter logo (shared) ---------- */
.block-logo {
  font-family: var(--block);
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: nowrap;
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  font-size: var(--fs, 64px);
}
.block-logo .ch {
  display: inline-block;
  color: var(--c);
  transform: rotate(var(--r));
  padding: 0 .015em;
  /* outline ring + stacked "block" depth + drop shadow */
  -webkit-text-stroke: .045em #160b0b;
  paint-order: stroke fill;
  text-shadow:
    .045em 0 0 #160b0b, -.045em 0 0 #160b0b, 0 .045em 0 #160b0b, 0 -.045em 0 #160b0b,
    .032em .032em 0 #160b0b, -.032em .032em 0 #160b0b, .032em -.032em 0 #160b0b, -.032em -.032em 0 #160b0b,
    0 .07em 0 #160b0b, 0 .095em 0 #0d0606, .02em .11em 0 #0d0606,
    0 .16em .14em rgba(0,0,0,.6);
}
.block-logo .sp { display: inline-block; width: .32em; }

/* ==========================================================================
   1. LOADING SCREEN
   ========================================================================== */
.boot {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse 55% 50% at 50% 50%, rgba(0, 95, 35, .42) 0%, rgba(0, 45, 18, .2) 45%, transparent 75%),
    #000;
  overflow: hidden;
  transform-origin: 50% 50%;
}
.boot-inner { width: 100%; padding: 24px; text-align: center; }

.boot-logo .ch {
  animation: drop .75s cubic-bezier(.25,.8,.35,1) both;
  animation-delay: calc(var(--i) * 85ms + 120ms);
}
@keyframes drop {
  0%   { transform: translateY(-110vh) rotate(var(--r)); }
  58%  { transform: translateY(6%) rotate(var(--r)); }
  74%  { transform: translateY(-9%) rotate(var(--r)); }
  88%  { transform: translateY(2%) rotate(var(--r)); }
  100% { transform: translateY(0) rotate(var(--r)); }
}

.boot-tagline {
  font: 22px/1.15 var(--mono);
  color: var(--green);
  text-shadow: 0 0 6px rgba(57,255,20,.55), 0 0 14px rgba(57,255,20,.25);
  margin: 34px auto 0;
  max-width: 640px;
  min-height: 2.3em;
  white-space: pre-line;
}
.boot-tagline .caret {
  display: inline-block; width: .55em; height: .95em; margin-left: 2px; vertical-align: -.1em;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.w98-progress {
  width: min(330px, 84vw);
  height: 24px;
  margin: 22px auto 8px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--sunken);
}
.w98-progress-track { display: flex; gap: 2px; height: 100%; overflow: hidden; }
.w98-progress-track i {
  flex: 0 0 8px;
  background: linear-gradient(#3cf03c, #0fa30f);
  visibility: hidden;
}
.w98-progress-track i.on { visibility: visible; }

.boot-status {
  font: 18px var(--mono);
  color: rgba(57,255,20,.7);
  margin: 4px 0 0;
  min-height: 1.3em;
}

.enter-btn {
  margin-top: 22px;
  font: bold clamp(17px, 2.6vw, 24px) var(--ui);
  color: #8b0a50;
  padding: 14px 30px;
  letter-spacing: .3px;
  animation: fadein .45s ease both;
}
.enter-btn:active { padding: 15px 29px 13px 31px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* CRT transition */
.crt-off { animation: crt-off .42s cubic-bezier(.6,0,.9,.4) forwards; }
.crt-on  { animation: crt-on .55s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes crt-off {
  0%   { transform: scale(1, 1); filter: brightness(1); }
  60%  { transform: scale(1, .004); filter: brightness(5); }
  100% { transform: scale(0, .004); filter: brightness(10); }
}
@keyframes crt-on {
  0%   { transform: scale(0, .004); filter: brightness(10); }
  40%  { transform: scale(1, .004); filter: brightness(5); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}
.fade-out { transition: opacity .5s ease; opacity: 0 !important; }
.fade-in  { animation: fadein .5s ease both; }

/* ==========================================================================
   2. DESKTOP
   ========================================================================== */
.app { position: fixed; inset: 0; visibility: hidden; transform-origin: 50% 50%; }
.app.on { visibility: visible; }

#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#floaters { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.desktop {
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--tb);
  overflow: auto; z-index: 2;
  overscroll-behavior: contain;
}
.surface { position: relative; min-height: 100%; }

.mini-logo {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  --fs: 46px;
  background: none; border: 0; padding: 0 6px 8px; cursor: pointer;
}
.mini-logo .ch { transition: transform .15s; }
.mini-logo:hover .ch { transform: rotate(var(--r)) translateY(-3px); }

/* floaters */
.floater { position: absolute; left: 0; top: 0; will-change: transform; }
.floater.sprite { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.floater.pill {
  width: 36px; height: 15px; border-radius: 999px;
  background: linear-gradient(90deg, #26d93a 0 50%, #f4f4f4 50% 100%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.65), 0 0 0 1px #0b3b12;
}
.floater.coin {
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7b8, #ffd21f 42%, #c98a00 78%);
  box-shadow: inset 0 0 0 2px #8a5a00, inset 0 0 0 4px #f3c63a, 0 2px 4px rgba(0,0,0,.6);
  display: grid; place-items: center;
  font: 19px/1 var(--block); color: #8a5a00;
}

/* ---------- Windows ---------- */
.win {
  position: absolute;
  display: flex; flex-direction: column;
  background: var(--face);
  box-shadow: var(--raised), 2px 2px 0 rgba(0,0,0,.35);
  padding: 3px;
  min-width: 200px;
  max-width: calc(100vw - 16px);
}
.win.minimized, .win.closed { display: none; }
.win.maxed {
  position: fixed !important;
  left: 0 !important; top: 0 !important;
  width: 100% !important; height: calc(100% - var(--tb)) !important;
  max-width: none;
}
.win.maxed .win-body { flex: 1; overflow: auto; }

.titlebar {
  display: flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 2px 0 3px;
  background: linear-gradient(90deg, #808080, #b5b5b5);
  color: #d8d8d8;
  font: bold 12px var(--ui);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  cursor: default;
}
.win.active > .titlebar { background: linear-gradient(90deg, var(--navy), #1084d0); color: #fff; }
.tb-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.tb-icon svg { width: 16px; height: 16px; display: block; }
.tb-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-btns { display: flex; }
.tb-btn {
  width: 16px; height: 14px; padding: 0; border: 0;
  background-color: var(--face); background-repeat: no-repeat; background-position: center;
  box-shadow: var(--raised); cursor: pointer;
}
.tb-btn:active { box-shadow: var(--pressed); background-position: calc(50% + 1px) calc(50% + 1px); }
.tb-min   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7'%3E%3Crect x='0' y='5' width='6' height='2'/%3E%3C/svg%3E"); }
.tb-max   { margin-right: 2px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath fill-rule='evenodd' d='M0 0h9v9H0zM1 2v6h7V2z'/%3E%3C/svg%3E"); }
.win.maxed .tb-max { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath fill-rule='evenodd' d='M2 0h7v6H7V2H2z M0 3h7v6H0zM1 5v3h5V5z'/%3E%3C/svg%3E"); }
.tb-close { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7'%3E%3Cpath d='M0 0h2l2 2 2-2h2v1L5.5 3.5 8 6v1H6L4 5 2 7H0V6l2.5-2.5L0 1z'/%3E%3C/svg%3E"); }
.tb-btn:focus-visible { outline: 1px dotted #000; outline-offset: -3px; }

.win.compact > .titlebar { height: 16px; font-size: 11px; }
.win.compact .tb-btn { width: 14px; height: 12px; }

.win-body { padding: 4px 1px 1px; }

.statusbar { display: flex; gap: 3px; margin-top: 4px; font: 11px var(--ui); }
.sb-field {
  box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--shadow);
  padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-field.grow { flex: 1; min-width: 0; }

.file-tag {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  background: rgba(0,0,0,.78); color: var(--green);
  font: 16px/1.1 var(--mono); padding: 1px 6px;
}
.file-tag.top { top: 6px; bottom: auto; }

/* ---------- 1. Main window ---------- */
.banner {
  position: relative; overflow: hidden;
  aspect-ratio: 780 / 190;
  border: 3px solid #ffd400;
  background: #000;
}
.banner .banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.board-scene { position: absolute; inset: 0; }
.board-wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 40% 70% at 50% 0%, rgba(255,226,150,.38), transparent 70%),
    linear-gradient(90deg, rgba(0,0,0,.65), transparent 18%, transparent 82%, rgba(0,0,0,.65)),
    repeating-linear-gradient(90deg, #3b2414 0 38px, #2a180c 38px 41px, #462a1a 41px 79px, #2a180c 79px 82px);
}
.board-art {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%);
  width: 20%; height: 30%;
  background: #031408;
  border: 4px solid #b8892c;
  box-shadow: 0 0 0 1px #4b350b, 0 4px 8px rgba(0,0,0,.6);
}
.board-art svg { width: 100%; height: 100%; display: block; }
.board-cats {
  position: absolute; left: 3%; right: 3%; bottom: 20%;
  display: flex; justify-content: space-around; align-items: flex-end;
}
.board-cats img { width: 13.2%; height: auto; filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.board-cats img:nth-child(odd)  { transform: translateY(4%) rotate(-2deg); }
.board-cats img:nth-child(even) { transform: translateY(-3%) rotate(2deg) scaleX(-1); }
.board-cats img:nth-child(4)    { width: 15.5%; transform: translateY(2%); }
.board-table {
  position: absolute; left: 1.5%; right: 1.5%; bottom: 0; height: 24%;
  background:
    radial-gradient(circle at 18% 30%, #ffd21f 0 5px, #a77400 5px 6.5px, transparent 7px),
    radial-gradient(circle at 21% 26%, #ffd21f 0 5px, #a77400 5px 6.5px, transparent 7px),
    radial-gradient(circle at 76% 32%, #ffd21f 0 5px, #a77400 5px 6.5px, transparent 7px),
    linear-gradient(#8a4a25 0 14%, #5c2f15 14% 22%, #3f1f0d 22% 100%);
  box-shadow: 0 -2px 0 #b06a3a inset;
}

.green-panel {
  margin-top: 6px;
  border: 3px solid #ffd400;
  padding: 14px 16px 18px;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 25%, #5cff4a, #16c516 70%, #0e9e0e);
}
.panel-logo { --fs: 76px; }
.panel-logo .ch:hover { animation: jiggle .4s ease; }
@keyframes jiggle {
  0%, 100% { transform: rotate(var(--r)) translateY(0); }
  40% { transform: rotate(calc(var(--r) * -2)) translateY(-8%); }
}
.panel-tagline {
  font: 21px/1.12 var(--mono);
  color: #fff;
  text-shadow: 1px 1px 0 #053005, -1px 0 0 #053005, 0 -1px 0 #053005, 0 1px 0 #053005;
  margin: 12px 0 0;
  white-space: pre-line;
}
.panel-row {
  display: grid; grid-template-columns: 170px 1fr; gap: 18px;
  align-items: center; margin-top: 14px; text-align: left;
}
.mascot-frame { background: #fff; padding: 4px; }
.mascot-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.panel-right { text-align: center; }
.panel-ticker {
  font: 40px/1 var(--block); color: #fff;
  text-shadow: 2px 0 0 #102010, -2px 0 0 #102010, 0 2px 0 #102010, 0 -2px 0 #102010, 2px 2px 0 #102010, -2px 2px 0 #102010, 2px -2px 0 #102010, -2px -2px 0 #102010, 0 5px 0 #102010;
}
.link-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: 390px; margin: 14px auto 0;
}
.link-btn, .foot-btn {
  font: bold 15px var(--ui); color: #0000a8; text-decoration: none; text-align: center;
  padding: 9px 4px;
}
.link-btn:active { padding: 10px 3px 8px 5px; }
.link-unset { color: #6d6d6d !important; cursor: not-allowed; }

.marquee {
  margin-top: 6px; height: 32px; overflow: hidden;
  background: #000; position: relative;
}
.marquee-track {
  display: inline-flex; white-space: nowrap;
  font: 23px/32px var(--mono); color: var(--green);
  text-shadow: 0 0 6px rgba(57,255,20,.6);
  animation: marquee 26s linear infinite;
}
.marquee-track span { padding-right: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.cult-btn {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 6px; height: 62px;
  text-decoration: none;
  border: 3px solid #0b0b0b;
  background: linear-gradient(90deg, #ff00d4, #ff3b3b, #ffae00, #fff200, #39ff14, #00e5ff, #3b6bff, #b400ff, #ff00d4);
  background-size: 200% 100%;
  animation: rainbow 5s linear infinite;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.65), inset -2px -2px 0 rgba(0,0,0,.35);
  cursor: pointer;
}
.cult-btn span {
  font: 36px/1 var(--block); color: #fff; letter-spacing: 1px; padding-top: 4px;
  text-shadow: 2px 0 0 #120a0a, -2px 0 0 #120a0a, 0 2px 0 #120a0a, 0 -2px 0 #120a0a, 2px 2px 0 #120a0a, -2px 2px 0 #120a0a, 2px -2px 0 #120a0a, -2px -2px 0 #120a0a, 0 5px 0 #120a0a;
}
.cult-btn img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.cult-btn:hover span { transform: scale(1.04); }
.cult-btn:active { box-shadow: inset -2px -2px 0 rgba(255,255,255,.65), inset 2px 2px 0 rgba(0,0,0,.35); transform: translateY(1px); }
@keyframes rainbow { to { background-position: 200% 0; } }

/* ---------- 6. Contract address ---------- */
.ca-body { display: flex; gap: 6px; align-items: stretch; padding: 6px 4px 4px; }
.ca-field { flex: 1; min-width: 0; background: #000; padding: 10px 14px; display: flex; align-items: center; }
.ca-field code {
  font: 31px/1.05 var(--mono); color: var(--green);
  text-shadow: 0 0 6px rgba(57,255,20,.45);
  word-break: break-all;
  user-select: all; -webkit-user-select: all;
}
.ca-copy { flex: 0 0 96px; font: bold 15px var(--ui); }
.ca-copy.copied { color: #006400; }

/* ---------- 5. Chart ---------- */
.chart-body { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 4px; }
.stat { display: flex; flex-direction: column; min-width: 0; padding: 5px 9px 4px; }
.stat-label { font: 11px var(--ui); color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-val { font: 27px/1 var(--mono); color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-val.up { color: #0a8a0a; }
.stat-val.down { color: #d40000; }
.stat-live { flex-direction: row; align-items: center; gap: 7px; padding: 0 14px; font: 22px var(--mono); }
.live-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #1ee81e; box-shadow: 0 0 0 1px #064d06, 0 0 7px #1ee81e;
  animation: pulse 1.2s steps(2, start) infinite;
}
@keyframes pulse { to { opacity: .25; } }
.stat-live.offline .live-dot { background: #8a8a8a; box-shadow: 0 0 0 1px #444; animation: none; }
.stat-live.offline .live-text { color: #6a6a6a; }

.chart-area { background: #000; box-shadow: var(--sunken); padding: 6px 9px 5px; }
.chart-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 24px; color: var(--green); font: 18px var(--mono);
}
.chart-name { text-shadow: 0 0 6px rgba(57,255,20,.5); }
.chart-readout { flex: 1; min-width: 0; color: #a6ffa0; font: 16px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-toggles { display: flex; gap: 12px; margin-left: auto; }
.seg { display: flex; gap: 3px; }
.chart-canvas-wrap { position: relative; height: 340px; margin-top: 4px; }
#chartCanvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.chart-msg {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center;
  font: 28px var(--mono); color: var(--green); text-align: center;
  text-shadow: 0 0 8px rgba(57,255,20,.5);
  pointer-events: none;
}
.chart-msg small { display: block; font-size: 17px; color: #5aa55a; text-shadow: none; margin-top: 4px; }
.chart-foot { align-items: stretch; margin-top: 0; }
.chart-foot .sb-field { display: flex; align-items: center; }
.foot-btn { padding: 6px 26px; display: flex; align-items: center; font-size: 13px; }
.foot-btn:active { padding: 7px 25px 5px 27px; }

/* ---------- 2. Meter ---------- */
.meter-body { padding: 8px 6px 2px; }
.meter-label { display: block; font: 12px var(--ui); }
.meter-row { display: flex; align-items: center; gap: 6px; font: bold 12px var(--ui); margin: 6px 0 10px; }
.meter-row input { flex: 1; min-width: 0; }
.meter-readout {
  background: #f6f3dc;
  font: 24px/1.05 var(--mono); color: #111; text-align: center;
  padding: 10px 8px; min-height: 64px;
  display: grid; place-items: center;
  white-space: pre-line;
}

/* ---------- 3. Image viewer ---------- */
.viewer-body { padding: 4px; }
.viewer-frame { position: relative; background: #fff; padding: 4px; }
.viewer-frame img { display: block; width: 100%; height: auto; }

/* ---------- 4. Memes ---------- */
.memes-body { padding: 4px; }
.memes-head { display: flex; align-items: center; gap: 6px; font: 20px var(--mono); padding: 0 2px 6px; }
.icon-slot svg { width: 20px; height: 20px; display: block; }
.meme-grid { background: #fff; padding: 6px; max-height: 330px; overflow-y: auto; }
.meme-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.meme-cells.two { grid-template-columns: repeat(2, 1fr); }
.meme-thumb {
  aspect-ratio: 1; padding: 0; border: 0; background: #eee;
  position: relative; overflow: hidden; cursor: pointer;
}
.meme-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meme-thumb:focus-visible { outline: 2px dotted #000080; outline-offset: 1px; }
.meme-thumb.placeholder {
  background: repeating-linear-gradient(45deg, #efefef 0 6px, #e2e2e2 6px 12px);
  outline: 1px dashed #9a9a9a; outline-offset: -1px;
  display: grid; place-items: center; font: 15px/1 var(--mono); color: #7a7a7a;
}
.meme-view { background: #fff; padding: 4px; }
.meme-view img { display: block; max-width: min(560px, 80vw); max-height: 70vh; width: auto; height: auto; margin: 0 auto; }
.meme-empty { padding: 18px 16px; font: 20px/1.2 var(--mono); background: #fff; max-width: 340px; }

/* ---------- 7. Music player ---------- */
.fm-body { padding: 5px 4px 3px; }
.fm-display { background: #000; box-shadow: var(--sunken); padding: 4px 7px 3px; color: var(--green); font: 18px/1 var(--mono); }
.fm-top { display: flex; justify-content: space-between; align-items: flex-end; height: 18px; }
.fm-bars { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.fm-bars i { display: block; width: 3px; height: 2px; background: linear-gradient(0deg, #39ff14, #ffd400 60%, #ff3b3b); transition: height .12s; }
.fm-title { overflow: hidden; white-space: nowrap; margin-top: 4px; height: 19px; }
.fm-title span { display: inline-block; min-width: 100%; animation: fmscroll 10s linear infinite; }
@keyframes fmscroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.fm-controls { display: flex; align-items: center; gap: 2px; margin-top: 5px; }
.fm-btn { width: 26px; height: 21px; padding: 0; display: grid; place-items: center; }
.fm-btn:active { padding: 1px 0 0 1px; }
.fm-btn svg { width: 10px; height: 8px; fill: #111; }
.fm-vol { flex: 1; min-width: 60px; margin-left: 8px; }

/* ---------- Helper popup ---------- */
.helper {
  position: fixed; right: 14px; bottom: calc(var(--tb) + 14px); z-index: 900;
  width: 280px;
  display: grid; grid-template-columns: 58px 1fr; column-gap: 10px;
  background: #ffffe1; border: 1px solid #000; border-radius: 9px;
  padding: 12px 14px 12px 10px;
  font: 12px/1.35 var(--ui);
  box-shadow: 3px 3px 0 rgba(0,0,0,.45);
  transform: translateX(calc(100% + 30px));
  transition: transform .5s cubic-bezier(.2,.9,.3,1.15);
}
.helper.show { transform: none; }
.helper::after {
  content: ""; position: absolute; right: 34px; bottom: -11px;
  border: 10px solid transparent; border-bottom: 0; border-top-color: #000;
}
.helper::before {
  content: ""; position: absolute; right: 35px; bottom: -9px; z-index: 1;
  border: 9px solid transparent; border-bottom: 0; border-top-color: #ffffe1;
}
.helper-img { width: 58px; height: 58px; object-fit: contain; grid-row: span 2; align-self: center; }
.helper p { margin: 2px 14px 0 0; }
.helper-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.helper-actions a { text-decoration: none; }
.helper-x {
  position: absolute; top: 3px; right: 6px; border: 0; background: none;
  font: bold 16px/1 var(--ui); cursor: pointer; padding: 2px 3px;
}

/* ---------- Taskbar + Start menu ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  height: var(--tb);
  display: flex; align-items: center; gap: 4px;
  padding: 3px 2px 1px;
  background: var(--face);
  box-shadow: inset 0 1px var(--hi), inset 0 2px var(--light);
}
.start-btn {
  display: flex; align-items: center; gap: 5px; height: 24px; flex: 0 0 auto;
  font: bold 13px var(--ui); padding: 2px 7px 2px 5px;
}
.start-btn:active, .start-btn[aria-expanded="true"] { box-shadow: var(--pressed); padding: 3px 6px 1px 6px; }
.start-logo { display: grid; grid-template-columns: 7px 7px; gap: 1px; transform: rotate(-8deg); }
.start-logo i { width: 7px; height: 7px; border-radius: 2px; box-shadow: inset -1px -1px rgba(0,0,0,.35), inset 1px 1px rgba(255,255,255,.55); }
.start-logo i:nth-child(1) { background: #ff8c00; transform: rotate(6deg); }
.start-logo i:nth-child(2) { background: #2f6bff; transform: rotate(-5deg); }
.start-logo i:nth-child(3) { background: #22c93a; transform: rotate(-4deg); }
.start-logo i:nth-child(4) { background: #ff2d2d; transform: rotate(7deg); }

.task-buttons { flex: 1; min-width: 0; display: flex; gap: 3px; overflow: hidden; }
.task-btn {
  flex: 0 1 160px; min-width: 44px; height: 24px;
  display: flex; align-items: center; gap: 5px;
  padding: 0 6px; font: 12px var(--ui); text-align: left;
}
.task-btn:active { padding: 1px 5px 0 7px; }
.task-btn svg { flex: 0 0 14px; width: 14px; height: 14px; }
.task-btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-btn.active { box-shadow: var(--pressed); background: var(--checker); font-weight: bold; }

.tray { display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px 0 6px; flex: 0 0 auto; font: 12px var(--ui); }
.tray-sound { border: 0; background: none; padding: 0; width: 16px; height: 16px; cursor: pointer; }
.tray-sound svg { width: 16px; height: 16px; display: block; }
.tray-sound.muted #muteWaves { display: none; }

.start-menu {
  position: fixed; left: 2px; bottom: calc(var(--tb) - 3px); z-index: 960;
  display: flex; min-width: 236px;
  background: var(--face); box-shadow: var(--raised), 2px 2px 0 rgba(0,0,0,.4);
  padding: 3px;
}
.start-side {
  width: 26px; flex: 0 0 26px;
  background: linear-gradient(0deg, var(--navy), #1084d0);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
}
.start-side span { writing-mode: vertical-rl; transform: rotate(180deg); font: 17px var(--ui); color: #cfd8ff; white-space: nowrap; }
.start-side b { color: #fff; font-weight: 900; }
.start-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.start-list button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 5px 24px 5px 8px;
  font: 13px var(--ui); text-align: left; cursor: pointer; color: #000;
}
.start-list button:hover, .start-list button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.start-list svg { width: 22px; height: 22px; flex: 0 0 22px; }
.start-list hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); margin: 3px 2px; }

/* ---------- Shutdown easter egg ---------- */
.shutdown {
  position: fixed; inset: 0; z-index: 2000; background: #000;
  display: grid; place-items: center; align-content: center; text-align: center;
  color: #ff8a00; font: 36px/1.2 var(--mono); cursor: pointer; padding: 20px;
}
.shutdown p { margin: 0 0 10px; }
.shutdown small { font-size: 18px; color: #8a4a00; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--green); font: 22px var(--mono); background: #000; z-index: 3000; }

/* ==========================================================================
   3. MOBILE (< 768px): stacked, full-width, not draggable
   ========================================================================== */
@media (max-width: 767px) {
  .surface { display: flex; flex-direction: column; gap: 14px; padding: 74px 8px 24px; }
  .win { position: relative !important; left: auto !important; top: auto !important; width: auto !important; max-width: none; z-index: auto !important; }
  .win.dyn { position: fixed !important; left: 8px !important; right: 8px; top: 60px !important; z-index: 800 !important; }
  .titlebar { touch-action: auto; }
  .tb-max { display: none; }
  .mini-logo { --fs: 40px; top: 12px; }

  .task-buttons { display: none; }
  .taskbar { justify-content: space-between; }

  .panel-logo { --fs: 54px; }
  .panel-row { grid-template-columns: 1fr; gap: 12px; }
  .mascot-frame { width: 150px; margin: 0 auto; }
  .panel-ticker { font-size: 34px; }
  .cult-btn { height: 56px; gap: 10px; }
  .cult-btn span { font-size: 27px; }
  .cult-btn img { width: 34px; height: 34px; }

  .ca-body { flex-direction: column; }
  .ca-field code { font-size: 23px; }
  .ca-copy { flex-basis: auto; padding: 10px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-live { justify-content: center; padding: 6px; }
  .stat-val { font-size: 24px; }
  .chart-canvas-wrap { height: 250px; }
  .chart-toggles { margin-left: 0; }
  .chart-foot { flex-wrap: wrap; }
  .chart-foot .sb-field.grow { flex-basis: 100%; }
  .chart-foot .foot-btn { flex: 1; justify-content: center; }

  .helper { left: 10px; right: 10px; width: auto; }
  .boot-tagline { font-size: 19px; }
}

/* ==========================================================================
   Reduced motion: no bounce, no CRT, calmer ambient motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .boot-logo .ch { animation: fadein .6s ease both; animation-delay: 0s; }
  .marquee-track { animation-duration: 80s; }
  .cult-btn { animation: none; }
  .live-dot { animation: none; }
  .fm-title span { animation: none; }
  .panel-logo .ch:hover { animation: none; }
  .helper { transition: opacity .4s; transform: none; opacity: 0; }
  .helper.show { opacity: 1; }
}
