/* =========================================================
   snips.gg — edgelord hacker LARP (CS2 palette)
   ========================================================= */

:root {
  --orange: #de9b35;
  --orange-bright: #ffb04a;
  --orange-glow: rgba(222, 155, 53, 0.55);
  --blue: #5e98d9;
  --blue-soft: #b5cce8;
  --bg: #0e1525;
  --panel: #0a0f1c;
  --warn: #ff5f57;
  --green-dot: #28c840;
  --yellow-dot: #febc2e;
  --red-dot: #ff5f57;
  --mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--orange);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Background layers
   ========================================================= */

#rain {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  opacity: 0.75;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
  z-index: 90;
  animation: flicker 8s infinite;
  mix-blend-mode: multiply;
}

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

@keyframes flicker {
  0%, 100% { opacity: 1; }
  3%       { opacity: 0.85; }
  3.5%     { opacity: 1; }
  47%      { opacity: 1; }
  47.5%    { opacity: 0.6; }
  48%      { opacity: 1; }
  72%      { opacity: 0.92; }
  73%      { opacity: 1; }
  92%      { opacity: 0.7; }
  93%      { opacity: 1; }
}

/* =========================================================
   Terminal window
   ========================================================= */

.terminal {
  position: relative;
  z-index: 20;
  width: min(720px, 92vw);
  margin: 11vh auto 0;
  background: rgba(10, 15, 28, 0.93);
  border: 1px solid var(--orange);
  border-radius: 6px;
  box-shadow:
    0 0 24px var(--orange-glow),
    0 0 80px rgba(222, 155, 53, 0.08),
    inset 0 0 70px rgba(0, 0, 0, 0.7);
  text-shadow: 0 0 4px rgba(222, 155, 53, 0.4);
  overflow: hidden;
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: linear-gradient(to bottom, #1a2233, #0f1622);
  border-bottom: 1px solid rgba(222, 155, 53, 0.25);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.5);
}
.dot-r { background: var(--red-dot); }
.dot-y { background: var(--yellow-dot); }
.dot-g { background: var(--green-dot); }

.title-bar .title {
  margin: 0 auto;
  padding-right: 50px; /* visual centering offset for the 3 dots */
  color: var(--blue-soft);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-shadow: 0 0 3px var(--blue);
  user-select: none;
}

.terminal-body {
  padding: 18px 22px 24px;
  min-height: 360px;
}

/* =========================================================
   Log lines / typewriter
   ========================================================= */

.log {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
}

.line {
  display: block;
  margin: 0;
  line-height: 1.55;
}

.line.cheat  { color: var(--blue); }
.line.server { color: var(--blue-soft); }
.line.warn   { color: var(--warn); text-shadow: 0 0 5px rgba(255, 95, 87, 0.5); }
.line.scrub  { color: #6b7a90; font-style: italic; }
.line.gold   { color: var(--orange-bright); text-shadow: 0 0 6px var(--orange); }

/* blinking cursor at end of currently-typing line */
.line.typing::after {
  content: '▌';
  display: inline-block;
  margin-left: 1px;
  animation: caret 0.7s steps(2) infinite;
  color: var(--orange);
}
@keyframes caret { 50% { opacity: 0; } }

/* =========================================================
   HELLO WORLD glitch headline
   ========================================================= */

#hello {
  margin: 22px 0 18px;
  font-size: clamp(34px, 7.5vw, 60px);
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  color: var(--orange);
  text-shadow:
    0 0 12px var(--orange),
    0 0 28px rgba(222, 155, 53, 0.55);
  user-select: none;
  position: relative;
  line-height: 1.1;
}

#hello.hidden { visibility: hidden; }

.glitch {
  position: relative;
  display: block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  letter-spacing: 6px;
  pointer-events: none;
}
.glitch::before {
  color: #00fff0;
  text-shadow: 0 0 6px rgba(0, 255, 240, 0.6);
  animation: glitch-cyan 4.2s infinite linear;
  mix-blend-mode: screen;
}
.glitch::after {
  color: #ff0066;
  text-shadow: 0 0 6px rgba(255, 0, 102, 0.6);
  animation: glitch-magenta 5.7s infinite linear;
  mix-blend-mode: screen;
}

@keyframes glitch-cyan {
  0%   { clip-path: inset(85% 0 12% 0); transform: translate(-1px, 0); }
  10%  { clip-path: inset(20% 0 78% 0); transform: translate(-2px, 0); }
  18%  { clip-path: inset(50% 0 48% 0); transform: translate(-1px, 0); }
  30%  { clip-path: inset(75% 0 22% 0); transform: translate(2px, 0); }
  44%  { clip-path: inset(10% 0 88% 0); transform: translate(-2px, 0); }
  55%  { clip-path: inset(60% 0 38% 0); transform: translate(1px, 0); }
  68%  { clip-path: inset(33% 0 65% 0); transform: translate(-3px, 0); }
  80%  { clip-path: inset(90% 0 8% 0);  transform: translate(2px, 0); }
  100% { clip-path: inset(85% 0 12% 0); transform: translate(0, 0); }
}

@keyframes glitch-magenta {
  0%   { clip-path: inset(45% 0 53% 0); transform: translate(1px, 0); }
  12%  { clip-path: inset(15% 0 84% 0); transform: translate(2px, 0); }
  25%  { clip-path: inset(70% 0 29% 0); transform: translate(-1px, 0); }
  37%  { clip-path: inset(35% 0 64% 0); transform: translate(2px, 0); }
  50%  { clip-path: inset(82% 0 17% 0); transform: translate(2px, 0); }
  63%  { clip-path: inset(5% 0 94% 0);  transform: translate(-2px, 0); }
  75%  { clip-path: inset(55% 0 44% 0); transform: translate(1px, 0); }
  88%  { clip-path: inset(25% 0 74% 0); transform: translate(-1px, 0); }
  100% { clip-path: inset(45% 0 53% 0); transform: translate(0, 0); }
}

/* =========================================================
   Counter (top-right)
   ========================================================= */

.counter {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 30;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--blue);
  background: rgba(10, 15, 28, 0.78);
  border: 1px solid rgba(94, 152, 217, 0.35);
  padding: 6px 10px;
  text-shadow: 0 0 4px var(--blue);
  user-select: none;
  white-space: nowrap;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
}

.counter #counter {
  color: var(--orange-bright);
  text-shadow: 0 0 6px var(--orange);
}

/* =========================================================
   Connection log (bottom-left)
   ========================================================= */

.connection-log {
  position: fixed;
  bottom: 16px;
  left: 18px;
  z-index: 30;
  width: min(420px, 55vw);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue-soft);
  text-shadow: 0 0 3px var(--blue);
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.conn-line {
  display: block;
  opacity: 0;
  animation: conn-in 0.4s forwards;
  text-shadow: 0 0 4px rgba(94, 152, 217, 0.6);
}
.conn-line.t   { color: var(--orange); text-shadow: 0 0 4px rgba(222, 155, 53, 0.6); }
.conn-line.ct  { color: #8fb6e0; }
.conn-line.warn{ color: var(--warn); text-shadow: 0 0 4px rgba(255, 95, 87, 0.5); }
@keyframes conn-in {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Custom block cursor
   ========================================================= */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--orange);
  text-shadow: 0 0 6px var(--orange), 0 0 14px rgba(222, 155, 53, 0.6);
  z-index: 1000;
  will-change: transform;
  animation: cursor-blink 1.05s steps(2) infinite;
  user-select: none;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 560px) {
  body { font-size: 12.5px; }
  .terminal { width: min(720px, 96vw); margin-top: 46px; }
  .terminal-body { padding: 14px 14px 18px; min-height: 300px; }
  .log { font-size: 11.5px; }
  .title-bar .title { font-size: 10.5px; padding-right: 30px; }
  .counter {
    font-size: 9.5px; padding: 4px 8px;
    top: 8px; right: 8px; letter-spacing: 0.6px;
  }
  .connection-log { font-size: 9.5px; width: calc(100vw - 20px); bottom: 8px; left: 10px; }
  #hello { letter-spacing: 3px; margin: 14px 0; font-size: clamp(28px, 11vw, 44px); }
  .vignette { background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.35) 100%); }
}
