@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Inter:wght@300;400;500;600&display=swap");

:root {
  --bg-primary: #0a0000;
  --bg-secondary: #0e0e18;
  --bg-card: linear-gradient(145deg, rgba(14,14,24,0.95), rgba(18,18,30,0.93));
  --bg-card-hover: linear-gradient(145deg, rgba(22,22,38,0.96), rgba(26,26,42,0.94));
  --steel-border: linear-gradient(135deg, rgba(140,140,160,0.25), rgba(80,80,100,0.15));
  --steel-highlight: inset 0 1px 0 rgba(200,200,220,0.06);
  --red: #dc143c;
  --red-bright: #ff1a4a;
  --red-dim: #8b0a1a;
  --red-glow: rgba(220, 20, 60, 0.12);
  --accent: #ff3333;
  --accent-dim: #991111;
  --text: #e8e0e0;
  --text-dim: #887080;
  --border: rgba(80, 70, 90, 0.3);
  --green: #00cc66;
  --green-dim: #008844;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("/static/bg-logo.png") center / cover no-repeat fixed;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5,0,0,0.3);
  pointer-events: none;
  z-index: 0;
}

nav, main { position: relative; z-index: 1; }

nav {
  background: rgba(8,8,16,0.92);
  border-bottom: 1px solid rgba(80,70,90,0.25);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

nav a:hover {
  color: var(--red-bright);
  background: rgba(220,20,60,0.08);
}

.nav-brand {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: 1.3em;
  color: var(--red) !important;
  margin-right: 20px;
  text-shadow: 0 0 30px var(--red-glow);
  letter-spacing: 0.08em;
}

.nav-user {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user a.logout { color: var(--red-dim); font-size: 0.85em; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

h1 {
  font-family: "Cinzel", serif;
  color: var(--red);
  font-size: 2em;
  margin-bottom: 24px;
  text-shadow: 0 0 40px var(--red-glow);
  letter-spacing: 0.03em;
  font-weight: 700;
}

h2 {
  font-family: "Cinzel", serif;
  color: var(--red-dim);
  font-size: 1.2em;
  margin: 24px 0 12px;
  letter-spacing: 0.02em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.server-card {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow), var(--steel-highlight);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.server-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: background 0.3s;
}

.server-card.running::before { background: linear-gradient(90deg, var(--green), var(--green-dim)); }
.server-card.stopped::before { background: linear-gradient(90deg, var(--red), var(--red-dim)); }

.server-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.8), var(--steel-highlight); }

.server-card h2 { font-size: 1em; margin: 0 0 12px; border: none; padding: 0; }
.server-card.running h2 { color: var(--green); }
.server-card.stopped h2 { color: var(--red); }

.server-card p { color: var(--text-dim); font-size: 0.9em; margin: 4px 0; }

.server-card .status-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.server-card.running .status-badge { background: rgba(0,204,102,0.12); color: var(--green); }
.server-card.stopped .status-badge { background: rgba(220,20,60,0.15); color: var(--red); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow), var(--steel-highlight);
  transition: all 0.3s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card .stat-value {
  font-family: "Cinzel", serif;
  font-size: 2em;
  color: var(--red);
  display: block;
}

.stat-card .stat-label {
  color: var(--text-dim);
  font-size: 0.85em;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filters {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow), var(--steel-highlight);
}

.filters form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.filters select, .filters input[type="text"] {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(8,8,16,0.8);
  color: var(--text);
  font-size: 0.9em;
  outline: none;
  transition: border-color 0.2s;
}

.filters select:focus, .filters input[type="text"]:focus { border-color: var(--red-dim); }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  box-shadow: var(--shadow), var(--steel-highlight);
}

th {
  background: linear-gradient(135deg, rgba(10,10,20,0.95), rgba(18,18,32,0.95));
  color: var(--red);
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(80,70,90,0.15);
  font-size: 0.9em;
  color: var(--text-dim);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); color: var(--text); }

a { color: var(--red-bright); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--red); }

.error {
  background: rgba(220,20,60,0.08);
  border: 1px solid rgba(220,20,60,0.25);
  color: var(--red-bright);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stats-grid div {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: 6px;
  padding: 12px 14px;
  text-align: center;
  transition: all 0.2s;
}

.stats-grid div:hover { }
.stats-grid div strong { display: block; color: var(--red); font-size: 1.1em; margin-bottom: 2px; }

.form-card {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  margin: 0 auto;
  box-shadow: var(--shadow), var(--steel-highlight);
}

.form-card label {
  display: block;
  color: var(--text-dim);
  font-size: 0.8em;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-card input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(8,8,16,0.8);
  color: var(--text);
  font-size: 0.95em;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}

.form-card input:focus { border-color: var(--red-dim); }

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, var(--red-dim), var(--red));
  color: #fff;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--red-glow); }

.btn-secondary { background: rgba(8,8,16,0.8); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: rgba(18,18,32,0.9); }

.chat-box {
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  padding: 16px;
  height: 500px;
  overflow-y: auto;
  box-shadow: var(--shadow), var(--steel-highlight);
  margin-bottom: 12px;
}

.chat-msg {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
}

.chat-msg:hover { background: rgba(255,255,255,0.04); }
.chat-msg .time { color: var(--text-dim); font-size: 0.75em; margin-right: 8px; }
.chat-msg .player { color: var(--red-bright); font-weight: 600; }
.chat-msg .text { color: var(--text); }

.chat-input { display: flex; gap: 8px; }

.chat-input input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(8,8,16,0.8);
  color: var(--text);
  font-size: 0.95em;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input input:focus { border-color: var(--red-dim); }
.chat-input button { padding: 10px 20px; border-radius: 6px; border: none; background: linear-gradient(135deg, var(--red-dim), var(--red)); color: #fff; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.chat-input button:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--red-glow); }

.chat-login-prompt {
  text-align: center;
  padding: 32px;
  background: var(--bg-card);
  border-image: var(--steel-border) 1;
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--steel-highlight);
}

.chat-login-prompt a { color: var(--red-bright); font-weight: 600; }

@media (max-width: 768px) {
  .server-grid { grid-template-columns: 1fr; }
  nav { padding: 0 12px; gap: 0; overflow-x: auto; }
  nav a { padding: 8px 8px; font-size: 0.75em; }
  main { padding: 20px 12px; }
  h1 { font-size: 1.4em; }
  th, td { padding: 10px 8px; font-size: 0.8em; }
  .nav-brand { font-size: 1em; margin-right: 8px; }
  body::before { background-size: cover; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(80,70,90,0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(80,70,90,0.6); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: 0.7; } 43% { opacity: 1; } 45% { opacity: 0.85; } 46% { opacity: 1; } }

.server-card.running .status-badge { animation: pulse 2s infinite; }
.nav-brand { animation: flicker 3s infinite; }
