:root {
  --black: #000000;

  /* ═══════════════════════════════════════════════════════════════
     THEME: THE ARCHIVE MAPPING
     ═══════════════════════════════════════════════════════════════ */
  --theme-logo:        var(--white);
  --theme-logo-shadow: var(--teal-mid);
  --theme-nav:         var(--white);
  --theme-nav-deco:    var(--teal-mid);
  --theme-text:        var(--white);
  --theme-head:        var(--cyan);
  --theme-border:      var(--teal-mid);
  --theme-accent:      var(--magenta);
  --theme-btn:         var(--cyan);
  --theme-motd-bg:     rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STRUCTURAL CSS
   ═══════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--black);
  background-image: radial-gradient(circle at center, var(--teal-deep) 0%, #000 100%);
  color: var(--theme-text);
  font-family: var(--font-mono);
  line-height: 1.6;
  -webkit-font-smoothing: none;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.central-stack {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */
.flash-block {
  width: 100%;
  margin-bottom: 15px;
}

.flash-error {
  border-left: 2px solid var(--red);
  padding: 6px 10px;
  color: var(--red);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.flash-success,
.flash-info {
  border-left: 2px solid var(--theme-btn);
  padding: 6px 10px;
  color: var(--theme-btn);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   MASTHEAD UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.logo-img {
  margin-bottom: 20px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- AUTH BAR (TOP RIGHT OF STACK) --- */
.auth-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 20px;
  align-items: center;
}

.auth-bar a {
  color: var(--gray);
  text-decoration: none;
  transition: all 0.2s;
}

.auth-bar a:hover { color: var(--theme-btn); }
.auth-bar a::before { content: '['; color: var(--theme-border); margin-right: 5px; }
.auth-bar a::after  { content: ']'; color: var(--theme-border); margin-left: 5px; }

/* Logout form button styled as auth-bar link */
.auth-bar-form { display: inline; }

.auth-bar-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  padding: 0;
  transition: all 0.2s;
}

.auth-bar-btn:hover { color: var(--theme-btn); }
.auth-bar-btn::before { content: '['; color: var(--theme-border); margin-right: 5px; }
.auth-bar-btn::after  { content: ']'; color: var(--theme-border); margin-left: 5px; }

/* --- LOGO ASCII --- */
pre.logo-ascii {
  line-height: 1.1;
  font-weight: 400;
  margin-bottom: 20px;
  text-align: center;
  color: var(--theme-logo);
  text-shadow: 2px 2px var(--theme-logo-shadow);
}

/* --- SUBTITLE --- */
h2.subtitle {
  color: var(--theme-head);
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-align: center;
}

/* --- NAVIGATION --- */
.main-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  font-size: var(--text-base);
  font-weight: 700;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  color: var(--theme-nav);
  text-decoration: none;
  transition: all 0.2s;
}

.main-nav a:hover { color: var(--theme-accent); }
.main-nav a::before { content: '[ '; color: var(--theme-nav-deco); }
.main-nav a::after  { content: ' ]'; color: var(--theme-nav-deco); }

/* --- PUN TICKER (index only) --- */
.pun-ticker {
  width: 100%;
  border-top: 1px dashed var(--theme-border);
  border-bottom: 1px dashed var(--theme-border);
  padding: 8px 20px;
  margin-bottom: 30px;
  font-size: var(--text-sm);
  color: var(--gray);
  text-align: center;
  letter-spacing: 1px;
}

/* --- SYSTEM OVERVIEW --- */
.sys-overview {
  width: 100%;
  text-align: left;
  margin-bottom: 30px;
  padding: 0 20px;
}

.sys-overview .title {
  color: var(--theme-border);
  font-size: var(--text-base);
  margin-bottom: 10px;
  font-weight: 700;
}

.sys-overview p { font-size: var(--text-base); }

/* --- MOTD BOX --- */
.motd-box {
  width: 100%;
  border: 1px solid var(--theme-border);
  padding: 20px;
  background: var(--theme-motd-bg);
  margin-bottom: 40px;
  position: relative;
}

.motd-box::before {
  content: '[ NY THYMES ]';
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--black);
  color: var(--theme-accent);
  padding: 0 10px;
  font-weight: 700;
  font-size: var(--text-xs);
  border: 1px solid var(--theme-border);
}

.motd-content { font-size: var(--text-sm); text-align: left; }

.motd-date {
  display: block;
  color: var(--theme-head);
  font-size: var(--text-xs);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.motd-date + .motd-date {
  border-bottom: 1px dashed var(--theme-border);
  padding-bottom: 5px;
}

/* --- DATA BLOCKS --- */
.info-blocks {
  display: flex;
  width: 100%;
  gap: 20px;
  margin-bottom: 40px;
}

.info-block {
  flex: 1;
  border: 1px solid var(--theme-border);
  padding: 15px;
  background: rgba(0,0,0,0.5);
}

.info-head {
  color: var(--white);
  font-weight: 700;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--theme-border);
  padding-bottom: 5px;
  font-size: var(--text-base);
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.info-row .label { color: var(--cyan-dim); }
.info-row .value { color: var(--theme-accent); font-weight: 700; }

/* --- CTA BUTTON --- */
.btn-init {
  display: inline-block;
  color: var(--theme-btn);
  border: 2px solid var(--theme-btn);
  padding: 12px 40px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  font-size: var(--text-lg);
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.btn-init:hover {
  background: var(--theme-btn);
  color: var(--black);
  box-shadow: 0 0 15px var(--theme-btn);
}

.cta-group {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-block;
  color: var(--gray);
  border: 2px solid var(--gray);
  padding: 12px 40px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  font-size: var(--text-lg);
  background: transparent;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.btn-secondary:hover {
  color: var(--white);
  border-color: var(--white);
  box-shadow: 0 0 10px var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES (how-to-play, leaderboard, knocked-out)
   ═══════════════════════════════════════════════════════════════ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th {
  color: var(--theme-head);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--theme-border);
  text-transform: uppercase;
}

td {
  padding: 8px 0;
  border-bottom: 1px solid rgba(6, 92, 92, 0.3);
  font-size: var(--text-sm);
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   TERMINAL FORMS
   ═══════════════════════════════════════════════════════════════ */
.input-group {
  display: flex;
  align-items: center;
}

.prompt {
  color: var(--theme-accent);
  font-weight: 700;
  font-size: var(--text-base);
  margin-right: 10px;
}

.input-group .prompt::after {
  content: ' [';
  color: var(--theme-border);
}

.input-group::after {
  content: ']';
  color: var(--theme-border);
  font-weight: 700;
  margin-left: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--theme-border);
  color: var(--theme-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
  flex-grow: 1;
  padding: 4px 8px;
  transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-bottom: 1px solid var(--theme-accent);
  background: rgba(255, 255, 255, 0.05);
}

/* Custom BBS Checkbox */
.terminal-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--theme-border);
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-grow: 0;
  padding: 0;
  margin: 0;
  outline: none;
}

.terminal-checkbox:checked::after {
  content: 'X';
  color: var(--theme-accent);
  position: absolute;
  top: -4px;
  left: 2px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}

/* Utility Link Styling */
.utility-link {
  color: var(--theme-border);
  text-decoration: none;
  transition: color 0.2s;
}

.utility-link:hover { color: var(--theme-accent); }

.turnstile-mount {
  border: 1px dashed var(--theme-border);
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  text-align: center;
  color: var(--theme-border);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD & LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.stack-vertical { flex-direction: column; gap: 15px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.flex-center-gap { display: flex; justify-content: center; gap: 15px; }

.pfp-container { flex: 0.3; display: flex; align-items: center; justify-content: center; }
.id-container { flex: 1; }

@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

.alert-text {
  color: var(--theme-accent);
  font-weight: 900;
  animation: pulse 2s infinite;
}

.action-links-container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 10px;
  padding-right: 5px;
}

.action-link {
  color: var(--gray);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.2s;
}

.action-link:hover { color: var(--theme-nav-deco); }

/* ═══════════════════════════════════════════════════════════════
   MODIFIER CLASSES
   ═══════════════════════════════════════════════════════════════ */
.btn-init.btn-sm {
  padding: 6px 20px;
  font-size: var(--text-sm);
  border-width: 1px;
}

.btn-init.btn-accent { color: var(--theme-accent); border-color: var(--theme-accent); }
.btn-init.btn-muted  { color: var(--gray); border-color: var(--gray); }
.btn-init.btn-filled { background: var(--theme-accent); color: var(--black); border-color: var(--theme-accent); }

.btn-init.btn-danger {
  background-color: var(--red);
  color: var(--black);
  border-color: var(--red);
}

.btn-init.btn-danger:hover {
  background-color: transparent;
  color: var(--red);
  box-shadow: 0 0 15px var(--red);
}

.sys-overview.compact { margin-bottom: 10px; }
.sys-overview.spaced  { margin-bottom: 10px; margin-top: 20px; }

.logo-ascii.pfp {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--theme-nav-deco);
}

.info-block.auth-card { max-width: 500px; margin-top: 40px; flex: none; }

.info-head.borderless { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.info-head.heading { color: var(--theme-head); }

.card-divider {
  border-top: 1px dashed var(--theme-border);
  padding-top: 10px;
  margin-top: 5px;
}

.info-block.empty-state {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--theme-border);
}

.block-status { color: var(--gray); margin-bottom: 15px; }
.block-desc { margin-bottom: 25px; font-size: var(--text-sm); }

.field-hint { font-size: var(--text-xs); color: var(--gray); text-align: left; margin-top: 0px; margin-bottom: 5px; }

/* ═══════════════════════════════════════════════════════════════
   MULTI-STEP FORMS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-step { display: none; animation: fadeIn 0.3s ease-in-out; }
.form-step.active { display: flex; flex-direction: column; gap: 15px; }

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: var(--text-xs);
  color: var(--gray);
  border-bottom: 1px dashed var(--theme-border);
  padding-bottom: 10px;
}

.step-indicator span.active { color: var(--theme-accent); font-weight: 700; }

.form-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.form-nav     { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.form-status  { font-size: var(--text-sm); margin-bottom: 10px; }

.form-footer   { color: var(--gray); font-size: var(--text-xs); margin-top: 30px; text-align: center; }
.form-footer a { color: var(--theme-accent); text-decoration: none; }

.ascii-preview-box {
  border: 1px dashed var(--theme-border);
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
  margin: 10px 0;
}

.ascii-preview-box pre {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.1;
  text-align: left;
  white-space: pre;
}

/* ═══════════════════════════════════════════════════════════════
   FORM LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.input-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.text-center  { text-align: center; }
.text-red     { color: var(--red); }
.text-cyan    { color: var(--cyan); }
.text-green   { color: var(--green-mint); }
.text-dim     { color: var(--gray); }
.text-accent  { color: var(--theme-accent); }
.border-red   { border-color: var(--red); }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mb-10 { margin-bottom: 10px; }
.gap-20 { gap: 20px; }
.align-center { align-items: center; }

/* Paragraph spacing within card sections */
p.mb-10 { margin-bottom: 10px; }

/* Join code display */
.join-code-display {
  font-size: 2rem;
  letter-spacing: 0.3em;
  padding: 12px 20px;
  border: 1px solid var(--theme-btn);
  color: var(--theme-btn);
  display: inline-block;
  text-align: center;
  margin: 15px 0;
}

/* Class selection radio rows */
.class-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid rgba(6, 92, 92, 0.4);
}

.class-option:last-of-type { border-bottom: none; }

.class-option input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--theme-accent);
}

.class-label { margin-bottom: 4px; font-weight: 700; color: var(--green-mint); }
.class-perks  { font-size: var(--text-sm); color: var(--gray); line-height: 1.8; }
.class-perks .plus { color: var(--green-mint); }
.class-tagline { color: var(--cyan-dim); font-size: var(--text-sm); font-weight: 400; margin-left: 8px; }

.synopsis-line { font-size: var(--text-sm); color: var(--green-mint); margin-bottom: 2px; }

/* ═══════════════════════════════════════════════════════════════
   CAPTCHA BOX
   ═══════════════════════════════════════════════════════════════ */
.captcha-box {
  border: 1px dashed var(--theme-border);
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--theme-border);
}


/* ═══════════════════════════════════════════════════════════════
   JUST DESSERTS — Recipe Cards
   ═══════════════════════════════════════════════════════════════ */

.recipe-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .recipe-card-grid { grid-template-columns: 1fr; }
}

.recipe-card {
  border: 1px solid var(--theme-border);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.recipe-card--unlocked {
  border-color: var(--theme-border);
}

.recipe-card--unlocked:hover {
  border-color: var(--theme-btn);
}

.recipe-card--locked {
  opacity: 0.5;
  cursor: default;
  position: relative;
}

.recipe-card-silhouette {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  min-height: 28px;
}

.recipe-card-lock {
  font-size: var(--text-xs);
  letter-spacing: 1px;
  margin-top: 4px;
}

.recipe-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-card-attr {
  font-size: var(--text-xs);
}

.recipe-card-cta {
  font-size: var(--text-xs);
  margin-top: 4px;
}

/* Preview card on landing page — slightly cropped at bottom */
.recipe-card--preview {
  max-height: 80px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* ── Recipe Page ──────────────────────────────────────────────── */

.recipe-header { padding: 12px 0 8px; }

.recipe-attribution {
  font-size: var(--text-sm);
  margin-top: 2px;
}

.recipe-story {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.recipe-body { padding: 10px 0; }

.recipe-columns {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 600px) {
  .recipe-columns { grid-template-columns: 1fr; }
}

.recipe-col-head {
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-size: var(--text-sm);
}

.recipe-rule {
  color: var(--theme-border);
  margin-bottom: 8px;
  font-size: var(--text-xs);
  letter-spacing: 0;
}

.recipe-ingredient {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: 2px;
}

.recipe-qty { font-size: var(--text-xs); padding-top: 2px; }

.recipe-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: 6px;
}

.recipe-step-num { font-size: var(--text-xs); padding-top: 2px; }

.recipe-yield, .recipe-notes {
  font-size: var(--text-xs);
  line-height: 1.5;
}

.recipe-unlock-line {
  font-size: var(--text-xs);
  line-height: 1.8;
}

.breadcrumb-link {
  color: var(--theme-nav);
  text-decoration: none;
  font-size: var(--text-sm);
}

.breadcrumb-link:hover { color: var(--theme-btn); }

/* ── Just Desserts teaser on landing page ─────────────────────── */

.just-desserts-teaser { max-width: 100%; }

/* ── Recipe reveal message ────────────────────────────────────── */

.recipe-reveal {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--theme-btn);
  font-style: italic;
}

/* ── Dashboard toggle ─────────────────────────────────────────── */

.just-desserts-toggle:hover .jd-chevron { color: var(--theme-btn); }

/* ── Print button reset (action-link on a <button>) ──────────── */

button.action-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
}


/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD PODIUM
   ═══════════════════════════════════════════════════════════════ */
.lb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lb-card .card-divider { width: 100%; }

.lb-card--first {
  border-color: var(--theme-accent);
}

.lb-legend {
  font-size: var(--text-xs);
  color: var(--gray);
  margin-top: 12px;
}

@media (max-width: 560px) {
  .info-blocks.lb-podium { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════
   JUST DESSERTS — Print Stylesheet
   Print output breaks from the terminal aesthetic intentionally.
   A recipe card used in a kitchen should read like one.
   ═══════════════════════════════════════════════════════════════ */

@media print {

  /* Hide everything except the recipe content block */
  body > *:not(.central-stack),
  .auth-bar,
  .main-nav,
  .sys-overview,
  .action-links-container,
  .recipe-unlock-line {
    display: none !important;
  }

  .central-stack {
    max-width: 100%;
    padding: 0;
    background: white;
    color: black;
    font-family: Georgia, "Times New Roman", serif;
    -webkit-font-smoothing: auto;
  }

  body {
    background: white !important;
    color: black !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11pt;
    padding: 0;
  }

  .info-block {
    border: none !important;
    background: none !important;
    padding: 0 !important;
  }

  .recipe-page {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  /* Single-column layout for print */
  .recipe-columns {
    grid-template-columns: 1fr;
    gap: 16pt;
  }

  .recipe-reveal { display: none; }

  .recipe-header .info-head,
  .recipe-col-head {
    font-size: 13pt;
    font-family: Georgia, "Times New Roman", serif;
    color: black;
    border: none;
  }

  .recipe-header .info-head { font-size: 18pt; }

  .recipe-attribution {
    font-size: 10pt;
    color: #444;
  }

  .recipe-story p,
  .recipe-ingredient,
  .recipe-step {
    font-size: 10pt;
    color: black;
  }

  .recipe-col-head {
    font-size: 11pt;
    font-family: Georgia, "Times New Roman", serif;
    color: black;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4pt;
    margin-bottom: 8pt;
  }

  .recipe-rule { display: none; }

  .recipe-yield, .recipe-notes {
    font-size: 9pt;
    color: #555;
  }

  /* Footer on printed page */
  .recipe-page::after {
    content: "Unlocked in Mess Hall";
    display: block;
    margin-top: 24pt;
    font-size: 8pt;
    color: #aaa;
    font-style: italic;
    border-top: 1px solid #eee;
    padding-top: 6pt;
  }
}
