:root {
  --cork: #14200f;
  --paper: #e9e4d2;
  --paper-2: #f2eedd;
  --ink: #232010;
  --ink-soft: #4a4636;
  --muted: #7a7458;
  --line: #b8b298;
  --green: #009900;
  --green-deep: #006600;
  --red: #8a3a2e;
  --discord: #5865f2;
}

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  background: var(--cork);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.07) 0px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0px, transparent 1px, transparent 3px);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
}

a { color: inherit; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 0;
}

/* ---------- Navbar ---------- */
.navbar {
  max-width: 960px;
  margin: 0 auto 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.navbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.navbar .brand img { width: 36px; height: 36px; object-fit: contain; }
.navbar .brand .name { font-family: 'Aldrich'; font-size: 22px; color: var(--paper); letter-spacing: 0.03em; }
.navbar nav { display: flex; gap: 20px; }
.navbar nav a {
  font-family: 'Aldrich';
  font-size: 12px;
  color: var(--paper);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity .15s ease;
}
.navbar nav a:hover, .navbar nav a.active { opacity: 1; }

.navbar-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: 36px; height: 32px;
  background: transparent; border: 1px solid rgba(233,228,210,0.35);
  cursor: pointer; padding: 7px 7px; flex-shrink: 0;
}
.nav-toggle .bar {
  display: block; width: 100%; height: 2px; background: var(--paper);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Discord auth widget ---------- */
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Aldrich';
  font-size: 12px;
  background: var(--discord);
  color: #fff;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.discord-btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 6px 14px rgba(0,0,0,0.35); }
.discord-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.discord-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(88,101,242,0.16), rgba(0,0,0,0.28));
  padding: 5px 6px 5px 5px;
  border: 1px solid rgba(88,101,242,0.45);
  border-radius: 999px;
  transition: border-color .15s ease, background .15s ease;
}
.discord-profile:hover { border-color: rgba(88,101,242,0.8); }
.discord-profile .avatar-wrap {
  position: relative; width: 28px; height: 28px; flex-shrink: 0;
}
.discord-profile img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--discord); display: block;
}
.discord-profile .online-dot {
  position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px;
  border-radius: 50%; background: #23a55a; border: 2px solid var(--cork);
}
.discord-profile .uname {
  font-family: 'Aldrich'; font-size: 11.5px; color: var(--paper); letter-spacing: 0.02em;
}
.discord-profile .divider { width: 1px; height: 16px; background: rgba(255,255,255,0.15); }
.discord-profile button {
  background: none; border: none; color: var(--muted); font-family: 'Aldrich';
  font-size: 10px; cursor: pointer; letter-spacing: 0.03em; padding: 6px 12px 6px 2px;
  transition: color .15s ease;
}
.discord-profile button:hover { color: #ff8a80; }

.discord-note {
  font-family: 'Aldrich'; font-size: 11px; color: var(--paper); opacity: 0.6;
}

/* ---------- Board ---------- */
.board {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  background: var(--paper);
  background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 4px 4px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.55);
  position: relative;
  animation: boardIn .5s ease both;
}
.board.narrow { max-width: 760px; }
.board::before {
  content: '';
  position: absolute; top: -9px; left: 0; right: 0; height: 10px;
  background:
    linear-gradient(135deg, transparent 50%, var(--paper) 50%) 0 0/16px 16px,
    linear-gradient(-135deg, transparent 50%, var(--paper) 50%) 0 0/16px 16px;
  background-repeat: repeat-x;
}
@keyframes boardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.pin {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9d2b8, #8b8672 70%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.5); z-index: 5;
  animation: pinDrop .5s cubic-bezier(.34,1.56,.64,1) both;
}
.pin.p2 { animation-delay: .08s; }
@keyframes pinDrop { from { transform: translateY(-30px) scale(0.6); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 40px 20px; border-bottom: 3px double var(--ink);
}
.unit { display: flex; align-items: center; gap: 16px; }
.emblem { width: 46px; height: 46px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25)); }
.unit-text .name { font-family: 'Aldrich'; font-size: 20px; letter-spacing: 0.03em; line-height: 1; }
.unit-text .sub { font-family: 'Aldrich'; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-top: 4px; }
.boardlabel { font-family: 'Aldrich'; font-size: 11px; text-align: right; color: var(--muted); line-height: 1.6; }
.backlink { font-family: 'Aldrich'; font-size: 11px; color: var(--muted); text-decoration: none; }
.backlink:hover { color: var(--ink); }

.notice { padding: 58px 40px 42px; text-align: center; }
.stamp {
  display: inline-block; border: 5px solid var(--green-deep); padding: 18px 46px;
  transform: rotate(-3deg) scale(1.15); position: relative;
  animation: stampHit .5s cubic-bezier(.2,.9,.3,1.2) .2s both;
}
@keyframes stampHit { 0% { opacity: 0; transform: rotate(-3deg) scale(1.4); } 60% { opacity: 1; transform: rotate(-3deg) scale(0.96); } 100% { opacity: 1; transform: rotate(-3deg) scale(1); } }
.stamp::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--green-deep); opacity: 0.6; }
.stamp .l1 { font-family: 'Aldrich'; font-size: 38px; line-height: 0.9; color: var(--green-deep); letter-spacing: 0.02em; }
.stamp .l2 { font-family: 'Aldrich'; font-size: 13px; color: var(--green-deep); margin-top: 6px; letter-spacing: 0.1em; }
.stamp.closed { border-color: var(--red); transform: rotate(2.5deg) scale(1); }
.stamp.closed::before { border-color: var(--red); }
.stamp.closed .l1, .stamp.closed .l2 { color: var(--red); }

.notice p.desc { max-width: 540px; margin: 22px auto 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); }

.cta-row { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: 'Aldrich'; font-size: 13px; padding: 13px 26px; border: 2px solid var(--ink);
  color: var(--paper); background: var(--ink); text-decoration: none; cursor: pointer; display: inline-block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.25); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.disabled { background: transparent; border-color: var(--line); color: var(--muted); cursor: not-allowed; pointer-events: none; }

.methods-wrap { padding: 46px 40px 10px; }
.methods-head { font-family: 'Aldrich'; font-size: 21px; margin-bottom: 22px; letter-spacing: 0.02em; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.card {
  background: var(--paper-2); border: 1px solid var(--line); padding: 26px 24px 24px; position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.2); }
.card.is-closed { border-color: var(--red); opacity: 0.85; }
.card .cardtop { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.card h3 { font-family: 'Aldrich'; font-size: 19px; margin: 6px 0 0; letter-spacing: 0.02em; }
.card .who { font-family: 'Aldrich'; font-size: 10.5px; color: var(--muted); }
.card .status {
  display: flex; align-items: center; gap: 6px; font-family: 'Aldrich'; font-size: 10.5px;
  padding: 5px 10px; border: 1px solid currentColor; white-space: nowrap; flex-shrink: 0; margin-left: 12px;
}
.card .status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.card .status.open { color: var(--green-deep); }
.card .status.always { color: var(--green-deep); }
.card .status.closed { color: var(--red); }
.card p { font-size: 14px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 20px; }
.card .apply {
  font-family: 'Aldrich'; font-size: 12.5px; color: var(--ink); border-bottom: 2px solid var(--ink);
  padding-bottom: 2px; text-decoration: none; transition: padding-left .15s ease;
}
.card .apply:not(.disabled):hover { padding-left: 6px; }
.card .apply.disabled { color: var(--muted); border-color: var(--line); cursor: not-allowed; pointer-events: none; }

.steps-wrap { padding: 10px 40px 46px; }
.steps-head { font-family: 'Aldrich'; font-size: 21px; margin-bottom: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  border: 1px solid var(--line); background: var(--paper-2); padding: 20px;
  animation: fadeUp .4s ease both;
}
.step:nth-child(1) { animation-delay: .05s; }
.step:nth-child(2) { animation-delay: .12s; }
.step:nth-child(3) { animation-delay: .19s; }
.step .num { font-family: 'Aldrich'; font-size: 30px; color: var(--green-deep); margin-bottom: 8px; }
.step h4 { margin: 0 0 6px; font-family: 'Aldrich'; font-size: 18px; letter-spacing: 0.02em; }
.step p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }

.closed-strip {
  margin: 0 40px 46px; border: 2px solid var(--red); padding: 20px 24px;
  background: repeating-linear-gradient(-45deg, rgba(138,58,46,0.06) 0 10px, transparent 10px 20px);
}
.closed-strip h4 { margin: 0 0 6px; font-family: 'Aldrich'; font-size: 20px; color: var(--red); }
.closed-strip p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }

.board > footer {
  border-top: 3px double var(--ink); padding: 18px 40px;
  display: flex; justify-content: space-between; font-family: 'Aldrich'; font-size: 10.5px; color: var(--muted);
}

/* ---------- Forms ---------- */
.head { padding: 36px 40px 0; }
.head .who { font-family: 'Aldrich'; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.head h1 { font-family: 'Aldrich'; font-size: 32px; margin: 0 0 10px; letter-spacing: 0.02em; }
.head p { font-size: 14px; line-height: 1.7; color: var(--ink-soft); max-width: 560px; margin: 0 0 8px; }
.head .rule { font-family: 'Aldrich'; font-size: 12px; color: var(--red); margin-top: 14px; margin-bottom: 0; }

.veteran-note {
  margin: 24px 40px 0; padding: 16px 20px; border: 1px solid var(--green-deep); background: rgba(0,153,0,0.08);
  font-family: 'Aldrich'; font-size: 11.5px; color: var(--ink-soft); line-height: 1.6;
}
.veteran-note b { color: var(--green-deep); }

.login-note {
  margin: 24px 40px 0; padding: 16px 20px; border: 1px dashed var(--discord); background: rgba(88,101,242,0.08);
  font-family: 'Aldrich'; font-size: 11.5px; color: var(--ink-soft); line-height: 1.6;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

form { padding: 30px 40px 44px; }
.field { margin-bottom: 24px; }
.field label { display: block; font-family: 'Aldrich'; font-size: 12.5px; color: var(--ink); margin-bottom: 8px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.field input, .field textarea {
  width: 100%; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink);
  font-family: 'IBM Plex Sans'; font-size: 14px; padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(0,153,0,0.15); }
.field input:disabled { color: var(--ink-soft); cursor: not-allowed; }
.field textarea { resize: vertical; min-height: 96px; font-family: 'IBM Plex Sans'; line-height: 1.6; }

.sectionrow { display: flex; align-items: center; gap: 14px; margin: 38px 0 22px; }
.sectionrow .num {
  font-family: 'Aldrich'; font-size: 20px; color: var(--green-deep); border: 1px solid var(--green-deep);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sectionrow h2 { font-family: 'Aldrich'; font-size: 17px; margin: 0; letter-spacing: 0.02em; }

.submit-row {
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.submit-row .note { font-family: 'Aldrich'; font-size: 11px; color: var(--muted); max-width: 280px; line-height: 1.6; }

.confirm-box {
  margin: 0 40px 44px; padding: 22px 24px; border: 2px solid var(--green-deep);
  background: rgba(0,153,0,0.08); font-family: 'Aldrich'; font-size: 12.5px;
  color: var(--ink-soft); line-height: 1.7;
}
.confirm-box b { color: var(--green-deep); }
.confirm-box.is-error { border-color: var(--red); background: rgba(138,58,46,0.08); }
.confirm-box.is-error b { color: var(--red); }

footer.site-footer {
  max-width: 960px; margin: 32px auto 24px; width: 100%;
  border-top: 3px double var(--paper); padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
footer.site-footer .fbrand { display: flex; align-items: center; gap: 10px; }
footer.site-footer .fbrand img { width: 26px; height: 26px; object-fit: contain; }
footer.site-footer .fbrand span { font-family: 'Aldrich'; font-size: 16px; color: var(--paper); letter-spacing: 0.03em; }
footer.site-footer .fnote { font-family: 'Aldrich'; font-size: 10.5px; color: var(--muted); text-align: right; line-height: 1.6; }
footer.site-footer .fnote .heart { color: var(--red); }

@media (max-width: 720px) {
  .board { max-width: 100%; }
  .topbar, .notice, .methods-wrap, .steps-wrap, form, .head, footer.site-footer { padding-left: 22px; padding-right: 22px; }
  .stamp .l1 { font-size: 28px; }
  .methods, .steps { grid-template-columns: 1fr; }
  .veteran-note, .login-note, .confirm-box { margin-left: 22px; margin-right: 22px; }
  footer.site-footer { flex-direction: column; align-items: flex-start; }
  footer.site-footer .fnote { text-align: left; }
}

@media (max-width: 640px) {
  .navbar { flex-wrap: wrap; row-gap: 12px; }
  .nav-toggle { display: flex; }

  .navbar nav#navLinks {
    order: 5;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    gap: 2px;
    background: rgba(20,32,15,0.97);
    border: 1px solid rgba(233,228,210,0.15);
    padding: 8px;
  }
  .navbar nav#navLinks.open { display: flex; }
  .navbar nav#navLinks a {
    padding: 11px 12px; font-size: 13px; opacity: 0.85;
  }
  .navbar nav#navLinks a:hover, .navbar nav#navLinks a.active {
    opacity: 1; background: rgba(255,255,255,0.06);
  }

  .discord-profile .uname { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 480px) {
  .navbar .brand .name { font-size: 18px; }
  .navbar .brand img { width: 30px; height: 30px; }

  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 22px; }
  .boardlabel { text-align: left; }

  .notice { padding: 40px 20px 32px; }
  .stamp { padding: 14px 26px; transform: rotate(-3deg) scale(0.95); }
  .stamp .l1 { font-size: 22px; }
  .stamp .l2 { font-size: 11px; }
  .notice p.desc { font-size: 13.5px; }

  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }

  .head h1 { font-size: 24px; }
  .sectionrow { margin: 28px 0 16px; }

  .login-note { flex-direction: column; align-items: flex-start; }

  .discord-profile .uname { max-width: 60px; }
  footer.site-footer .fnote { font-size: 9.5px; }
}
