/* ===== TOKENS =====
   bg:      #0a0a0f
   pink:    #ff2fb0
   cyan:    #00fff2
   yellow:  #ffe600
   purple:  #7b2ff7
   red:     #ff2740
   green:   #29ff7a
*/

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a0f;
  color: #00fff2;
  font-family: 'VT323', monospace;
  font-size: 22px;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, .arcade-btn, .hud, .npc-avatar, .boss { font-family: 'Press Start 2P', monospace; }

/* ---- CRT overlay effects ---- */
.scanlines {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0.15) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 3px
  );
  mix-blend-mode: multiply;
}
.vignette {
  position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
}
.noise {
  position: fixed; inset: 0; z-index: 9996; pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-shift 0.2s steps(2) infinite;
}
@keyframes noise-shift {
  0% { transform: translate(0,0); }
  50% { transform: translate(-1%,1%); }
  100% { transform: translate(1%,-1%); }
}

.cabinet {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 16px 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- screens ---- */
.screen { display: none; width: 100%; text-align: center; animation: screen-in 0.25s steps(6); }
.screen.active { display: flex; flex-direction: column; align-items: center; gap: 18px; }
@keyframes screen-in {
  0% { opacity: 0; filter: brightness(3) blur(2px); }
  100% { opacity: 1; filter: none; }
}

/* ---- boot screen ---- */
#screen-boot { justify-content: flex-start; padding-top: 40px; }
.boot-log {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #29ff7a;
  text-align: left;
  width: 100%;
  white-space: pre-wrap;
  min-height: 300px;
}
.boot-log .cursor::after { content: "█"; animation: blink-hard 0.8s steps(1) infinite; }

/* ---- headings ---- */
h1 {
  font-size: 26px;
  color: #ff2fb0;
  text-shadow: 3px 3px 0 #7b2ff7;
  line-height: 1.6;
  margin: 20px 0 0;
}
h2.level-title {
  font-size: 16px;
  color: #ffe600;
  text-shadow: 2px 2px 0 #7b2ff7;
  border-bottom: 3px dashed #7b2ff7;
  padding-bottom: 10px;
  width: 100%;
}
.boss-title { color: #ff2740 !important; }

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden;
}
.glitch::before {
  color: #00fff2;
  animation: glitch-1 2.5s infinite linear alternate-reverse;
  z-index: -1;
}
.glitch::after {
  color: #ff2fb0;
  animation: glitch-2 3s infinite linear alternate-reverse;
  z-index: -1;
}
@keyframes glitch-1 {
  0% { clip-path: inset(0 0 90% 0); transform: translate(-2px,-1px); }
  20% { clip-path: inset(10% 0 60% 0); transform: translate(2px,1px); }
  40% { clip-path: inset(40% 0 40% 0); transform: translate(-1px,2px); }
  60% { clip-path: inset(70% 0 10% 0); transform: translate(2px,-2px); }
  80% { clip-path: inset(20% 0 70% 0); transform: translate(-2px,1px); }
  100% { clip-path: inset(0 0 90% 0); transform: translate(1px,-1px); }
}
@keyframes glitch-2 {
  0% { clip-path: inset(60% 0 20% 0); transform: translate(2px,1px); }
  25% { clip-path: inset(10% 0 80% 0); transform: translate(-2px,-1px); }
  50% { clip-path: inset(85% 0 5% 0); transform: translate(1px,2px); }
  75% { clip-path: inset(30% 0 50% 0); transform: translate(-1px,-2px); }
  100% { clip-path: inset(60% 0 20% 0); transform: translate(2px,1px); }
}
.red-glitch::before, .red-glitch::after { color: #ff2740; }
.gold-glitch::before { color: #ffe600; }
.gold-glitch::after { color: #ff2fb0; }

.subtitle { color: #ff2740; font-size: 18px; letter-spacing: 1px; }
.blink { animation: blink-hard 1s steps(1) infinite; }
@keyframes blink-hard { 50% { opacity: 0; } }

.coin-text { color: #ffe600; font-size: 16px; margin-top: -8px; }
.coin-count { color: #ff2fb0; }
.footer-credit { color: #444; font-size: 14px; margin-top: auto; padding-top: 24px; }

/* ---- buttons ---- */
.arcade-btn {
  background: #0a0a0f;
  color: #ffe600;
  border: 3px solid #ffe600;
  padding: 16px 28px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 4px 4px 0 #7b2ff7;
  transition: transform 0.05s;
}
.arcade-btn:hover { background: #ffe600; color: #0a0a0f; }
.arcade-btn:active { transform: translate(4px,4px); box-shadow: none; }
.arcade-btn.small { font-size: 12px; padding: 12px 20px; }
.attack-btn { border-color: #ff2740; color: #ff2740; box-shadow: 4px 4px 0 #ff2740; }
.attack-btn:hover { background: #ff2740; color: #0a0a0f; }

/* ---- HUD ---- */
.hud {
  position: sticky; top: 0; z-index: 50;
  width: 100%; max-width: 720px;
  display: flex; justify-content: space-between;
  background: rgba(10,10,15,0.9);
  border-bottom: 2px solid #7b2ff7;
  padding: 8px 4px;
  font-size: 12px;
  color: #00fff2;
}
.hud.hidden { display: none; }

/* ---- level 1 ---- */
.level-desc { color: #b8f7ff; font-size: 19px; max-width: 560px; }
.timer-bar-wrap, .hp-bar-wrap {
  width: 100%; max-width: 400px; height: 20px;
  border: 2px solid #00fff2; background: #111;
}
.hp-bar-wrap.small { max-width: 260px; height: 14px; }
.timer-bar, .hp-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #29ff7a, #ffe600);
  transition: width 0.1s linear;
}
.hp-bar#boss-hp { background: linear-gradient(90deg, #ff2740, #ff2fb0); }
.hp-bar.player { background: linear-gradient(90deg, #00fff2, #29ff7a); }
.dummy-wrap { margin: 10px 0; }
.dummy {
  font-size: 90px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.05s;
  filter: drop-shadow(0 0 10px #ff2fb0);
}
.dummy:active, .dummy.hit { transform: scale(0.85) rotate(-8deg); }
.hit-counter { color: #ffe600; font-size: 20px; }

/* ---- level 2 riddle ---- */
.npc-box {
  display: flex; gap: 14px; align-items: flex-start;
  border: 3px solid #7b2ff7; padding: 16px;
  background: #12081f; text-align: left; width: 100%; max-width: 560px;
}
.npc-avatar { font-size: 40px; }
.npc-text { color: #d9baff; font-size: 20px; margin: 0; }
.answers { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 500px; }
.answer-btn {
  background: #0a0a0f; color: #00fff2; border: 2px solid #00fff2;
  padding: 12px; font-size: 17px; font-family: 'VT323', monospace;
  cursor: pointer; text-align: left;
}
.answer-btn:hover { background: #00fff2; color: #0a0a0f; }
.answer-btn.correct { background: #29ff7a; border-color: #29ff7a; color: #0a0a0f; }
.answer-btn.wrong { background: #ff2740; border-color: #ff2740; color: #0a0a0f; }
.riddle-feedback { color: #ffe600; font-size: 18px; min-height: 24px; }

/* ---- level 3 boss ---- */
.boss-hp-wrap { width: 100%; max-width: 420px; }
.boss-name { color: #ff2740; font-size: 13px; font-family: 'Press Start 2P', monospace; }
.boss-arena { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 10px 0; position: relative; }
.boss { font-size: 100px; transition: transform 0.1s; user-select: none; }
.boss.shake { animation: boss-shake 0.3s; }
.boss.dead { opacity: 0; transform: scale(0.2) rotate(360deg); transition: all 0.5s; }
@keyframes boss-shake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-6px,3px); }
  75% { transform: translate(6px,-3px); }
}
.player-hp-wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.player-label { font-size: 11px; color: #00fff2; font-family: 'Press Start 2P', monospace; }
.boss-hint { color: #888; font-size: 15px; max-width: 480px; }
.flash-danger {
  position: fixed; inset: 0; background: rgba(255,39,64,0.35);
  z-index: 9995; pointer-events: none; animation: flash-out 0.4s forwards;
}
@keyframes flash-out { to { opacity: 0; } }
body.shake-screen { animation: screen-shake 0.3s; }
@keyframes screen-shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4px,2px); }
  40% { transform: translate(4px,-2px); }
  60% { transform: translate(-3px,-2px); }
  80% { transform: translate(3px,2px); }
}

/* ---- victory ---- */
#confetti-canvas { position: fixed; inset: 0; z-index: 9990; pointer-events: none; }
.victory-sub { color: #d9baff; }
.victory-name { font-size: 20px; color: #ffe600; }
#friend-name { color: #ff2fb0; }
.loot-drop { width: 100%; max-width: 640px; }
.loot-label { color: #29ff7a; font-family: 'Press Start 2P', monospace; font-size: 12px; text-align: left; }
.video-cards { display: flex; flex-direction: column; gap: 24px; }
.video-card {
  border: 3px solid #ff2fb0; background: #16081f; padding: 16px;
  box-shadow: 6px 6px 0 #7b2ff7;
}
.card-header { color: #ffe600; font-family: 'Press Start 2P', monospace; font-size: 12px; margin-bottom: 10px; }
.video-card video { width: 100%; border: 2px solid #00fff2; background: #000; margin-bottom: 12px; }
.download-btn { width: 100%; }

/* ---- realistic fake shutdown overlay (BSOD + Windows Update look) ---- */
#fake-shutdown {
  position: fixed; inset: 0; z-index: 99999;
  cursor: none;
}
#fake-shutdown.hidden { display: none !important; }

#fake-shutdown.crash-active {
  display: flex; align-items: center; justify-content: center;
  background: #0078d7;
  color: #fff;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.crash-phase { max-width: 560px; padding: 40px; }
.crash-text { font-size: 120px; font-weight: 300; line-height: 1; margin-bottom: 20px; }
.crash-sub { font-size: 24px; font-weight: 300; margin-bottom: 40px; line-height: 1.4; }
.crash-percent { font-size: 18px; font-weight: 300; opacity: 0.9; }

#fake-shutdown.black-active {
  display: block;
  background: #000;
}

#fake-shutdown.update-active {
  display: flex; align-items: center; justify-content: center;
  background: #0078d7;
  color: #fff;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.update-phase { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.win-spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: win-spin 0.9s linear infinite;
}
@keyframes win-spin { to { transform: rotate(360deg); } }
.update-text { font-size: 22px; font-weight: 300; }
.update-percent { font-size: 16px; font-weight: 300; opacity: 0.85; margin-top: -12px; }
.update-warning { font-size: 14px; font-weight: 600; letter-spacing: 0.5px; opacity: 0.95; margin-top: 4px; }

.timer-bar-wrap.small-timer { max-width: 500px; }
.timer-bar.danger { background: linear-gradient(90deg, #ff2740, #ff2740); animation: blink-hard 0.3s steps(1) infinite; }

/* ---- buy button + checkout modal ---- */
.buy-btn { border-color: #29ff7a; color: #29ff7a; box-shadow: 4px 4px 0 #29ff7a; margin-top: 8px; }
.buy-btn:hover { background: #29ff7a; color: #0a0a0f; }

#checkout-overlay {
  position: fixed; inset: 0; z-index: 9985;
  background: rgba(5,5,10,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.checkout-box {
  background: #12081f;
  border: 3px solid #ffe600;
  box-shadow: 8px 8px 0 #7b2ff7;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #00fff2;
}
.checkout-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: #ffe600;
  margin-bottom: 16px;
  line-height: 1.6;
}
.checkout-price {
  font-size: 24px;
  color: #ff2fb0;
  margin-bottom: 18px;
}
.checkout-price span { font-family: 'Press Start 2P', monospace; font-size: 20px; }
.checkout-label { display: block; text-align: left; color: #d9baff; font-size: 17px; margin-bottom: 6px; }
.checkout-input {
  width: 100%;
  background: #0a0a0f;
  border: 2px solid #00fff2;
  color: #00fff2;
  font-family: 'VT323', monospace;
  font-size: 18px;
  padding: 10px;
  margin-bottom: 18px;
}
.checkout-input:focus { outline: none; border-color: #ffe600; }
.checkout-cancel {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: #666;
  font-family: 'VT323', monospace;
  font-size: 16px;
  cursor: pointer;
  text-decoration: underline;
}
.checkout-cancel:hover { color: #999; }

#checkout-step-processing { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.checkout-processing-text { font-size: 20px; color: #ffe600; }
.checkout-processing-sub { font-size: 16px; color: #888; min-height: 20px; }

.checkout-done-icon { font-size: 48px; margin-bottom: 12px; }
.checkout-done-sub { color: #d9baff; font-size: 17px; margin: 10px 0 20px; }

/* ---- fake live chat (hype comments) ---- */
#fake-chat {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 9980;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  max-width: 260px;
  pointer-events: none;
}
.chat-msg {
  background: rgba(18,8,31,0.92);
  border: 2px solid #7b2ff7;
  padding: 6px 10px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  line-height: 1.3;
  color: #00fff2;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  animation: chat-in 0.2s steps(3) both, chat-out 0.35s ease 3.6s both;
}
.chat-msg .chat-user { color: #ffe600; margin-right: 4px; }
@keyframes chat-in {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes chat-out { to { opacity: 0; } }
@media (max-width: 480px) {
  #fake-chat { max-width: 70vw; bottom: 8px; left: 8px; }
  .chat-msg { font-size: 14px; padding: 5px 8px; }
}

/* ---- proof photo (trophy polaroid) ---- */
.proof-photo { width: 100%; max-width: 460px; }
.proof-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #29ff7a;
  margin-bottom: 10px;
}
.proof-img {
  width: 100%;
  display: block;
  border: 4px solid #ffe600;
  box-shadow: 6px 6px 0 #ff2fb0;
  filter: saturate(1.1) contrast(1.05);
}

/* ---- retro "online counter" widget ---- */
#online-counter {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 9970;
  background: #000;
  border: 2px solid #29ff7a;
  color: #29ff7a;
  font-family: 'VT323', monospace;
  font-size: 14px;
  padding: 6px 10px;
  line-height: 1.5;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}
.oc-row { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.oc-sub { color: #1a8f4a; font-size: 12px; }
.oc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #29ff7a;
  box-shadow: 0 0 4px #29ff7a;
  animation: blink-hard 1.2s steps(1) infinite;
}
@media (max-width: 480px) {
  #online-counter { font-size: 11px; padding: 4px 7px; top: 4px; right: 4px; }
}

/* ---- minigame: falling pixels ---- */
.mg-arena {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 320px;
  border: 3px solid #7b2ff7;
  background: repeating-linear-gradient(0deg, #0d0616, #0d0616 18px, #120a1e 18px, #120a1e 19px);
  overflow: hidden;
  cursor: crosshair;
}
.falling-pixel {
  position: absolute;
  top: -24px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  box-shadow: 0 0 8px currentColor;
}
@keyframes pixel-fall {
  from { top: -24px; }
  to { top: 100%; }
}

/* ---- neon cursor trail ---- */
.cursor-trail-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  animation: trail-fade 0.5s ease-out forwards;
  box-shadow: 0 0 6px currentColor;
}
@keyframes trail-fade {
  from { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}
@media (hover: none) {
  .cursor-trail-dot { display: none; } /* на тачскринах трейл не нужен */
}

/* ---- random ambient glitch moments ---- */
body.glitch-moment .cabinet {
  animation: ambient-glitch 0.26s steps(2);
}
@keyframes ambient-glitch {
  0%   { transform: translate(0,0); filter: none; }
  20%  { transform: translate(-5px, 2px) skewX(2deg); filter: invert(0.85) hue-rotate(60deg); }
  40%  { transform: translate(4px, -3px) skewX(-1.5deg); filter: invert(0); }
  60%  { transform: translate(-3px, 1px); filter: invert(0.6) saturate(3); }
  80%  { transform: translate(2px, -1px); filter: none; }
  100% { transform: translate(0,0); filter: none; }
}

/* ---- music toggle button ---- */
.music-toggle {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 9970;
  background: #12081f;
  color: #ffe600;
  border: 2px solid #ffe600;
  font-family: 'VT323', monospace;
  font-size: 15px;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #7b2ff7;
}
.music-toggle:hover { background: #ffe600; color: #0a0a0f; }
@media (max-width: 480px) {
  .music-toggle { font-size: 12px; padding: 5px 9px; bottom: 8px; right: 8px; }
}

/* ---- fake cookie-consent popup ---- */
#cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(5,5,10,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cookie-box {
  background: #12081f;
  border: 3px solid #ffe600;
  box-shadow: 8px 8px 0 #7b2ff7;
  padding: 24px 22px;
  max-width: 460px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  font-family: 'VT323', monospace;
  color: #00fff2;
  text-align: left;
}
.cookie-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: #ffe600;
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: center;
}
.cookie-text {
  font-size: 17px;
  line-height: 1.4;
  color: #d9baff;
  margin-bottom: 18px;
}
.cookie-btns { display: flex; flex-direction: column; gap: 10px; }
.cookie-settings-link {
  display: block;
  margin: 14px auto 6px;
  background: none;
  border: none;
  color: #666;
  font-family: 'VT323', monospace;
  font-size: 15px;
  cursor: pointer;
  text-decoration: underline;
}
.cookie-settings-link:hover { color: #999; }
.cookie-fineprint { text-align: center; color: #444; font-size: 13px; margin-top: 4px; }
.cookie-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  color: #d9baff;
  margin-bottom: 12px;
  line-height: 1.35;
}
.cookie-check input { margin-top: 3px; flex-shrink: 0; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  body { font-size: 18px; }
  h1 { font-size: 20px; }
  .arcade-btn { font-size: 12px; padding: 12px 18px; }
  .dummy { font-size: 70px; }
  .boss { font-size: 70px; }
}
