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

:root {
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-2: #1b1b1b;
  --border: #2a2a2a;
  --text: #e8e4dc;
  --muted: #9b968d;
  --faint: #6b675f;
  --orange: #ff7b1c;
  --yellow: #f1c232;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;

  --transition: all 0.2s ease;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: var(--orange);
}

a:hover {
  color: var(--yellow);
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--orange);
}

.brand:hover {
  color: var(--text);
  opacity: 0.7;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-toggle {
  display: none;
}

.nav-drop {
  position: relative;
}

.drop-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.drop-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}

.drop-btn[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.drop-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.drop-btn.active,
.drop-btn.active[aria-expanded="true"] {
  color: var(--orange);
}

.drop-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 290px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.nav-drop.open .drop-list {
  display: block;
}

.drop-pages {
  display: grid;
  perspective: 900px;
}

.drop-page {
  grid-area: 1 / 1;
  visibility: hidden;
  backface-visibility: hidden;
}

.drop-page.current,
.drop-page.flip-out {
  visibility: visible;
}

.drop-page.flip-out.fwd {
  animation: flip-out-fwd 0.17s ease-in forwards;
}

.drop-page.flip-in.fwd {
  animation: flip-in-fwd 0.22s ease-out;
}

.drop-page.flip-out.back {
  animation: flip-out-back 0.17s ease-in forwards;
}

.drop-page.flip-in.back {
  animation: flip-in-back 0.22s ease-out;
}

@keyframes flip-out-fwd {
  to {
    transform: rotateY(-90deg) translateX(-12px);
    opacity: 0.3;
  }
}

@keyframes flip-in-fwd {
  from {
    transform: rotateY(90deg) translateX(12px);
    opacity: 0.3;
  }
}

@keyframes flip-out-back {
  to {
    transform: rotateY(90deg) translateX(12px);
    opacity: 0.3;
  }
}

@keyframes flip-in-back {
  from {
    transform: rotateY(-90deg) translateX(-12px);
    opacity: 0.3;
  }
}

.drop-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.drop-prev,
.drop-next {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}

.drop-prev::before,
.drop-next::before {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.drop-prev::before {
  transform: translateX(2px) rotate(-135deg);
}

.drop-next::before {
  transform: translateX(-2px) rotate(45deg);
}

.drop-prev:hover,
.drop-next:hover {
  background: var(--surface-2);
  color: var(--yellow);
}

.drop-dots {
  display: flex;
  gap: 6px;
}

.drop-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  background: var(--border);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.drop-dots button.on {
  width: 18px;
  border-radius: 4px;
  background: var(--orange);
}

.drop-item {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.drop-item span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 400;
}

.drop-item small {
  font-size: 0.7rem;
  color: var(--yellow);
}

.drop-item:hover,
.drop-item:focus-visible {
  background: var(--surface-2);
  color: var(--yellow);
}

.drop-item.active {
  color: var(--orange);
  box-shadow: inset 2px 0 0 var(--orange);
}

@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    padding: var(--space-xs) var(--space-sm);
  }

  .brand {
    margin-right: auto;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 2;
    padding: 0.45rem 0.75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: 500 0.875rem var(--font-sans);
    cursor: pointer;
  }

  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    display: block;
    width: 14px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, background 0.2s ease;
  }

  .nav-toggle span {
    position: relative;
  }

  .nav-toggle span::before,
  .nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle span::before {
    top: -5px;
  }

  .nav-toggle span::after {
    top: 5px;
  }

  .nav-toggle[aria-expanded="true"] {
    background: var(--surface-2);
    color: var(--orange);
  }

  .nav-toggle[aria-expanded="true"] span {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] span::before {
    transform: translateY(5px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span::after {
    transform: translateY(-5px) rotate(-45deg);
  }

  .admin-link {
    order: 3;
  }

  .nav-menu {
    display: none;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: var(--space-xs) 0;
    border-top: 1px solid var(--border);
  }

  .nav.open .nav-menu {
    display: flex;
  }

  .nav-menu .nav-item {
    padding: 0.7rem 0.75rem;
    font-size: 1rem;
  }

  .drop-btn {
    width: 100%;
    justify-content: space-between;
  }

  .drop-list {
    position: static;
    transform: none;
    width: auto;
    max-height: none;
    margin: 2px 0 4px 0.75rem;
    padding: 0 0 0 6px;
    background: none;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
  }

  .drop-pager {
    margin-right: var(--space-xs);
  }

  .drop-item {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
  }
}

.nav-item {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-2);
  color: var(--orange);
}

.nav-item small {
  font-size: 0.7rem;
  color: var(--yellow);
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

.container.wide {
  max-width: 1100px;
}

.page-head {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.page-head h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-head p {
  margin-top: var(--space-sm);
  color: var(--muted);
  font-size: 1.1rem;
}

section {
  margin-bottom: var(--space-xl);
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
  scroll-margin-top: 80px;
}

h3 {
  font-size: 1.1rem;
  margin: var(--space-md) 0 var(--space-xs);
  scroll-margin-top: 80px;
}

p + p {
  margin-top: var(--space-sm);
}

ul, ol {
  padding-left: 1.4rem;
  margin: var(--space-xs) 0 var(--space-sm);
}

li + li {
  margin-top: 0.3rem;
}

strong {
  color: #fff;
}

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

.note {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--orange);
  background: var(--surface);
  color: var(--muted);
}

.passage {
  margin: var(--space-md) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--yellow);
  background: var(--surface);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.75;
}

.card {
  border: 2px solid var(--border);
  padding: var(--space-md);
  background: var(--surface);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.fact {
  border: 2px solid var(--border);
  padding: var(--space-sm);
}

.fact span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.fact b {
  font-size: 1.15rem;
}

.table-wrap {
  overflow-x: auto;
  margin: var(--space-sm) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
}

thead th {
  background: var(--surface-2);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

tbody th {
  font-weight: 600;
  white-space: nowrap;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem var(--space-md);
}

dt {
  font-weight: 600;
}

dd {
  color: var(--muted);
}

.pages {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-xs);
}

.pages li + li {
  margin-top: 0;
}

.pages a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.8rem var(--space-sm);
  border: 2px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.pages a:hover {
  border-color: var(--orange);
  background: var(--surface);
}

.pages a span {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.timeline {
  list-style: none;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 var(--space-md) var(--space-md);
}

.timeline li + li {
  margin-top: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.55rem;
  width: 10px;
  height: 10px;
  background: var(--bg);
  border: 2px solid var(--orange);
  border-radius: 50%;
}

.timeline .year {
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: 0.9rem;
}

.timeline h3 {
  margin-top: 0;
}

.levels-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-sm) 0 var(--space-md);
}

.levels-jump a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.levels-jump a:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.level {
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
}

.level h3 span {
  font-family: var(--font-mono);
  color: var(--orange);
  margin-right: 0.4rem;
}

.specimen-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-xl);
}

.specimen-top .table-wrap {
  margin: 0;
}

.expie-figure {
  border: 2px solid var(--border);
  background: var(--surface);
  padding: var(--space-md);
}

.expie {
  position: relative;
  width: 100%;
  aspect-ratio: 431 / 403;
}

.expie canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.expie-eyes {
  filter: drop-shadow(0 0 3px #ff7b1c) drop-shadow(0 0 8px rgba(255, 123, 28, 0.6));
}

.expie-figure figcaption {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg) calc(6rem + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  max-width: 820px;
  margin: 0 auto;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.pager a {
  font-weight: 600;
}

.game-credit {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.game-credit img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.credits p + p {
  margin-top: 0.25rem;
}

.takedown-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  background: #0a0a2a url("../assets/galaxy.webp") center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.takedown-btn:hover {
  color: #fff;
  border-color: var(--orange);
  background-size: 140%;
}


.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.92);
}

.gate[hidden] {
  display: none;
}

.gate-box {
  max-width: 460px;
  border: 2px solid var(--orange);
  background: var(--surface);
  padding: var(--space-lg);
}

.gate-box h2 {
  margin-bottom: var(--space-xs);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn.go {
  background: var(--orange);
  border-color: var(--orange);
  color: #140800;
}

.btn:hover {
  border-color: var(--yellow);
}

body.gated {
  overflow: hidden;
}

@media (max-width: 860px) {
  .specimen-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-lg) var(--space-sm) var(--space-xl);
  }

  .footer {
    padding-inline: var(--space-sm);
  }

  dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  dd {
    margin-bottom: var(--space-xs);
  }

  .pages a {
    flex-direction: column;
    gap: 0.15rem;
  }

  .pages a span {
    text-align: left;
  }

  .takedown-btn {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 11px 14px;
    font-size: 0.85rem;
  }
}

body.home {
  background: #050508;
}

.menu-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #000;
}

.menu-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  transform: translate(-50%, -50%);
}

.menu-edge {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask-image: radial-gradient(ellipse at center, transparent 50%, #000 95%);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 50%, #000 95%);
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

body.home .header {
  background: rgba(11, 11, 11, 0.85);
}

.home-box {
  max-width: 560px;
  margin: 8vh auto var(--space-xl);
  padding: var(--space-md);
  background: rgba(11, 11, 11, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.home-box h1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.home-sub {
  margin: 0.35rem 0 var(--space-sm);
  color: var(--yellow);
  font-size: 0.95rem;
}

.home-box > p:not(.home-sub) {
  font-size: 0.95rem;
}

.home-pages {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.home-pages li + li {
  margin-top: 0;
}

.home-pages a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.home-pages a:hover {
  background: rgba(255, 123, 28, 0.25);
  color: #fff;
}

.home-pages span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

body.home .footer {
  background: rgba(11, 11, 11, 0.6);
}

@media (max-width: 768px) {
  .home-box {
    margin: 6vh var(--space-sm) var(--space-lg);
  }

  .home-pages {
    grid-template-columns: 1fr;
  }
}

@media (max-aspect-ratio: 1 / 1) {
  .menu-scene {
    transform: translate(-28%, -50%);
  }
}

.menu-layer {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.menu-layer img {
  display: block;
  width: 100%;
  height: 100%;
}

.menu-layer img[hidden] {
  display: none;
}
.nav-menu {
  margin-left: auto;
}

.admin-link {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 6px;
  transition: var(--transition);
}

.admin-link img {
  display: block;
  width: 32px;
  height: 32px;
}

.admin-link:hover {
  background: var(--surface-2);
}


body.admin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-md);
  background: #05070f url("../assets/admin/loading.webp") 25% center / cover no-repeat;
  image-rendering: pixelated;
}

.login-box {
  width: 100%;
  max-width: 340px;
  padding: var(--space-lg);
  background: rgba(8, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  image-rendering: auto;
}

.login-box h1 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
}

.login-box h1 img {
  width: 32px;
  height: 32px;
}

.login-note {
  margin-bottom: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  border-left: 3px solid var(--yellow);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.login-note strong {
  color: var(--yellow);
}

.login-box label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
  color: var(--muted);
}

.login-box input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.login-box input:focus {
  outline: none;
  border-color: var(--orange);
}

.login-box .btn {
  width: 100%;
  margin-top: var(--space-xs);
}

.login-msg {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--yellow);
}

.login-back {
  display: inline-block;
  margin-top: var(--space-md);
  font-size: 0.85rem;
}

.credit-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: 2px solid var(--border);
  border-left: 3px solid var(--orange);
}

.credit-box p {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.credit-url {
  color: var(--yellow);
  overflow-wrap: anywhere;
}

.home-use {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .credit-box {
    flex-direction: column;
    align-items: stretch;
  }
}

.company-logo {
  margin: var(--space-sm) 0 var(--space-md);
  padding: var(--space-lg) var(--space-md);
  background: radial-gradient(ellipse at center, #1d1c1a 0%, var(--surface) 70%);
  border: 2px solid var(--border);
}

.company-logo img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.expie,
.monitor,
.menu-bg,
.admin-link,
.game-credit img,
.login-box h1 img,
.company-logo {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.expie img,
.monitor img,
.menu-bg img,
.admin-link img,
.company-logo img {
  -webkit-user-drag: none;
}

.note-main {
  max-width: 1000px;
}

.note-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-xl);
  align-items: center;
}

.note-paper {
  position: relative;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(120, 95, 40, 0.18) 31px 32px),
    linear-gradient(160deg, #efe4c2 0%, #e2d3a6 60%, #d6c48f 100%);
  color: #2a241a;
  transform: rotate(-1.2deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(120, 80, 20, 0.25);
  transition: box-shadow 1.5s ease;
}

.note-paper::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 26px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(241, 194, 50, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.note-text {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.15rem;
  line-height: 32px;
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
}

.note-text.shuffle {
  animation: shuffle 0.25s ease-out;
}

@keyframes shuffle {
  from {
    filter: blur(2px);
    opacity: 0.5;
  }
}

.note-text .line {
  opacity: 0;
  animation: line-in 0.9s ease forwards;
}

.note-text .line.last {
  color: #a04800;
}

@keyframes line-in {
  from {
    opacity: 0;
    filter: blur(3px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

.wheel-box {
  text-align: center;
}

.wheel {
  --size: 260px;
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, #1b1b1b 0 38%, #141414 38% 58%, #1b1b1b 58% 100%);
  border: 2px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.wheel.grab {
  cursor: grabbing;
}

.wheel.locked {
  cursor: default;
  border-color: var(--orange);
}

.ring {
  position: absolute;
  inset: 0;
}

.ring-in {
  inset: 22%;
  transition: transform 0.25s ease;
}

.ring span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  margin: -0.65em 0 0 -10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  transform: rotate(calc(var(--i) * 360deg / 26)) translateY(calc(var(--size) * -0.43));
}

.ring-out span {
  color: var(--muted);
}

.ring-in span {
  color: var(--orange);
  font-size: 0.8rem;
  transform: rotate(calc(var(--i) * 360deg / 26)) translateY(calc(var(--size) * -0.235));
}

.wheel-mark {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 26px;
  height: calc(var(--size) * 0.36);
  margin-left: -13px;
  border: 1px solid rgba(241, 194, 50, 0.6);
  border-radius: 13px;
  pointer-events: none;
}

.wheel-hub {
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
}

.wheel.locked .wheel-mark {
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(241, 194, 50, 0.5);
}

.wheel-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  max-width: 260px;
  margin: var(--space-md) auto 0;
}

.wheel-controls input {
  flex: 1;
  accent-color: var(--orange);
}

.wheel-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.wheel-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

#wheel-back::before {
  transform: translateX(2px) rotate(-135deg);
}

#wheel-fwd::before {
  transform: translateX(-2px) rotate(45deg);
}

.wheel-step:hover {
  color: var(--yellow);
  border-color: var(--orange);
}

.wheel-hint {
  margin-top: var(--space-xs);
  color: var(--faint);
  font-size: 0.8rem;
}

.note-after {
  position: relative;
  max-width: 620px;
  margin: var(--space-xl) auto 0;
  text-align: center;
  color: var(--muted);
  animation: line-in 1.2s ease;
}

.note-lights {
  margin-top: var(--space-md);
  padding: 0.6rem 1.1rem;
  background: none;
  border: 1px solid var(--orange);
  border-radius: 6px;
  color: var(--orange);
  font: 500 0.9rem var(--font-sans);
  cursor: pointer;
}

.note-lights:hover {
  background: var(--orange);
  color: var(--bg);
}

.lights {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.dark .lights {
  visibility: visible;
  animation: lights-out 1.6s ease forwards;
}

body.dark .note-stage,
body.dark .note-after {
  z-index: 61;
}

body.dark .note-paper {
  box-shadow: 0 0 0 1px rgba(241, 194, 50, 0.08), 0 0 80px rgba(241, 194, 50, 0.18), inset 0 0 60px rgba(120, 80, 20, 0.35);
}

body.dark .wheel-box {
  opacity: 0.35;
  transition: opacity 1.5s ease;
}

@keyframes lights-out {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  18% { opacity: 0.1; }
  30% { opacity: 0.9; }
  36% { opacity: 0.3; }
  55% { opacity: 0.92; }
  100% { opacity: 0.92; }
}

@media (prefers-reduced-motion: reduce) {
  body.dark .lights {
    animation: none;
    opacity: 0.92;
  }

  .note-text.shuffle,
  .note-after {
    animation: none;
  }
}

@media (max-width: 860px) {
  .note-stage {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .note-paper {
    padding: var(--space-md) var(--space-md) var(--space-lg);
    transform: rotate(-0.6deg);
  }

  .note-text {
    font-size: 1rem;
  }

  .wheel {
    --size: 230px;
  }
}

.glitch {
  animation: glitch 6s steps(1) infinite;
}

.drop-item.glitch {
  animation-delay: -2.5s;
}

@keyframes glitch {
  0%, 91%, 100% {
    transform: none;
    text-shadow: none;
  }
  92% {
    transform: translateX(-2px) skewX(-8deg);
    text-shadow: 2px 0 rgba(255, 123, 28, 0.8), -2px 0 rgba(241, 194, 50, 0.6);
  }
  93.5% {
    transform: translateX(2px);
    text-shadow: -2px 0 rgba(255, 123, 28, 0.8), 2px 0 rgba(241, 194, 50, 0.6);
    opacity: 0.6;
  }
  95% {
    transform: translateX(-1px) skewX(6deg);
    text-shadow: 1px 0 rgba(255, 123, 28, 0.6);
    opacity: 1;
  }
  96.5% {
    transform: none;
    text-shadow: none;
  }
}

.spoil-left {
  margin-top: var(--space-sm);
  color: var(--muted);
  font-size: 0.9rem;
}

.spoil-list {
  margin: var(--space-xs) 0 0 1.2em;
  columns: 2;
  column-gap: var(--space-lg);
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .spoil-list {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glitch {
    animation: none;
  }
}
