/* MyLinuxServer Games — arcade / neon game-site shell */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #050814;
  --bg2: #0a1024;
  --card: rgba(14, 20, 40, 0.72);
  --card-solid: #10182c;
  --text: #f2f6ff;
  --muted: #9aafd0;
  --accent: #3dff9a;
  --accent-dim: rgba(61, 255, 154, 0.14);
  --accent2: #6ea8ff;
  --accent3: #c084fc;
  --danger: #ff6b8a;
  --warn: #ffd166;
  --border: rgba(140, 180, 255, 0.14);
  --border-glow: rgba(61, 255, 154, 0.35);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Orbitron", "Outfit", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --radius: 18px;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Animated game background layers */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(110, 168, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(192, 132, 252, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(61, 255, 154, 0.12), transparent 55%),
    linear-gradient(180deg, #050814 0%, #070c1a 45%, #050814 100%);
}

/* Grid + scanline */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(110, 168, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 168, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 20%, transparent 75%);
}

/* Floating game icons layer (used on hub) */
.bg-icons {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-icons span {
  position: absolute;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  opacity: 0.12;
  filter: blur(0.2px);
  animation: float-icon 14s ease-in-out infinite;
  user-select: none;
}
.bg-icons span:nth-child(odd) { animation-duration: 16s; }
.bg-icons span:nth-child(3n) { animation-duration: 12s; opacity: 0.09; }
.bg-icons span:nth-child(1) { top: 8%; left: 6%; animation-delay: 0s; }
.bg-icons span:nth-child(2) { top: 18%; right: 8%; animation-delay: -2s; }
.bg-icons span:nth-child(3) { top: 42%; left: 3%; animation-delay: -4s; }
.bg-icons span:nth-child(4) { top: 55%; right: 4%; animation-delay: -1s; }
.bg-icons span:nth-child(5) { bottom: 18%; left: 12%; animation-delay: -6s; }
.bg-icons span:nth-child(6) { bottom: 12%; right: 14%; animation-delay: -3s; }
.bg-icons span:nth-child(7) { top: 30%; left: 22%; animation-delay: -5s; font-size: 1.2rem; }
.bg-icons span:nth-child(8) { top: 70%; left: 45%; animation-delay: -7s; }
.bg-icons span:nth-child(9) { top: 12%; left: 48%; animation-delay: -2.5s; }
.bg-icons span:nth-child(10) { bottom: 28%; right: 28%; animation-delay: -8s; }
.bg-icons span:nth-child(11) { top: 48%; right: 18%; animation-delay: -1.5s; }
.bg-icons span:nth-child(12) { bottom: 8%; left: 35%; animation-delay: -4.5s; }

@keyframes float-icon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 18px calc(32px + var(--safe-b));
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(10, 16, 32, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}
.logo span {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(61, 255, 154, 0.45);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 0.84rem;
  font-weight: 600;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.15s;
}
.nav a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

/* Hero */
.hero {
  position: relative;
  padding: 8px 4px 6px;
  margin-bottom: 8px;
}
.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #fff 10%, #9ad4ff 40%, #3dff9a 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(110, 168, 255, 0.25));
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 52ch;
  font-size: 1.02rem;
}
.hero p strong { color: var(--text); font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(61, 255, 154, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(61, 255, 154, 0.12);
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.6s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.section-label {
  margin: 26px 0 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* Cards grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  background: linear-gradient(155deg, rgba(22, 32, 56, 0.9), rgba(8, 12, 24, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 0%, rgba(110, 168, 255, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
a.card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-glow);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(61, 255, 154, 0.15), 0 0 40px rgba(61, 255, 154, 0.08);
  text-decoration: none;
}
a.card:hover::before { opacity: 1; }

.card .emoji {
  font-size: 2rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  flex: 1;
}
.card .meta {
  font-size: 0.7rem;
  color: var(--accent2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.card .play-hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: 0.18s;
}
a.card:hover .play-hint {
  opacity: 1;
  transform: translateY(0);
}

.card.featured {
  border-color: rgba(61, 255, 154, 0.35);
  background:
    linear-gradient(145deg, rgba(24, 48, 42, 0.92), rgba(10, 16, 30, 0.96));
  box-shadow: var(--shadow), 0 0 0 1px rgba(61, 255, 154, 0.08), 0 0 40px rgba(61, 255, 154, 0.06);
}
.card.featured .emoji {
  background: rgba(61, 255, 154, 0.1);
  border-color: rgba(61, 255, 154, 0.28);
}
.card.featured .meta { color: var(--accent); }

.panel {
  background: linear-gradient(160deg, rgba(18, 26, 48, 0.9), rgba(8, 12, 24, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-top: 14px;
  backdrop-filter: blur(10px);
}
.panel h2 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 46px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(135deg, #4dffaa 0%, #2bd67a 100%);
  color: #031a0e;
  box-shadow: 0 8px 24px rgba(61, 255, 154, 0.22);
  transition: transform 0.12s, filter 0.12s;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { filter: brightness(0.96); transform: none; }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.muted { color: var(--muted); }

.toast {
  position: fixed;
  top: calc(16px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 90vw;
  text-align: center;
  font-family: var(--font);
}
.toast.hidden { display: none; }

.site-footer {
  margin-top: 40px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* Game page headings */
.wrap > h1 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  margin: 0 0 8px;
}

/* Keyboard helper (hangman etc.) */
.kb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.kb button {
  min-width: 36px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #151f38;
  color: var(--text);
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.kb button.used { opacity: 0.35; }
.kb button.hit { background: rgba(61, 255, 154, 0.22); border-color: var(--accent); }
.kb button.miss { background: rgba(255, 107, 138, 0.18); border-color: var(--danger); }

input[type="text"], select {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a1020;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
}
.status-line { margin: 8px 0 0; font-weight: 700; }

/* Shine sweep on featured cards */
.card.featured::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-18deg);
  animation: shine 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine {
  0%, 60% { left: -40%; }
  100% { left: 120%; }
}

@media (max-width: 560px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { min-height: 150px; padding: 14px 12px; }
  .card h2 { font-size: 0.95rem; }
  .card p { font-size: 0.8rem; }
  .card .emoji { width: 44px; height: 44px; font-size: 1.6rem; }
  .nav { font-size: 0.78rem; }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-icons span, .badge::before, .card.featured::after { animation: none; }
  a.card:hover { transform: none; }
}
