:root {
  --bg: #101012;
  --panel: #18181c;
  --panel2: #1f1f24;
  --line: #2a2a31;
  --text: #e8e6e1;
  --dim: #9b988f;
  --accent: #e0a458;      /* aged brass */
  --pass: #7fb069;
  --fail: #d1495b;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
}
.hidden { display: none !important; }

.wordmark { font-weight: 800; letter-spacing: .14em; font-size: 22px; color: var(--text); text-decoration: none; }
.wordmark span { color: var(--accent); }
.wordmark.small { font-size: 15px; }
.sub { color: var(--dim); margin-top: 6px; font-size: 14px; }

/* login */
#login { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.login-card { text-align: center; padding: 32px; width: min(340px, 90vw); }
.login-card form { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
input[type=password], textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 12px 14px; font-size: 16px; width: 100%;
}
textarea { min-height: 72px; resize: vertical; font-family: inherit; }
button {
  background: var(--accent); color: #17130c; border: 0; border-radius: 10px;
  padding: 13px 18px; font-size: 16px; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: .35; cursor: default; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.err { color: var(--fail); font-size: 14px; }

/* layout */
header {
  position: sticky; top: 0; z-index: 5; background: rgba(16,16,18,.92);
  backdrop-filter: blur(8px); padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.page { padding: 18px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; padding-bottom: 60px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin-bottom: 10px; }

/* mission card */
.mission-card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
}
.mission-card .label { font-family: var(--mono); color: var(--accent); font-size: 13px; letter-spacing: .08em; }
.mission-card h1 { font-size: 24px; margin: 4px 0 10px; }
.mission-card .criterion { font-size: 15px; }
.mission-card .drill { color: var(--dim); font-size: 14px; margin-top: 10px; }
.mission-card .actions { margin-top: 16px; display: flex; gap: 10px; }
.promote-banner {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: rgba(127,176,105,.12); border: 1px solid rgba(127,176,105,.4);
  color: var(--pass); font-size: 14px;
}

/* dropzone */
.dropzone {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--line); border-radius: 14px; padding: 30px 16px;
  color: var(--dim); cursor: pointer; transition: border-color .15s;
}
.dropzone:active, .dropzone.hover { border-color: var(--accent); color: var(--accent); }
.dropzone input { display: none; }
.dropzone small { color: var(--dim); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
#upload-form { display: flex; flex-direction: column; gap: 12px; }

/* session list */
.session-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; color: var(--text); text-decoration: none;
}
.session-row .meta { font-size: 13px; color: var(--dim); }
.session-row .score { font-family: var(--mono); font-size: 14px; }
.score .p { color: var(--pass); } .score .f { color: var(--fail); }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 700; letter-spacing: .05em; }
.badge.grading { background: rgba(224,164,88,.15); color: var(--accent); }
.badge.error { background: rgba(209,73,91,.15); color: var(--fail); }

/* ladder */
.ladder-row {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 4px;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.ladder-row .lab { font-family: var(--mono); font-size: 12px; width: 44px; flex-shrink: 0; color: var(--dim); }
.ladder-row.passed { color: var(--dim); }
.ladder-row.passed .tick { color: var(--pass); }
.ladder-row.current { color: var(--text); font-weight: 700; }
.ladder-row.current .lab { color: var(--accent); }
.ladder-row.locked { color: #55555c; }
.phase-head { margin-top: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }

/* session detail */
.back { color: var(--dim); text-decoration: none; font-size: 14px; }
.detail-head { margin: 14px 0 18px; }
.detail-head .score-big { font-family: var(--mono); font-size: 30px; margin-top: 6px; }
.summary-block {
  background: var(--panel); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  padding: 14px 16px; font-size: 15px; white-space: pre-wrap; margin-bottom: 14px;
}
.regression { border-left-color: var(--fail); color: #f0c0c7; }
.seed { border-left-color: #6b8fb3; color: #b9cee2; font-size: 14px; }
.photo-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.photo-card img { width: 100%; display: block; }
.photo-card .body { padding: 12px 14px; }
.verdict { font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .1em; }
.verdict.pass { color: var(--pass); } .verdict.fail { color: var(--fail); }
.best-tag { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; margin-left: 8px; }
.photo-card .exif { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 2px; }
.photo-card .note { font-size: 14.5px; margin-top: 8px; }

.spinner-block { text-align: center; padding: 50px 0; color: var(--dim); }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
