:root {
  --bg-deep: #0d0221;
  --bg-deep2: #1a0a3e;
  --neon-pink: #ff2e9a;
  --neon-cyan: #2ee6ff;
  --neon-purple: #b967ff;
  --neon-yellow: #ffd23f;
  --neon-green: #2ee69b;
  --neon-orange: #ff7a2e;
  --c-telegram: #2ee6ff;
  --c-spotify: #2ee69b;
  --c-yandex: #ffd23f;
  --c-discord: #b967ff;
  --c-instagram: #ff2e9a;
  --c-tiktok: #ffffff;
  --c-steam: #ff7a2e;
  --font-pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  font-family: var(--font-pixel);
  color: #fff;
  overflow-x: hidden;
}

body {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* ---------- Boot screen ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

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

.boot-text {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--neon-green);
  text-shadow: 0 0 4px var(--neon-green);
  line-height: 1.8;
  text-align: left;
  min-height: 80px;
}

.boot-bar {
  width: 200px;
  height: 14px;
  border: 2px solid var(--neon-cyan);
  margin-top: 18px;
  box-shadow: 0 0 8px var(--neon-cyan);
}

.boot-bar-fill {
  width: 0;
  height: 100%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  transition: width 0.9s steps(20);
}

.boot-skip {
  margin-top: 14px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.3);
  animation: blink 1.4s steps(1) infinite;
}

/* ---------- Background layers ---------- */

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.1s linear;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 4px #fff;
  animation: twinkle 2.4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 1; }
}

.sun {
  position: fixed;
  top: 12%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(calc(-50% + var(--px, 0px)), var(--py, 0px));
  border-radius: 50%;
  background: repeating-linear-gradient(
    to bottom,
    var(--neon-yellow) 0px,
    var(--neon-pink) 8px,
    var(--neon-pink) 12px,
    transparent 12px,
    transparent 20px
  );
  box-shadow: 0 0 60px 10px rgba(255, 46, 154, 0.45);
  z-index: 0;
  opacity: 0.85;
  animation: sun-pulse 4s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% { box-shadow: 0 0 60px 10px rgba(255, 46, 154, 0.45); }
  50% { box-shadow: 0 0 90px 18px rgba(255, 46, 154, 0.65); }
}

.grid-floor {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 45vh;
  z-index: 0;
  background-image:
    linear-gradient(var(--neon-purple) 1px, transparent 1px),
    linear-gradient(90deg, var(--neon-purple) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: translate(var(--px, 0px), var(--py, 0px)) perspective(220px) rotateX(70deg) scale(2.2);
  transform-origin: bottom;
  opacity: 0.55;
  animation: grid-move 1.4s linear infinite;
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

@keyframes grid-move {
  from { background-position: 0 0; }
  to { background-position: 0 40px; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to bottom, var(--bg-deep) 0%, var(--bg-deep2) 55%, #2a0845 100%);
  pointer-events: none;
}

/* ---------- CRT / scanline ---------- */

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%);
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 1px,
    transparent 2px,
    transparent 3px
  );
  animation: flicker 6s linear infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.9; }
  92% { opacity: 0.9; }
  93% { opacity: 0.5; }
  94% { opacity: 0.9; }
}

/* ---------- Layout ---------- */

.screen {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 32px 16px 60px;
}

.card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep2);
  border: 3px solid var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan), inset 0 0 12px rgba(46, 230, 255, 0.3);
  image-rendering: pixelated;
  margin-bottom: 18px;
  animation: avatar-bob 2.2s ease-in-out infinite;
}

@keyframes avatar-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.avatar-face {
  font-size: 14px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
}

.title {
  font-size: 30px;
  margin: 0 0 10px;
  color: #fff;
  letter-spacing: 4px;
  text-shadow:
    0 0 6px var(--neon-pink),
    0 0 14px var(--neon-pink),
    3px 3px 0 var(--neon-cyan);
  animation: title-glitch 6s infinite;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

@keyframes title-glitch {
  0%, 96%, 100% { transform: translate(0,0); }
  97% { transform: translate(-2px, 1px); }
  98% { transform: translate(2px, -1px); }
  99% { transform: translate(-1px, 0); }
}

.title.glitch-burst {
  animation: glitch-burst 0.4s steps(2);
}

@keyframes glitch-burst {
  0%   { transform: translate(0,0) skewX(0); }
  20%  { transform: translate(-6px, 2px) skewX(8deg); }
  40%  { transform: translate(6px, -2px) skewX(-8deg); }
  60%  { transform: translate(-3px, 1px) skewX(4deg); }
  80%  { transform: translate(3px, -1px) skewX(-4deg); }
  100% { transform: translate(0,0) skewX(0); }
}

.subtitle {
  font-size: 11px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
  margin: 0 0 28px;
  min-height: 14px;
  letter-spacing: 1px;
}

.cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Links ---------- */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-btn {
  --c: var(--neon-cyan);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: rgba(13, 2, 33, 0.75);
  border: 2px solid var(--c);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 var(--c), 4px 4px 0 0 rgba(0,0,0,0.5);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.link-btn[data-color="telegram"]   { --c: var(--c-telegram); }
.link-btn[data-color="spotify"]    { --c: var(--c-spotify); }
.link-btn[data-color="yandex"]     { --c: var(--c-yandex); }
.link-btn[data-color="discord"]    { --c: var(--c-discord); }
.link-btn[data-color="instagram"]  { --c: var(--c-instagram); }
.link-btn[data-color="tiktok"]     { --c: var(--c-tiktok); }
.link-btn[data-color="steam"]      { --c: var(--c-steam); }

.link-btn:hover,
.link-btn:focus-visible {
  transform: translate(-2px, -2px);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 14px var(--c), 6px 6px 0 0 rgba(0,0,0,0.55);
  outline: none;
}

.link-btn:active {
  transform: translate(0, 0);
  box-shadow: 0 0 8px var(--c), 2px 2px 0 0 rgba(0,0,0,0.55);
}

.link-btn .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c);
  text-shadow: 0 0 6px var(--c);
}

.link-btn .arrow {
  color: var(--c);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.link-btn:hover .arrow {
  opacity: 1;
  transform: translateX(2px);
}

.icon {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.link-btn:hover .icon {
  animation: icon-bounce 0.5s ease;
}

@keyframes icon-bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-3px) rotate(-5deg); }
  60% { transform: translateY(1px) rotate(4deg); }
}

.insert-coin {
  margin-top: 30px;
  font-size: 10px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
  animation: blink 1.4s steps(1) infinite;
  text-align: center;
}

.visitor-counter {
  margin-top: 10px;
  font-size: 9px;
  color: var(--neon-purple);
  text-shadow: 0 0 6px var(--neon-purple);
  text-align: center;
  letter-spacing: 1px;
}

.secret-hint {
  margin-top: 6px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  letter-spacing: 1px;
}

/* ---------- Sound toggle ---------- */

.sound-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 2, 33, 0.8);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 8px var(--neon-cyan);
  transition: transform 0.15s ease;
}

.sound-toggle:hover {
  transform: scale(1.1);
}

.sound-toggle:active {
  transform: scale(0.95);
}

/* ---------- Cursor pixel trail ---------- */

.pixel-spark {
  position: fixed;
  width: 4px;
  height: 4px;
  pointer-events: none;
  z-index: 45;
  animation: spark-fade 0.6s ease-out forwards;
}

@keyframes spark-fade {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.4) translateY(10px); }
}

/* ---------- Click explosion particles ---------- */

.pixel-particle {
  position: fixed;
  width: 4px;
  height: 4px;
  pointer-events: none;
  z-index: 46;
  animation: particle-fly 0.5s ease-out forwards;
}

@keyframes particle-fly {
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ---------- Party mode (Konami easter egg) ---------- */

body.party-mode .screen {
  animation: rainbow-cycle 2s linear infinite;
}

body.party-mode .sun {
  animation: sun-pulse 0.6s ease-in-out infinite;
}

body.party-mode .grid-floor {
  animation: grid-move 0.3s linear infinite;
}

@keyframes rainbow-cycle {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  padding: 12px 18px;
  background: var(--bg-deep2);
  border: 2px solid var(--neon-green);
  color: var(--neon-green);
  font-family: var(--font-pixel);
  font-size: 11px;
  text-shadow: 0 0 6px var(--neon-green);
  box-shadow: 0 0 14px var(--neon-green);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 360px) {
  .title { font-size: 24px; }
  .link-btn { font-size: 10px; padding: 12px; }
}
