:root {
  --bg: #0b0909;
  --panel: #151112;
  --panel-hi: #1f1819;
  --line: #2e2425;
  --line-strong: #4a3a3b;
  --text: #efe9e6;
  --text-soft: #ddd3d0;
  --muted: #b0a3a1;
  --faint: #8f8381;
  --red: #c41e2a;
  --red-text: #ef6b6b;
  --amber: #e3b25a;
  --blue: #8fc1e3;
  --green: #a9d2a3;
  --error: #ef8f8f;
  --serif: 'Shippori Mincho B1', serif;
  --sans: 'Zen Kaku Gothic New', system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
a { color: var(--red-text); }
a:hover { color: #ff9a9a; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 2px; }

.wrap { max-width: 1280px; width: 100%; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.serif { font-family: var(--serif); font-weight: 800; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.unset { color: var(--faint) !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 4px; border: 1px solid transparent; font-size: 15px; font-weight: 700; text-decoration: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #d42733; color: #fff; }
.btn-light { background: var(--text); color: var(--bg); }
.btn-light:hover { background: #fff; color: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: #6a5455; color: var(--text); }
.btn-off, .btn:disabled { background: #241c1d; color: #9a8d8b; border-color: #241c1d; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; min-height: 32px; color: var(--red-text); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link-btn:hover { color: #ff9a9a; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.input { width: 100%; min-height: 46px; padding: 0 14px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 4px; font-size: 15px; }
textarea.input { padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.input:disabled { opacity: 0.6; }
.code-input { min-height: 56px; font-family: var(--mono); font-size: 28px; letter-spacing: 0.35em; text-align: center; }
.msg { margin: 0; font-size: 14px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--green); font-weight: 700; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.hero { position: relative; overflow: hidden; min-height: 780px; display: flex; flex-direction: column; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.hero-art.on { opacity: 1; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,9,9,0.94) 0%, rgba(11,9,9,0.74) 42%, rgba(11,9,9,0.2) 100%); }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 240px; background: linear-gradient(180deg, rgba(11,9,9,0) 0%, var(--bg) 100%); }
.topbar { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; }
.topbar .logo { height: 38px; width: auto; }
.hero-body { position: relative; flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 40px; padding-top: 56px; padding-bottom: 110px; }
.hero-copy { flex: 1 1 420px; max-width: 600px; display: flex; flex-direction: column; gap: 20px; }
.hero-logo { width: min(100%, 470px); height: auto; }
.hero-copy h1 { margin: 0; font-size: 46px; line-height: 1.1; }
.hero-copy .lead { margin: 0; font-size: 17px; color: var(--text-soft); max-width: 500px; }
.lock-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: #b9acaa; }

.verify-card { flex: 1 1 360px; max-width: 440px; background: rgba(21,17,18,0.93); border: 1px solid #3a2d2e; border-radius: 6px; padding: 28px; }
.verify-step { display: flex; flex-direction: column; gap: 18px; }
.verify-step > .link-btn { align-self: flex-start; }
.step-head { display: flex; flex-direction: column; gap: 4px; }
.step-head h2 { margin: 0; font-size: 26px; }
.step-head p { margin: 0; }
.step { font-size: 13px; color: var(--muted); }
.verify-form { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.demo-note { margin: 0; padding: 10px 12px; border: 1px dashed #3a2d2e; border-radius: 4px; font-size: 13px; color: var(--muted); }
.demo-note strong { color: var(--text); font-family: var(--mono); letter-spacing: 0.12em; }
.demo-names { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 14px; border-top: 1px dashed #3a2d2e; font-size: 13px; color: var(--muted); }
.demo-names .link-btn { font-size: 13px; }
.verified { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--green); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.thumb { padding: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); border: 2px solid rgba(239,233,230,0.12); border-radius: 4px; }
.thumb[aria-pressed="true"] { border-color: var(--red); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.how { padding-top: 64px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 22px; }
.how h2 { margin: 0; font-size: 30px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.how li { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; }
.how .num { font-family: var(--serif); font-weight: 800; font-size: 32px; line-height: 1; color: var(--red-text); }
.how h3 { margin: 0; font-size: 18px; }
.how p { margin: 0; color: #c8bcba; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.site-footer img { height: 24px; width: auto; }

.page-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-head-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.page-head-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,9,9,0.96) 0%, rgba(11,9,9,0.82) 50%, rgba(11,9,9,0.5) 100%); }
.page-head .wrap { position: relative; padding-top: 20px; padding-bottom: 34px; display: flex; flex-direction: column; gap: 30px; }
.nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.nav .logo { height: 34px; width: auto; display: block; }
.nav-user { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: 14px; }
.nav-user .who { display: flex; flex-direction: column; line-height: 1.3; text-align: right; }
.nav-user .who span { font-size: 13px; color: #b9acaa; }
.nav-user a { font-weight: 700; }
.page-title h1 { margin: 0; font-size: 46px; line-height: 1.1; }
.page-title p { margin: 4px 0 0; color: var(--text-soft); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }

.board { padding-top: 28px; padding-bottom: 56px; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.board-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.squad-box { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.squad-box .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.squad-box h2 { margin: 0; font-size: 20px; }
.squad-box p { margin: 0; font-size: 14px; color: var(--text-soft); }
.slot { font-size: 13px; font-weight: 700; color: var(--muted); }
.slot.full { color: var(--blue); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { min-height: 44px; padding: 0 12px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.tab[aria-pressed="true"] { border-bottom-color: var(--red); color: var(--text); }
.mission-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mission-item { width: 100%; display: flex; gap: 14px; align-items: flex-start; padding: 14px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.mission-item:hover { border-color: var(--line-strong); }
.mission-item[aria-pressed="true"] { background: var(--panel-hi); border-color: var(--red); }
.rank { flex: none; min-width: 48px; height: 48px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border: 1.5px solid #5a4647; font-family: var(--serif); font-weight: 800; font-size: 21px; }
.mission-item .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission-item .title { font-family: var(--serif); font-weight: 800; font-size: 18px; line-height: 1.25; }
.mission-item .meta { font-size: 13px; color: #b9acaa; }
.mission-item .status { margin-top: 4px; }
.status { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.status-open { color: var(--red-text); }
.status-partial { color: var(--amber); }
.status-claimed { color: #9a8d8b; }
.status-mine { color: var(--blue); }
.tag { padding: 4px 10px; border: 1px solid currentColor; border-radius: 3px; }
.empty { margin: 0; padding: 24px; text-align: center; border: 1px dashed #3a2d2e; border-radius: 6px; color: var(--muted); }

.mission { flex: 999 1 560px; min-width: 0; }
.mission-head { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--line); }
.mission-head .row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.mission-head h2 { margin: 0; font-size: 40px; line-height: 1.15; }
.claimed-line { font-size: 13px; color: #b9acaa; }
.title-block { display: flex; flex-direction: column; gap: 4px; }
.host-line { margin: 0; font-size: 14px; color: var(--muted); }
.host-line strong { color: var(--text); }
.action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.action .note { font-size: 13px; color: #b9acaa; }
.action .msg { flex-basis: 100%; }
.facts { margin: 0; padding: 18px 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 24px; border-bottom: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.mission-body { padding: 26px 28px 32px; display: flex; flex-direction: column; gap: 24px; }
.mission-body section { display: flex; flex-direction: column; gap: 6px; }
.mission-body h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 19px; }
.mission-body p, .mission-body ol { margin: 0; color: var(--text-soft); max-width: 760px; }
.mission-body ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

.admin { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 48px; }
.admin-section { display: flex; flex-direction: column; gap: 18px; }
.section-title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 28px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split-main { flex: 1 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.split-side { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-wide { flex: 999 1 520px; min-width: 0; }
.paste-box { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.paste-box p { margin: 0; }
.paste-box textarea { font-family: var(--mono); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.post-form { display: flex; flex-direction: column; gap: 18px; }
.preview-label { padding: 14px 24px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.preview .mission-head { padding: 12px 24px 20px; }
.preview .mission-head h2 { font-size: 28px; }
.preview .facts { padding: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 18px; }
.preview .facts dd { font-size: 14px; }
.preview .mission-body { padding: 18px 24px 24px; gap: 16px; font-size: 14px; }
.preview .mission-body h3 { font-size: 16px; }
.table-wrap { overflow-x: auto; }
.table { min-width: 860px; }
.table-row { display: grid; grid-template-columns: 2fr 1.1fr 0.6fr 0.8fr 1.1fr 1.8fr; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.table-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.table-row .right { text-align: right; }
.table-row .row-title { font-size: 17px; }
.table-row .actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.admin-list li:last-child { border-bottom: 0; }
.admin-list .who { display: flex; flex-direction: column; line-height: 1.35; }
.admin-list .who span { font-size: 13px; color: #b9acaa; }
.access-owner { color: var(--amber); }
.access-admin { color: var(--blue); }
.card-form { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card-form p { margin: 0; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; }
.inline .input { flex: 1 1 180px; width: auto; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.check-text { display: flex; flex-direction: column; gap: 2px; }
.check-text strong { font-size: 14px; }
.check-text span { font-size: 13px; color: var(--muted); }
.demo-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .hero { min-height: 0; }
  .hero-copy h1, .page-title h1 { font-size: 36px; }
  .mission-head h2 { font-size: 30px; }
  .verify-card { padding: 22px; }
  .topbar .logo { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art { transition: none; }
}
