@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&display=swap');

/* ─── Variables ─── */
:root {
  --bg:      #faf8f3;
  --bg-warm: #f0ece0;
  --ink:     #1a1a1a;
  --ink-2:   #3a3a3a;
  --ink-3:   #6a6a6a;
  --ink-4:   #9a9a8a;
  --rule:    #c8c0b0;
  --rule-lt: #ddd8cc;
  --seal:    #8b1a1a;
  --seal-lt: #b04040;
  --paper:   #f5f1e6;
  --shadow:  rgba(30,25,20,0.08);
  --header-h: 52px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'HiraMinProN-W3', serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── Header ─── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  background: rgba(250,248,243,0.94);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-left { display: flex; align-items: center; gap: 24px; }
.site-logo {
  font-size: 13px; letter-spacing: 0.25em; color: var(--ink-2);
  white-space: nowrap;
}
.site-logo span.en { color: var(--ink-4); font-size: 11px; letter-spacing: 0.2em; }
.header-nav { display: flex; align-items: center; gap: 0; }
.header-nav a {
  display: block; padding: 0 18px; height: var(--header-h);
  line-height: var(--header-h);
  font-size: 12px; letter-spacing: 0.18em; color: var(--ink-3);
  transition: color 0.2s, border-bottom 0.2s;
  border-bottom: 2px solid transparent;
}
.header-nav a:hover { color: var(--ink); }
.header-nav a.active { color: var(--ink); border-bottom-color: var(--ink); }
.header-right { display: flex; align-items: center; gap: 16px; }
.lang-btns { display: flex; gap: 6px; }
.lang-btn {
  background: none; border: 1px solid var(--rule);
  padding: 3px 11px; font-size: 11px; letter-spacing: 0.12em;
  color: var(--ink-3); transition: all 0.18s;
}
.lang-btn:hover { border-color: var(--ink-3); color: var(--ink-2); }
.lang-btn.active {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}

/* ─── Page body ─── */
.page-body { padding-top: var(--header-h); min-height: 100vh; }

/* ─── Hero (index) ─── */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 60px 20px 40px;
}
.hero-scene {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.hero-title-block {
  position: relative; z-index: 10;
  text-align: center; margin-bottom: 32px;
}
.hero-title-block h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 400; letter-spacing: 0.35em;
  line-height: 1.3; margin-bottom: 14px;
}
.hero-subtitle {
  font-size: 14px; letter-spacing: 0.25em; color: var(--ink-3);
  margin-bottom: 4px;
}
.hero-subtitle-en {
  font-size: 13px; letter-spacing: 0.4em; color: var(--ink-4);
  font-weight: 300;
}
.hero-gates {
  position: relative; z-index: 10;
  margin: 8px auto;
}
.hero-tagline {
  position: relative; z-index: 10;
  text-align: center; margin-top: 32px;
}
.hero-tagline p { font-size: 13px; letter-spacing: 0.2em; color: var(--ink-2); margin-bottom: 4px; }
.hero-tagline .en { font-size: 12px; color: var(--ink-4); letter-spacing: 0.3em; font-weight: 300; }
.hero-nav-cards {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; width: 100%; max-width: 900px;
  margin: 60px auto 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.hero-card {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  transition: background 0.2s;
}
.hero-card:last-child { border-right: none; }
.hero-card:hover { background: var(--bg-warm); }
.hero-card-num {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4);
  margin-bottom: 12px;
}
.hero-card-title {
  font-size: 16px; letter-spacing: 0.2em; margin-bottom: 8px;
}
.hero-card-title-en {
  font-size: 11px; letter-spacing: 0.2em; color: var(--ink-4);
  font-weight: 300; margin-bottom: 12px;
}
.hero-card-desc { font-size: 12px; color: var(--ink-3); line-height: 1.9; }

/* ─── Section layout ─── */
.section-header {
  padding: 48px 48px 0;
  border-bottom: 1px solid var(--rule);
  max-width: 1100px; margin: 0 auto;
}
.section-header h2 {
  font-size: 22px; letter-spacing: 0.3em; font-weight: 400;
  margin-bottom: 6px;
}
.section-header .en {
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-4);
  font-weight: 300; display: block; margin-bottom: 16px;
}
.section-header p {
  font-size: 13px; color: var(--ink-3); margin-bottom: 24px;
}

/* ─── Problems page ─── */
.problems-layout {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 280px 1fr;
  gap: 0; min-height: calc(100vh - var(--header-h));
}
.problems-sidebar {
  border-right: 1px solid var(--rule);
  padding: 32px 0; position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.sidebar-label {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4);
  padding: 0 24px 12px;
}
.problem-list-item {
  display: block; padding: 14px 24px;
  border-bottom: 1px solid var(--rule-lt);
  font-size: 13px; letter-spacing: 0.1em;
  transition: background 0.15s;
  cursor: pointer; position: relative;
}
.problem-list-item:hover { background: var(--bg-warm); }
.problem-list-item.active { background: var(--paper); }
.problem-list-item::before {
  content: attr(data-num);
  font-size: 10px; color: var(--ink-4);
  display: block; margin-bottom: 3px; letter-spacing: 0.2em;
}
.problem-difficulty {
  font-size: 10px; color: var(--seal);
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
}
.problems-main { padding: 40px 48px; }
.problem-card {
  display: none;
}
.problem-card.visible { display: block; }
.problem-card-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.problem-num-label {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4); margin-bottom: 8px;
}
.problem-title {
  font-size: 20px; letter-spacing: 0.2em; font-weight: 400; margin-bottom: 4px;
}
.problem-title-en {
  font-size: 12px; letter-spacing: 0.25em; color: var(--ink-4); font-weight: 300;
}
.problem-meta {
  display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap;
}
.problem-tag {
  font-size: 10px; letter-spacing: 0.15em; color: var(--ink-3);
  border: 1px solid var(--rule); padding: 2px 10px;
}
.problem-body {
  font-size: 14px; line-height: 2; letter-spacing: 0.05em;
  margin-bottom: 24px; color: var(--ink-2);
}
.problem-body .block {
  background: var(--paper);
  border-left: 2px solid var(--rule);
  padding: 16px 20px; margin: 16px 0;
  font-size: 13px; color: var(--ink-2);
}
.spoiler-toggle {
  background: none; border: 1px solid var(--rule);
  padding: 8px 20px; font-size: 12px; letter-spacing: 0.15em;
  color: var(--ink-3); transition: all 0.2s;
  margin-bottom: 24px;
}
.spoiler-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.spoiler-content {
  display: none; background: var(--paper);
  border: 1px solid var(--rule-lt); padding: 24px;
  margin-bottom: 28px; font-size: 13px; line-height: 2;
}
.spoiler-content.open { display: block; }

/* Discussion (問題ページ内) */
.discussion-section { margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 32px; }
.discussion-label {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4); margin-bottom: 24px;
}
.discussion-label span { font-size: 14px; letter-spacing: 0.15em; color: var(--ink-2); }
.comment-form { margin-bottom: 28px; }
.comment-form-fields { display: flex; gap: 12px; margin-bottom: 10px; }
.input-field {
  background: var(--bg); border: 1px solid var(--rule);
  padding: 8px 12px; font-family: inherit; font-size: 12px;
  color: var(--ink); width: 100%; outline: none;
  transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--ink-3); }
.input-name { width: 160px; flex-shrink: 0; }
.textarea-field {
  background: var(--bg); border: 1px solid var(--rule);
  padding: 10px 14px; font-family: inherit; font-size: 13px;
  color: var(--ink); width: 100%; outline: none; resize: vertical;
  min-height: 80px; transition: border-color 0.2s; line-height: 1.8;
}
.textarea-field:focus { border-color: var(--ink-3); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-submit {
  background: var(--ink); color: var(--bg);
  border: none; padding: 8px 24px; font-size: 12px;
  letter-spacing: 0.2em; transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.75; }
.comment { border-bottom: 1px solid var(--rule-lt); padding: 18px 0; }
.comment-header {
  display: flex; gap: 16px; align-items: baseline;
  margin-bottom: 8px; font-size: 11px; color: var(--ink-4);
}
.comment-num { color: var(--seal); font-size: 12px; font-weight: 500; }
.comment-handle { color: var(--ink-3); }
.comment-time { margin-left: auto; letter-spacing: 0.1em; }
.comment-body { font-size: 13px; line-height: 2; color: var(--ink-2); }
.comment-body .quote {
  color: var(--seal); cursor: pointer;
}
.comment-reactions { display: flex; gap: 10px; margin-top: 10px; }
.reaction-btn {
  background: none; border: 1px solid var(--rule-lt);
  padding: 2px 10px; font-size: 11px; color: var(--ink-4);
  letter-spacing: 0.1em; transition: all 0.15s;
}
.reaction-btn:hover { border-color: var(--rule); color: var(--ink-3); }
.reaction-btn.reacted { border-color: var(--ink-3); color: var(--ink-2); }

/* ─── Forum page ─── */
.forum-layout { max-width: 1000px; margin: 0 auto; padding: 40px 40px; }
.forum-boards { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px;
  border: 1px solid var(--rule); margin-bottom: 40px; }
.forum-board-card {
  padding: 20px 24px; border-right: 1px solid var(--rule);
  transition: background 0.15s; cursor: pointer;
}
.forum-board-card:hover { background: var(--bg-warm); }
.forum-board-card:nth-child(2n) { border-right: none; }
.forum-board-card:nth-child(n+3) { border-top: 1px solid var(--rule); }
.board-name { font-size: 14px; letter-spacing: 0.2em; margin-bottom: 4px; }
.board-name-en { font-size: 11px; color: var(--ink-4); letter-spacing: 0.2em; font-weight: 300; }
.board-count { font-size: 11px; color: var(--ink-4); margin-top: 8px; }

.forum-section-label {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-lt);
  display: flex; justify-content: space-between; align-items: center;
}
.btn-new-thread {
  background: none; border: 1px solid var(--rule);
  padding: 4px 16px; font-size: 11px; letter-spacing: 0.15em;
  color: var(--ink-3); transition: all 0.18s;
}
.btn-new-thread:hover { border-color: var(--ink-3); color: var(--ink); }

.thread-list { margin-bottom: 40px; }
.thread-item {
  display: flex; align-items: baseline; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--rule-lt);
  cursor: pointer; transition: background 0.12s; padding-left: 4px;
}
.thread-item:hover { background: var(--bg-warm); padding-left: 8px; }
.thread-item-num { font-size: 11px; color: var(--ink-4); min-width: 28px; }
.thread-item-title { font-size: 13px; letter-spacing: 0.08em; flex: 1; }
.thread-item-board { font-size: 11px; color: var(--ink-4); letter-spacing: 0.1em; }
.thread-item-count {
  font-size: 11px; color: var(--ink-4); min-width: 50px; text-align: right;
}
.thread-item-time { font-size: 11px; color: var(--ink-4); min-width: 120px; text-align: right; }

/* Thread view */
.thread-view { display: none; }
.thread-view.open { display: block; }
.thread-view-header {
  margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--rule);
}
.thread-view-back {
  background: none; border: none; font-size: 12px; letter-spacing: 0.1em;
  color: var(--ink-4); margin-bottom: 16px; padding: 0;
  cursor: pointer; transition: color 0.15s;
}
.thread-view-back:hover { color: var(--ink); }
.thread-title-display {
  font-size: 18px; letter-spacing: 0.2em; font-weight: 400; margin-bottom: 6px;
}
.thread-board-tag {
  font-size: 11px; color: var(--ink-4); letter-spacing: 0.15em;
}

.forum-post { border-bottom: 1px solid var(--rule-lt); padding: 16px 0; }
.forum-post-header {
  display: flex; gap: 14px; align-items: baseline; margin-bottom: 8px;
}
.post-num { font-size: 12px; color: var(--seal); min-width: 30px; font-weight: 500; }
.post-handle { font-size: 12px; color: var(--ink-2); }
.post-time { font-size: 11px; color: var(--ink-4); margin-left: auto; }
.post-id { font-size: 11px; color: var(--ink-4); }
.forum-post-body { font-size: 13px; line-height: 2; color: var(--ink-2); padding-left: 44px; }
.forum-post-body .quote-ref { color: var(--seal); cursor: pointer; }
.post-reactions { display: flex; gap: 8px; margin-top: 8px; padding-left: 44px; }

.new-thread-form, .new-post-form {
  background: var(--paper); border: 1px solid var(--rule-lt);
  padding: 24px; margin-bottom: 24px;
}
.new-thread-form h3, .new-post-form h3 {
  font-size: 13px; letter-spacing: 0.2em; margin-bottom: 16px;
  color: var(--ink-3); font-weight: 400;
}
.form-row { margin-bottom: 12px; }
.form-label {
  display: block; font-size: 11px; letter-spacing: 0.15em;
  color: var(--ink-4); margin-bottom: 4px;
}
.select-field {
  background: var(--bg); border: 1px solid var(--rule);
  padding: 8px 12px; font-family: inherit; font-size: 12px;
  color: var(--ink); outline: none; width: 100%;
  transition: border-color 0.2s; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9a8a'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select-field:focus { border-color: var(--ink-3); }

/* ─── Lab page ─── */
.lab-layout { max-width: 900px; margin: 0 auto; padding: 40px 40px; }
.lab-intro {
  font-size: 14px; line-height: 2.1; color: var(--ink-2);
  margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--rule);
  max-width: 600px;
}
.lab-intro .president-label {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-4); margin-bottom: 12px;
}
.lab-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px; border: 1px solid var(--rule); margin-bottom: 48px;
}
.lab-card {
  padding: 24px; border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); background: var(--bg);
  transition: background 0.15s;
}
.lab-card:hover { background: var(--bg-warm); }
.lab-card-date {
  font-size: 10px; letter-spacing: 0.2em; color: var(--ink-4); margin-bottom: 10px;
}
.lab-card-tag {
  display: inline-block; font-size: 9px; letter-spacing: 0.15em;
  border: 1px solid var(--rule); padding: 1px 8px; color: var(--ink-4);
  margin-bottom: 10px;
}
.lab-card-title { font-size: 15px; letter-spacing: 0.15em; margin-bottom: 8px; }
.lab-card-body {
  font-size: 12px; color: var(--ink-3); line-height: 1.9; letter-spacing: 0.05em;
}
.lab-card-link {
  display: inline-block; margin-top: 12px; font-size: 11px;
  letter-spacing: 0.15em; color: var(--ink-4); border-bottom: 1px solid var(--rule);
  transition: all 0.15s; padding-bottom: 1px;
}
.lab-card-link:hover { color: var(--ink); border-bottom-color: var(--ink-3); }

.lab-notebook {
  border: 1px solid var(--rule-lt); padding: 32px;
  background: var(--paper); font-size: 13px; line-height: 2.2;
  color: var(--ink-2); margin-bottom: 32px;
}
.lab-notebook-title {
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-4);
  margin-bottom: 16px; border-bottom: 1px solid var(--rule-lt); padding-bottom: 10px;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: 0.2em; color: var(--ink-4);
}
.footer-center { text-align: center; flex: 1; }
.footer-center p { margin: 2px 0; }
.seal-svg { width: 36px; height: 36px; }

/* ─── Utilities ─── */
.divider { border: none; border-top: 1px solid var(--rule); margin: 32px 0; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.hidden { display: none !important; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rule); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Hide mobile-only elements on desktop */
.problem-mobile-nav { display: none; }

/* ─── Mobile nav toggle button ─── */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px;
  background: none; border: none; padding: 4px; cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.5px;
  background: var(--ink-3); transition: transform 0.22s, opacity 0.22s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Responsive ─── */
@media (max-width: 860px) {
  /* Hide right-side "Logica University" subtitle */
  .header-en-sub { display: none !important; }
}

@media (max-width: 768px) {
  /* ── Header ── */
  .nav-toggle { display: flex; }
  .site-header { padding: 0 16px; gap: 0; }
  .site-logo { font-size: 12px; letter-spacing: 0.15em; }

  /* Nav becomes fullscreen dropdown */
  .header-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 199;
    background: rgba(250,248,243,0.97); backdrop-filter: blur(12px);
    flex-direction: column; display: none;
    border-bottom: 2px solid var(--rule);
    padding: 8px 0 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .header-nav.open { display: flex; }
  .header-nav a {
    height: auto; line-height: 1.5; padding: 16px 28px;
    font-size: 15px; letter-spacing: 0.18em;
    border-bottom: 1px solid var(--rule-lt); border-left: none;
  }
  .header-nav a:last-child { border-bottom: none; }
  .header-nav a.active { border-bottom-color: var(--rule-lt); border-left: 3px solid var(--ink); }

  /* ── Hero ── */
  .hero { padding-top: var(--header-h); }
  .hero-text-block { padding: 20px 16px 8px; }
  .hero-tagline-bar { padding: 13px 16px 0; font-size: 12px; }
  .hero-tagline-bar .en { font-size: 10px; }

  /* Hide watercolor landscape on mobile — gates are the focus */
  .scene-landscape { display: none; }

  /* Navigation cards: single column */
  .hero-nav-cards { grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
  .hero-card { border-right: none; border-bottom: 1px solid var(--rule-lt); padding: 24px 20px; }
  .hero-card:last-child { border-bottom: none; }

  /* ── Problems ── */
  .problems-layout { display: block; }
  .problems-sidebar { display: none; }
  .problems-main { padding: 20px; }
  .problem-mobile-nav {
    display: flex; overflow-x: auto; gap: 0; margin-bottom: 24px;
    border-bottom: 1px solid var(--rule);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .problem-mobile-nav::-webkit-scrollbar { display: none; }
  .problem-mobile-tab {
    flex-shrink: 0; padding: 10px 16px; font-size: 11px;
    letter-spacing: 0.1em; color: var(--ink-4); cursor: pointer;
    border-bottom: 2px solid transparent; white-space: nowrap;
    transition: all 0.15s; font-family: inherit;
    background: none; border-top: none; border-left: none; border-right: none;
  }
  .problem-mobile-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
  .problem-card-header { margin-bottom: 20px; padding-bottom: 16px; }
  .problem-title { font-size: 17px; }
  .problem-body { font-size: 13px; }

  /* ── Forum ── */
  .forum-layout { padding: 20px 16px; }
  .forum-boards { grid-template-columns: 1fr 1fr; }
  .forum-board-card { padding: 14px 16px; }
  .forum-rules { grid-template-columns: 1fr; }
  .forum-rule { border-right: none; border-bottom: 1px solid var(--rule-lt); }
  .forum-rule:last-child { border-bottom: none; }
  .thread-item-time { display: none; }
  .thread-item-board { display: none; }
  .forum-post-body { padding-left: 24px; }
  .post-reactions { padding-left: 24px; }
  .new-thread-form, .new-post-form { padding: 16px; }

  /* ── Lab ── */
  .lab-layout { padding: 20px 16px; }
  .lab-intro-block { flex-direction: column; gap: 16px; }
  .lab-grid { grid-template-columns: 1fr; }
  .mini-game-block { padding: 16px; }
  #mini-canvas { width: 100%; max-width: 100%; }

  /* ── Footer ── */
  .site-footer { flex-direction: column; gap: 12px; text-align: center; padding: 20px 16px; }
  .site-footer > span { order: 3; }

  /* ── Comment form ── */
  .comment-form-fields { flex-direction: column; }
  .input-name { width: 100%; }
}

@media (max-width: 480px) {
  .forum-boards { grid-template-columns: 1fr; }
  .forum-board-card:nth-child(n) { border-right: none; }
  .forum-board-card:nth-child(n+2) { border-top: 1px solid var(--rule-lt); }
  .lang-btns .lang-btn { padding: 3px 8px; font-size: 10px; }
  .problem-meta { gap: 8px; }
  .problem-tag { font-size: 9px; padding: 2px 7px; }
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease both; }

/* MathJax overrides */
.MJX-TEX { font-size: 1em !important; }
