:root {
  --bg: #0b0e19;
  --bg-2: #12162a;
  --accent: #ff7ad9;
  --accent-2: #7cf1ff;
  --gold: #ffd27d;
  --text: #e8ecff;
  --muted: #aab1d6;
  --card: rgba(255, 255, 255, 0.07);
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 10%, #1b1f3a 0%, var(--bg) 60%),
    radial-gradient(900px 600px at 80% 90%, #2a163a 0%, var(--bg-2) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

body.glitch-mode {
  background: radial-gradient(1200px 800px at 20% 10%, #291b3a 0%, #120f22 60%),
    radial-gradient(900px 600px at 80% 90%, #1b2a3a 0%, #0c101c 55%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='5' cy='5' r='1'/%3E%3Ccircle cx='25' cy='10' r='1'/%3E%3Ccircle cx='40' cy='35' r='1'/%3E%3Ccircle cx='50' cy='20' r='1'/%3E%3Ccircle cx='15' cy='45' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.5;
}

.shell {
  width: min(1100px, 92vw);
  padding: 60px 40px 70px;
  display: grid;
  gap: 28px;
}

.hero {
  display: grid;
  gap: 18px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  text-shadow: 0 20px 60px rgba(255, 122, 217, 0.18);
}

.subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  max-width: 640px;
}

.silent-rock {
  width: 80px;
  height: 50px;
  border-radius: 40px 40px 30px 30px;
  background: #1a2038;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.35);
  opacity: 0.25;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.silent-rock:hover {
  opacity: 0.6;
  transform: translateY(-2px);
}

.jump-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.98);
  opacity: 0;
  z-index: 40;
  pointer-events: none;
  animation: jumpFlash 1.6s ease 2.6s forwards;
}

.cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.btn {
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0e0f1a;
  box-shadow: 0 10px 30px rgba(124, 241, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 36px rgba(124, 241, 255, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px var(--shadow);
  backdrop-filter: blur(16px);
}

.panels {
  display: grid;
  gap: 18px;
}

.panel h3 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--gold);
}

.panel p,
.panel li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.panel ul {
  display: grid;
  gap: 8px;
  list-style: none;
}

.panel li::before {
  content: "✦";
  color: var(--accent-2);
  margin-right: 8px;
}

.alert {
  border: 1px solid rgba(255, 122, 217, 0.3);
  background: rgba(255, 122, 217, 0.08);
}

.alert-title {
  font-weight: 600;
  color: var(--gold);
  font-size: 18px;
}

.quest-info ul {
  margin-top: 6px;
}

.quest-stages {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.quest-stage {
  position: relative;
}

.stage-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-badge {
  align-self: flex-start;
  background: rgba(124, 241, 255, 0.15);
  color: var(--accent-2);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-text {
  color: var(--muted);
}

.stage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress {
  font-size: 14px;
  color: var(--text);
  opacity: 0.8;
}

.bug-list {
  display: grid;
  gap: 10px;
}

.bug {
  background: rgba(10, 12, 22, 0.6);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.bug::before {
  content: "";
  margin-right: 0;
}

.bug:hover {
  border-color: rgba(124, 241, 255, 0.4);
  transform: translateY(-1px);
}

.bug.found {
  border-color: rgba(124, 241, 255, 0.8);
  background: rgba(124, 241, 255, 0.1);
  color: var(--text);
}

.terminal {
  display: grid;
  gap: 10px;
  background: rgba(7, 10, 18, 0.75);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header {
  font-size: 13px;
  color: var(--muted);
}

.terminal-output {
  min-height: 120px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--accent-2);
  display: grid;
  gap: 6px;
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maze-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.maze-tile {
  background: rgba(12, 14, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.maze-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 217, 0.4);
}

.maze-tile.found {
  background: rgba(255, 122, 217, 0.15);
  border-color: rgba(255, 122, 217, 0.8);
  color: var(--text);
}

.final-card {
  display: grid;
  gap: 12px;
  background: rgba(10, 12, 22, 0.6);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.final-title {
  color: var(--gold);
  font-weight: 600;
}

.final-message {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(124, 241, 255, 0.12);
  border: 1px solid rgba(124, 241, 255, 0.4);
  color: var(--text);
}

.gift-panel .gift-frame {
  position: relative;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: rgba(12, 15, 30, 0.6);
}

.gift-iframe {
  width: 100%;
  height: 420px;
  border: none;
  border-radius: 14px;
  background: #0b0e19;
}

.game-lock {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  border-radius: 14px;
  background: rgba(10, 12, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  font-size: 14px;
}

.game-lock.hidden {
  display: none;
}

.game-status {
  font-size: 14px;
  color: var(--accent-2);
  padding: 6px 0 2px;
}

.gift-message {
  text-align: center;
  gap: 12px;
}

.gift-title {
  font-size: clamp(24px, 4vw, 36px);
  color: var(--gold);
  text-shadow: 0 10px 30px rgba(255, 210, 125, 0.25);
  opacity: 0;
  transform: translateY(8px);
}

.gift-text {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
}

.gift-message.visible .gift-title {
  animation: giftGlow 1s ease forwards;
}

.gift-message.visible .gift-text {
  animation: giftRise 1.2s ease forwards 0.3s;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 22, 0.86);
  display: grid;
  place-items: center;
  z-index: 20;
}

.overlay-card {
  width: min(520px, 92vw);
  max-height: 80vh;
  background: rgba(12, 14, 28, 0.9);
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 14px;
}

.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.achievements-list {
  display: grid;
  gap: 10px;
  list-style: none;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 4px;
}

.achievement {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--muted);
  background: rgba(10, 12, 22, 0.6);
}

.achievement.unlocked {
  border-color: rgba(124, 241, 255, 0.8);
  color: var(--text);
  background: rgba(124, 241, 255, 0.08);
}

.achievement-title {
  font-size: 14px;
  color: var(--gold);
}

.achievement-text {
  font-size: 13px;
  color: inherit;
  margin-top: 4px;
}

.achievement.locked .achievement-text {
  color: rgba(255, 255, 255, 0.35);
}

.gallery-panel {
  text-align: center;
}

.gallery-grid {
  margin-top: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.gallery-item {
  position: relative;
  height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 15, 30, 0.6);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) grayscale(0.3);
  transition: filter 0.2s ease;
}

.gallery-item.revealed img {
  filter: none;
}

.gallery-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(10, 12, 22, 0.6);
  transition: opacity 0.2s ease;
}

.gallery-item.revealed .gallery-cover {
  opacity: 0;
  pointer-events: none;
}

.gallery-item.fleeing {
  position: fixed;
  z-index: 60;
  width: 160px;
  height: 120px;
  transition: transform 0.1s ease;
}

.gallery-placeholder {
  width: 160px;
  height: 120px;
}

.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  background: rgba(12, 14, 28, 0.95);
  border: 1px solid rgba(124, 241, 255, 0.4);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  animation: toastSlide 3.2s ease forwards;
}

.toast-title {
  font-size: 14px;
  color: var(--gold);
}

.toast-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.footer-line {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

.binary-input {
  cursor: pointer;
  user-select: none;
}

.binary-bit {
  padding: 0 2px;
  border-radius: 4px;
}

.binary-bit.active {
  background: rgba(124, 241, 255, 0.2);
  color: var(--accent-2);
}

@keyframes toastSlide {
  0% {
    opacity: 0;
    transform: translateX(12px);
  }
  10%,
  85% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(12px);
  }
}

@keyframes jumpFlash {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  15%,
  65% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
  }
}

.hidden {
  display: none;
}

.locked {
  opacity: 0.5;
  filter: grayscale(0.4);
  pointer-events: none;
}

.center-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(13, 15, 26, 0.95), rgba(10, 12, 20, 0.95));
  z-index: 10;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.center-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  text-align: center;
  padding: 38px 34px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  max-width: 420px;
  display: grid;
  gap: 16px;
}

.start-card h1 {
  font-size: 24px;
  color: var(--gold);
}

.start-card p {
  color: var(--muted);
  font-size: 15px;
}

.rat-crew {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.rat {
  width: 48px;
  height: 48px;
  border-radius: 50% 50% 45% 45%;
  background: #1a1f38;
  border: 2px solid rgba(124, 241, 255, 0.4);
  position: relative;
  animation: float 3.8s ease-in-out infinite;
}

.rat::before,
.rat::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: #1a1f38;
  border: 2px solid rgba(255, 122, 217, 0.4);
  border-radius: 50%;
  top: -6px;
}

.rat::before {
  left: 4px;
}

.rat::after {
  right: 4px;
}

.rat--two {
  animation-delay: 0.6s;
}

.rat--three {
  animation-delay: 1.1s;
}

.rat::marker {
  content: none;
}

.rat::selection {
  background: transparent;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes giftGlow {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes giftRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 40px 18px 50px;
  }

  .quest-stages {
    grid-template-columns: 1fr;
  }

  .gift-iframe {
    height: 360px;
  }
}
