/* ==========================================================================
   gmnavi BBS — Production Design System CSS
   Mobile-first, kid-friendly, high-speed, zero-dependency
   ========================================================================== */

:root {
  --bg-canvas: #f3f6fb;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f8;
  --bg-muted: #e5ebf4;

  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #5b677a;
  --ink-inverse: #ffffff;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);

  --status-open: #059669;
  --status-open-bg: #ecfdf5;
  --status-open-border: #a7f3d0;
  --status-solved: #2563eb;
  --status-solved-bg: #eff6ff;
  --status-solved-border: #bfdbfe;
  --status-closed: #64748b;
  --status-closed-bg: #f1f5f9;
  --status-hot: #e11d48;
  --status-hot-bg: #fff1f2;
  --status-warn: #d97706;
  --status-warn-bg: #fffbeb;
  --status-warn-border: #fde68a;
  --status-danger: #dc2626;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;

  /* Dynamic Game Theme (overridden per-game via inline CSS vars) */
  --game-primary: #1d4ed8;
  --game-primary-hover: #1e40af;
  --game-primary-soft: #eff6ff;
  --game-primary-ring: rgba(29, 78, 216, 0.22);
  --game-accent: #f59e0b;
  --game-accent-ink: #451a03;
  --game-accent-soft: #fef3c7;
  --game-header-start: #0f2557;
  --game-header-end: #1e40af;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --font-sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "BIZ UDPGothic", Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container-max: 1180px;
  --header-h: 62px;
  --bottom-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-primary);
  background: var(--bg-canvas);
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; touch-action: manipulation; }
a { color: var(--game-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ruby rt { font-size: 0.56em; font-weight: 500; opacity: 0.82; }
:focus-visible { outline: 3px solid var(--game-accent); outline-offset: 2px; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   Site Header & Global Game Switcher
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--game-header-start) 0%, var(--game-header-end) 100%);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.16);
}

.header-inner {
  max-width: var(--container-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}
.brand-link:hover { text-decoration: none; opacity: 0.94; }

.brand-emblem {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--game-accent);
  color: var(--game-accent-ink);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.78); }
.brand-title { font-size: 16px; font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search { flex: 1; max-width: 360px; position: relative; display: none; }
.header-search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.14); color: #ffffff; font-size: 14px;
}
.header-search input::placeholder { color: rgba(255, 255, 255, 0.74); }
.header-search input:focus { background: rgba(255, 255, 255, 0.22); border-color: var(--game-accent); outline: none; }
.header-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, 0.8); pointer-events: none; }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-btn {
  height: 38px; padding: 0 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.1);
  color: #ffffff; font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s ease;
}
.header-btn:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.header-btn-cta { background: var(--game-accent); color: var(--game-accent-ink); border-color: transparent; padding: 0 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.header-btn-cta:hover { background: #fbbf24; }
.header-desktop-only { display: none; }

/* Game Switcher Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); z-index: 80; }
.game-drawer {
  position: fixed; top: calc(var(--header-h) + 8px); right: 16px; width: min(340px, calc(100% - 32px));
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 16px; z-index: 90;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { font-size: 15px; font-weight: 800; color: var(--ink-primary); }
.drawer-close { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-subtle); cursor: pointer; display: grid; place-items: center; font-weight: 800; }
.drawer-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--ink-primary); text-decoration: none; font-weight: 700; }
.drawer-item:hover { background: var(--bg-subtle); text-decoration: none; }
.drawer-item.is-current { background: var(--game-primary-soft); color: var(--game-primary); }
.drawer-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #ffffff; font-weight: 900; font-size: 14px; flex-shrink: 0; }
.drawer-meta { display: block; font-size: 12px; font-weight: 500; color: var(--ink-muted); }

/* ==========================================================================
   Layout
   ========================================================================== */
.main-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 18px 14px calc(var(--bottom-nav-h) + 28px);
}
.main-wrap-narrow { max-width: 760px; }
.layout-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.main-col { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ==========================================================================
   Common UI Components
   ========================================================================== */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-primary); }
.icon-pill { width: 28px; height: 28px; border-radius: 8px; background: var(--game-primary-soft); color: var(--game-primary); display: grid; place-items: center; flex-shrink: 0; }
.section-more { font-size: 13px; font-weight: 700; color: var(--game-primary); white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: 15px; font-weight: 800; cursor: pointer; text-decoration: none;
  background: var(--game-primary); color: #ffffff; box-shadow: 0 3px 10px var(--game-primary-ring);
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { background: var(--game-primary-hover); text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn-accent, .btn-gold { background: var(--game-accent); color: var(--game-accent-ink); box-shadow: 0 3px 10px rgba(245, 158, 11, 0.25); }
.btn-accent:hover, .btn-gold:hover { background: #fbbf24; }
.btn-secondary, .btn-ghost { background: var(--bg-surface); color: var(--ink-primary); border-color: var(--border-strong); box-shadow: none; }
.btn-secondary:hover, .btn-ghost:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--status-danger); color: #ffffff; box-shadow: none; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap; }
.badge-open, .badge-count { background: var(--status-open-bg); color: var(--status-open); border: 1px solid var(--status-open-border); }
.badge-open::before, .badge-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--status-open); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2); }
.badge-solved { background: var(--status-solved-bg); color: var(--status-solved); border: 1px solid var(--status-solved-border); }
.badge-hot { background: var(--status-hot-bg); color: var(--status-hot); border: 1px solid #fecdd3; }
.badge-closed { background: var(--status-closed-bg); color: var(--status-closed); border: 1px solid var(--border-subtle); }
.badge-cat { background: var(--bg-subtle); color: var(--ink-secondary); font-weight: 700; }
.badge-platform { background: #f8fafc; color: var(--ink-secondary); border: 1px solid var(--border-subtle); font-weight: 700; }
.badge-new { background: #ef4444; color: #ffffff; font-size: 11px; height: 20px; padding: 0 7px; }

/* Flash & Banner */
.banner, .flash {
  padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 14px; font-size: 14px; font-weight: 700;
  background: var(--game-primary-soft); border: 1px solid rgba(29, 78, 216, 0.2); color: var(--game-primary);
}
.flash-ng { background: var(--status-danger-bg); border-color: var(--status-danger-border); color: var(--status-danger); }
.flash-ok { background: var(--status-open-bg); border-color: var(--status-open-border); color: var(--status-open); }
.banner-solved { background: var(--status-solved-bg); color: var(--status-solved); }

/* ==========================================================================
   Hero & Game Directory Cards
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, var(--game-header-start) 0%, var(--game-header-end) 100%);
  color: #ffffff; border-radius: var(--radius-xl); padding: 22px 20px; margin-bottom: 18px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-md);
}
.hero-banner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 70%); pointer-events: none;
}
.hero-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--game-accent); margin-bottom: 6px; }
.hero-title { font-size: 23px; font-weight: 900; line-height: 1.3; letter-spacing: -0.025em; }
.hero-lead { font-size: 14px; color: rgba(255, 255, 255, 0.86); margin-top: 6px; max-width: 640px; }
.hero-search-bar { margin-top: 16px; display: flex; gap: 8px; max-width: 580px; }
.hero-search-input { flex: 1; height: 46px; padding: 0 16px; border-radius: var(--radius-md); border: 2px solid transparent; background: #ffffff; color: var(--ink-primary); font-size: 15px; }
.hero-search-input:focus { border-color: var(--game-accent); outline: none; }
.hero-quick-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-pill-link {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff; font-size: 13px; font-weight: 700; text-decoration: none;
}
.hero-pill-link:hover { background: rgba(255, 255, 255, 0.24); text-decoration: none; }

.game-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.game-portal-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px;
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink-primary);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.game-portal-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--card-accent, var(--game-primary)); }
.game-portal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.game-portal-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--card-accent, var(--game-primary)); color: #ffffff; font-weight: 900; font-size: 17px; display: grid; place-items: center; flex-shrink: 0; }
.game-portal-info { min-width: 0; flex: 1; }
.game-portal-name { font-size: 16px; font-weight: 800; line-height: 1.3; display: flex; align-items: center; gap: 6px; }
.game-portal-stats { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 8px; }
.game-portal-stats strong { color: var(--status-open); }

/* One-Tap Quick Recruit Strip */
.onetap-strip {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border: 1.5px solid #fcd34d;
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.onetap-copy { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.onetap-icon { width: 42px; height: 42px; border-radius: 12px; background: #f59e0b; color: #ffffff; display: grid; place-items: center; flex-shrink: 0; }
.onetap-title { font-size: 15.5px; font-weight: 900; color: #451a03; line-height: 1.3; }
.onetap-desc { font-size: 13px; color: #78350f; margin-top: 2px; }
.onetap-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pinned Bar, Tabs, Filter Toolbar */
.pinned-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 16px; overflow-x: auto; font-size: 13px;
}
.pinned-label { font-weight: 800; color: var(--game-primary); white-space: nowrap; flex-shrink: 0; }
.pinned-link { color: var(--ink-secondary); font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: var(--radius-sm); }
.pinned-link:hover { background: var(--bg-subtle); text-decoration: none; }

.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  height: 40px; padding: 0 15px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--ink-secondary); font-size: 14px; font-weight: 700;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.cat-tab:hover { border-color: var(--game-primary); color: var(--game-primary); text-decoration: none; }
.cat-tab.is-active, .cat-tab[aria-current="page"] { background: var(--game-primary); color: #ffffff; border-color: var(--game-primary); box-shadow: 0 3px 10px var(--game-primary-ring); }

.filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  height: 34px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--ink-secondary); font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.filter-chip input { margin: 0; }
.filter-chip.is-active { background: var(--status-open-bg); color: var(--status-open); border-color: var(--status-open); }
.finder-inline { flex: 1; min-width: 180px; max-width: 280px; }
.finder-inline input { width: 100%; height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--bg-surface); font-size: 13.5px; }
.sort-select { height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-surface); font-size: 13px; font-weight: 700; color: var(--ink-secondary); cursor: pointer; }
.wiki-link { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 6px; background: var(--game-primary-soft); color: var(--game-primary); font-weight: 700; border-bottom: 1.5px solid rgba(29, 78, 216, 0.35); }
.poll-box { background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; margin: 16px 0; }
.poll-title { font-size: 14.5px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.poll-option { width: 100%; text-align: left; position: relative; overflow: hidden; border: 1px solid var(--border-strong); background: var(--bg-surface); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.poll-option:hover { border-color: var(--game-primary); }
.poll-option.is-voted { border-color: var(--game-primary); box-shadow: 0 0 0 2px var(--game-primary-ring); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--game-primary-soft); z-index: 0; transition: width 0.3s ease; }
.poll-option span { position: relative; z-index: 1; }

/* ==========================================================================
   Thread List Cards & QA Strip
   ========================================================================== */
.qa-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 20px; }
.qa-mini-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-top: 3px solid var(--status-warn);
  border-radius: var(--radius-md); padding: 12px 14px; text-decoration: none; color: var(--ink-primary);
  box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 6px;
}
.qa-mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.qa-mini-title { font-size: 14.5px; font-weight: 800; line-height: 1.4; }
.qa-mini-cta { font-size: 12px; font-weight: 800; color: var(--status-warn); margin-top: auto; }

.thread-list { display: flex; flex-direction: column; gap: 12px; }
.thread-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-xs); transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.thread-card:hover { border-color: rgba(29, 78, 216, 0.28); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.thread-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.thread-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thread-time { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.thread-card-title { font-size: 17px; font-weight: 800; line-height: 1.4; color: var(--ink-primary); margin-bottom: 6px; }
.thread-card-title a { color: inherit; text-decoration: none; }
.thread-card-title a:hover { color: var(--game-primary); }
.thread-excerpt { font-size: 14px; color: var(--ink-secondary); line-height: 1.6; margin-bottom: 10px; }

.recruit-meter { display: flex; align-items: center; gap: 10px; background: var(--bg-subtle); padding: 8px 12px; border-radius: var(--radius-md); margin-bottom: 10px; }
.recruit-bar-track { flex: 1; height: 8px; background: #dbe3ef; border-radius: var(--radius-pill); overflow: hidden; }
.recruit-bar-fill { height: 100%; background: linear-gradient(90deg, #10b981, #059669); border-radius: var(--radius-pill); }
.recruit-meter-text { font-size: 12.5px; font-weight: 800; color: var(--status-open); white-space: nowrap; }

.code-pill-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f8fafc; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 8px 10px 8px 12px; margin-bottom: 10px;
}
.code-pill-label { font-size: 11px; font-weight: 700; color: var(--ink-muted); display: block; }
.code-pill-value { font-family: var(--font-mono); font-size: 15px; font-weight: 800; letter-spacing: 0.04em; color: var(--ink-primary); }
.copy-mini-btn {
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: var(--game-primary);
  color: #ffffff; font-size: 12.5px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.copy-mini-btn.is-copied { background: var(--status-open); }

.thread-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 12.5px; color: var(--ink-muted); }
.author-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-secondary); flex-wrap: wrap; }
.trip-code, .trip { font-family: var(--font-mono); font-size: 11.5px; color: #b45309; background: #fef3c7; padding: 1px 6px; border-radius: 5px; font-weight: 700; }
.thread-metrics { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; }

/* ==========================================================================
   Thread Detail & Replies & Share Bar
   ========================================================================== */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-secondary); font-weight: 600; }
.thread-article { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.thread-h1 { font-size: 22px; font-weight: 900; line-height: 1.35; letter-spacing: -0.02em; margin: 10px 0 12px; }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 14px 0; }
.spec-cell { background: var(--bg-subtle); border-radius: var(--radius-md); padding: 10px 12px; }
.spec-label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-muted); }
.spec-val { display: block; font-size: 14.5px; font-weight: 800; color: var(--ink-primary); margin-top: 2px; }

.friend-code-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--game-primary-soft) 0%, #ffffff 100%);
  border: 1.5px solid rgba(29, 78, 216, 0.25); margin: 16px 0;
}
.friend-code-num { font-family: var(--font-mono); font-size: 20px; font-weight: 900; letter-spacing: 0.05em; color: var(--game-primary); }
.friend-code-note { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.best-answer-card { background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%); border: 2px solid #f59e0b; border-radius: var(--radius-lg); padding: 16px; margin: 16px 0; }
.best-answer-badge { display: inline-flex; align-items: center; gap: 6px; background: #f59e0b; color: #451a03; font-size: 12.5px; font-weight: 900; padding: 4px 10px; border-radius: var(--radius-pill); margin-bottom: 10px; }

.replies-section { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.reply-item { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.reply-item:last-of-type { border-bottom: 0; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.reply-num { font-family: var(--font-mono); font-weight: 800; color: var(--game-primary); background: var(--game-primary-soft); padding: 1px 7px; border-radius: 6px; }
.reply-quote { background: var(--bg-subtle); border-left: 3px solid var(--game-primary); padding: 6px 10px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.reply-body { font-size: 15.5px; line-height: 1.75; word-break: break-word; }

.reaction-row, .reacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.react-btn {
  height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--ink-secondary); font-size: 12.5px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.react-btn:hover { border-color: var(--game-primary); background: var(--game-primary-soft); }
.react-note { font-size: 12.5px; color: var(--status-open); font-weight: 700; margin-top: 6px; }

.reply-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; }
.tool-link-btn { background: none; border: 0; color: var(--ink-muted); font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; }
.tool-link-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); text-decoration: none; }

.share-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn { height: 38px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-surface); font-size: 13px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.share-btn-x { background: #0f172a; color: #ffffff; border-color: #0f172a; }
.share-btn-line { background: #06c755; color: #ffffff; border-color: #06c755; }
.share-btn-edit { background: var(--game-primary-soft); color: var(--game-primary); border-color: rgba(29, 78, 216, 0.25); }

/* ==========================================================================
   Sidebar, 3 AdSense Slots & Amazon Associate Product Cards WITH IMAGES
   ========================================================================== */
.side-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); }
.side-title { font-size: 15px; font-weight: 800; color: var(--ink-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.side-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.side-link-item { display: flex; align-items: flex-start; gap: 10px; text-decoration: none; color: var(--ink-primary); padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-sm); }
.side-link-item:hover { background: var(--bg-subtle); text-decoration: none; }
.rank-num { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-subtle); color: var(--ink-secondary); font-size: 12px; font-weight: 900; display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; }
.rank-num.top-1 { background: #f59e0b; color: #451a03; }
.rank-num.top-2 { background: #cbd5e1; color: #1e293b; }
.rank-num.top-3 { background: #fdba74; color: #7c2d12; }
.side-link-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; display: block; }
.side-link-meta { font-size: 11.5px; color: var(--ink-muted); display: block; margin-top: 2px; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-tile { padding: 10px; border-radius: var(--radius-md); background: var(--game-primary-soft); color: var(--game-primary); font-size: 13px; font-weight: 800; text-decoration: none; display: flex; flex-direction: column; gap: 3px; border: 1px solid rgba(29, 78, 216, 0.12); }
.tool-tile small { font-weight: 500; color: var(--ink-muted); font-size: 11px; }

/* AdSense Slot (3 slots/page max, clearly labeled, generous margin) */
.ad-slot { background: #f8fafc; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 12px 14px; margin: 18px 0; text-align: center; }
.sidebar .ad-slot { margin: 0; }
.ad-label { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-muted); background: #e2e8f0; padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; }
.ad-frame {
  min-height: 92px; border-radius: var(--radius-md);
  background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 10px, #e9eef5 10px, #e9eef5 20px);
  border: 1px dashed #cbd5e1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px; color: var(--ink-muted); font-size: 12.5px; font-weight: 600;
}
.ad-frame-rect { min-height: 250px; }

/* Amazon Associate Card WITH Product Images */
.aff-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-xs); }
.aff-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aff-pr { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 4px; background: #fef3c7; color: #92400e; }
.aff-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.aff-img-wrap { width: 68px; height: 86px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-subtle); border: 1px solid var(--border-subtle); display: grid; place-items: center; }
.aff-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.aff-thumb-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, var(--game-header-start), var(--game-header-end)); color: #ffffff; font-size: 11px; font-weight: 800; display: grid; place-items: center; text-align: center; padding: 4px; }
.aff-info { min-width: 0; flex: 1; }
.aff-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--game-primary-soft); color: var(--game-primary); margin-bottom: 4px; }
.aff-name { font-size: 13.5px; font-weight: 800; line-height: 1.35; color: var(--ink-primary); }
.aff-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; height: 30px; padding: 0 11px; border-radius: 6px; background: #ff9900; color: #111827; font-size: 12px; font-weight: 800; text-decoration: none; }
.aff-cta:hover { filter: brightness(0.96); text-decoration: none; }
.aff-disclosure { margin-top: 8px; font-size: 11px; color: var(--ink-muted); line-height: 1.5; }

/* ==========================================================================
   Diary Editorial Styles
   ========================================================================== */
.diary-article { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 24px 22px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.diary-meta-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-muted); margin-bottom: 12px; }
.diary-prose { font-size: 16.5px; line-height: 1.9; color: var(--ink-primary); }
.diary-prose p + p { margin-top: 16px; }
.diary-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.diary-nav-card { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-subtle); text-decoration: none; color: var(--ink-primary); }
.diary-nav-card small { display: block; font-size: 11.5px; color: var(--ink-muted); }
.diary-nav-card strong { display: block; font-size: 14px; margin-top: 2px; }

/* ==========================================================================
   Forms, Admin & Legacy Compatibility
   ========================================================================== */
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stepper span { background: var(--bg-surface); border: 1.5px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 8px; text-align: center; font-size: 13.5px; font-weight: 800; color: var(--ink-muted); }
.stepper span.is-on, .stepper span.is-current { border-color: var(--game-primary); background: var(--game-primary-soft); color: var(--game-primary); }

.form-surface, .panel, .done, .empty { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 22px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.field { display: block; margin: 14px 0; font-weight: 800; font-size: 14.5px; }
.field > span { display: block; margin-bottom: 6px; color: var(--ink-primary); }
.field input, .field select, .field textarea, .text-input, .text-area {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong); background: #ffffff; font-size: 15.5px; font-weight: 500;
}
.field textarea, .text-area { min-height: 108px; resize: vertical; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--game-primary); box-shadow: 0 0 0 3px var(--game-primary-ring); outline: none; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle); background: var(--bg-surface); cursor: pointer; font-weight: 700;
}
.choice:has(input:checked) { border-color: var(--game-primary); background: var(--game-primary-soft); color: var(--game-primary); }
.choice small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.hint { font-size: 13px; color: var(--ink-muted); margin: 10px 0; }
.board-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.board-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); color: var(--ink-primary); text-decoration: none; box-shadow: var(--shadow-xs); }
.board-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--game-primary); color: #ffffff; display: grid; place-items: center; font-weight: 900; flex-shrink: 0; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-surface); border-radius: var(--radius-md); overflow: hidden; margin: 12px 0; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); text-align: left; font-size: 14px; }
.admin-table th { background: var(--bg-subtle); font-weight: 800; }

/* Modal & Toast */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52); backdrop-filter: blur(2px); z-index: 110; display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(480px, 100%); background: var(--bg-surface); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow-lg); }
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #ffffff; padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 120; white-space: nowrap;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Mobile Bottom Nav & Footer */
.mobile-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottom-nav-h);
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-around; padding: 0 6px; z-index: 55; box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}
.bottom-nav-item { flex: 1; height: 100%; border: 0; background: transparent; color: var(--ink-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.bottom-nav-item.is-active { color: var(--game-primary); }
.bottom-nav-write { background: var(--game-primary); color: #ffffff; width: 48px; height: 40px; border-radius: 14px; display: grid; place-items: center; box-shadow: 0 4px 12px var(--game-primary-ring); }

.site-footer { margin-top: 32px; padding: 24px 16px 84px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--ink-muted); font-size: 12.5px; }
.footer-inner { max-width: var(--container-max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--ink-secondary); font-weight: 600; }
.footer-admin-strip {
  max-width: var(--container-max); margin: 14px auto 0; padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.06);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 11px; color: #94a3b8; opacity: 0.62; transition: opacity 0.15s ease;
}
.footer-admin-strip:hover { opacity: 1; }
.footer-admin-strip a { color: #94a3b8; font-weight: 600; }
.footer-admin-strip a:hover { color: var(--ink-secondary); }

.thread-card[data-href] { cursor: pointer; }
.back-to-top {
  position: fixed; right: 16px; bottom: 78px; z-index: 50;
  height: 40px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.94);
  color: var(--ink-primary); font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-md); backdrop-filter: blur(6px);
  transition: transform 0.14s ease, background 0.14s ease;
}
.back-to-top:hover { background: var(--game-primary); color: #ffffff; border-color: var(--game-primary); transform: translateY(-2px); }
@media (min-width: 768px) {
  .back-to-top { bottom: 24px; right: 24px; }
}

.unread-dot {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--radius-pill); background: #ef4444; color: #ffffff;
  font-size: 11px; font-weight: 800; line-height: 1;
}

/* Inline Quick Reply Box & Phrase Chips */
.quick-reply-box {
  margin-top: 18px; padding: 16px; border-radius: var(--radius-lg);
  background: var(--bg-subtle); border: 1.5px solid var(--border-subtle);
}
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.quick-phrases { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.phrase-chip {
  height: 32px; padding: 0 11px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--ink-secondary); font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.phrase-chip:hover { border-color: var(--game-primary); background: var(--game-primary-soft); color: var(--game-primary); transform: translateY(-1px); }
.phrase-chip:active { transform: scale(0.95); }
.join-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 14px;
  border-radius: var(--radius-pill); background: var(--status-open-bg); border: 1.5px solid var(--status-open-border);
  color: var(--status-open); font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.qr-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.qr-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Playful Micro-Interactions */
@keyframes react-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@keyframes reply-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reply-glow {
  0% { background: #fef3c7; }
  100% { background: transparent; }
}
@keyframes float-burst {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1.25); }
}
.react-btn { transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease; position: relative; }
.react-btn.is-reacted { background: var(--game-primary-soft); border-color: var(--game-primary); color: var(--game-primary); }
.react-btn.is-popping { animation: react-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
.reply-item.is-new-reply { animation: reply-enter 0.35s ease; }
.reply-item.is-highlighted { animation: reply-glow 1.6s ease; border-radius: var(--radius-md); padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }
.sparkle-burst {
  position: fixed; pointer-events: none; z-index: 150; font-size: 16px; font-weight: 900;
  animation: float-burst 0.65s ease-out forwards;
}

/* Tap-pill selectors in Post Form */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pill-opt {
  min-height: 44px; padding: 0 15px; border-radius: var(--radius-pill); border: 2px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--ink-secondary); font-size: 14px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.14s ease;
}
.pill-opt:hover { border-color: var(--game-primary); }
.pill-opt.is-selected { border-color: var(--game-primary); background: var(--game-primary-soft); color: var(--game-primary); box-shadow: 0 0 0 3px var(--game-primary-ring); }
.preset-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 12px 0 18px; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--ink-primary); }
.pager span.is-current { background: var(--game-primary); color: #ffffff; border-color: var(--game-primary); }

@media (min-width: 768px) {
  .header-search, .header-desktop-only { display: inline-flex; }
  .header-search { display: block; }
  .main-wrap { padding: 24px 20px 48px; }
  .hero-banner { padding: 28px; }
  .hero-title { font-size: 28px; }
  .mobile-bottom-nav { display: none; }
  .site-footer { padding-bottom: 32px; }
}

@media (min-width: 980px) {
  .layout-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; }
  .sidebar { position: sticky; top: calc(var(--header-h) + 18px); }
}
