/* === RESET & BASE === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #0a0a0a;
  --dark: #111111;
  --grey: #1a1a1a;
  --light-grey: #2a2a2a;
  --white: #e0e0e0;
  --accent: #00ff41;
  --green: #39ff14;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Inter', sans-serif;
  --font-pixel: 'VT323', 'Space Mono', monospace;
  --font-bitmap: 'Press Start 2P', 'VT323', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--black);
}

/* ============================================ */
/* === SPLASH / PASSWORD GATE WITH CRT === */
/* ============================================ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #0a0c10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#splash.splash-exit {
  animation: splash-out 0.8s ease-in forwards;
}
@keyframes splash-out {
  0%   { opacity: 1; filter: brightness(1); }
  50%  { filter: brightness(3); }
  100% { opacity: 0; filter: brightness(0); }
}

/* CRT scanlines overlay */
.crt-scanlines {
  position: fixed;
  inset: 0;
  z-index: 2001;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0.15) 1px,
    rgba(0,0,0,0.15) 2px
  );
  mix-blend-mode: multiply;
}

/* CRT flicker */
.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 2002;
  pointer-events: none;
  background: transparent;
  animation: crt-flick 0.12s infinite;
  opacity: 0.03;
}
@keyframes crt-flick {
  0%   { background: rgba(18,16,16,0); }
  50%  { background: rgba(18,16,16,1); }
  100% { background: rgba(18,16,16,0); }
}

/* CRT vignette + barrel curvature feel */
#splash::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2003;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.6) 100%
  );
}

/* Phosphor glow on text */
#splash-content {
  position: relative;
  z-index: 2004;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  width: min(600px, 92vw);
  text-shadow: 0 0 8px rgba(57,255,20,0.5), 0 0 20px rgba(57,255,20,0.2);
}

/* COUNTDOWN */
#splash-countdown {
  font-family: var(--font-pixel);
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: var(--green);
  letter-spacing: 0.08em;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  text-shadow: 0 0 12px rgba(57,255,20,0.7), 0 0 30px rgba(57,255,20,0.3);
}
#splash-countdown b {
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* MODAL */
#splash-modal {
  width: 100%;
  max-width: 420px;
  border: 1px solid #333;
  background: #111;
  box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 2px rgba(57,255,20,0.15);
}
.splash-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  font-family: var(--font-bitmap);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: #aaa;
}
.splash-modal-x {
  cursor: pointer;
  font-size: 1.2rem;
  color: #666;
  line-height: 1;
}
.splash-modal-body {
  padding: 20px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#splash-email {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #aaa;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  padding: 10px 12px;
  outline: none;
  letter-spacing: 0.04em;
}
#splash-email:focus { border-color: var(--green); color: #ddd; }
#splash-email::placeholder { color: #555; }
#splash-enter-btn {
  width: 100%;
  background: var(--green);
  color: #000;
  border: none;
  padding: 11px;
  font-family: var(--font-bitmap);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
#splash-enter-btn:hover {
  background: #50ff30;
  box-shadow: 0 0 20px rgba(57,255,20,0.5);
}
#splash-enter-btn:disabled {
  background: #1a3a10;
  color: var(--green);
  cursor: default;
}
#splash-pw-row {
  margin-top: 4px;
}
#splash-pw {
  width: 100%;
  background: #050505;
  border: 1px dashed #333;
  color: var(--green);
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  padding: 9px 12px;
  outline: none;
  letter-spacing: 0.08em;
  text-align: center;
}
#splash-pw:focus { border-color: var(--green); }
#splash-pw::placeholder { color: #2a4a1a; letter-spacing: 0.1em; }
#splash-pw.shake {
  animation: pw-shake 0.4s ease;
  border-color: #ff3355;
  color: #ff3355;
}
@keyframes pw-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.splash-modal-footer {
  padding: 8px 12px;
  border-top: 1px solid #222;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: #444;
  letter-spacing: 0.06em;
}

/* MST CLOCK (bottom) */
#splash-clock {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 2vw, 1rem);
  color: var(--green);
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(57,255,20,0.6);
  opacity: 0.75;
}

/* Mobile */
@media (max-width: 500px) {
  #splash-countdown { font-size: 0.9rem; gap: 0.3rem; }
  .splash-modal-header { font-size: 0.5rem; }
  #splash-enter-btn { font-size: 0.55rem; }
}

/* === GATE SCREEN === */
#gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  transition: opacity 0.3s;
  overflow-y: auto;
}

#gate.hidden {
  pointer-events: none;
  opacity: 0;
}

#static-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}

#gate-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem 1.5rem;
  width: min(420px, 90vw);
  margin: auto;
}

/* === GATE TITLE === */
#gate-title {
  text-align: center;
}

#logo-canvas {
  width: min(520px, 88vw);
  height: 240px;
  display: block;
  margin: 0 auto;
}

/* === IP WARNING === */
#gate-ip-warning {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #39ff14;
  letter-spacing: 0.1em;
  text-align: center;
  animation: blink 1.2s ease-in-out infinite;
}

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

#fake-ip {
  color: var(--white);
  font-weight: 700;
}

/* === VIRUS SCAN === */
#gate-scan-result {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #888;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.3rem 0.8rem;
  border: 1px dashed rgba(57,255,20,0.2);
  border-radius: 4px;
  background: rgba(0,255,65,0.05);
}

.scan-clean {
  color: var(--green);
  font-weight: 700;
}

/* === FAKE PROGRESS BAR === */
#gate-progress-wrap {
  width: 100%;
  max-width: 420px;
}

#gate-progress-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #555;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

#gate-progress-bar {
  width: 100%;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

#gate-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), #00ff41);
  border-radius: 3px;
  animation: fakeProgress 3s ease-in-out infinite;
}

@keyframes fakeProgress {
  0% { width: 0%; }
  70% { width: 88%; }
  85% { width: 88%; }
  100% { width: 0%; }
}

/* === USERS ONLINE === */
#gate-users-online {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #555;
  letter-spacing: 0.05em;
  text-align: center;
}

#users-count {
  color: var(--green);
  font-weight: 700;
}

#users-downloading {
  color: #ffc107;
  font-weight: 700;
}

/* === TESTIMONIAL === */
#gate-testimonial {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: #444;
  text-align: center;
  letter-spacing: 0.04em;
  max-width: 380px;
}

#gate-testimonial em {
  color: #666;
}

/* === FAKE STATS === */
#gate-stats {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 460px;
}

.stat-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--green);
  background: rgba(0,255,65,0.08);
  border: 1px solid rgba(57,255,20,0.2);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  letter-spacing: 0.05em;
}

.stat-badge .stat-val {
  color: var(--white);
  font-weight: 700;
}

/* === NEWSLETTER MODAL BOX === */
#gate-modal {
  width: 100%;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 4%, #111 100%);
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

#gate-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #222 100%);
  border-bottom: 1px solid #444;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.08em;
  position: relative;
}

#gate-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

#gate-modal-x {
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

#gate-modal-x:hover {
  color: var(--white);
}

#gate-modal-body {
  padding: 1rem 1rem;
}

#email-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#email-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #0a0a0a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  outline: none;
  caret-color: var(--green);
  transition: border-color 0.3s;
}

#email-input:focus {
  border-color: var(--green);
}

#email-input::placeholder {
  color: #555;
}

#enter-btn {
  width: 100%;
  padding: 0.45rem;
  border: none;
  border-radius: 5px;
  background: linear-gradient(180deg, #39ff14 0%, #00ff41 40%, #008020 100%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 4px 15px rgba(0,255,65,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#enter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 5px 5px 0 0;
  pointer-events: none;
}

#enter-btn:hover {
  transform: scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 6px 25px rgba(0,255,65,0.5);
}

#enter-btn:active {
  transform: scale(0.98);
}

#gate-modal-footer {
  padding: 0.5rem 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #444;
  letter-spacing: 0.12em;
  border-top: 1px solid #1a1a1a;
}


/* === TEAR OVERLAY === */
#tear-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
}

#tear-overlay.active {
  display: block;
}

#tear-top, #tear-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--black);
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

#tear-top {
  top: 0;
  border-bottom: 2px solid var(--accent);
}

#tear-bottom {
  bottom: 0;
  border-top: 2px solid var(--accent);
}

#tear-overlay.open #tear-top {
  transform: translateY(-105%) skewY(-1deg);
}

#tear-overlay.open #tear-bottom {
  transform: translateY(105%) skewY(1deg);
}

/* === TICKER === */
#ticker-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 101;
  height: 35px;
  background: #0d1117;
  border-bottom: 1px solid rgba(0,255,65,0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.815rem;
  letter-spacing: 0.05em;
}

#ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll var(--ticker-duration, 40s) linear infinite;
  will-change: transform;
}

#ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1.2rem;
  color: #888;
}

.ticker-item .ticker-emoji {
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.ticker-item .ticker-emoji .pixel-icon {
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.ticker-item .ticker-label {
  color: #888;
}

.ticker-item .ticker-value {
  color: #888;
  font-weight: 700;
}

.ticker-item .ticker-change {
  font-size: 0.75rem;
}

.ticker-item .ticker-change.up {
  color: #39ff14;
}
.ticker-item .ticker-change.down {
  color: #ff2d2d;
}
.ticker-item .ticker-change.flat {
  color: #888;
}

.ticker-sep {
  color: #222;
  padding: 0 0.3rem;
  user-select: none;
}

/* === NAV === */
#main-nav {
  position: fixed;
  top: 35px;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

#nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.15em;
}

#nav-links {
  display: flex;
  gap: 2.5rem;
}

#nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #777;
  text-decoration: none;
  letter-spacing: 0.2em;
  transition: color 0.3s;
  position: relative;
}

#nav-links a:hover {
  color: var(--white);
}

#nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

#nav-links a:hover::after {
  width: 100%;
}

#nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

#nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s;
}

#nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
#nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(10,10,10,0.97);
  z-index: 99;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

#mobile-menu.open {
  display: flex;
}

#mobile-menu a {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.2em;
  transition: color 0.3s;
}

#mobile-menu a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  #nav-links { display: none; }
  #nav-hamburger { display: flex; }
}

/* === FEED === */
#feed {
  position: relative;
  width: 100%;
  min-height: 200vh;
  padding-top: 100px;
  overflow: visible;
}

/* Each feed item is a floating popup window */
.feed-item {
  position: absolute;
  cursor: pointer;
  opacity: 0;
  background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Pop-in animation variants */
.feed-item.anim-scale {
  transform: scale(0) rotate(var(--rot, 0deg));
  transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.feed-item.anim-slide-left {
  transform: translateX(-120px) scale(0.8) rotate(var(--rot, 0deg));
  transition: opacity 0.4s ease-out, transform 0.4s ease-out, box-shadow 0.3s;
}

.feed-item.anim-slide-right {
  transform: translateX(120px) scale(0.8) rotate(var(--rot, 0deg));
  transition: opacity 0.4s ease-out, transform 0.4s ease-out, box-shadow 0.3s;
}

.feed-item.anim-drop {
  transform: translateY(-80px) scale(0.9) rotate(var(--rot, 0deg));
  transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.feed-item.anim-glitch {
  transform: scale(1.1) rotate(var(--rot, 0deg));
  transition: opacity 0.15s steps(3), transform 0.15s steps(3), box-shadow 0.3s;
}

.feed-item.visible {
  opacity: 1;
  transform: scale(1) rotate(var(--rot, 0deg));
  pointer-events: auto;
}

.feed-item:hover {
  z-index: 50 !important;
  box-shadow: 0 8px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.15);
}

.feed-item.focused {
  z-index: 60 !important;
}

/* Popup title bar — glossy dark modal style */
.feed-item .popup-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #222 100%);
  border-bottom: 1px solid #444;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: #666;
  letter-spacing: 0.08em;
  cursor: grab;
  user-select: none;
  position: relative;
  border-radius: 8px 8px 0 0;
}

.feed-item .popup-titlebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  border-radius: 8px 8px 0 0;
}

.feed-item .popup-titlebar .popup-dots {
  display: flex;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.feed-item .popup-titlebar .popup-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.popup-dot.r { background: #ff5f56; box-shadow: 0 0 3px rgba(255,95,86,0.4); cursor: pointer; }
.popup-dot.r:hover { background: #ff3b30; transform: scale(1.3); }
.popup-dot.y { background: #ffbd2e; box-shadow: 0 0 3px rgba(255,189,46,0.4); }
.popup-dot.g { background: #27c93f; box-shadow: 0 0 3px rgba(39,201,63,0.4); }

.feed-item .popup-titlebar .popup-title-text {
  flex: 1;
  text-align: center;
  color: #555;
  position: relative;
  z-index: 1;
}


/* Feed item content area */
.feed-item .popup-body {
  position: relative;
  overflow: hidden;
}

.feed-item img,
.feed-item video {
  width: 100%;
  display: block;
  filter: grayscale(20%) contrast(1.1);
  transition: filter 0.4s, transform 0.4s;
}

.feed-item:hover video {
  filter: grayscale(0%) contrast(1.2);
  transform: scale(1.03);
}

.feed-item:hover img {
  filter: grayscale(0%) contrast(1.2);
  transform: scale(1.03);
}

.feed-item .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 2px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  background: rgba(0,0,0,0.5);
  z-index: 2;
}

.feed-item.video-thumb:hover .play-icon {
  opacity: 1;
}

.play-icon::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent var(--white);
  margin-left: 3px;
}

.feed-item .item-tag {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  padding: 2px 6px;
  background: rgba(0,0,0,0.8);
  color: var(--green);
  border: 1px solid rgba(57,255,20,0.25);
  pointer-events: none;
  z-index: 2;
}

.feed-item.meme .item-tag { color: #ff6b6b; border-color: rgba(255,107,107,0.3); }
.feed-item.video-thumb .item-tag { color: #fff; border-color: rgba(255,255,255,0.2); }

/* YouTube embeds */
.feed-item.youtube-thumb .popup-body {
  padding: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}
.yt-aspect {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}
.yt-aspect iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}
.yt-thumb-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.feed-item.youtube-thumb .play-icon { z-index: 4; opacity: 1; }
.yt-fallback {
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #888;
  text-align: center;
}
.yt-fallback a { color: var(--green); text-decoration: underline; }
.yt-fallback a:hover { color: #fff; }

/* Text-only feed items */
.feed-item.text-card .popup-body {
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  text-align: center;
}

.feed-item.text-card .text-content {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--white);
  letter-spacing: 0.05em;
}

.feed-item.text-card.red-card .popup-body {
  background: var(--accent);
}

.feed-item.text-card.red-card .text-content {
  color: var(--black);
  font-weight: 700;
}

.feed-item.text-card.terminal-card .popup-body {
  background: var(--black);
  border: 1px solid rgba(0,255,65,0.2);
}

/* Resize handle */
.feed-item .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
}

.feed-item .resize-handle::before {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,0.15);
  border-bottom: 2px solid rgba(255,255,255,0.15);
}

.feed-item .resize-handle:hover::before {
  border-color: rgba(255,255,255,0.35);
}

.feed-item.resizing {
  transition: none !important;
}

.feed-item.resizing img,
.feed-item.resizing video {
  pointer-events: none;
}

/* Floating transparent graphic overlay */
.floating-overlay {
  position: absolute;
  max-width: 420px;
  width: 420px;
  height: auto !important;
  z-index: 100;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
}

.feed-item.text-card.terminal-card .text-content {
  color: var(--green);
  font-size: 0.75rem;
}

/* === VIDEO MODAL === */
#video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
}

#video-modal.open {
  display: flex;
}

#video-modal-inner {
  position: relative;
  width: min(800px, 90vw);
}

#video-modal-inner video {
  width: 100%;
  outline: none;
}

#video-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  font-family: var(--font-mono);
}

/* === RANDOM POPUP === */
#random-popup {
  position: fixed;
  z-index: 150;
  background: var(--dark);
  border: 1px solid var(--accent);
  padding: 1.5rem;
  display: none;
  max-width: 320px;
  box-shadow: 0 0 40px rgba(255, 60, 60, 0.15);
}

#random-popup.show {
  display: block;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#popup-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  font-family: var(--font-mono);
}

#popup-content {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--white);
  line-height: 1.6;
}

#popup-content img {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* === CONTENT MODAL (expanded popup) === */
#content-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#content-modal.open {
  display: flex;
}

#content-modal-window {
  position: relative;
  width: min(600px, 90vw);
  max-height: 85vh;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 4%, #111 100%);
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow:
    0 16px 80px rgba(0,0,0,0.9),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#content-modal-window .modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #222 100%);
  border-bottom: 1px solid #444;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #666;
  letter-spacing: 0.08em;
  position: relative;
}

#content-modal-window .modal-titlebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  border-radius: 8px 8px 0 0;
}

#content-modal-window .modal-titlebar .modal-dots {
  display: flex;
  gap: 5px;
  position: relative;
  z-index: 1;
}

#content-modal-window .modal-titlebar .modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

#content-modal-window .modal-titlebar .modal-dot.r { background: #ff5f56; box-shadow: 0 0 4px rgba(255,95,86,0.4); }
#content-modal-window .modal-titlebar .modal-dot.y { background: #ffbd2e; box-shadow: 0 0 4px rgba(255,189,46,0.4); }
#content-modal-window .modal-titlebar .modal-dot.g { background: #27c93f; box-shadow: 0 0 4px rgba(39,201,63,0.4); }

#content-modal-window .modal-titlebar .modal-title-text {
  flex: 1;
  text-align: center;
  color: #555;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

#content-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: color 0.2s;
  line-height: 1;
  position: relative;
  z-index: 1;
}

#content-modal-close:hover {
  color: var(--white);
}

#content-modal-body {
  overflow-y: auto;
  max-height: calc(85vh - 36px);
}

#content-modal-body img {
  width: 100%;
  display: block;
}

#content-modal-body .modal-text-content {
  padding: 2.5rem 2rem;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--white);
  text-align: center;
  letter-spacing: 0.05em;
}

#content-modal-body .modal-text-content.red {
  background: var(--accent);
  color: var(--black);
  font-weight: 700;
}

#content-modal-body .modal-text-content.terminal {
  background: var(--black);
  color: var(--green);
  font-size: 1rem;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--black);
}
::-webkit-scrollbar-thumb {
  background: var(--light-grey);
}
::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ===================================================== */
/*  EARLY WEB / 90s AESTHETIC — GATE SCREEN              */
/* ===================================================== */

/* Pixel font on all gate headlines & ornaments */
#gate-title,
#gate-modal-header,
#enter-btn,
#gate-ip-warning,
#gate-scan-result,
#gate-testimonial,
#gate-users-online,
.stat-badge,
#gate-modal-footer {
  font-family: var(--font-pixel) !important;
  letter-spacing: 0.04em !important;
}

/* Bump pixel-font sizes since VT323 runs small */
#gate-ip-warning { font-size: 1rem !important; }
#gate-scan-result { font-size: 0.95rem !important; }
#gate-testimonial { font-size: 1.05rem !important; }
#gate-users-online { font-size: 1rem !important; }
.stat-badge { font-size: 0.95rem !important; }
#gate-modal-header { font-size: 0.95rem !important; }
#enter-btn { font-size: 1.1rem !important; }

/* HAZARD STRIPE — animated under construction bar */
.hazard-stripe {
  position: absolute;
  left: 0; right: 0;
  height: 26px;
  overflow: hidden;
  z-index: 50;
  background:
    repeating-linear-gradient(
      135deg,
      #000 0 14px,
      #ffcc00 14px 28px
    );
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  box-shadow: 0 2px 0 #ffcc00, 0 -2px 0 #ffcc00;
}
.hazard-stripe.top { top: 0; }
.hazard-stripe .hazard-text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-bitmap);
  font-size: 0.62rem;
  color: #000;
  background: #ffcc00;
  padding: 6px 14px;
  position: relative;
  top: 4px;
  animation: hazard-scroll 22s linear infinite;
  letter-spacing: 0.1em;
}
@keyframes hazard-scroll {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}

/* FAKE DISCLAIMER */
#gate-disclaimer {
  max-width: 640px;
  margin: 1.6rem auto 1rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  line-height: 1.35;
  color: #ffcc00;
  background: #1a1a1a;
  border-top: 2px solid #ffcc00;
  border-bottom: 2px solid #ffcc00;
  text-align: center;
  letter-spacing: 0.02em;
}
#gate-disclaimer strong {
  color: #ff2d2d;
  text-decoration: blink;
  animation: blinker 1s steps(2, start) infinite;
}
@keyframes blinker { to { visibility: hidden; } }

/* 88×31 WEB BUTTON ROW */
.web-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0.6rem auto 0.3rem;
  max-width: 400px;
  padding: 0;
}
.btn-88 {
  width: 88px;
  height: 31px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-bitmap);
  font-size: 7px;
  letter-spacing: 0.05em;
  line-height: 1;
  text-align: center;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,0.4), inset 1px 1px 0 rgba(255,255,255,0.3);
  image-rendering: pixelated;
  user-select: none;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-88:hover { transform: translateY(-1px) scale(1.03); }
.btn-88:active { transform: translateY(1px); box-shadow: inset 1px 1px 0 rgba(0,0,0,0.4); }
.btn-88 .b1 { margin-bottom: 2px; }

/* WARBUX web buttons — all 8 */
.btn-wb-net { background: linear-gradient(180deg, #39ff14 0 50%, #000 50% 100%); color: #000; }
.btn-wb-net .b2 { color: #39ff14; }

.btn-wb-rx { background: #fff; color: #000; border-color: #000; }
.btn-wb-rx .b1 { color: #000; }
.btn-wb-rx .b2 { color: #ff2d2d; }

.btn-wb-ss26 { background: #000; color: #39ff14; border-color: #39ff14; }
.btn-wb-ss26 .b1 { color: #fff; }
.btn-wb-ss26 .b2 { color: #39ff14; }

.btn-wb-beta { background: repeating-linear-gradient(45deg, #000 0 6px, #39ff14 6px 12px); color: #fff; text-shadow: 1px 1px 0 #000; }

.btn-wb-trial { background: linear-gradient(180deg, #00ccff 0 50%, #000 50% 100%); color: #000; }
.btn-wb-trial .b2 { color: #00ccff; }

.btn-wb-recall { background: linear-gradient(180deg, #ff2d2d 0 50%, #000 50% 100%); color: #fff; }
.btn-wb-recall .b1 { color: #fff; text-shadow: 1px 1px 0 #000; }
.btn-wb-recall .b2 { color: #ff2d2d; }

.btn-wb-hotline { background: #000; color: #ffcc00; border-color: #ffcc00; }
.btn-wb-hotline .b1 { color: #fff; }
.btn-wb-hotline .b2 { color: #ffcc00; }

.btn-wb-lab { background: #c0c0c0; color: #000; border-color: #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff; }
.btn-wb-lab .b2 { color: #008020; }

/* FOOTER STRIP — visitor counter + webmaster */
.gate-footer-strip {
  max-width: 400px;
  width: 100%;
  margin: 0.3rem auto 0;
  padding: 0.3rem 0.4rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: #888;
  border-top: 1px dashed #333;
  letter-spacing: 0.05em;
}
.visitor-counter {
  background: #000;
  color: #39ff14;
  padding: 2px 8px;
  border: 1px inset #39ff14;
  font-family: var(--font-bitmap);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}
.webmaster { color: #00ccff; text-decoration: underline; }


/* Gate content spacing tweaks */

@media (max-width: 600px) {
  .btn-88 { transform: scale(0.9); }
  .gate-footer-strip { flex-direction: column; gap: 0.3rem; text-align: center; }
  #gate-disclaimer { font-size: 0.8rem; }
}
