@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #232a3a;
  --ink-soft: #444d63;
  --muted: #6a7185;
  --paper: #f7f5ef;
  --panel: #fdfcf9;
  --rule: #ddd9cd;
  --navy: #1a2338;
  --navy-2: #262f47;
  --navy-3: #3a4460;
  --gold: #d1a94e;
  --gold-deep: #a9782f;
  --gold-ink: #241d0c;
  --danger: #b23a2e;
  --danger-bg: #fbe9e6;
  --success: #3f8f5f;
  --success-bg: #e6f4ea;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--gold-deep); font-weight: 600; }
a.link:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: 'Source Serif 4', Georgia, serif; margin: 0; font-weight: 700; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* Utility bar + header */
.utility-bar { background: var(--ink); color: #cfd2da; font-size: 12px; }
.utility-bar .container { display: flex; justify-content: space-between; align-items: center; padding: 8px 28px; }
.utility-bar a { font-weight: 600; }
.utility-bar a.gold { color: var(--gold); }

.site-header { background: var(--navy); border-bottom: 1px solid var(--navy-3); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fafaf6; }
.brand .wordmark { font-family: 'Source Serif 4', Georgia, serif; font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.brand .tagline { font-size: 10px; color: var(--gold); letter-spacing: 0.14em; margin-top: 2px; }
.brand svg { flex: none; }
nav.main-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; color: #d8dae2; }
nav.main-nav a.current { color: var(--gold); }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border-radius: 4px; font-weight: 700; font-size: 14px; padding: 11px 20px; border: none; cursor: pointer; font-family: inherit; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; border: 1.5px solid var(--gold-deep); color: var(--gold-deep); }
.btn-danger-outline { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.user-chip { display: flex; align-items: center; gap: 9px; background: var(--navy-2); padding: 6px 14px 6px 6px; border-radius: 20px; border: 1px solid var(--navy-3); color: #eceef3; font-size: 13.5px; font-weight: 600; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Rank badges */
.badge { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 9px; letter-spacing: 0.02em; }
.badge-MM { color: var(--success); background: var(--success-bg); }
.badge-FC { color: #2f5fa0; background: #e7eefa; }
.badge-EA { color: #93641f; background: #f7ecd8; }

/* Footer */
.site-footer { margin-top: 48px; background: var(--navy); color: #a9adbb; }
.site-footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 38px 28px 26px; max-width: 1200px; margin: 0 auto; }
.site-footer h4 { font-size: 11px; letter-spacing: 0.1em; color: #dfe0e6; margin-bottom: 12px; font-family: 'Public Sans', sans-serif; }
.site-footer .links { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; }
.site-footer .bottom { border-top: 1px solid var(--navy-3); font-size: 12px; padding: 16px 28px; display: flex; justify-content: space-between; max-width: 1200px; margin: 0 auto; color: #7c8194; }

/* Ad banners */
.ad-label { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 6px; }
.ad-leaderboard { border: 1px solid var(--rule); border-top: 3px solid var(--gold); background: var(--panel); display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-radius: 2px; max-width: 728px; }
.ad-leaderboard .name { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; font-weight: 700; }
.ad-leaderboard .tag { font-size: 13px; color: var(--ink-soft); }
.ad-mpu { width: 100%; max-width: 300px; border: 1px solid var(--rule); border-top: 3px solid var(--gold); background: var(--panel); border-radius: 2px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; }
.ad-mpu .name { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; font-weight: 700; }
.ad-mpu .tag { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.ad-mpu.inactive { opacity: 0.7; background: #efece2; }

/* Cards, panels */
.panel { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.notice { border: 1px solid var(--rule); border-left: 3px solid var(--gold-deep); background: var(--panel); border-radius: 2px; padding: 14px 18px; font-size: 12.5px; color: var(--ink-soft); }
.notice strong { color: var(--ink); }
.alert-error { border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); border-radius: 4px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; }
.alert-success { border: 1px solid var(--success); background: var(--success-bg); color: var(--success); border-radius: 4px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; }
.alert-info { border: 1px solid var(--gold-deep); background: #fbf3e1; color: var(--gold-ink); border-radius: 4px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 11.5px; color: var(--danger); margin-top: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--rule); border-radius: 4px; font-size: 14px;
  background: white; font-family: inherit; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.rank-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rank-option { border: 1.5px solid var(--rule); border-radius: 5px; padding: 12px 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.rank-option input { position: absolute; opacity: 0; pointer-events: none; }
.rank-option.checked, .rank-option:has(input:checked) { border-color: var(--gold-deep); background: #fbf3e1; color: var(--gold-ink); }
.otp-boxes { display: flex; gap: 8px; justify-content: center; }
.otp-boxes input { width: 44px; height: 54px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 600; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12px; color: var(--ink-soft); list-style: none; padding: 0; margin: 10px 0 0; }
.checklist li { display: flex; align-items: center; gap: 6px; }
.checklist li.ok { color: var(--success); }

/* Forum */
.forum-notice-icon { flex: none; }
.category-row, .topic-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.category-row:last-child, .topic-row:last-child { border-bottom: none; }
.cat-icon { width: 40px; height: 40px; border-radius: 6px; background: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.post { border-bottom: 1px solid var(--rule); padding: 20px 0; }
.post:last-child { border-bottom: none; }
.post-body { white-space: pre-wrap; margin-top: 10px; font-size: 14.5px; }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 222px; flex: none; background: var(--navy); padding: 22px 12px; color: #c3c7d4; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 5px; font-size: 13.5px; margin-bottom: 2px; }
.admin-sidebar a.current { background: var(--navy-2); color: var(--gold); font-weight: 600; }
.admin-main { flex: 1; padding: 30px 36px 60px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th { text-align: left; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); background: #f1efe6; }
table.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.admin-table tr.flagged { background: var(--danger-bg); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); padding: 18px 20px; }
.stat-card .value { font-family: 'Source Serif 4', Georgia, serif; font-size: 30px; font-weight: 700; }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* News */
.thumb { display: block; width: 100%; aspect-ratio: 16/10; border-radius: 4px; overflow: hidden; }

/* "No photo" placeholder - shown in place of an article's image whenever none
   was uploaded, so the slot always reads as a card rather than empty space. */
.photo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; width: 100%; height: 100%; border-radius: 4px; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--gold-deep) 160%);
}
.photo-placeholder svg { flex: none; opacity: 0.9; }
.photo-placeholder .word { color: #fafaf6; font-weight: 700; letter-spacing: 0.08em; font-size: 13px; white-space: nowrap; }
.photo-placeholder.lg .word { font-size: 17px; }
.photo-placeholder.sm svg { width: 20px; height: 20px; }
.photo-placeholder.sm .word { display: none; }

@media (max-width: 860px) {
  nav.main-nav { display: none; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
