/* ================= RUGSWEEPER: the crypto layer ================= */

:root {
  --pump: #2fe07a;
  --dump: #ff3b4a;
  --gold: #ffd21a;
  --hud-bg: rgba(8, 12, 16, 0.78);
}

.stage {
  position: relative;
  z-index: 2;
}

/* ---------- Market HUD (top-left, AAA style) ---------- */

.market {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  width: 250px;
  padding: 12px 14px 12px;
  z-index: 15;
  font-family: "Michroma", "Eurostile", Arial, sans-serif;
  color: #e9f3ee;
  background: linear-gradient(90deg, var(--hud-bg), rgba(8, 12, 16, 0.5));
  border-left: 3px solid var(--pump);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  animation: hud-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.market[hidden] { display: none; }

@keyframes hud-in {
  from { transform: translateX(-30px); opacity: 0; }
}

.m-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.m-ticker { color: var(--gold); }
.m-delta { color: var(--pump); font-family: "Oswald", sans-serif; font-weight: 700; font-size: 13px; }
.m-delta.down { color: var(--dump); }

.m-cap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.m-value {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 14px rgba(47, 224, 122, 0.45);
}

.m-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #8fa59a;
}

.m-chart {
  display: block;
  width: 100%;
  height: 54px;
  margin: 6px 0 8px;
}

.m-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-bar {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  transform: skewX(-20deg);
  overflow: hidden;
}

.m-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16b85c, var(--pump));
  transform-origin: left;
  transition: transform 0.15s linear;
}

.m-bar.low i {
  background: linear-gradient(90deg, #b3001b, var(--dump));
  animation: low-blink 0.5s steps(2) infinite;
}

@keyframes low-blink {
  50% { opacity: 0.45; }
}

.m-obj {
  margin-top: 9px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: #cfd8d3;
}

.m-obj span { color: #fff; }

/* HINTS chip: toggles the objective markers (also the H key). The HUD ignores the
   pointer; the chip takes it. */
.m-hints {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 4px 9px;
  border: 0;
  font-family: inherit;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--gold);
  background: rgba(255, 210, 26, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 26, 0.55);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.m-hints-ico { width: 13px; height: 13px; }
.m-hints:hover { background: rgba(255, 210, 26, 0.18); }
.m-hints:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.m-hints.off { color: #8fa59a; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.m-hints.off .m-hints-ico { display: none; }
.hints-off .m-obj { opacity: 0.4; }

/* Narrow screens: a compact strip on top, the board moves down to make room. */
@media (max-width: 979px) {
  .market {
    left: 50%;
    top: max(8px, env(safe-area-inset-top));
    width: min(420px, calc(100vw - 16px));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 3px;
    padding: 8px 10px;
    animation: none;
  }
  .m-top { grid-column: 1; grid-row: 1; gap: 10px; }
  .m-cap { grid-column: 1; grid-row: 2; }
  .m-value { font-size: 22px; }
  .m-chart { grid-column: 2 / span 2; grid-row: 1 / span 2; height: 44px; margin: 0; }
  .m-row { grid-column: 1 / span 2; grid-row: 3; }
  .m-obj { display: none; }
  .m-hints { grid-column: 3; grid-row: 3; justify-self: end; align-self: center; margin: 0; padding: 3px 8px; font-size: 8px; }
  body.market-on .stage { padding-top: max(100px, calc(env(safe-area-inset-top) + 92px)); }
  /* Below the achievement toasts (top ~96–170px), which used to cover "$1.00B / UP ONLY". */
  .moon-cap { top: max(186px, calc(env(safe-area-inset-top) + 178px)); }
  .moon-word { top: calc(max(186px, calc(env(safe-area-inset-top) + 178px)) + clamp(44px, 10vw, 110px)); }
  .toasts { top: max(96px, calc(env(safe-area-inset-top) + 88px)); bottom: auto; }
  .toast { min-width: 250px; padding: 6px 14px 6px 6px; }
  .toast-icon { width: 46px; height: 46px; margin: -4px 0; }
  .toast-icon .ico { width: 44px; height: 44px; }
  .toast-name { font-size: 14px; }
}

/* ---------- Floating PnL numbers ---------- */

.pnl {
  position: fixed;
  z-index: 24;
  transform: translate(-50%, -50%);
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 700;
  font-size: 20px;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 0 10px rgba(0, 0, 0, 0.6);
  animation: pnl-up 1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.pnl.up { color: var(--pump); }
.pnl.big { color: var(--gold); font-size: 34px; animation-duration: 1.4s; }
.pnl.rug { color: var(--dump); font-size: 44px; animation: pnl-down 1.6s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }

@keyframes pnl-up {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}

@keyframes pnl-down {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 140%) scale(0.9); }
}

/* ---------- YOU GOT RUGGED ---------- */

.rugged {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  align-content: center;
  pointer-events: none;
}

.rugged[hidden] { display: none; }

.rugged-band {
  width: 100%;
  padding: 26px 0 22px;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82) 25%, rgba(0, 0, 0, 0.82) 75%, transparent);
  opacity: 0;
}

.rugged-word {
  font-family: "Optima", "Times New Roman", Georgia, serif;
  font-size: clamp(34px, 8vw, 92px);
  letter-spacing: 0.06em;
  color: #a3141e;
  text-shadow: 0 0 24px rgba(160, 0, 0, 0.5);
  transform: scale(0.96);
}

.rugged.go .rugged-band { animation: rug-band 3.6s ease forwards; }
.rugged.go .rugged-word { animation: rug-word 3.6s ease-out forwards; }

@keyframes rug-band {
  0% { opacity: 0; }
  12% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes rug-word {
  from { transform: scale(0.96); }
  to { transform: scale(1.06); }
}

.respects {
  margin-top: 14px;
  padding: 6px 14px;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #ddd;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  animation: fade-in 0.4s 0.9s forwards;
}

.respects kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  margin: 0 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  color: #fff;
}

.respects.paid { color: var(--gold); }

@keyframes fade-in { to { opacity: 1; } }

/* ---------- Achievement toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 48;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 290px;
  padding: 10px 18px 10px 10px;
  border-radius: 40px;
  background: linear-gradient(90deg, #111, #262626);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  animation: toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.toast.out { animation: toast-out 0.35s ease-in both; }

.toast-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -6px 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(78, 245, 154, 0.55), rgba(16, 154, 73, 0.25) 55%, transparent 72%);
  flex: none;
}

/* The achievement's own icon, big and glossy, with a sheen that sweeps once. */
.toast-icon .ico {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 10px rgba(78, 245, 154, 0.45));
  animation: toast-ico 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.4) 0.1s both;
}

.toast-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 130% 0;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: toast-sheen 1.1s ease-out 0.45s both;
}

@keyframes toast-ico { from { transform: scale(0.4) rotate(-12deg); opacity: 0; } }
@keyframes toast-sheen { to { background-position: -30% 0; } }

.toast-head { font-size: 10px; letter-spacing: 0.16em; color: #9aa; }
.toast-name { font-size: 16px; font-weight: 700; }
.toast-desc { font-size: 12px; color: #bbb; }

@keyframes toast-in {
  from { transform: translateY(30px) scale(0.9); opacity: 0; }
}

@keyframes toast-out {
  to { transform: translateY(20px); opacity: 0; }
}

/* ---------- Milestone banner ---------- */

.milestone {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 26;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.milestone.go { animation: ms 3s ease forwards; }

.ms-head {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(26px, 6vw, 56px);
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 200, 0, 0.5), 0 3px 0 #000;
}

.ms-text {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  background: rgba(0, 0, 0, 0.7);
  font-family: "Michroma", Arial, sans-serif;
  font-size: clamp(10px, 2.4vw, 14px);
  letter-spacing: 0.16em;
  color: #fff;
}

@keyframes ms {
  0% { opacity: 0; transform: translateX(-50%) scale(1.4); }
  10% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}

/* ---------- HODL quick-time event ---------- */

.qte {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.55), rgba(20, 0, 0, 0.88));
  animation: qte-pulse 0.9s ease-in-out infinite alternate;
  user-select: none;
  -webkit-user-select: none;
}

.qte[hidden] { display: none; }

@keyframes qte-pulse {
  to { background-color: rgba(120, 0, 0, 0.25); }
}

.qte-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(20px, 5vw, 44px);
  color: var(--dump);
  letter-spacing: 0.04em;
  animation: low-blink 0.6s steps(2) infinite;
}

.qte-key {
  position: relative;
  width: 140px;
  height: 140px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  touch-action: none;
}

.qte-key svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.qte-key circle { fill: none; stroke-width: 7; }
.qte-key .track { stroke: rgba(255, 255, 255, 0.15); }
.qte-key .fill { stroke: var(--pump); stroke-linecap: round; filter: drop-shadow(0 0 8px var(--pump)); }

.qte-key span {
  position: absolute;
  inset: 26px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  font-family: "Michroma", Arial, sans-serif;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  transition: transform 0.08s;
}

.qte.holding .qte-key span { transform: scale(0.92); background: rgba(47, 224, 122, 0.25); }

.qte-warn { width: clamp(28px, 6vw, 48px); height: clamp(28px, 6vw, 48px); filter: drop-shadow(0 0 10px rgba(255, 59, 74, 0.6)); }

.qte-hint {
  font-family: "Michroma", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.2em;
  color: #fff;
}

.qte-hint b { color: var(--pump); }

.qte-result {
  min-height: 1.2em;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(22px, 5vw, 40px);
}

.qte.won { animation: none; background: radial-gradient(ellipse at center, rgba(0, 60, 25, 0.6), rgba(0, 15, 6, 0.9)); }
.qte.won .qte-result { color: var(--pump); }
.qte.lost .qte-result { color: var(--dump); }
.qte.won .qte-alert, .qte.lost .qte-alert { visibility: hidden; }

/* ---------- Store (the microtransaction) ---------- */

.store {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.store[hidden] { display: none; }

.store-card {
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  text-align: center;
  color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #2a1d52, #120c26);
  border: 1px solid rgba(255, 210, 26, 0.5);
  box-shadow: 0 0 60px rgba(140, 90, 255, 0.35);
  animation: toast-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.store-tag {
  font-family: "Michroma", Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.store-timer { color: var(--dump); }
.store-clock { margin: 0 4px 0 6px; }

.store-art {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 12px auto 6px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 210, 26, 0.35), transparent 70%);
}

.store-art svg { width: 84px; height: 84px; }
.store-art b { position: absolute; right: 4px; bottom: 6px; font-family: "Archivo Black", sans-serif; font-size: 22px; color: var(--gold); }
.store-name { font-family: "Archivo Black", "Arial Black", sans-serif; font-size: 22px; }
.store-desc { margin: 6px 0 10px; font-size: 13px; color: #c9c2e8; }
.store-price { font-family: "Oswald", sans-serif; font-size: 22px; font-weight: 700; color: var(--pump); }
.store-price s { color: #8a83a8; font-size: 16px; margin-right: 6px; }

.store-buy,
.store-no {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 0;
  cursor: pointer;
  font-family: "Michroma", Arial, sans-serif;
  letter-spacing: 0.1em;
}

.store-buy { padding: 12px; font-size: 14px; color: #0b1a10; background: linear-gradient(180deg, #5effa0, #1fc061); }
.store-no { padding: 6px; font-size: 9px; color: #8a83a8; background: none; }

/* ---------- Laser eyes ---------- */

.face svg { overflow: visible; }
.face .lasers { display: none; }
.face.laser .lasers { display: inline; }
.face.laser .eyes,
.face.laser .eyes-o,
.face.laser .shades { display: none; }
.face .lasers circle { fill: #ff1a1a; filter: drop-shadow(0 0 1px #ff0000); }
.face .lasers .beam {
  stroke: #ff2020;
  stroke-width: 0.9;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 1.2px #ff0000);
  animation: beam 0.12s steps(2) infinite;
}

@keyframes beam { 50% { stroke-width: 0.6; opacity: 0.8; } }

.game { overflow: visible !important; }
.header { position: relative; z-index: 4; }
/* The beams run almost flat across the header strip and are clipped to it: never over a cell. */
.header:has(.face.laser) { overflow: hidden; }

/* ---------- Up only finale ---------- */

.moon {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.moon[hidden] { display: none; }

.moon canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.moon-cap {
  position: absolute;
  top: 10%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 9vw, 96px);
  color: #fff;
  text-shadow: 0 0 30px rgba(47, 224, 122, 0.8);
  opacity: 0;
}

.moon-word {
  position: absolute;
  top: calc(10% + clamp(44px, 10vw, 110px));
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(22px, 5vw, 48px);
  letter-spacing: 0.3em;
  color: var(--pump);
  opacity: 0;
}

.moon.go .moon-cap { animation: fade-in 1s 0.6s forwards; }
.moon.go .moon-word { animation: fade-in 1s 3.2s forwards; }

/* ---------- Credits token card ---------- */

.credits-token {
  margin: 140px auto 120px;
  text-align: center;
}

.ct-ticker { font-family: "Archivo Black", "Arial Black", sans-serif; font-size: 64px; color: var(--pump); letter-spacing: 0.04em; }
.ct-chain { font-size: 13px; letter-spacing: 0.32em; color: #8f8b84; margin-top: 4px; }
.ct-ca { margin-top: 24px; font-size: 13px; letter-spacing: 0.08em; text-transform: none; word-break: break-all; }
.ct-up { margin-top: 40px; font-size: 13px; letter-spacing: 0.5em; color: var(--gold); }

/* ---------- Day one patch screen ---------- */

.patch {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: grid;
  place-items: center;
  background: #000;
  color: #d8d8d8;
  font-family: "Michroma", Arial, sans-serif;
  opacity: 0;
}

.patch[hidden] { display: none; }

.patch-box { width: min(440px, calc(100vw - 48px)); }
.patch-label { font-size: 12px; letter-spacing: 0.18em; margin-bottom: 12px; }
.patch-bar { height: 4px; background: #222; overflow: hidden; }
.patch-bar i { display: block; height: 100%; background: #e8e8e8; transform-origin: left; transform: scaleX(0); }
.patch-num { margin-top: 10px; font-family: "Oswald", sans-serif; font-size: 14px; color: #888; text-align: right; }
.patch-tip { position: absolute; bottom: 64px; left: 24px; right: 24px; text-align: center; font-size: 11px; letter-spacing: 0.1em; color: #777; }

/* ---------- Desktop: icons, taskbar, windows ---------- */

.desktop-credit { display: none; }

.icons {
  position: absolute;
  top: 10px;
  left: 6px;
  bottom: 44px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 118px);
  grid-auto-columns: 118px;
  align-content: start;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  background: none;
  cursor: default;
  outline: none;
  touch-action: manipulation;
}

.icon canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.icon-pic { width: 48px; height: 48px; }
.icon-label { width: calc(var(--w) * 1.5px); height: calc(var(--h) * 1.5px); max-width: 112px; }
.icon.sel .icon-pic { filter: sepia(1) hue-rotate(190deg) saturate(6) brightness(0.55); }
.icon.sel .icon-label { background: #000080; outline: 1px dotted #ffff7f; }

@media (max-width: 640px) {
  .icons {
    right: 6px;
    bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    row-gap: 4px;
  }
  .icon-pic { width: 44px; height: 44px; }
  .icon-label { width: calc(var(--w) * 1.25px); height: calc(var(--h) * 1.25px); }
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(40px + env(safe-area-inset-bottom));
  padding: 4px 4px env(safe-area-inset-bottom);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  font-family: Tahoma, Verdana, Geneva, sans-serif;
  font-size: 14px;
  color: #000;
  z-index: 2;
}

.start-btn,
.w95-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  font: bold 14px Tahoma, Verdana, Geneva, sans-serif;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #dfdfdf;
  cursor: pointer;
}

.start-btn.down,
.w95-btn:active {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 2px 2px 0 #808080;
}

.winlogo {
  display: grid;
  grid-template-columns: 8px 8px;
  gap: 1px;
  transform: skewY(-6deg);
}

.winlogo b { width: 8px; height: 8px; }
.winlogo b:nth-child(1) { background: #f03c1e; }
.winlogo b:nth-child(2) { background: #3cb43c; }
.winlogo b:nth-child(3) { background: #1e64f0; }
.winlogo b:nth-child(4) { background: #f0c81e; }

.tray {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding: 0 12px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.tray-token { font-weight: bold; color: #006000; }

.start-menu {
  position: absolute;
  left: 4px;
  bottom: calc(42px + env(safe-area-inset-bottom));
  display: flex;
  min-width: 240px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset -2px -2px 0 #808080;
  z-index: 3;
  font-family: Tahoma, Verdana, Geneva, sans-serif;
}

.start-menu[hidden] { display: none; }

.sm-side {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 8px 4px;
  background: linear-gradient(0deg, #000080, #1084d0);
  color: #c0c0c0;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.sm-side b { color: #fff; margin-top: 6px; }

.sm-items { flex: 1; padding: 2px; }
.sm-items hr { border: 0; border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 3px 2px; }

.sm-items button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  font: 14px Tahoma, Verdana, Geneva, sans-serif;
  text-align: left;
  cursor: pointer;
}

.sm-items button:hover { background: #000080; color: #fff; }
.sm-ico { flex: none; width: 24px; height: 24px; line-height: 0; }
.sm-ico .ico { width: 24px; height: 24px; }
.sm-ico .ico[src$=".png"] { image-rendering: pixelated; }

.windows { position: absolute; inset: 0; pointer-events: none; }

.win {
  position: absolute;
  max-width: calc(100vw - 16px);
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff, 4px 4px 0 rgba(0, 0, 0, 0.25);
  padding: 3px;
  pointer-events: auto;
  font-family: Tahoma, Verdana, Geneva, sans-serif;
  font-size: 14px;
  color: #000;
}

.win-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 3px 0 6px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  cursor: default;
  touch-action: none;
}

.win-x {
  width: 20px;
  height: 18px;
  padding: 0;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  cursor: pointer;
}

.win-body { padding: 8px 6px 4px; }

.np .win-body { padding: 2px 0 0; }
.np-menu { padding: 2px 6px 4px; font-size: 13px; word-spacing: 10px; }

.notepad {
  margin: 0;
  width: min(520px, calc(100vw - 32px));
  height: min(380px, calc(100vh - 220px));
  overflow: auto;
  padding: 6px 8px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  font: 13px/1.35 "Fixedsys", "Courier New", monospace;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

.win-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px 6px;
}

.w95-btn { min-width: 84px; justify-content: center; font-weight: normal; height: 28px; }

.msg { display: flex; gap: 14px; align-items: flex-start; max-width: 360px; padding: 6px 8px 2px; }
.msg p { margin: 4px 0 0; line-height: 1.4; }
.msg a { color: #000080; }

.msg-ico {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: bold 20px Georgia, serif;
  font-style: normal;
  color: #fff;
  background: #0000c0;
  border: 2px solid #000;
}

.msg-ico.info::after { content: "i"; }
.msg-ico.warn { border-radius: 0; background: none; border: 0; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-bottom: 32px solid #ffd800; position: relative; }
.msg-ico.warn::after { content: "!"; position: absolute; top: 9px; left: -4px; color: #000; font-size: 18px; }

.its-safe {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  color: #ff8a00;
  font: bold clamp(18px, 4vw, 34px) Tahoma, Verdana, sans-serif;
  text-align: center;
  cursor: pointer;
}

.its-safe[hidden] { display: none; }

/* UP ONLY finale: the comms box rides out with the drifting board and covered "$1.00B / UP ONLY".
   The subtitle already names the speaker, so the box steps aside for the moment. */
body:has(.moon.go:not([hidden])) .comms { opacity: 0; transition: opacity 0.4s; }

/* Phones: the HOLD TO SKIP pill (bottom-right) covered the patch tip. Lift the tip above it. */
@media (max-width: 600px) {
  .patch-tip { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); }
}
