:root {
  --bg: #0a0e14;
  --surface: #10161f;
  --surface-2: #171f2b;
  --text: #d7e2ea;
  --muted: #7c8ba1;
  --accent: #38f0d0;
  --accent-dim: #1c8e7c;
  --create: #34d399;
  --attack: #f87171;
  --error: #f87171;
  --border: #223047;
}

* { box-sizing: border-box; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(56, 240, 208, 0); }
  50% { box-shadow: 0 0 14px rgba(56, 240, 208, 0.25); }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* subtle CRT scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease, text-shadow 0.15s ease; }
a:hover { text-decoration: underline; text-shadow: 0 0 8px rgba(56, 240, 208, 0.5); }

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.9rem 1.5rem;
  background: rgba(16, 22, 31, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(56, 240, 208, 0.35);
}
.nav .brand::after {
  content: '_';
  animation: blink 1.1s step-end infinite;
}
.nav .user { color: var(--muted); margin-left: auto; }

.tag {
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag.create { background: rgba(52, 211, 153, 0.1); color: var(--create); border-color: rgba(52, 211, 153, 0.4); }
.tag.attack { background: rgba(248, 113, 113, 0.1); color: var(--attack); border-color: rgba(248, 113, 113, 0.4); }

.container {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.4s ease both;
}
.container.narrow { max-width: 560px; }

h1, h2 { margin-top: 0; letter-spacing: 0.01em; }
h1::before, h2::before {
  content: '> ';
  color: var(--accent);
  text-shadow: 0 0 8px rgba(56, 240, 208, 0.4);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); animation: pulseGlow 1.6s ease infinite; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  transition: border-left-color 0.2s ease;
}
.team-card:hover { border-left-color: var(--accent); }
.team-card ul { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.table th, .table td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--accent-dim); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: rgba(56, 240, 208, 0.04); }

.form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.form.inline { flex-direction: row; align-items: end; flex-wrap: wrap; max-width: none; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.form input, .form select, .form textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 240, 208, 0.12);
}
.form button {
  align-self: flex-start;
  background: var(--accent);
  color: #05141b;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.form button:hover { box-shadow: 0 0 16px rgba(56, 240, 208, 0.5); transform: translateY(-1px); }
.form button:active { transform: translateY(0); }

code {
  font-family: inherit;
  background: rgba(56, 240, 208, 0.08);
  border: 1px solid rgba(56, 240, 208, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}

.error { color: var(--error); font-weight: 600; }
.muted { color: var(--muted); }

#matrix-bg { z-index: 0; }
