@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

:root {
  --bg-dark: #0f0f1a;
  --bg-panel: #1a1a2e;
  --bg-panel-hover: #242445;
  --gold: #c9a84c;
  --gold-dim: #8a7230;
  --gold-glow: #d4b85c;
  --text: #d6d6d6;
  --text-muted: #888;
  --border: #2a2a4a;
  --red: #c0392b;
  --green: #27ae60;
}

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

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
}

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

/* ── Navigation ── */

nav {
  background: var(--bg-panel);
  border-bottom: 2px solid var(--gold-dim);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 60px;
}

nav .logo {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

nav .nav-links a {
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

nav .nav-links a:hover,
nav .nav-links a.active {
  border-color: var(--gold);
  color: var(--gold-glow);
}

/* ── Main content ── */

main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ── Filter input ── */

.filter-box {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.filter-box:focus {
  border-color: var(--gold);
}
.filter-box::placeholder {
  color: var(--text-muted);
}

/* ── Scenario table ── */

.scenario-table {
  width: 100%;
  border-collapse: collapse;
}

.scenario-table th {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--gold-dim);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scenario-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.scenario-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.scenario-table tbody tr:hover {
  background: var(--bg-panel-hover);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* ── Home page ── */

.home-card {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

.home-card p {
  margin-bottom: 1rem;
}

.home-card p:last-child {
  margin-bottom: 0;
}

/* ── Archive stats ── */

.archive-stats {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Upload intro ── */

.upload-intro {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2rem;
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  line-height: 1.7;
}

.upload-intro p {
  margin-bottom: 1rem;
}

.upload-intro code {
  background: var(--bg-dark);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--gold-glow);
}

.hidden {
  display: none !important;
}

/* ── Upload panel ── */

.upload-panel {
  max-width: 540px;
  margin: 0 auto;
}

/* ── Upload form ── */

.upload-form {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

/* ── Drop zone ── */

.drop-zone {
  width: 100%;
  border: 2px dashed var(--gold-dim);
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}

.drop-zone-text {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.drop-zone-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.drop-zone input[type="file"] {
  display: none;
}

.btn-small {
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  display: inline-block;
}

/* ── File list ── */

.file-list {
  width: 100%;
}

.file-list-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-list ul {
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.file-item-size {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.file-remove-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}
.file-remove-btn:hover {
  color: #e74c3c;
}

/* ── Turnstile centering ── */

.turnstile-center {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ── Upload result ── */

.upload-result {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  margin-top: 1rem;
}

.result-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.upload-result > p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.rejected-heading {
  text-align: left;
  font-weight: 600;
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.rejected-list-wrapper {
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  text-align: left;
}

.rejected-list-wrapper ul {
  list-style: none;
}

.rejected-list-wrapper li {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.rejected-list-wrapper li:last-child {
  border-bottom: none;
}

.upload-form label {
  font-weight: 600;
  color: var(--gold);
  font-size: 0.9rem;
}

.upload-form input[type="file"] {
  background: var(--bg-dark);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem;
  font-family: 'Open Sans', sans-serif;
}

.btn {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  padding: 0.7rem 1.5rem;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.btn:hover {
  background: var(--gold);
  color: var(--bg-dark);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  display: none;
}
.message.success {
  display: block;
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
}
.message.error {
  display: block;
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
}

/* ── Contact page ── */

.contact-card {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── Footer ── */

footer {
  text-align: center;
  padding: 1.2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */

@media (max-width: 640px) {
  nav {
    padding: 0 1rem;
    gap: 1rem;
  }
  nav .logo {
    font-size: 1rem;
  }
  main {
    padding: 0 1rem;
  }
  .scenario-table th,
  .scenario-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
}
