/* ==========================================================================
   THPCTF × Rotala CTF — Grand Line Cyber Academy
   Design tokens & components
   ========================================================================== */

:root {
  --ink: #061019;
  --ocean-900: #081a2a;
  --ocean-800: #0b2436;
  --ocean-700: #103049;
  --ocean-600: #16405f;
  --parchment: #f4e6c8;
  --parchment-dim: #e2cfa6;
  --parchment-ink: #22303a;
  --gold: #e8b23a;
  --gold-2: #f7d271;
  --gold-dark: #a97a16;
  --crimson: #c8462f;
  --marine: #3fa7c9;
  --haki: #9b6ef3;
  --green: #4fc08d;
  --muted: #9fb3c4;
  --line: rgba(232, 178, 58, 0.22);

  --font-display: "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-story: Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Mono", "Consolas", "Courier New", monospace;

  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--parchment);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(63, 167, 201, 0.16), transparent 60%),
    radial-gradient(900px 600px at 92% 4%, rgba(155, 110, 243, 0.12), transparent 60%),
    linear-gradient(180deg, #081a2a 0%, #061019 55%, #050d15 100%);
  background-attachment: fixed;
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.1; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

::selection { background: var(--gold); color: #1b1405; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 18px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.section-lead { color: var(--muted); max-width: 62ch; margin-bottom: 32px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 16, 25, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--parchment); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.brand-text .x { color: var(--parchment); opacity: 0.7; padding: 0 2px; }
.brand-text small {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--parchment);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  opacity: 0.82;
}
.main-nav a:hover { background: rgba(244, 230, 200, 0.08); opacity: 1; text-decoration: none; }
.main-nav a.active { color: var(--gold-2); background: rgba(232, 178, 58, 0.12); opacity: 1; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.bounty-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1b1405;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
}
.bounty-chip:hover { text-decoration: none; filter: brightness(1.05); }
.bounty-chip .bz { font-weight: 900; opacity: 0.65; }

.student-chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--parchment);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-chip:hover { border-color: var(--gold); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--parchment);
  border-radius: 8px;
  width: 40px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1b1405;
  border: 0;
  border-radius: 10px;
  padding: 13px 22px;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: 0 8px 0 rgba(120, 82, 8, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 rgba(120, 82, 8, 0.55); filter: brightness(1.04); text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 4px 0 rgba(120, 82, 8, 0.55); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(244, 230, 200, 0.04);
  color: var(--parchment);
  border: 1px solid rgba(244, 230, 200, 0.3);
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn-ghost:hover { border-color: var(--gold); background: rgba(232, 178, 58, 0.1); transform: translateY(-1px); text-decoration: none; }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sm { padding: 9px 14px; font-size: 0.8rem; box-shadow: 0 5px 0 rgba(120, 82, 8, 0.5); }
.btn-danger { background: linear-gradient(180deg, #e2604a, var(--crimson)); color: #fff; box-shadow: 0 8px 0 rgba(90, 22, 12, 0.6); }
.btn-danger:hover { box-shadow: 0 10px 0 rgba(90, 22, 12, 0.6); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 70px 0 130px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -10% -10%;
  height: 70%;
  background:
    radial-gradient(60% 60% at 50% 100%, rgba(232, 178, 58, 0.18), transparent 70%),
    radial-gradient(60% 80% at 80% 100%, rgba(63, 167, 201, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-inner { max-width: 860px; }

.hero-brand {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 4px;
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3.1rem, 10vw, 7.2rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  margin: 0 0 24px;
  color: var(--parchment);
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.4);
}
.hero-title .accent {
  color: var(--gold);
  display: block;
  -webkit-text-stroke: 1px rgba(27, 20, 5, 0.25);
}
.hero-title .small-line {
  display: block;
  font-size: 0.28em;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 18px;
  text-shadow: none;
}

.hero-lead {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: #cfdae4;
  max-width: 56ch;
  margin: 0 0 32px;
}
.hero-lead strong { color: var(--gold-2); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 44px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  max-width: 620px;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--gold-2);
  line-height: 1;
  letter-spacing: 0.04em;
}
.hero-stat span { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.hero-waves {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  width: 100%;
  height: 120px;
  pointer-events: none;
}
.hero-waves path { fill: rgba(8, 26, 42, 0.85); }
.hero-waves .w2 { fill: rgba(11, 36, 54, 0.9); }

/* floating compass */
.compass {
  position: absolute;
  right: 4vw;
  top: 18%;
  width: clamp(100px, 16vw, 190px);
  opacity: 0.5;
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections & cards ---------- */

.section { padding: 78px 0; position: relative; }
.section-tight { padding: 46px 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(11, 36, 54, 0.55), rgba(6, 16, 25, 0));
  border-top: 1px solid rgba(232, 178, 58, 0.1);
  border-bottom: 1px solid rgba(232, 178, 58, 0.1);
}

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(16, 48, 73, 0.72), rgba(8, 26, 42, 0.9));
  border: 1px solid rgba(232, 178, 58, 0.16);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
}

.card-icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(232, 178, 58, 0.12);
  border: 1px solid rgba(232, 178, 58, 0.3);
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.93rem; margin-bottom: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 178, 58, 0.35);
  color: var(--gold-2);
  background: rgba(232, 178, 58, 0.08);
  white-space: nowrap;
}
.tag-red { color: #ffb4a4; border-color: rgba(200, 70, 47, 0.5); background: rgba(200, 70, 47, 0.14); }
.tag-blue { color: #a9e0f2; border-color: rgba(63, 167, 201, 0.5); background: rgba(63, 167, 201, 0.14); }
.tag-purple { color: #d3bcfb; border-color: rgba(155, 110, 243, 0.5); background: rgba(155, 110, 243, 0.14); }
.tag-green { color: #b6f0d5; border-color: rgba(79, 192, 141, 0.5); background: rgba(79, 192, 141, 0.14); }

/* steps */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); counter-reset: step; }
.step { position: relative; padding-left: 0; }
.step-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold);
  opacity: 0.55;
  line-height: 1;
  margin-bottom: 8px;
}
.step h3 { font-size: 1rem; }
.step p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* ---------- Page head ---------- */

.page-head {
  padding: 60px 0 36px;
  border-bottom: 1px solid rgba(232, 178, 58, 0.12);
  background:
    radial-gradient(700px 260px at 15% 0%, rgba(232, 178, 58, 0.1), transparent 70%);
  margin-bottom: 40px;
}
.page-head h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.page-head p { color: var(--muted); max-width: 66ch; margin: 0; }
.crumbs { font-size: 0.8rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--gold); }
.crumbs span { color: var(--gold); }

/* ---------- Route / islands ---------- */

.route { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 0; }

.island-card {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 20px;
  background: linear-gradient(90deg, rgba(16, 48, 73, 0.85), rgba(8, 26, 42, 0.9));
  border: 1px solid rgba(232, 178, 58, 0.16);
  border-radius: var(--radius);
  padding: 22px 26px 22px 20px;
  transition: transform 0.18s, border-color 0.18s;
  overflow: hidden;
}
.island-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0.7;
}
.island-card:hover { transform: translateX(4px); border-color: rgba(232, 178, 58, 0.45); }
.island-card.locked { opacity: 0.52; filter: saturate(0.4); }
.island-card.locked:hover { transform: none; }
.island-card.done { border-color: rgba(79, 192, 141, 0.35); }
.island-card.done::before { background: linear-gradient(180deg, var(--green), transparent); }

.island-num {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(232, 178, 58, 0.55);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-2);
  background: radial-gradient(circle at 30% 25%, rgba(232, 178, 58, 0.25), rgba(8, 26, 42, 0.9));
  box-shadow: inset 0 0 0 4px rgba(6, 16, 25, 0.7);
}
.island-card.done .island-num { border-color: var(--green); color: #d8ffe9; }
.island-card.locked .island-num { border-color: rgba(159, 179, 196, 0.35); color: var(--muted); }

.island-arc { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; font-weight: 800; }
.island-card h3 { font-size: 1.28rem; margin: 0 0 6px; }
.island-jurus { font-size: 0.86rem; color: var(--parchment); margin: 0 0 2px; }
.island-jurus b { color: var(--gold-2); }
.island-cyber { font-size: 0.8rem; color: var(--muted); margin: 0; }
.island-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.island-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.progress-wrap { margin-bottom: 30px; }
.progress-top { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.progress { height: 12px; background: rgba(244, 230, 200, 0.09); border-radius: 999px; overflow: hidden; border: 1px solid rgba(244, 230, 200, 0.12); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-2)); border-radius: 999px; transition: width 0.5s ease; box-shadow: 0 0 18px rgba(232, 178, 58, 0.5); }

/* ---------- Module page ---------- */

.module-page { padding-bottom: 80px; }

.module-head {
  position: relative;
  padding: 44px 0 34px;
  border-bottom: 1px solid rgba(232, 178, 58, 0.16);
  margin-bottom: 36px;
}
.module-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 8px 0 12px;
}
.module-head .island-sub { color: var(--gold-2); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.module-head .lead { color: var(--muted); max-width: 64ch; font-size: 1.02rem; }
.module-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.chapter { margin-bottom: 52px; scroll-margin-top: 90px; }
.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(244, 230, 200, 0.1);
  padding-bottom: 10px;
}
.chapter-head .num {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.7;
}
.chapter-head h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--parchment);
}
.chapter-head .hint { margin-left: auto; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }

/* comic */
.comic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.panel {
  background: var(--parchment);
  color: var(--parchment-ink);
  border: 3px solid #0a1722;
  border-radius: 6px;
  overflow: hidden;
  margin: 0;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}
.panel-art {
  height: 132px;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  background:
    radial-gradient(circle at 50% 45%, rgba(232, 178, 58, 0.4), transparent 65%),
    repeating-linear-gradient(45deg, #e8d5ab 0 8px, #f0e2c0 8px 16px);
  border-bottom: 2px solid #0a1722;
  filter: saturate(0.9);
}
.panel figcaption { padding: 14px 15px 16px; font-family: var(--font-story); font-size: 0.9rem; line-height: 1.5; flex: 1; }
.panel figcaption strong { display: block; font-family: var(--font-body); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8a5a10; margin-bottom: 5px; }
.panel figcaption p { margin: 0; }

/* jurus vs cyber */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 12px;
  align-items: stretch;
}
.vs-card {
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(232, 178, 58, 0.2);
  background: linear-gradient(180deg, rgba(16, 48, 73, 0.8), rgba(8, 26, 42, 0.9));
}
.vs-card.op { border-top: 3px solid var(--gold); }
.vs-card.cyber { border-top: 3px solid var(--crimson); }
.vs-card h3 { font-size: 1.25rem; margin: 10px 0 6px; }
.vs-card .kicker { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.vs-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0; }
.vs-card .technique { color: var(--gold-2); font-weight: 700; }
.vs-arrow { display: grid; place-items: center; color: var(--gold); font-size: 1.8rem; }

/* defenses */
.defense-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.defense {
  display: flex; gap: 14px;
  padding: 16px 18px;
  background: rgba(155, 110, 243, 0.07);
  border: 1px solid rgba(155, 110, 243, 0.25);
  border-radius: 12px;
}
.defense .haki-mark {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(155, 110, 243, 0.18);
  border: 1px solid rgba(155, 110, 243, 0.4);
  font-size: 0.9rem;
}
.defense h4 { font-size: 0.88rem; margin: 0 0 3px; color: #e2d6fb; }
.defense p { margin: 0; font-size: 0.82rem; color: var(--muted); }

/* checklist */
.objectives { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.objectives li {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px dashed rgba(244, 230, 200, 0.22);
  border-radius: 999px;
  padding: 6px 12px;
}
.objectives li::before { content: "◈ "; color: var(--gold); }

/* ---------- Lab ---------- */

.lab {
  border: 1px solid rgba(232, 178, 58, 0.28);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(4, 13, 21, 0.5);
  box-shadow: var(--shadow);
}
.lab-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, rgba(232, 178, 58, 0.12), rgba(232, 178, 58, 0.02));
  border-bottom: 1px solid rgba(232, 178, 58, 0.2);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gold-2);
}
.lab-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.lab-head .lab-status { margin-left: auto; color: var(--muted); letter-spacing: 0.08em; text-transform: none; font-weight: 600; }
.lab-body { padding: 22px 22px 26px; }
.lab-note { font-size: 0.78rem; color: var(--muted); margin: 0 0 18px; }
.lab-note b { color: var(--gold-2); }

.lab-grid { display: grid; gap: 18px; grid-template-columns: 1.05fr 0.95fr; }
.lab-col h4 { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.input, .select {
  width: 100%;
  background: rgba(244, 230, 200, 0.06);
  border: 1px solid rgba(244, 230, 200, 0.2);
  color: var(--parchment);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
}
.input:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 178, 58, 0.14); }
.input::placeholder { color: rgba(159, 179, 196, 0.6); }

.code, pre.code-block {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(2, 9, 15, 0.8);
  border: 1px solid rgba(244, 230, 200, 0.14);
  border-radius: 8px;
  padding: 2px 6px;
  color: #ffd88a;
  overflow-wrap: anywhere;
}
pre.code-block { padding: 14px; overflow-x: auto; line-height: 1.6; margin: 0 0 14px; }

.terminal {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: #020a08;
  color: #8df0b4;
  border: 1px solid rgba(79, 192, 141, 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 150px;
  max-height: 230px;
  overflow-y: auto;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal .dim { color: #4f7c66; }
.terminal .bad { color: #ff8f7a; }
.terminal .good { color: #7ef0a8; }
.terminal .warn { color: #ffd88a; }

.account-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(244, 230, 200, 0.05);
  border: 1px solid rgba(244, 230, 200, 0.14);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 14px;
}
.avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(232, 178, 58, 0.16); display: grid; place-items: center; font-size: 1.2rem; }
.account-card strong { display: block; font-size: 0.9rem; }
.account-card span { font-size: 0.74rem; color: var(--muted); }

.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.84rem; color: var(--muted); margin: 10px 0; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex: 0 0 auto; }
.check-row b { color: var(--parchment); }

.result-box {
  margin-top: 16px;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.88rem;
  border: 1px solid rgba(244, 230, 200, 0.18);
  background: rgba(244, 230, 200, 0.05);
}
.result-box.good { border-color: rgba(79, 192, 141, 0.5); background: rgba(79, 192, 141, 0.1); color: #c9f7e2; }
.result-box.bad { border-color: rgba(200, 70, 47, 0.5); background: rgba(200, 70, 47, 0.1); color: #ffc9be; }
.result-box strong { display: block; margin-bottom: 4px; }
.result-box p { margin: 0; font-size: 0.84rem; }

/* email lab */
.email-list { display: flex; flex-direction: column; gap: 10px; }
.email {
  border: 1px solid rgba(244, 230, 200, 0.14);
  border-radius: 10px;
  background: rgba(244, 230, 200, 0.04);
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.email.answered-good { border-color: rgba(79, 192, 141, 0.55); background: rgba(79, 192, 141, 0.07); }
.email.answered-bad { border-color: rgba(200, 70, 47, 0.55); background: rgba(200, 70, 47, 0.07); }
.email-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 6px; }
.email-from { font-size: 0.8rem; color: var(--gold-2); font-weight: 700; word-break: break-all; }
.email-time { font-size: 0.7rem; color: var(--muted); margin-left: auto; }
.email-subject { font-size: 0.9rem; font-weight: 700; margin: 0 0 5px; }
.email-body { font-size: 0.82rem; color: var(--muted); margin: 0 0 10px; }
.email-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.email-verdict { font-size: 0.8rem; margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed rgba(244, 230, 200, 0.16); }
.email-verdict b { color: var(--parchment); }

/* file grid */
.file-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.file {
  border: 1px solid rgba(244, 230, 200, 0.14);
  background: rgba(244, 230, 200, 0.05);
  border-radius: 9px;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--parchment-dim);
  transition: all 0.25s;
  word-break: break-all;
}
.file .ico { display: block; font-size: 1.3rem; margin-bottom: 5px; }
.file.encrypted { border-color: rgba(200, 70, 47, 0.6); background: rgba(200, 70, 47, 0.14); color: #ffb4a4; animation: shake 0.35s ease; }
.file.encrypted .ico { filter: grayscale(1); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* MITM */
.net {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin: 6px 0 16px;
}
.node {
  border: 1px solid rgba(244, 230, 200, 0.18);
  background: rgba(244, 230, 200, 0.05);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  position: relative;
}
.node .ico { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.node b { display: block; color: var(--parchment); font-size: 0.8rem; }
.node.attacker { border-color: rgba(200, 70, 47, 0.55); background: rgba(200, 70, 47, 0.1); }
.net-wire { height: 2px; background: rgba(244, 230, 200, 0.18); position: relative; }
.packet {
  position: absolute; top: -4px; left: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px var(--gold);
  opacity: 0;
}
.packet.run { animation: travel 1s linear forwards; opacity: 1; }
@keyframes travel { from { left: 0; } to { left: 100%; } }

/* ---------- Quiz ---------- */

.quiz-q {
  border: 1px solid rgba(244, 230, 200, 0.14);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: rgba(244, 230, 200, 0.03);
}
.quiz-q h3 { font-size: 0.98rem; margin: 0 0 12px; }
.quiz-q h3 .qnum { color: var(--gold); margin-right: 8px; font-family: var(--font-display); }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--parchment-dim);
}
.opt:hover { background: rgba(244, 230, 200, 0.05); }
.opt input { margin-top: 3px; accent-color: var(--gold); }
.opt.correct { border-color: rgba(79, 192, 141, 0.5); background: rgba(79, 192, 141, 0.1); color: #d6fbe9; }
.opt.wrong { border-color: rgba(200, 70, 47, 0.5); background: rgba(200, 70, 47, 0.1); color: #ffd0c6; }
.explain {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  padding-left: 10px;
}

/* ---------- Poneglyph ---------- */

.poneglyph {
  background:
    linear-gradient(180deg, rgba(42, 48, 56, 0.9), rgba(22, 27, 33, 0.95));
  border: 1px solid rgba(244, 230, 200, 0.18);
  border-radius: var(--radius);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
}
.poneglyph::before {
  content: "ᛒ ᛟ ᚾ ᛖ ᚷ ᛚ ᛁ ᚦ";
  position: absolute;
  right: 12px; top: 6px;
  font-size: 3.4rem;
  letter-spacing: 0.1em;
  color: rgba(244, 230, 200, 0.05);
  pointer-events: none;
}
.poneglyph ul { margin: 0; padding-left: 20px; }
.poneglyph li { margin-bottom: 8px; font-size: 0.9rem; color: var(--parchment-dim); }
.poneglyph li::marker { color: var(--gold); }

.ethics-note {
  border-left: 3px solid var(--crimson);
  background: rgba(200, 70, 47, 0.07);
  padding: 15px 18px;
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: var(--parchment-dim);
}
.ethics-note b { color: #ffc9be; }

/* ---------- Module nav ---------- */

.module-nav {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  border-top: 1px solid rgba(244, 230, 200, 0.12);
  padding-top: 26px;
  margin-top: 10px;
}

/* ---------- Wanted poster / certificate ---------- */

.wanted {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25), transparent 60%),
    linear-gradient(180deg, #f6e9cc, #e3cfa3);
  color: #2a2318;
  border: 10px solid #2a2318;
  outline: 3px solid #b98d3a;
  outline-offset: -18px;
  border-radius: 4px;
  padding: 34px 30px 28px;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
  transform: rotate(-1deg);
}
.wanted::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(90, 70, 40, 0.06) 0 2px, transparent 2px 5px);
  pointer-events: none;
}
.wanted h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: 0.14em;
  margin: 0;
  color: #241c10;
}
.wanted .poster-sub { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: #6b5426; margin: 4px 0 18px; }
.poster-portrait {
  width: 128px; height: 148px;
  margin: 0 auto 18px;
  border: 3px solid #2a2318;
  background: linear-gradient(160deg, #cdb488, #a88f60);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 3.4rem;
  color: #2a2318;
  overflow: hidden;
}
.poster-name { font-family: var(--font-story); font-size: 1.5rem; font-weight: 700; margin: 0 0 2px; }
.poster-class { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: #6b5426; margin: 0 0 14px; }
.poster-bounty { font-family: var(--font-display); font-size: 1.9rem; color: #7a1f12; margin: 0 0 4px; letter-spacing: 0.04em; }
.poster-bounty-label { font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: #6b5426; }
.poster-rank { display: inline-block; margin-top: 12px; border: 1px solid #2a2318; padding: 4px 12px; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.badge-item {
  text-align: center;
  border: 1px solid rgba(244, 230, 200, 0.12);
  border-radius: 12px;
  padding: 18px 10px 14px;
  background: rgba(244, 230, 200, 0.03);
}
.badge-medal {
  width: 66px; height: 66px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.7rem;
  background: radial-gradient(circle at 35% 30%, rgba(232, 178, 58, 0.4), rgba(8, 26, 42, 0.9));
  border: 2px solid rgba(232, 178, 58, 0.55);
  box-shadow: 0 0 18px rgba(232, 178, 58, 0.2), inset 0 0 0 4px rgba(6, 16, 25, 0.6);
}
.badge-item.locked .badge-medal { filter: grayscale(1); opacity: 0.4; border-color: rgba(159, 179, 196, 0.3); box-shadow: none; }
.badge-item.locked { opacity: 0.6; }
.badge-item strong { display: block; font-size: 0.82rem; }
.badge-item span { font-size: 0.7rem; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat {
  border: 1px solid rgba(244, 230, 200, 0.12);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(244, 230, 200, 0.03);
}
.stat strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-2); line-height: 1.1; }
.stat span { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; border: 1px solid rgba(244, 230, 200, 0.12); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
thead th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  background: rgba(244, 230, 200, 0.04);
  border-bottom: 1px solid rgba(244, 230, 200, 0.12);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(244, 230, 200, 0.06); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(244, 230, 200, 0.03); }
.cell-yes { color: var(--green); font-weight: 700; }
.cell-no { color: var(--muted); }

/* ---------- Misc ---------- */

.notice {
  border: 1px solid rgba(63, 167, 201, 0.3);
  background: rgba(63, 167, 201, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.86rem;
  color: #c8e9f4;
}
.notice b { color: #e5f7fd; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.toolbar .spacer { flex: 1; }

.footer-cta {
  border: 1px solid rgba(232, 178, 58, 0.28);
  background:
    radial-gradient(500px 200px at 80% 20%, rgba(232, 178, 58, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(16, 48, 73, 0.8), rgba(8, 26, 42, 0.9));
  border-radius: var(--radius);
  padding: 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
}
.footer-cta h2 { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(1.5rem, 3.4vw, 2.4rem); margin: 0 0 6px; }
.footer-cta p { color: var(--muted); margin: 0; max-width: 50ch; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 34px;
  margin-top: 80px;
  font-size: 0.84rem;
  color: var(--muted);
  background: rgba(4, 12, 19, 0.6);
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.site-footer h3 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.site-footer a { color: var(--muted); display: block; margin-bottom: 6px; font-size: 0.83rem; }
.site-footer a:hover { color: var(--gold-2); }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.05em; color: var(--parchment); margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(244, 230, 200, 0.08); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 0.76rem; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 9, 14, 0.75);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%; max-width: 430px;
  background: linear-gradient(180deg, #12324a, #081a2a);
  border: 1px solid rgba(232, 178, 58, 0.35);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.modal h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.5rem; margin-bottom: 6px; }
.modal p { font-size: 0.84rem; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  background: #0e2b40;
  border: 1px solid rgba(232, 178, 58, 0.45);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 0.84rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--crimson); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 26px; }
.mt-3 { margin-top: 26px; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .compass { opacity: 0.25; }
  .lab-grid { grid-template-columns: 1fr; }
  .island-card { grid-template-columns: 60px 1fr; }
  .island-side { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #071620;
    border-bottom: 1px solid var(--line);
    padding: 12px 18px 18px;
    box-shadow: 0 20px 30px rgba(0,0,0,0.4);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; }
  .nav-toggle { display: block; }
  .student-chip { max-width: 110px; }
  .brand-text small { display: none; }
  .hero { min-height: auto; padding: 48px 0 110px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .comic { grid-template-columns: 1fr; }
  .panel-art { height: 110px; }
  .vs-grid { grid-template-columns: 1fr; }
  .vs-arrow { transform: rotate(90deg); height: 30px; }
  .defense-list { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: repeat(3, 1fr); }
  .net { grid-template-columns: 1fr; }
  .net-wire { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-cta { padding: 28px; }
  .header-actions { gap: 6px; }
  .bounty-chip { padding: 6px 10px; font-size: 0.78rem; }
  .chapter { margin-bottom: 40px; }
  .module-head { padding-top: 28px; }
  .wanted { padding: 26px 18px; }
}

@media (max-width: 420px) {
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stat strong { font-size: 1.5rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 0.9rem; }
  .bounty-chip .bz { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .hero-cta, .module-nav, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
