﻿:root {
  /* Sections: base/app shell, start/HUD, rooms, overlays/victory, responsive. */
  --bg: #11151c;
  --panel: #17202b;
  --panel-2: #202b38;
  --text: #f5f7fb;
  --muted: #aab6c7;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #4fd1a5;
  --accent-2: #ffb84d;
  --danger: #ef5b5b;
  --blue: #5aa9e6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --pixel-border: #121722;
  --pixel-light: #f7f0d7;
  --pixel-size: 6px;
  --pixel-line: 2px;
  --pixel-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / var(--pixel-size) var(--pixel-size),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / var(--pixel-size) var(--pixel-size),
    linear-gradient(135deg, #10141b, #1a2029 52%, #2d1d20);
  image-rendering: pixelated;
}

button,
input,
select {
  font: inherit;
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(79, 209, 165, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(255, 184, 77, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    radial-gradient(circle at 50% 20%, rgba(79, 209, 165, 0.18), transparent 34%),
    rgba(4, 8, 13, 0.96);
}

.start-screen.hidden {
  display: none;
}

.start-screen.hacking-corrupt {
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  animation: start-hack-screen 1.28s steps(9, end) forwards;
}

.start-screen.hacking-corrupt::before,
.start-screen.hacking-corrupt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.start-screen.hacking-corrupt::before {
  z-index: 10;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.42) 0 2px, rgba(128, 255, 90, 0.12) 2px 4px, transparent 4px 8px),
    repeating-linear-gradient(90deg, rgba(255, 54, 54, 0.12) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 50% 42%, rgba(128, 255, 90, 0.2), transparent 36%);
  mix-blend-mode: screen;
  opacity: 0.12;
  animation: start-hack-noise 0.48s steps(5, end) infinite;
}

.start-screen.hacking-corrupt::after {
  z-index: 11;
  background:
    linear-gradient(90deg, transparent, rgba(128, 255, 90, 0.6), rgba(0, 232, 255, 0.46), transparent),
    linear-gradient(0deg, transparent 0 46%, rgba(255, 255, 255, 0.15) 46% 48%, transparent 48% 100%);
  opacity: 0;
  transform: translateY(-120%);
  animation: start-hack-scanline 1.04s cubic-bezier(.2,.84,.24,1) forwards;
}

.start-screen.hacking-corrupt > .start-panel {
  text-shadow:
    3px 0 rgba(255, 45, 45, 0.45),
    -3px 0 rgba(0, 232, 255, 0.42);
  animation: start-panel-hack-corrupt 1.18s steps(8, end) forwards;
}

.start-screen.hacking-corrupt > .creator-banner,
.start-screen.hacking-corrupt > .start-actions {
  animation: start-secondary-hack-corrupt 1.08s steps(7, end) forwards;
}

.start-hack-field {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.start-hack-scan,
.start-hack-slice,
.start-hack-block,
.start-hack-glyph {
  position: absolute;
}

.start-hack-scan {
  left: -12%;
  top: -18%;
  width: 124%;
  height: 18%;
  background:
    linear-gradient(180deg, transparent, rgba(128, 255, 90, 0.72), rgba(0, 232, 255, 0.38), transparent);
  box-shadow: 0 0 34px rgba(128, 255, 90, 0.46);
  opacity: 0;
  transform: skewY(-3deg);
  animation: start-hack-scan 1.1s cubic-bezier(.19,.88,.28,1) forwards;
}

.start-hack-slice {
  left: -10%;
  width: 120%;
  background:
    linear-gradient(90deg, transparent, rgba(255, 55, 55, var(--alpha)), rgba(0, 232, 255, calc(var(--alpha) * 0.8)), rgba(128, 255, 90, var(--alpha)), transparent);
  box-shadow: 0 0 18px rgba(128, 255, 90, 0.22);
  opacity: 0;
  transform: translateX(0) scaleX(1);
  animation: start-hack-slice var(--duration) steps(4, end) var(--delay) both;
}

.start-hack-block {
  display: block;
  background: var(--tone);
  box-shadow: 0 0 12px rgba(128, 255, 90, 0.34);
  opacity: 0;
  transform: translateX(0);
  animation: start-hack-block var(--duration) steps(3, end) var(--delay) both;
}

.start-hack-glyph {
  color: rgba(128, 255, 90, 0.9);
  font-family: "Courier New", monospace;
  font-size: var(--size);
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0;
  text-shadow:
    0 0 10px rgba(128, 255, 90, 0.72),
    2px 0 rgba(255, 54, 54, 0.46),
    -2px 0 rgba(0, 232, 255, 0.4);
  transform: translateY(0);
  animation: start-hack-glyph var(--duration) steps(4, end) var(--delay) both;
}

.creator-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  width: min(820px, calc(100% - 28px));
  min-height: 190px;
  padding: clamp(24px, 5vw, 46px) clamp(22px, 5vw, 56px);
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.055) 1px, transparent 1px) 0 0 / 8px 8px,
    var(--accent-2);
  box-shadow: var(--pixel-shadow);
  transform: translate(-50%, -50%) rotate(-3deg);
}

.creator-banner p {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.creator-banner .icon-button {
  position: absolute;
  right: 12px;
  top: 12px;
  min-height: 34px;
  width: 34px;
  color: #102019;
  background: #f5f7fb;
}

.creator-banner.hidden {
  display: none;
}

.start-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto;
  gap: 16px;
  width: min(980px, 100%);
  min-height: min(760px, calc(100vh - 36px));
  padding: clamp(18px, 3vw, 34px);
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#1b2634 0 54%, #111923 54% 100%);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.start-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.start-panel h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: #f5f7fb;
  text-shadow: 4px 4px 0 #0b1017, 0 0 22px rgba(79, 209, 165, 0.4);
}

.start-pitch {
  width: min(760px, 100%);
  margin: 0;
  color: #d6dde8;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.55;
  font-weight: 700;
}

.start-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.start-stats span {
  min-height: 38px;
  padding: 9px 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background: var(--accent-2);
  box-shadow: var(--pixel-shadow);
  font-weight: 800;
}

.jury-promise,
.credits-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(255, 255, 255, 0.07);
  box-shadow: var(--pixel-shadow);
}

.jury-promise strong,
.credits-card strong {
  color: #80ff5a;
  text-transform: uppercase;
}

.jury-promise span,
.credits-card span {
  color: #d6dde8;
  line-height: 1.35;
}

.sponsor-heading {
  align-self: end;
  margin: 8px 0 -4px;
  color: #f5f7fb;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sponsor-strip {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sponsor-strip figure {
  display: grid;
  grid-template-rows: 120px auto;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #ffffff;
  box-shadow: var(--pixel-shadow), inset 0 0 0 1px rgba(18, 23, 34, 0.08);
}

.sponsor-strip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.sponsor-strip figcaption {
  overflow: hidden;
  color: #12151c;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.start-button {
  justify-self: center;
  align-self: end;
  min-width: 190px;
  min-height: 52px;
  margin-top: 4px;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.demo-button {
  color: #f5f7fb;
  border-color: rgba(128, 255, 90, 0.55);
  background: rgba(128, 255, 90, 0.14);
}

.game-shell {
  width: min(1440px, 100%);
  height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.hud {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(18, 24, 32, 0.84);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 174px;
}

.home-button {
  position: relative;
  z-index: 36;
  min-width: 88px;
  min-height: 36px;
  white-space: nowrap;
}

.mode-badge {
  min-height: 36px;
  padding: 7px 9px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background: #80ff5a;
  box-shadow: var(--pixel-shadow);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  background:
    linear-gradient(90deg, transparent 43%, #11151c 43% 57%, transparent 57%),
    linear-gradient(var(--accent), var(--accent-2));
  box-shadow: var(--pixel-shadow);
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.18rem, 2.4vw, 1.55rem);
  white-space: nowrap;
}

.meters {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 7px;
}

.meter-card {
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
}

.timer-card {
  border-color: rgba(255, 72, 72, 0.78);
  color: #fff7f2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    #b71924;
  box-shadow: 0 0 0 3px rgba(239, 91, 91, 0.16), 0 0 18px rgba(239, 91, 91, 0.35), var(--pixel-shadow);
}

.timer-card .label,
.timer-card strong {
  color: #fff7f2;
  text-shadow: 2px 2px 0 rgba(60, 0, 0, 0.7);
}

.timer-card.critical-time {
  animation: critical-timer-alert 0.32s steps(2, end) infinite;
}

.meter-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.08rem;
  line-height: 1;
  white-space: nowrap;
}

.gauge-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 12px;
}

.gauge-card .label {
  grid-column: 1 / -1;
}

.gauge-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--pixel-border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.13);
}

.gauge-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--danger));
  transition: width 250ms ease;
}

.stage,
.side-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(18, 24, 32, 0.72);
  box-shadow: var(--shadow);
}

.stage {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
}

.room-nav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.room-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.room-tab:hover,
.room-tab:focus-visible,
.room-tab.active {
  color: #102019;
  background: var(--accent);
  outline: none;
}

.room-tab.locked,
.room-tab:disabled {
  color: rgba(232, 241, 255, 0.38);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(9, 12, 18, 0.68);
  border-color: rgba(255, 255, 255, 0.12);
  cursor: not-allowed;
  opacity: 0.72;
}

.room-tab.locked:hover,
.room-tab.locked:focus-visible,
.room-tab:disabled:hover,
.room-tab:disabled:focus-visible {
  color: rgba(232, 241, 255, 0.38);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(9, 12, 18, 0.68);
  outline: none;
}

.room {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#27313e 0 58%, #1b1417 58% 100%);
}

.room.hidden-room {
  display: none;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.045) 18px 24px, transparent 24px 48px),
    linear-gradient(0deg, transparent 0 30px, rgba(0,0,0,0.12) 30px 36px, transparent 36px 60px);
  mix-blend-mode: screen;
  opacity: 0.55;
}

.room::after {
  content: "";
  position: absolute;
  inset: 58% 0 0 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 6px, transparent 6px 12px);
  opacity: 0.5;
}

.room-title {
  position: absolute;
  left: 24px;
  top: 20px;
  z-index: 2;
  padding: 12px 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  background: #17202b;
  box-shadow: var(--pixel-shadow);
}

.room > div:not(.room-title) {
  z-index: 1;
}

.room-title h2 {
  font-size: 1.15rem;
}

.room-control {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#2e4054 0 16%, #263445 16% 58%, #191215 58% 100%);
}

.room-mixroom {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#263a55 0 17%, #1e2b3d 17% 56%, #15171f 56% 100%);
}

.room-weatherroom {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#162947 0 18%, #142234 18% 58%, #11141c 58% 100%);
}

.room-laundry {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#344050 0 18%, #28313d 18% 57%, #15181d 57% 100%);
}

.room-electrical {
  background:
    linear-gradient(90deg, rgba(255, 184, 77, 0.1) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(#202b38 0 18%, #1a222c 18% 58%, #100d10 58% 100%);
}

.plant {
  position: absolute;
  right: 10%;
  bottom: 20%;
  width: 82px;
  height: 160px;
  border-radius: 50% 50% 8px 8px;
  background:
    radial-gradient(circle at 28% 20%, #4fd1a5 0 18px, transparent 19px),
    radial-gradient(circle at 62% 32%, #3aa985 0 22px, transparent 23px),
    linear-gradient(90deg, transparent 45%, #6b4b34 45% 55%, transparent 55%),
    linear-gradient(transparent 65%, #824d35 65%);
}

.hotspot {
  position: absolute;
  z-index: 3;
  min-width: 132px;
  min-height: 44px;
  padding: 8px 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  color: #10141b;
  background: rgba(255, 207, 90, 0.94);
  box-shadow: var(--pixel-shadow);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.hotspot:hover,
.hotspot:focus-visible {
  transform: translate(-50%, -2px);
  background: #fff0a3;
  outline: 3px solid rgba(79, 209, 165, 0.52);
}

.hotspot.solved {
  color: #092014;
  background: #78e3bd;
}

.hotspot-screen {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.hotspot-cards {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.hotspot-tablet {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.hotspot-programmer {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.hotspot-final {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.door {
  position: absolute;
  z-index: 3;
  bottom: 26px;
  min-width: 130px;
  min-height: 44px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--pixel-shadow);
  cursor: pointer;
}

.door:hover,
.door:focus-visible {
  background: rgba(90, 169, 230, 0.24);
  outline: 3px solid rgba(90, 169, 230, 0.36);
}

.door.next-room-ready:not(:disabled) {
  color: #102019;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px) 0 0 / 8px 8px,
    #80ff5a;
  border-color: rgba(128, 255, 90, 0.95);
  box-shadow:
    0 0 0 3px rgba(128, 255, 90, 0.2),
    0 0 20px rgba(128, 255, 90, 0.46),
    var(--pixel-shadow);
  animation: next-room-ready-pulse 0.82s steps(2, end) infinite;
}

.door.next-room-ready:not(:disabled):hover,
.door.next-room-ready:not(:disabled):focus-visible {
  color: #102019;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px) 0 0 / 8px 8px,
    #9cff7a;
  outline: 3px solid rgba(128, 255, 90, 0.42);
}

.door.locked,
.door:disabled {
  color: rgba(232, 241, 255, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(9, 12, 18, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.door.locked:hover,
.door.locked:focus-visible,
.door:disabled:hover,
.door:disabled:focus-visible {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(9, 12, 18, 0.72);
  outline: none;
}

.easter-egg {
  position: absolute;
  z-index: 4;
  width: 94px;
  height: 136px;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: help;
  overflow: hidden;
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.easter-egg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  background: #fff;
  border: var(--pixel-line) solid #80ff5a;
  box-shadow: 0 0 0 2px #11151c, 0 0 18px rgba(128, 255, 90, 0.48);
}

.easter-egg:hover,
.easter-egg:focus-visible,
.easter-egg.revealed {
  opacity: 1;
  transform: translateY(-4px);
  outline: none;
  filter: saturate(1.15) contrast(1.08);
}

.easter-egg-control {
  left: 14%;
  bottom: 14%;
  width: 128px;
  height: 54px;
}

.easter-egg-control img {
  object-fit: contain;
  object-position: center;
  transform: none;
}

.easter-egg-laundry {
  right: 8%;
  top: 11%;
  width: 96px;
  height: 132px;
}

.easter-egg-mix {
  left: 50%;
  top: 10%;
  width: 128px;
  height: 54px;
}

.easter-egg-laundry img {
  object-fit: cover;
  object-position: center;
}

.door-prev {
  left: 24px;
}

.door-next {
  right: 24px;
}

.side-panel {
  align-self: stretch;
  display: flex;
  height: 100%;
  max-height: none;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(128, 255, 90, 0.55) rgba(255, 255, 255, 0.07);
  scrollbar-width: thin;
}

.side-panel > section {
  flex: 0 0 auto;
}

.side-panel section + section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-panel h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.code-groups {
  display: grid;
  gap: 12px;
}

.code-group {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 6px 6px,
    rgba(255, 255, 255, 0.04);
}

.code-group p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.code-group-main {
  border-left: 4px solid var(--blue);
}

.code-group-bonus {
  border-left: 4px solid #80ff5a;
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.code-slots-bonus {
  grid-template-columns: repeat(3, 1fr);
}

.code-slots span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 6px 6px,
    var(--panel-2);
  font-size: 1.15rem;
  font-weight: 700;
}

.code-group-main .code-slots span {
  border-color: rgba(90, 169, 230, 0.5);
}

.code-group-bonus .code-slots span {
  border-color: rgba(128, 255, 90, 0.5);
}

.final-code-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background: var(--accent-2);
  box-shadow: var(--pixel-shadow);
}

.final-code-preview span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.final-code-preview strong {
  font-size: 1.1rem;
}

.journal-section {
  min-height: 0;
}

#logList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 6px 0 0;
  overflow: visible;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  list-style: none;
}

.log-entry {
  display: block;
  padding: 6px 0 6px 9px;
  border: 0;
  border-left: 2px solid var(--line);
  background: transparent;
}

.log-entry span {
  display: inline;
  margin-right: 5px;
  padding: 0;
  border: 0;
  color: var(--accent-2);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.log-main {
  border-left-color: rgba(90, 169, 230, 0.85);
}

.log-main span {
  color: var(--blue);
}

.log-easter {
  border-left-color: rgba(128, 255, 90, 0.85);
}

.log-easter span {
  color: #80ff5a;
}

.guide-panel {
  padding: 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, rgba(128,255,90,0.06) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(128, 255, 90, 0.08);
  box-shadow: var(--pixel-shadow);
}

.guide-panel p {
  margin: 8px 0 0;
  color: #d6dde8;
  line-height: 1.45;
}

.discovery-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 42;
  display: grid;
  place-items: center;
  min-width: min(420px, calc(100vw - 28px));
  min-height: 86px;
  padding: 18px 24px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 / 8px 8px,
    #80ff5a;
  box-shadow: 0 0 0 4px rgba(128, 255, 90, 0.28), 0 0 34px rgba(128, 255, 90, 0.62), var(--pixel-shadow);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  pointer-events: none;
}

.discovery-toast.show {
  animation: discovery-pop 1.8s steps(4, end) both;
}

@keyframes start-hack-screen {
  0% {
    opacity: 1;
    filter: none;
    transform: translate3d(0, 0, 0);
  }

  12% {
    filter: contrast(1.55) saturate(1.9) hue-rotate(54deg);
    transform: translate3d(5px, -2px, 0);
  }

  24% {
    filter: contrast(1.2) saturate(0.7) hue-rotate(-28deg);
    transform: translate3d(-7px, 3px, 0);
  }

  44% {
    opacity: 0.9;
    filter: contrast(2) saturate(2.2) brightness(1.18);
    transform: translate3d(4px, 0, 0);
  }

  72% {
    opacity: 0.42;
    filter: contrast(2.4) saturate(2.8) brightness(0.9);
    transform: translate3d(-10px, 2px, 0);
  }

  100% {
    opacity: 0;
    filter: contrast(3) saturate(0.4) brightness(0.1);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes start-hack-noise {
  0%,
  100% {
    opacity: 0.16;
    transform: translate3d(0, 0, 0);
  }

  25% {
    opacity: 0.54;
    transform: translate3d(-7px, 3px, 0);
  }

  50% {
    opacity: 0.34;
    transform: translate3d(6px, -2px, 0);
  }

  75% {
    opacity: 0.68;
    transform: translate3d(-2px, 6px, 0);
  }
}

@keyframes start-hack-scanline {
  0% {
    opacity: 0;
    transform: translateY(-120%);
  }

  18%,
  64% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: translateY(120%);
  }
}

@keyframes start-panel-hack-corrupt {
  0% {
    opacity: 1;
    clip-path: inset(0);
    filter: none;
    transform: translate3d(0, 0, 0);
  }

  18% {
    filter: contrast(1.4) saturate(1.8) hue-rotate(72deg);
    transform: translate3d(9px, -3px, 0) skewX(1deg);
  }

  32% {
    clip-path: polygon(0 0, 100% 0, 100% 16%, 0 16%, 0 28%, 100% 28%, 100% 42%, 0 42%, 0 100%, 100% 100%, 100% 100%, 0 100%);
    transform: translate3d(-13px, 4px, 0) skewX(-2deg);
  }

  54% {
    opacity: 0.76;
    clip-path: polygon(0 0, 100% 0, 100% 8%, 0 8%, 0 23%, 100% 23%, 100% 34%, 0 34%, 0 58%, 100% 58%, 100% 100%, 0 100%);
    filter: contrast(2) saturate(2.4);
    transform: translate3d(16px, 1px, 0);
  }

  78% {
    opacity: 0.34;
    clip-path: inset(16% 0 12% 0);
    transform: translate3d(-18px, 9px, 0) scale(0.98);
  }

  100% {
    opacity: 0;
    clip-path: inset(48% 0 48% 0);
    filter: contrast(3) saturate(0.2) brightness(0.12);
    transform: translate3d(0, 24px, 0) scale(0.96);
  }
}

@keyframes start-secondary-hack-corrupt {
  0% {
    opacity: 1;
    filter: none;
    transform: translate3d(0, 0, 0) rotate(var(--banner-rotation, 0deg));
  }

  34% {
    opacity: 0.86;
    filter: contrast(1.7) saturate(1.8);
    transform: translate3d(-10px, 3px, 0) rotate(var(--banner-rotation, 0deg));
  }

  68% {
    opacity: 0.45;
    filter: contrast(2.4) saturate(2.3) hue-rotate(80deg);
    transform: translate3d(13px, -4px, 0) rotate(var(--banner-rotation, 0deg));
  }

  100% {
    opacity: 0;
    filter: contrast(3) saturate(0.2);
    transform: translate3d(0, 18px, 0) rotate(var(--banner-rotation, 0deg));
  }
}

@keyframes start-hack-scan {
  0% {
    opacity: 0;
    transform: translateY(-140%) skewY(-3deg);
  }

  18%,
  72% {
    opacity: 0.86;
  }

  100% {
    opacity: 0;
    transform: translateY(720%) skewY(-3deg);
  }
}

@keyframes start-hack-slice {
  0% {
    opacity: 0;
    transform: translateX(0) scaleX(0.35);
  }

  18%,
  76% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(var(--shift)) scaleX(1.08);
  }
}

@keyframes start-hack-block {
  0% {
    opacity: 0;
    transform: translateX(0) scaleX(0.4);
  }

  20%,
  82% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: translateX(var(--shift)) scaleX(1.4);
  }
}

@keyframes start-hack-glyph {
  0% {
    opacity: 0;
    transform: translateY(0);
  }

  20%,
  76% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(32px);
  }
}

@keyframes start-screen-jitter {
  0%,
  100% {
    transform: translate(0, 0);
  }

  12% {
    transform: translate(3px, -2px);
  }

  24% {
    transform: translate(-4px, 2px);
  }

  36% {
    transform: translate(5px, 1px);
  }

  48% {
    transform: translate(-2px, -3px);
  }

  60% {
    transform: translate(4px, 3px);
  }

  76% {
    transform: translate(-3px, 1px);
  }
}

@keyframes start-scan-break {
  0% {
    opacity: 0;
    transform: translateY(-12%);
  }

  18%,
  62% {
    opacity: 0.9;
  }

  42% {
    transform: translateY(9%);
  }

  100% {
    opacity: 0;
    transform: translateY(34%);
  }
}

@keyframes start-blackout-slices {
  0%,
  24% {
    opacity: 0;
    clip-path: inset(0);
  }

  46% {
    opacity: 0.62;
    clip-path: polygon(0 0, 100% 0, 100% 18%, 0 18%, 0 26%, 100% 26%, 100% 42%, 0 42%, 0 100%, 100% 100%, 100% 100%, 0 100%);
  }

  72% {
    opacity: 0.82;
    clip-path: polygon(0 0, 100% 0, 100% 9%, 0 9%, 0 31%, 100% 31%, 100% 51%, 0 51%, 0 74%, 100% 74%, 100% 100%, 0 100%);
  }

  100% {
    opacity: 1;
    clip-path: inset(0);
  }
}

@keyframes start-snapshot-tile-break {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: none;
  }

  38% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: contrast(1.12) saturate(1.08);
  }

  68% {
    opacity: 0.84;
    transform: translate3d(var(--shift-x), 7px, 0) scale(0.92);
    filter: contrast(1.36) saturate(1.25);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--shift-x-end), var(--shift-y-end), 0) scale(0.58);
    filter: contrast(1.7) saturate(1.4);
  }
}

@keyframes discovery-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.75);
  }

  16%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
}

@keyframes critical-timer-alert {
  0% {
    filter: brightness(1);
    transform: translate(0, 0);
  }

  50% {
    filter: brightness(1.35);
    transform: translate(-1px, 1px);
  }

  100% {
    filter: brightness(0.92);
    transform: translate(1px, -1px);
  }
}

@keyframes next-room-ready-pulse {
  0%,
  100% {
    filter: brightness(1);
    transform: translate(0, 0);
  }

  50% {
    filter: brightness(1.35);
    transform: translate(-2px, -2px);
  }
}

.modal-backdrop,
.end-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 8, 13, 0.74);
}

.modal-backdrop {
  z-index: 30;
}

.end-screen {
  z-index: 90;
}

.modal-backdrop.easter-mode {
  align-items: end;
  padding-bottom: 18px;
  background: rgba(4, 8, 13, 0.28);
}

.modal-backdrop.easter-mode .modal {
  width: min(460px, calc(100% - 24px));
  max-height: 32vh;
  padding: 10px 12px;
  border-color: #80ff5a;
  background:
    linear-gradient(90deg, rgba(128,255,90,0.06) 1px, transparent 1px) 0 0 / 8px 8px,
    #111923;
}

.modal-backdrop.easter-mode .modal h2 {
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.modal-backdrop.easter-mode .modal p {
  margin: 0 0 8px;
  line-height: 1.35;
}

.modal-backdrop.easter-mode .modal-actions {
  margin-top: 8px;
}

.modal-backdrop.easter-mode input[type="text"] {
  min-height: 34px;
  padding: 6px 8px;
}

.modal-backdrop.easter-mode .primary-button,
.modal-backdrop.easter-mode .secondary-button {
  min-height: 34px;
  padding: 0 12px;
}

.modal-backdrop.easter-mode .feedback {
  min-height: 18px;
  margin-top: 6px;
}

.dialogue-layer {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px;
  background: rgba(4, 8, 13, 0.22);
  pointer-events: auto;
}

.dialogue-bubble {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  width: min(760px, 100%);
  padding: 16px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  color: #12151c;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px) 0 0 / 8px 8px,
    var(--pixel-light);
  box-shadow: var(--pixel-shadow);
  pointer-events: auto;
  padding-bottom: 56px;
}

.dialogue-bubble::after {
  content: "";
  position: absolute;
  left: 118px;
  bottom: -22px;
  width: 30px;
  height: 22px;
  background: var(--pixel-light);
  clip-path: polygon(0 0, 100% 0, 20% 100%);
  border-left: var(--pixel-line) solid var(--pixel-border);
  border-bottom: var(--pixel-line) solid var(--pixel-border);
  transform: translateX(-50%);
}

.dialogue-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  padding: 3px;
  background: #020403;
  font-weight: 800;
  box-shadow: var(--pixel-shadow);
}

.dialogue-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: contrast(1.18) saturate(1.25);
}

.dialogue-content p {
  margin: 0;
}

.dialogue-bubble .eyebrow {
  color: #42505f;
}

#dialogueText {
  margin-top: 6px;
  color: #12151c;
  line-height: 1.45;
  font-weight: 700;
}

#dialogueText p {
  margin: 0;
}

#dialogueText p + p {
  margin-top: 10px;
}

.dialogue-actions {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  justify-content: center;
  margin-top: 0;
  transform: translateX(-50%);
}

.dialogue-character {
  position: relative;
  align-self: flex-start;
  width: 150px;
  height: 252px;
  margin-left: max(14px, calc(50% - 380px + 48px));
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.32));
  image-rendering: pixelated;
  pointer-events: none;
}

.pixel-head {
  position: absolute;
  left: 37px;
  top: 22px;
  z-index: 2;
  width: 76px;
  height: 82px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, #241514 0 10px, transparent 10px 64px, #241514 64px 76px),
    linear-gradient(#2f201b 0 12px, transparent 12px),
    #cf9677;
}

.pixel-cap {
  position: absolute;
  left: -12px;
  top: -22px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 84px;
  height: 32px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #c8ced8;
  box-shadow: 0 0 0 2px rgba(90, 255, 235, 0.28);
}

.pixel-cap img {
  width: 25px;
  height: 25px;
  padding: 2px;
  border: 1px solid #5affe9;
  background: #020403;
  object-fit: cover;
  image-rendering: pixelated;
  filter: contrast(1.35) saturate(1.7);
}

.pixel-cap-brim {
  position: absolute;
  right: -26px;
  top: -8px;
  z-index: 6;
  width: 42px;
  height: 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #c8ced8;
  box-shadow: 0 0 0 2px rgba(90, 255, 235, 0.18);
}

.pixel-hair {
  position: absolute;
  left: 0;
  top: -4px;
  z-index: 1;
  width: 70px;
  height: 22px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, #171217 0 14px, #2f201b 14px 28px, #171217 28px 58px, #241514 58px),
    #171217;
}

.pixel-hair::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 14px;
  width: 14px;
  height: 28px;
  border-right: var(--pixel-line) solid var(--pixel-border);
  background: #171217;
}

.pixel-ear {
  position: absolute;
  top: 32px;
  width: 10px;
  height: 18px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #b97d64;
}

.pixel-ear-left {
  left: -12px;
}

.pixel-ear-right {
  right: -12px;
}

.pixel-eye {
  position: absolute;
  top: 34px;
  width: 8px;
  height: 8px;
  background: #11151c;
}

.pixel-eye-left {
  left: 18px;
}

.pixel-eye-right {
  right: 20px;
}

.pixel-glasses {
  position: absolute;
  top: 28px;
  z-index: 8;
  width: 24px;
  height: 17px;
  border: 2px solid #f5f7fb;
  background: rgba(90, 169, 230, 0.12);
}

.pixel-glasses-left {
  left: 10px;
}

.pixel-glasses-right {
  right: 12px;
}

.pixel-glasses-left::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 6px;
  width: 8px;
  height: 2px;
  background: #f5f7fb;
}

.pixel-mouth {
  position: absolute;
  left: 31px;
  top: 54px;
  z-index: 9;
  width: 14px;
  height: 4px;
  border: 2px solid var(--pixel-border);
  background: #32151b;
  animation: pixel-talk 0.42s steps(2, end) infinite;
}

.pixel-chin-line {
  position: absolute;
  left: 15px;
  top: 51px;
  z-index: 4;
  width: 46px;
  height: 27px;
  background:
    linear-gradient(90deg, #241514 0 8px, transparent 8px 38px, #241514 38px),
    linear-gradient(90deg, #241514 0 12px, transparent 12px 34px, #241514 34px) 0 7px / 100% 8px no-repeat,
    linear-gradient(90deg, transparent 0 6px, #241514 6px 40px, transparent 40px) 0 14px / 100% 13px no-repeat;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 82% 100%, 18% 100%, 0 62%);
}

.pixel-chin-line::before,
.pixel-chin-line::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 9px;
  height: 20px;
  background: #241514;
}

.pixel-chin-line::before {
  left: 0;
}

.pixel-chin-line::after {
  right: 0;
}

.pixel-body {
  position: absolute;
  left: 8px;
  top: 102px;
  z-index: 1;
  width: 134px;
  height: 78px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(90deg, #0c0d10 0 18px, transparent 18px 116px, #0c0d10 116px),
    linear-gradient(#111217 0 100%);
}

.pixel-hand {
  position: absolute;
  top: 14px;
  z-index: 3;
  display: block;
  width: 20px;
  height: 64px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #0c0d10;
  transform-origin: 50% 0;
}

.pixel-hand-left {
  left: -14px;
  transform: rotate(4deg);
}

.pixel-hand-right {
  right: -14px;
  transform: rotate(-4deg);
}

.pixel-hand::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 39px;
  width: 20px;
  height: 6px;
  background: #111217;
  border-top: var(--pixel-line) solid var(--pixel-border);
}

.pixel-hand::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -8px;
  width: 14px;
  height: 10px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #cf9677;
}

.pixel-legs {
  position: absolute;
  left: 29px;
  top: 180px;
  z-index: 0;
  width: 92px;
  height: 72px;
}

.pixel-leg {
  position: absolute;
  top: 0;
  width: 30px;
  height: 60px;
  border: var(--pixel-line) solid var(--pixel-border);
  background:
    linear-gradient(180deg, #0c0d10 0 40px, #111217 40px),
    #0c0d10;
}

.pixel-leg-left {
  left: 8px;
  transform: skewX(-4deg);
}

.pixel-leg-right {
  right: 8px;
  transform: skewX(4deg);
}

.pixel-leg-left::before,
.pixel-leg-right::before {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 10px;
  background: #0c0d10;
}

.pixel-leg-left::before {
  right: -3px;
}

.pixel-leg-right::before {
  left: -3px;
}

.pixel-shoe {
  position: absolute;
  bottom: 0;
  width: 38px;
  height: 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  background: #090a0d;
}

.pixel-shoe-left {
  left: 0;
}

.pixel-shoe-right {
  right: 0;
}

@keyframes pixel-talk {
  0%,
  100% {
    height: 4px;
    transform: translateY(2px);
  }

  50% {
    height: 12px;
    transform: translateY(-2px);
  }
}

.modal,
.end-screen > div:not(.confetti-layer) {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 8px 8px,
    #17202b;
  box-shadow: var(--pixel-shadow);
}

.modal {
  position: relative;
  padding: 22px;
}

.end-screen > div:not(.confetti-layer) {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
  padding: 26px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  overflow: visible;
}

.confetti-layer.energy-burst-active {
  mix-blend-mode: screen;
}

.lightning-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.72), rgba(128, 224, 255, 0.24) 16%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(128, 255, 90, 0.28), transparent 30%);
  animation: lightning-screen-flash 1.05s steps(5, end) both;
}

.lightning-bolt {
  position: absolute;
  left: calc(50% + var(--origin-x));
  top: calc(50% + var(--origin-y));
  width: var(--length);
  height: var(--height);
  overflow: visible;
  opacity: 0;
  transform-origin: 0 50%;
  animation: lightning-jolt 1.18s cubic-bezier(.18,.8,.24,1) var(--delay) both;
  filter:
    drop-shadow(0 0 7px rgba(175, 244, 255, 0.95))
    drop-shadow(0 0 20px rgba(72, 188, 255, 0.7))
    drop-shadow(0 0 34px rgba(128, 255, 90, 0.34));
}

.lightning-glow,
.lightning-core,
.lightning-branch-glow,
.lightning-branch-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightning-glow {
  stroke: rgba(86, 205, 255, 0.52);
  stroke-width: var(--glow-width);
}

.lightning-core {
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: var(--core-width);
}

.lightning-branch-glow {
  stroke: rgba(128, 255, 255, 0.42);
  stroke-width: var(--branch-glow-width);
}

.lightning-branch-core {
  stroke: rgba(245, 255, 255, 0.92);
  stroke-width: var(--branch-core-width);
}

@keyframes lightning-screen-flash {
  0% {
    opacity: 0;
  }

  8% {
    opacity: 0.72;
  }

  16%,
  38% {
    opacity: 0.18;
  }

  26% {
    opacity: 0.46;
  }

  100% {
    opacity: 0;
  }
}

@keyframes lightning-jolt {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-50%) scaleX(0.05);
  }

  8% {
    opacity: 1;
    transform: rotate(var(--angle)) translateY(-50%) scaleX(1.02);
  }

  14% {
    opacity: 0.35;
  }

  22% {
    opacity: 1;
  }

  52% {
    opacity: 0.72;
    transform: rotate(var(--angle)) translateY(-50%) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-50%) scaleX(1.04);
  }
}

@keyframes console-blink {
  0%,
  100% {
    filter: brightness(0.85);
  }

  50% {
    filter: brightness(1.55);
  }
}

@keyframes mix-signal {
  0% {
    transform: translateX(-12px);
    opacity: 0.65;
  }

  100% {
    transform: translateX(12px);
    opacity: 1;
  }
}

@keyframes radar-sweep {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes washer-spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes frequency-pulse {
  0%,
  100% {
    color: var(--accent);
  }

  50% {
    color: #80ff5a;
  }
}

@keyframes alert-run {
  100% {
    background-position: 48px 0;
  }
}

@keyframes turbine-steps {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes cloud-drift {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(18px);
  }
}

@keyframes ticker-slide {
  100% {
    background-position: 48px 0, 0 0;
  }
}

@keyframes warning-pop {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spark-flicker {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.modal h2,
.end-screen h2 {
  margin: 6px 0 16px;
  font-size: 1.45rem;
}

.modal p,
.end-screen p {
  color: var(--muted);
  line-height: 1.5;
}

.end-screen.defeat-screen #endKicker {
  display: grid;
  place-items: center;
  width: min(100%, 420px);
  min-height: 54px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #fff7f2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px) 0 0 / 8px 8px,
    #c91624;
  box-shadow: 0 0 0 4px rgba(239, 91, 91, 0.18), 0 0 24px rgba(239, 91, 91, 0.45), var(--pixel-shadow);
  font-size: clamp(1rem, 3vw, 1.35rem);
  text-align: center;
  text-transform: uppercase;
}

.defeat-expired-label {
  display: grid;
  place-items: center;
  width: min(100%, 420px);
  min-height: 54px;
  margin: 8px auto 14px;
  padding: 10px 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #fff7f2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px) 0 0 / 8px 8px,
    #c91624;
  box-shadow: 0 0 0 4px rgba(239, 91, 91, 0.18), 0 0 24px rgba(239, 91, 91, 0.45), var(--pixel-shadow);
  font-size: clamp(1rem, 3vw, 1.35rem);
  text-align: center;
  text-transform: uppercase;
}

.victory-frequency {
  display: inline-grid;
  place-items: center;
  min-width: 124px;
  min-height: 58px;
  margin: 0 0 14px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.07) 1px, transparent 1px) 0 0 / 8px 8px,
    #80ff5a;
  box-shadow: 0 0 0 4px rgba(128, 255, 90, 0.18), 0 0 28px rgba(128, 255, 90, 0.38), var(--pixel-shadow);
  font-size: 2rem;
  font-weight: 900;
}

.victory-lead,
.victory-code {
  display: block;
  color: var(--text);
}

.victory-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.victory-report span {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(255, 184, 77, 0.08) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(255, 184, 77, 0.09);
}

.victory-report strong {
  color: var(--accent-2);
  font-size: 1.25rem;
}

.victory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.victory-grid span {
  display: block;
  min-height: 76px;
  padding: 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(255, 255, 255, 0.07);
}

.victory-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #80ff5a;
}

.victory-code {
  width: min(100%, 620px);
  margin-top: 12px;
  padding: 8px 12px;
  border: var(--pixel-line) solid var(--pixel-border);
  color: #102019;
  background: var(--accent-2);
  font-weight: 900;
}

.control-grid,
.choice-list,
.sort-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.choice-list label,
.control-grid label,
.sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 6px 6px,
    rgba(255, 255, 255, 0.05);
}

.sort-row {
  display: grid;
  grid-template-columns: 32px 1fr;
}

.availability-row {
  grid-template-columns: minmax(112px, 34%) minmax(0, 1fr);
}

.availability-label {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.answer-correct {
  border-color: #80ff5a !important;
  background:
    linear-gradient(90deg, rgba(128, 255, 90, 0.12) 1px, transparent 1px) 0 0 / 6px 6px,
    rgba(128, 255, 90, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(128, 255, 90, 0.72), 0 0 0 2px rgba(128, 255, 90, 0.14);
}

.answer-wrong {
  border-color: var(--danger) !important;
  background:
    linear-gradient(90deg, rgba(239, 91, 91, 0.13) 1px, transparent 1px) 0 0 / 6px 6px,
    rgba(239, 91, 91, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(239, 91, 91, 0.82), 0 0 0 2px rgba(239, 91, 91, 0.14);
  animation: wrong-answer-jolt 0.18s steps(2, end);
}

select.answer-correct,
input[type="text"].answer-correct {
  color: #efffe7;
  border-color: #80ff5a !important;
  background:
    linear-gradient(90deg, rgba(128, 255, 90, 0.12) 1px, transparent 1px) 0 0 / 6px 6px,
    #102718 !important;
}

select.answer-wrong,
input[type="text"].answer-wrong {
  color: #ffecec;
  border-color: var(--danger) !important;
  background:
    linear-gradient(90deg, rgba(239, 91, 91, 0.13) 1px, transparent 1px) 0 0 / 6px 6px,
    #30151a !important;
}

@keyframes wrong-answer-jolt {
  0% {
    transform: translateX(0);
  }

  33% {
    transform: translateX(-3px);
  }

  66% {
    transform: translateX(3px);
  }

  100% {
    transform: translateX(0);
  }
}

select,
input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 6px 6px,
    #101720;
  padding: 8px 10px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 42px;
  border: var(--pixel-line) solid var(--pixel-border);
  border-radius: 0;
  cursor: pointer;
  box-shadow: var(--pixel-shadow);
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.8);
}

.primary-button {
  padding: 0 18px;
  color: #102019;
  background: var(--accent);
  font-weight: 700;
}

.secondary-button {
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.close-button {
  position: absolute;
  right: 14px;
  top: 14px;
}

.feedback {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 700;
}

.hidden {
  display: none;
}

.dialogue-layer.hidden {
  display: none;
}

/* Fine pixel art room redesign */
.room > div:not(.room-title),
.room > button {
  image-rendering: pixelated;
}

.room-title,
.hotspot,
.door,
.room-tab,
.meter-card,
.side-panel,
.stage,
.modal,
.end-screen > div:not(.confetti-layer) {
  border-color: #1b2130;
}

.room-control {
  background:
    linear-gradient(90deg, rgba(105, 150, 190, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.14) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#223044 0 18%, #1b2634 18% 58%, #171015 58% 100%);
}

.room-mixroom {
  background:
    linear-gradient(90deg, rgba(255, 213, 102, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#26364d 0 20%, #202a3a 20% 56%, #15171f 56% 100%);
}

.room-weatherroom {
  background:
    linear-gradient(90deg, rgba(90, 169, 230, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.14) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#10233e 0 20%, #142234 20% 58%, #10131b 58% 100%);
}

.room-laundry {
  background:
    linear-gradient(90deg, rgba(219, 230, 245, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#344050 0 20%, #28313d 20% 57%, #15181d 57% 100%);
}

.room-electrical {
  background:
    linear-gradient(90deg, rgba(255, 184, 77, 0.13) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.16) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(#202b38 0 20%, #1a222c 20% 58%, #100d10 58% 100%);
}

/* Deep room decor pass */
.room-control::before,
.room-mixroom::before,
.room-weatherroom::before,
.room-laundry::before,
.room-electrical::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 18px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(0,0,0,0.16) 0 2px, transparent 2px 18px) 0 0 / 36px 36px,
    linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.035) 18px 24px, transparent 24px 48px);
  opacity: 0.75;
}

.room-control::after,
.room-mixroom::after,
.room-weatherroom::after,
.room-laundry::after,
.room-electrical::after {
  inset: 57% 0 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.28) 0 2px, transparent 2px 18px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 18px) 0 0 / 36px 36px,
    linear-gradient(rgba(0,0,0,0.22), rgba(0,0,0,0.08));
  opacity: 0.85;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .victory-report {
    grid-template-columns: 1fr;
  }

  .start-panel {
    min-height: min(820px, calc(100vh - 28px));
  }

  .sponsor-strip {
    grid-template-columns: 1fr;
  }

  .sponsor-strip figure {
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto;
    align-items: center;
  }

  .sponsor-strip figcaption {
    text-align: left;
    white-space: normal;
  }

  .game-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .side-panel {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .stage {
    overflow: visible;
  }

  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .home-button {
    align-self: flex-start;
  }

  .meters {
    grid-template-columns: 1fr;
  }

  .room {
    min-height: 620px;
  }

  .room-nav {
    grid-template-columns: 1fr 1fr;
  }

  .hotspot {
    min-width: 112px;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .victory-grid {
    grid-template-columns: 1fr;
  }

  .start-actions {
    display: grid;
  }

  .victory-frequency {
    min-width: 104px;
    min-height: 50px;
    font-size: 1.55rem;
  }

  .start-screen {
    padding: 10px;
  }

  .start-panel {
    gap: 11px;
    min-height: calc(100vh - 20px);
    padding: 16px;
  }

  .start-panel h1 {
    font-size: clamp(2.4rem, 15vw, 4.6rem);
  }

  .start-pitch {
    font-size: 0.92rem;
  }

  .start-stats span {
    min-height: 32px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .sponsor-strip {
    gap: 8px;
  }

  .sponsor-strip figure {
    grid-template-columns: 92px 1fr;
    padding: 8px;
  }

  .sponsor-strip img {
    max-height: 54px;
  }

  .start-button {
    min-height: 46px;
  }

  .game-shell {
    padding: 8px;
  }

  .stage {
    padding: 6px;
  }

  .room {
    min-height: 560px;
  }

  .room-title {
    left: 12px;
    top: 12px;
    padding: 9px 10px;
  }

  .hotspot {
    min-width: 96px;
    min-height: 40px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .hotspot-screen {
    left: 50%;
  }

  .hotspot-cards {
    left: 50%;
  }

  .hotspot-tablet {
    left: 50%;
  }

  .hotspot-programmer {
    left: 50%;
  }

  .hotspot-final {
    left: 50%;
  }

  .door {
    min-width: 96px;
    min-height: 40px;
    font-size: 0.8rem;
  }

  .door-prev {
    left: 12px;
  }

  .door-next {
    right: 12px;
  }

  .easter-egg {
    width: 70px;
    height: 100px;
  }

  .easter-egg-control {
    left: 14%;
    bottom: 16%;
    width: 86px;
    height: 38px;
  }

  .easter-egg-laundry {
    right: 8%;
    top: 18%;
    width: 64px;
    height: 90px;
  }

  .easter-egg-mix {
    left: 44%;
    top: 20%;
    width: 86px;
    height: 38px;
  }

  .dialogue-layer {
    gap: 10px;
    padding: 10px;
  }

  .dialogue-bubble {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 12px;
  }

  .dialogue-avatar {
    width: 42px;
    height: 42px;
  }

  .dialogue-character {
    transform: scale(0.78);
    transform-origin: top left;
  }
}

/* GitHub Pages responsive polish */
@media (max-width: 1240px), (max-height: 820px) {
  body {
    overflow: hidden;
  }

  .start-screen {
    padding: 10px;
  }

  .start-panel {
    width: min(920px, 100%);
    min-height: min(680px, calc(100dvh - 20px));
    gap: 10px;
    padding: 18px;
  }

  .start-panel h1 {
    font-size: clamp(2.65rem, 7vw, 5.2rem);
  }

  .start-pitch {
    font-size: 0.96rem;
    line-height: 1.38;
  }

  .start-stats {
    gap: 8px;
  }

  .start-stats span {
    min-height: 31px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .jury-promise,
  .credits-card {
    gap: 4px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .sponsor-heading {
    margin: 2px 0 -5px;
    font-size: 0.78rem;
  }

  .sponsor-strip {
    gap: 8px;
  }

  .sponsor-strip figure {
    grid-template-rows: 72px auto;
    gap: 6px;
    padding: 8px;
  }

  .sponsor-strip figcaption {
    font-size: 0.68rem;
  }

  .start-actions {
    gap: 8px;
  }

  .start-button {
    min-height: 42px;
    font-size: 0.9rem;
  }

  .creator-banner {
    width: min(760px, calc(100% - 22px));
    min-height: 160px;
  }

  .creator-banner p {
    font-size: clamp(1.35rem, 3.3vw, 2.3rem);
  }

  .game-shell {
    width: 100%;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 10px;
    padding: 10px;
    overflow: hidden;
  }

  .hud {
    gap: 10px;
    padding: 9px 10px;
  }

  .brand {
    min-width: 150px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand h1 {
    font-size: 1.18rem;
  }

  .home-button {
    min-width: 82px;
    min-height: 36px;
  }

  .meters {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
    gap: 7px;
  }

  .meter-card {
    min-height: 50px;
    padding: 7px 8px;
  }

  .meter-card strong {
    margin-top: 3px;
    font-size: 1rem;
  }

  .stage {
    padding: 9px;
    min-height: 0;
  }

  .room-nav {
    gap: 5px;
    margin-bottom: 8px;
  }

  .room-tab {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.78rem;
  }

  .room {
    min-height: 0;
  }

  .side-panel {
    max-height: calc(100vh - 20px);
    padding: 9px;
    overflow-y: auto;
  }

  .side-panel > section {
    padding: 8px;
  }

  .side-panel h2 {
    font-size: 0.8rem;
  }

  .code-groups {
    gap: 6px;
  }

  .code-slots span {
    min-height: 28px;
    font-size: 0.9rem;
  }

  .final-code-preview strong {
    font-size: 1.08rem;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .hud {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .meters {
    flex-basis: 100%;
  }

  .stage {
    min-height: auto;
    overflow: visible;
  }

  .room {
    min-height: clamp(520px, 62vw, 700px);
  }

  .side-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .game-shell {
    padding: 8px;
  }

  .hud {
    flex-direction: column;
  }

  .meters {
    grid-template-columns: 1fr;
  }

  .room-nav {
    grid-template-columns: 1fr 1fr;
  }

  .room {
    min-height: 560px;
  }

  .room-title {
    max-width: calc(100% - 24px);
  }
}

@media (max-height: 700px) and (min-width: 1101px) {
  .game-shell {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .stage {
    min-height: 0;
  }

  .room {
    min-height: 0;
  }

  .room-title {
    top: 12px;
    padding: 8px 10px;
  }

  .room-title h2 {
    font-size: 0.98rem;
  }

  .hotspot {
    min-width: 108px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .door {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }
}

/* Smartphone layout: compact, touch friendly, and no cropped start screen. */
@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-y: auto;
    min-height: 100dvh;
  }

  .start-screen {
    display: block;
    overflow-y: auto;
    padding: 8px;
  }

  .start-panel {
    width: 100%;
    min-height: auto;
    gap: 8px;
    margin: 0 auto;
    padding: 12px;
  }

  .start-panel::before {
    inset: 7px;
  }

  .start-panel h1 {
    font-size: clamp(2.15rem, 13vw, 3.25rem);
    line-height: 0.96;
  }

  .start-pitch {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .start-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .start-stats span {
    min-height: 34px;
    padding: 6px 5px;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
  }

  .jury-promise,
  .credits-card {
    gap: 3px;
    padding: 7px;
    font-size: 0.7rem;
  }

  .sponsor-heading {
    margin: 0;
    font-size: 0.68rem;
  }

  .sponsor-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .sponsor-strip figure {
    grid-template-rows: 42px;
    gap: 0;
    min-width: 0;
    padding: 5px;
  }

  .sponsor-strip figcaption {
    display: none;
  }

  .start-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .start-button,
  .demo-button {
    width: 100%;
    min-height: 40px;
    font-size: 0.82rem;
  }

  .creator-banner {
    width: min(330px, calc(100vw - 22px));
    min-height: 150px;
    max-height: calc(100dvh - 28px);
    padding: 36px 16px 18px;
    overflow-y: auto;
  }

  .creator-banner p {
    font-size: clamp(1.22rem, 7vw, 1.72rem);
  }

  .creator-banner .icon-button {
    right: 8px;
    top: 8px;
  }

  .game-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
    height: auto;
    padding: 6px;
    overflow: visible;
  }

  .hud,
  .stage,
  .side-panel,
  .room-nav,
  .room,
  .brand,
  .meters,
  .code-groups,
  .code-group,
  .final-code-preview,
  #logList {
    min-width: 0;
    max-width: 100%;
  }

  .hud {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 7px;
    padding: 8px;
  }

  .brand {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .mode-badge {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 0.58rem;
  }

  .home-button {
    min-width: 78px;
    min-height: 32px;
    font-size: 0.7rem;
  }

  .meters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
  }

  .meter-card {
    min-height: 40px;
    padding: 5px 5px;
  }

  .meter-card .label {
    font-size: 0.56rem;
  }

  .meter-card strong {
    margin-top: 2px;
    font-size: 0.72rem;
  }

  .gauge-card {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .gauge-track {
    height: 8px;
  }

  .stage {
    padding: 6px;
    overflow: visible;
  }

  .room-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .room-tab {
    flex: 0 0 112px;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.68rem;
  }

  .room {
    height: min(58dvh, 420px);
    min-height: 330px;
    --room-decor-offset: 0px;
  }

  .room-control,
  .room-mixroom,
  .room-weatherroom,
  .room-laundry,
  .room-electrical {
    background-position: center, center, center -8px !important;
    background-repeat: no-repeat, no-repeat, no-repeat !important;
    background-size: auto, auto, contain !important;
  }

  .room-title {
    left: 8px;
    top: 8px;
    max-width: calc(100% - 16px);
    padding: 7px 8px;
  }

  .room-title h2 {
    font-size: 0.82rem;
  }

  .room-title .eyebrow {
    font-size: 0.56rem;
  }

  .mix-info-wind {
    left: 22%;
    top: 40%;
  }

  .mix-info-nuclear {
    left: 52%;
    top: 42%;
  }

  .mix-info-solar {
    left: 77%;
    top: 64%;
  }

  .mix-info-hydro {
    left: 37%;
    top: 76%;
  }

  .tech-info-washer {
    left: 33%;
    top: 59%;
  }

  .tech-info-dryer {
    left: 49%;
    top: 59%;
  }

  .tech-info-water {
    left: 66%;
    top: 47%;
  }

  .tech-info-car {
    left: 84%;
    top: 56%;
  }

  .hotspot {
    min-width: 82px;
    min-height: 34px;
    padding: 5px 6px;
    font-size: 0.64rem;
  }

  .door {
    min-width: 82px;
    min-height: 34px;
    padding: 5px 7px;
    font-size: 0.65rem;
  }

  .door-prev {
    left: 8px;
  }

  .door-next {
    right: 8px;
  }

  .easter-egg {
    width: 58px;
    height: 78px;
  }

  .easter-egg-laundry {
    width: 52px;
    height: 74px;
  }

  .easter-egg-mix {
    width: 74px;
    height: 32px;
  }

  .side-panel {
    max-height: 46dvh;
    padding: 7px;
    overflow-y: auto;
  }

  .side-panel > section {
    padding: 7px;
  }

  .side-panel h2 {
    margin-bottom: 7px;
    font-size: 0.72rem;
  }

  .jury-room-grid,
  .jury-actions,
  .code-groups {
    gap: 5px;
  }

  .log-list {
    max-height: 150px;
  }

  .code-group {
    padding: 7px;
  }

  .code-group p {
    font-size: 0.62rem;
  }

  .code-slots {
    gap: 5px;
  }

  .code-slots span {
    min-width: 0;
    min-height: 30px;
    font-size: 0.82rem;
  }

  .final-code-preview {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 7px;
  }

  .final-code-preview strong {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }

  .modal-backdrop,
  .end-screen {
    padding: 8px;
  }

  .modal,
  .end-screen > div:not(.confetti-layer) {
    width: min(100%, 360px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 12px;
  }

  .modal h2,
  .end-screen h2 {
    margin-bottom: 10px;
    font-size: 1.05rem;
  }

  .control-grid,
  .choice-list,
  .sort-list {
    gap: 7px;
    margin: 10px 0;
  }

  .choice-list label,
  .control-grid label,
  .sort-row {
    gap: 7px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .sort-row {
    grid-template-columns: 26px 1fr;
  }

  .availability-row {
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
  }

  select,
  input[type="text"] {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 0.9rem;
  }

  .modal-actions {
    gap: 7px;
    margin-top: 10px;
  }

  .primary-button,
  .secondary-button,
  .icon-button {
    min-height: 36px;
  }

  .modal-backdrop.easter-mode {
    padding: 0 8px 8px;
  }

  .modal-backdrop.easter-mode .modal {
    width: min(100%, 350px);
    max-height: 38dvh;
  }

  .dialogue-layer {
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: max(10px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom));
    background: rgba(4, 8, 13, 0.42);
    overflow-y: auto;
  }

  .dialogue-bubble {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    width: min(100%, 350px);
    max-height: none;
    padding: 10px 10px 46px;
    overflow: visible;
  }

  .dialogue-bubble::after {
    left: 74px;
    bottom: -20px;
    width: 28px;
    height: 20px;
  }

  .dialogue-content {
    min-width: 0;
  }

  .dialogue-avatar {
    width: 34px;
    height: 34px;
  }

  .dialogue-bubble .eyebrow {
    font-size: 0.58rem;
  }

  #dialogueText {
    max-height: 30dvh;
    font-size: 0.78rem;
    line-height: 1.34;
    overflow-y: auto;
    padding-right: 4px;
  }

  .dialogue-actions {
    bottom: 8px;
  }

  .dialogue-actions .primary-button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  .dialogue-character {
    width: 150px;
    height: 148px;
    margin-top: 2px;
    margin-left: max(8px, calc(50% - 175px + 16px));
    transform: scale(0.54);
    transform-origin: top left;
  }
}

/* Final desktop HUD compression: keeps the game area taller on wide screens. */
@media (min-width: 1101px) {
  .game-shell {
    gap: 8px;
    padding: 8px;
  }

  .hud {
    min-height: 58px;
    max-height: 58px;
    gap: 8px;
    padding: 5px 8px;
    overflow: hidden;
  }

  .brand {
    min-width: 168px;
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand h1 {
    font-size: 1.08rem;
    line-height: 1;
  }

  .brand .eyebrow {
    font-size: 0.62rem;
    line-height: 1;
  }

  .home-button,
  .mode-badge {
    min-height: 32px;
  }

  .home-button {
    min-width: 82px;
    padding: 0 12px;
  }

  .mode-badge {
    display: grid;
    place-items: center;
    padding: 0 10px;
  }

  .meters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 6px;
  }

  .meter-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    height: 42px;
    padding: 5px 10px;
  }

  .meter-card .label {
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
  }

  .meter-card strong {
    margin-top: 0;
    font-size: 1.04rem;
    line-height: 1;
  }

  .gauge-card {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    column-gap: 8px;
  }

  .gauge-card .label {
    grid-column: auto;
  }

  .gauge-track {
    height: 8px;
  }

  .stage {
    padding: 8px;
  }

  .room-nav {
    margin-bottom: 6px;
  }

  .room-tab {
    min-height: 32px;
  }
}

