@font-face {
  font-family: 'GameFont';
  src: url('font.ttf') format('truetype');
}

/* ===================== VARIABLES ===================== */
:root {
  --red:        #b41e1e;
  --red-bright: #e83030;
  --red-dim:    #5a0a0a;
  --blood:      #8c0000;
  --dark:       #06040a;
  --dark2:      #0c0810;
  --panel:      #10080e;
  --panel2:     #180d16;
  --border:     #2a1020;
  --text:       #e0ccc0;
  --text-dim:   #7a6858;
  --text-faint: #3a2a24;
  --green:      #00c850;
  --green-dim:  #005c25;
  --yellow:     #ffd800;
  --yellow-dim: #7a6000;
  --cyan:       #00c8dc;
  --orange:     #ff8c00;
  --gray:       #505050;
  --gray-dark:  #282028;
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--dark);
  color: var(--text);
  font-family: 'GameFont', 'Courier New', monospace;
  overflow-x: hidden;
  cursor: none;
  min-height: 100vh;
}

/* ===================== NOISE TEXTURE OVERLAY ===================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

/* ===================== RAIN CANVAS ===================== */
#rain-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
}

/* ===================== VIGNETTE ===================== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.35) 70%,
    rgba(0,0,0,0.7) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ===================== SCANLINES ===================== */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 3;
}

/* ===================== CUSTOM CURSOR ===================== */
#cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
}
#cursor .c-inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  background: var(--red-bright);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: cur-spin 3s linear infinite, cur-pulse 0.8s ease-in-out infinite alternate;
}
#cursor .c-outer {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border: 1px solid rgba(232, 48, 48, 0.45);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: cur-spin 3s linear infinite reverse, cur-pulse 0.8s ease-in-out infinite alternate-reverse;
}
@keyframes cur-spin  { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes cur-pulse { from { opacity: 1; } to { opacity: 0.3; } }

/* ===================== PAGE WRAPPER ===================== */
#page {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===================== HEADER / LOGO ===================== */
header {
  text-align: center;
  padding-top: 40px;
  animation: fade-in-down 0.8s ease both;
}

.logo-wrap {
  display: inline-block;
  position: relative;
}

.logo-img {
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 28px rgba(180, 30, 30, 0.6)) drop-shadow(0 0 60px rgba(180, 30, 30, 0.25));
  animation: logo-flicker 6s ease-in-out infinite;
}

@keyframes logo-flicker {
  0%, 90%, 100% { filter: drop-shadow(0 0 28px rgba(180,30,30,0.6)) drop-shadow(0 0 60px rgba(180,30,30,0.25)); }
  92%           { filter: drop-shadow(0 0 14px rgba(180,30,30,0.3)) drop-shadow(0 0 30px rgba(180,30,30,0.1)); }
  94%           { filter: drop-shadow(0 0 28px rgba(180,30,30,0.6)) drop-shadow(0 0 60px rgba(180,30,30,0.25)); }
  96%           { filter: drop-shadow(0 0 8px  rgba(180,30,30,0.2)); }
  98%           { filter: drop-shadow(0 0 28px rgba(180,30,30,0.6)) drop-shadow(0 0 60px rgba(180,30,30,0.25)); }
}

.tagline {
  font-size: 22px;
  letter-spacing: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 8px;
  animation: fade-in 1s ease 0.4s both;
}

/* ===================== DIVIDER ===================== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0;
  animation: fade-in 0.8s ease 0.5s both;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--red-dim), transparent);
}
.divider-skull {
  font-size: 18px;
  color: var(--red);
  line-height: 1;
  filter: drop-shadow(0 0 6px var(--red));
}

/* ===================== SECTION CARD ===================== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red-dim);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fade-in-up 0.7s ease both;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, var(--red), transparent);
}
.card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at 100% 100%, rgba(180,30,30,0.08), transparent 70%);
}
.card:hover {
  border-color: rgba(180,30,30,0.35);
  box-shadow: 0 0 20px rgba(180,30,30,0.08);
}

.card-title {
  font-size: 28px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title .ct-icon {
  color: var(--red);
  filter: drop-shadow(0 0 4px var(--red));
}

/* ===================== ABOUT / DESCRIPTION ===================== */
.about-text {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.about-text strong {
  color: var(--text);
}
.about-text .hl-red    { color: var(--red-bright); }
.about-text .hl-green  { color: var(--green); }
.about-text .hl-yellow { color: var(--yellow); }
.about-text .hl-cyan   { color: var(--cyan); }

/* ===================== FEATURES GRID ===================== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.feature-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-dim);
  padding: 12px 14px;
  font-size: 18px;
  color: var(--text-dim);
  letter-spacing: 1px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-left-color 0.2s, color 0.2s, background 0.2s;
}
.feature-item:hover {
  border-left-color: var(--red-bright);
  color: var(--text);
  background: rgba(180,30,30,0.06);
}
.feature-item .fi-icon {
  color: var(--red);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===================== HOW TO PLAY ===================== */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: var(--text-dim);
}
.key {
  display: inline-block;
  background: var(--panel2);
  border: 1px solid var(--gray);
  border-bottom: 2px solid var(--gray);
  padding: 2px 8px;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text);
  min-width: 36px;
  text-align: center;
  font-family: 'GameFont', monospace;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.ctrl:hover .key {
  border-color: var(--red);
  color: var(--red-bright);
}

/* ===================== DIFFICULTY BARS ===================== */
.diff-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diff-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
}
.diff-label {
  width: 80px;
  flex-shrink: 0;
}
.diff-label.easy   { color: var(--green); }
.diff-label.normal { color: var(--yellow); }
.diff-label.hard   { color: var(--red-bright); }
.diff-bar-bg {
  flex: 1;
  height: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.diff-bar {
  height: 100%;
  transition: width 1.2s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
.diff-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.15), transparent);
}
.diff-bar.easy   { width: 0; background: var(--green); box-shadow: 0 0 8px var(--green-dim); }
.diff-bar.normal { width: 0; background: var(--yellow); box-shadow: 0 0 8px var(--yellow-dim); }
.diff-bar.hard   { width: 0; background: var(--red-bright); box-shadow: 0 0 8px var(--red-dim); }
.diff-bar.easy.animate   { width: 35%; }
.diff-bar.normal.animate { width: 65%; }
.diff-bar.hard.animate   { width: 100%; }
.diff-desc {
  width: 170px;
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-align: right;
}

/* ===================== MULTIPLAYER INFO ===================== */
.mp-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mp-mode {
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mp-mode:hover {
  transform: translateY(-2px);
}
.mp-mode.coop { border-top: 2px solid var(--green); }
.mp-mode.pvp  { border-top: 2px solid var(--red-bright); }
.mp-mode.coop:hover { box-shadow: 0 4px 20px rgba(0,200,80,0.12); }
.mp-mode.pvp:hover  { box-shadow: 0 4px 20px rgba(232,48,48,0.12); }
.mp-mode-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}
.mp-mode-name {
  font-size: 24px;
  letter-spacing: 3px;
  display: block;
  margin-bottom: 6px;
}
.mp-mode.coop .mp-mode-name { color: var(--green); }
.mp-mode.pvp  .mp-mode-name { color: var(--red-bright); }
.mp-mode-desc {
  font-size: 17px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ===================== DOWNLOAD BUTTON ===================== */
.download-section {
  text-align: center;
  animation: fade-in-up 0.7s ease 0.2s both;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--red-dim);
  color: var(--text);
  border: 2px solid var(--red);
  padding: 20px 52px;
  font-family: 'GameFont', monospace;
  font-size: 32px;
  letter-spacing: 4px;
  text-decoration: none;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  cursor: none;
  transition: color 0.2s, border-color 0.2s;
}

.btn-download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--blood) 0%, var(--red) 50%, var(--blood) 100%);
  transform: translateX(-110%) skewX(-8deg);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}

.btn-download:hover::before {
  transform: translateX(0) skewX(-8deg);
}

.btn-download:hover {
  color: #fff;
  border-color: var(--red-bright);
  box-shadow: 0 0 30px rgba(180,30,30,0.5), 0 0 60px rgba(180,30,30,0.2);
}

.btn-download .btn-text {
  position: relative;
  z-index: 1;
}

.btn-download .btn-icon {
  position: relative;
  z-index: 1;
  font-size: 28px;
  transition: transform 0.3s ease;
}

.btn-download:hover .btn-icon {
  transform: translateY(3px);
  animation: bounce-dl 0.6s ease infinite alternate;
}

@keyframes bounce-dl { from { transform: translateY(3px); } to { transform: translateY(7px); } }

/* Corner decorations */
.btn-download .corner {
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--red-bright);
  border-style: solid;
  z-index: 1;
  transition: border-color 0.2s;
}
.btn-download .corner.tl { top: 4px; left: 4px;  border-width: 2px 0 0 2px; }
.btn-download .corner.tr { top: 4px; right: 4px; border-width: 2px 2px 0 0; }
.btn-download .corner.bl { bottom: 4px; left: 4px;  border-width: 0 0 2px 2px; }
.btn-download .corner.br { bottom: 4px; right: 4px; border-width: 0 2px 2px 0; }

.dl-meta {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-faint);
  letter-spacing: 2px;
  display: flex;
  justify-content: center;
  gap: 24px;
}
.dl-meta span { color: var(--text-dim); }

/* ===================== PIXEL ZOMBIE DECO ===================== */
.zombie-deco {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 4px;
  opacity: 0.35;
}
.zombie-pixel {
  width: 10px; height: 10px;
  background: var(--red-dim);
  animation: zp-float 2s ease-in-out infinite;
}
.zombie-pixel:nth-child(2) { animation-delay: 0.3s; background: var(--blood); }
.zombie-pixel:nth-child(3) { animation-delay: 0.6s; }
.zombie-pixel:nth-child(4) { animation-delay: 0.9s; background: var(--blood); }
.zombie-pixel:nth-child(5) { animation-delay: 1.2s; }
@keyframes zp-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }

/* ===================== FOOTER ===================== */
footer {
  text-align: center;
  padding: 32px 0 16px;
  position: relative;
  z-index: 10;
  animation: fade-in 1s ease 1s both;
}
.footer-text {
  font-size: 17px;
  color: var(--text-faint);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.footer-text .hl { color: var(--red-dim); }

/* ===================== LIGHTNING FLASH ===================== */
#lightning-flash {
  position: fixed;
  inset: 0;
  background: rgba(180, 200, 255, 0);
  pointer-events: none;
  z-index: 5;
  transition: background 0.05s;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* staggered cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--red-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
  .mp-modes { grid-template-columns: 1fr; }
  .btn-download { font-size: 22px; padding: 16px 32px; }
  .card { padding: 20px 18px; }
  .diff-desc { display: none; }
}