/* ==========================================================================
   Design tokens — edit these to retheme the whole site
   ========================================================================== */
:root {
  /* Colours */
  --bg:              #0a0806;   /* near-black with a hint of brown */
  --bg-raised:       #131008;   /* slightly lighter — panels, table rows */
  --bg-input:        #0f0d08;   /* form inputs */
  --border:          #2e2820;   /* subtle warm-dark border */
  --border-bright:   #5a4e3a;   /* focused / hover border */

  --text:            #c8b89a;   /* warm cream — Quake console default */
  --text-bright:     #e8d8be;   /* headings, labels */
  --text-muted:      #6a5e4a;   /* placeholder, optional markers */

  --accent:          #c8901a;   /* brownish-orange — damage number colour */
  --accent-dim:      #7a5810;   /* dimmer accent for hover states */

  --green:           #5a9a3a;   /* approve */
  --red:             #9a3a2a;   /* reject */

  /* Typography */
  --font:            'Quake1', 'Courier New', 'Lucida Console', monospace;
  --font-size:       14px;
  --line-height:     1.6;

  /* Layout */
  --max-width:       780px;
  --gap:             1.5rem;

  /* Misc */
  --radius:          0;         /* console: hard edges everywhere */
  --transition:      80ms ease;
}

/* ==========================================================================
   Base
   ========================================================================== */
@font-face {
  font-family: 'Quake1';
  src: url('/static/fonts/Quake1.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);

  /* Keep bitmap-style fonts crisp */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}

body {
  min-height: 100vh;
  padding: var(--gap);
}

/* ==========================================================================
   Layout
   ========================================================================== */
header,
main {
  max-width: var(--max-width);
  margin: 0 auto;
}

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--gap);
  margin-bottom: var(--gap);
}

header h1 {
  font-size: 1.4rem;
  color: var(--text-bright);
  letter-spacing: 0.05em;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  color: var(--accent);
}

header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h2 {
  font-size: 1.1rem;
  color: var(--text-bright);
  letter-spacing: 0.05em;
  margin-bottom: var(--gap);
}

h3 {
  font-size: 0.95rem;
  color: var(--text-bright);
  margin: var(--gap) 0 0.75rem;
}

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

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

p {
  margin-bottom: 0.75rem;
}

strong {
  color: var(--text-bright);
}

/* ==========================================================================
   Forms
   ========================================================================== */
form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

label {
  display: block;
  color: var(--text-bright);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.optional {
  color: var(--text-muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-bright);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a5e4a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}

select option {
  background: var(--bg-raised);
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input[type="file"] {
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  color: var(--text-muted);
}

input[type="file"]::-webkit-file-upload-button {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  margin-right: 0.6rem;
}

/* Completion time MM:SS */
.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.time-inputs input[type="number"] {
  width: 4rem;
  text-align: center;
}

/* Hide number spinners — the field is narrow enough that they crowd it */
.time-inputs input[type="number"]::-webkit-inner-spin-button,
.time-inputs input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.time-inputs input[type="number"] { -moz-appearance: textfield; }

.time-sep {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.time-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

/* hCaptcha sits on its own line */
.h-captcha {
  margin-top: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
button,
a.button {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  margin-top: 0.5rem;
}

button:hover,
a.button:hover {
  background: var(--text);
  color: var(--bg);
}

button.approve {
  border-color: var(--green);
  color: var(--green);
}

button.approve:hover {
  background: var(--green);
  color: var(--bg);
}

button.reject {
  border-color: var(--red);
  color: var(--red);
}

button.reject:hover {
  background: var(--red);
  color: var(--bg);
}

/* ==========================================================================
   Tables
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

th {
  text-align: left;
  color: var(--text-muted);
  font-weight: normal;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.6rem 0.4rem;
}

td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:hover td {
  background: var(--bg-raised);
}

/* Detail view — two-column key/value table */
table.detail th {
  width: 8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Admin tabs
   ========================================================================== */
nav.tabs {
  display: flex;
  gap: 0.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap);
}

nav.tabs a {
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

nav.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

nav.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==========================================================================
   SCP command block
   ========================================================================== */
section.scp-command {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 0.75rem;
  margin-bottom: var(--gap);
}

section.scp-command strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

section.scp-command pre {
  color: var(--text-bright);
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

section.scp-command button {
  margin-top: 0;
  font-size: 0.8rem;
  padding: 0.2rem 0.7rem;
}

/* ==========================================================================
   Error / status messages
   ========================================================================== */
p.error {
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0.5rem 0.75rem;
  margin-bottom: var(--gap);
}
