/* Travian Admin Panel — self-hosted layout (no framework CDN) */

:root {
  --bg: #0f1419;
  --bg-elevated: #1a222d;
  --surface: #232d3b;
  --border: #2f3d4f;
  --text: #e8eef4;
  --text-muted: #8fa3b8;
  --accent: #3d9cf0;
  --accent-hover: #5eb0ff;
  --danger: #e85d5d;
  --danger-muted: #f0a0a0;
  --success: #4ecf8a;
  --warning: #e8b84a;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(61, 156, 240, 0.12), transparent),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(78, 207, 138, 0.06), transparent);
  color: var(--text);
  line-height: 1.5;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* Top navigation */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.nav a.is-active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}
.nav a.nav-danger {
  color: var(--danger-muted);
}
.nav a.nav-danger:hover {
  color: var(--danger);
}

.status-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  width: 100%;
  flex-basis: 100%;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  margin-top: 0.25rem;
}
@media (min-width: 720px) {
  .status-pill {
    flex-basis: auto;
    width: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    margin-left: auto;
  }
}
.status-pill strong.ok {
  color: var(--success);
}
.status-pill strong.bad {
  color: var(--warning);
}
.status-pill code {
  font-size: 0.85em;
}

/* Panels & typography */
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel h1.panel-title {
  font-size: 1.6rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Forms */
.stack {
  margin-bottom: 1rem;
}
.stack:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 156, 240, 0.2);
}

.textarea {
  min-height: 6rem;
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid .span-2 {
    grid-column: span 2;
  }
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #0a0e12;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #0a0e12;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.btn-danger-outline {
  background: transparent;
  color: var(--danger-muted);
  border-color: rgba(232, 93, 93, 0.45);
}
.btn-danger-outline:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Alerts */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.alert:last-child {
  margin-bottom: 0;
}
.alert-success {
  background: rgba(78, 207, 138, 0.12);
  border-color: rgba(78, 207, 138, 0.35);
  color: #b8f0d0;
}
.alert-danger {
  background: rgba(232, 93, 93, 0.1);
  border-color: rgba(232, 93, 93, 0.35);
  color: #ffc8c8;
}
.alert-warning {
  background: rgba(232, 184, 74, 0.1);
  border-color: rgba(232, 184, 74, 0.35);
  color: #f5e6b8;
}
.alert-info {
  background: rgba(61, 156, 240, 0.1);
  border-color: rgba(61, 156, 240, 0.3);
  color: #c8e6ff;
}
.alert-muted {
  background: var(--surface);
  color: var(--text-muted);
}
.alert-snippet {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  word-break: break-word;
}

/* Player list */
.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.player-list li {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
}
.player-list li:last-child {
  border-bottom: none;
}

.footer-strip {
  margin-top: 1.5rem;
}
