:root {
  --bg-cream: #fafbf2;
  --bg-card: rgba(255, 255, 252, 0.86);
  --bg-card-solid: #fffffc;
  --sticky-bg: #ebf3d1;
  --sticky-tape: rgba(164, 214, 102, 0.62);
  --ink: #161d14;
  --ink-muted: #4b5946;
  --ink-subtle: #6e7d68;
  --accent: #4c8c42;
  --accent-strong: #376e30;
  --accent-soft: #e3f0d5;
  --border: rgba(45, 75, 38, 0.13);
  --border-strong: rgba(45, 75, 38, 0.24);
  --correct: #2f7d3c;
  --correct-bg: #e3f4e6;
  --wrong: #b8423a;
  --wrong-bg: #fbe9e7;
  --gold: #c99a2e;
  --silver: #7c8994;
  --bronze: #b26e3d;
  --shadow-soft: 0 14px 40px -14px rgba(34, 58, 28, 0.12), 0 2px 10px -2px rgba(34, 58, 28, 0.05);
  --shadow-card: 0 18px 46px -18px rgba(30, 52, 24, 0.16);
  --font-serif: 'Catchy Mager', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Dotcam', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  background-color: var(--bg-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Organic botanical mesh gradient matching presentation slides */
.slide-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg-cream);
  background-image:
    radial-gradient(ellipse 72% 62% at 54% 56%, rgba(108, 174, 86, 0.56) 0%, rgba(164, 206, 120, 0.28) 44%, transparent 76%),
    radial-gradient(ellipse 56% 52% at 10% 88%, rgba(114, 178, 92, 0.48) 0%, transparent 70%),
    radial-gradient(ellipse 50% 46% at 90% 10%, rgba(154, 199, 108, 0.44) 0%, transparent 68%);
}

.serif-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Authentic element box badge styled after periodensystem_5600.gif */
.element-tile {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f5f8f2;
  border: 1px solid rgba(40, 62, 42, 0.16);
  border-radius: 7px;
  padding: 4px 6px 6px;
  min-width: 44px;
  height: 48px;
  box-shadow: 0 3px 10px -4px rgba(24, 42, 22, 0.18);
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
}

.element-tile::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--el-color, #5fb7df);
}

.element-tile__num {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #29435c;
  text-align: left;
}

.element-tile__sym {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.05;
  color: #172838;
  text-align: center;
  margin-bottom: 2px;
}

.element-tile--lg {
  min-width: 68px;
  height: 74px;
  padding: 6px 9px 9px;
  border-radius: 10px;
}

.element-tile--lg::after {
  height: 5px;
}

.element-tile--lg .element-tile__num {
  font-size: 0.78rem;
}

.element-tile--lg .element-tile__sym {
  font-size: 1.6rem;
}

.element-tile--sm {
  min-width: 36px;
  height: 40px;
  padding: 3px 4px 5px;
  border-radius: 6px;
}

.element-tile--sm .element-tile__num {
  font-size: 0.54rem;
}

.element-tile--sm .element-tile__sym {
  font-size: 0.88rem;
}

/* Sticky note card motif from slides 2 & 3 */
.sticky-note {
  position: relative;
  background: linear-gradient(165deg, #eef5d5 0%, #e4efc2 100%);
  border: 1px solid rgba(114, 148, 66, 0.22);
  border-radius: 14px;
  box-shadow: 0 16px 32px -18px rgba(48, 70, 26, 0.28), 0 2px 6px rgba(48, 70, 26, 0.06);
  padding: 24px 20px 18px;
}

.sticky-note::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 78px;
  height: 20px;
  background: var(--sticky-tape);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(60, 90, 30, 0.12);
}

/* =========================================================
   MOBILE QUIZ PAGE (index.php)
   ========================================================= */
body.page-quiz {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.quiz-shell {
  width: 100%;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.quiz-brand {
  text-align: center;
  margin-bottom: 18px;
}

.quiz-brand__title {
  font-size: clamp(2.85rem, 11vw, 3.7rem);
  margin-bottom: 6px;
}

.quiz-brand__sub {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

/* Subtle preview strip of cropped periodic table on start screen */
.pse-teaser {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.pse-teaser__img {
  width: 82px;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.pse-teaser__copy {
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--ink-muted);
}

.pse-teaser__copy strong {
  color: var(--ink);
  font-weight: 600;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.name-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.element-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.element-picker-hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--ink-subtle);
}

.input-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 15px;
  height: 54px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input-name:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 140, 66, 0.16);
}

.btn-primary {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #fafbf2;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px -10px rgba(22, 29, 20, 0.45);
  transition: transform 0.14s ease, background-color 0.16s ease, opacity 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--wrong-bg);
  color: var(--wrong);
  font-size: 0.86rem;
  font-weight: 500;
}

.quiz-footer-sig {
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Playing HUD */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-player__name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  color: var(--ink);
}

.pill--streak {
  background: #fff2d6;
  border-color: rgba(201, 154, 46, 0.32);
  color: #875b08;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(45, 75, 38, 0.1);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6aa656 0%, #3d7a36 100%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.round-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.q-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Smooth speed-bonus meter */
.speed-meter {
  margin-bottom: 16px;
}

.speed-meter__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--ink-subtle);
  margin-bottom: 4px;
  font-weight: 500;
}

.speed-meter__track {
  height: 4px;
  border-radius: 999px;
  background: rgba(45, 75, 38, 0.08);
  overflow: hidden;
}

.speed-meter__bar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #91c25a 0%, #4c8c42 100%);
  transform-origin: left center;
}

.question-text {
  font-family: var(--font-sans);
  font-size: clamp(1.12rem, 4.4vw, 1.28rem);
  font-weight: 700;
  line-height: 1.34;
  color: var(--ink);
  margin: 0 0 18px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.32;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.option-btn__key {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(45, 75, 38, 0.08);
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.option-btn.is-correct {
  background: var(--correct-bg);
  border-color: var(--correct);
  color: #15451e;
}

.option-btn.is-correct .option-btn__key {
  background: var(--correct);
  color: #ffffff;
}

.option-btn.is-wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong);
  color: #6b1d17;
}

.option-btn.is-wrong .option-btn__key {
  background: var(--wrong);
  color: #ffffff;
}

.option-btn.is-dimmed {
  opacity: 0.54;
}

.answer-feedback-card {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  animation: fadeUp 0.2s ease both;
}

.answer-feedback-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.94rem;
  font-weight: 700;
}

.answer-feedback-card__exp {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  opacity: 0.88;
}

.answer-feedback--ok {
  background: var(--correct-bg);
  color: var(--correct);
}

.answer-feedback--bad {
  background: var(--wrong-bg);
  color: var(--wrong);
}

.answer-feedback__sub {
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.88;
}

.btn-next-inline {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(22, 29, 20, 0.1);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Round banner card */
.round-interstitial {
  text-align: center;
  padding: 32px 22px;
  animation: fadeUp 0.28s ease both;
}

.round-interstitial__title {
  font-size: 2.5rem;
  margin: 8px 0 6px;
}

.round-interstitial__pts {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

/* Result Screen */
.result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 18px;
}

.result-score {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 11vw, 3.6rem);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  color: var(--ink);
}

.result-score-max {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.rank-note {
  text-align: center;
  margin-bottom: 18px;
}

.rank-note__title {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 600;
  margin: 4px 0 6px;
  color: var(--ink);
}

.rank-note__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}

.metric-box__val {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-box__lbl {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.review-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.review-item {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  line-height: 1.38;
}

.review-item--wrong {
  border-color: rgba(184, 66, 58, 0.28);
  background: rgba(251, 233, 231, 0.6);
}

.review-item__q {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.review-item__ans {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* =========================================================
   LANDSCAPE BOARD DASHBOARD (dashboard.php)
   ========================================================= */
body.page-dashboard {
  min-height: 100vh;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
}

.dash-wrap {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.dash-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-title {
  font-size: clamp(1.9rem, 2.8vw, 2.7rem);
}

.dash-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d9a48;
  box-shadow: 0 0 0 4px rgba(61, 154, 72, 0.2);
  margin-right: 6px;
  animation: pulseDot 2s infinite;
}

.dash-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.dash-stat-pill span {
  color: var(--ink-muted);
  font-weight: 500;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.btn-ghost:hover {
  background: #ffffff;
}

.btn-ghost--danger:hover {
  background: var(--wrong-bg);
  border-color: rgba(184, 66, 58, 0.35);
  color: var(--wrong);
}

.dash-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.dash-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.dash-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px 22px;
}

/* Podium for Top 3 */
.podium-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.podium-stage {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  align-items: end;
  gap: 16px;
  padding: 20px 6px 4px;
  flex: 1;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.podium-card {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  box-shadow: 0 10px 24px -14px rgba(28, 48, 24, 0.18);
  transition: transform 0.25s ease;
}

.podium-card .board-row__del {
  position: absolute;
  top: 6px;
  right: 6px;
}

.podium-card:hover .board-row__del {
  opacity: 1;
}

.podium-slot--1 .podium-card {
  background: linear-gradient(180deg, rgba(255, 253, 240, 0.96) 0%, rgba(242, 248, 224, 0.92) 100%);
  border-color: rgba(201, 154, 46, 0.42);
  box-shadow: 0 18px 34px -16px rgba(154, 122, 28, 0.28);
  padding: 20px 14px 16px;
}

.podium-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  color: var(--ink);
}

.podium-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.podium-pedestal {
  width: 100%;
  border-radius: 14px 14px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
}

.podium-slot--1 .podium-pedestal {
  height: 148px;
  background: linear-gradient(180deg, #d7ab42 0%, #b38520 100%);
}

.podium-slot--2 .podium-pedestal {
  height: 102px;
  background: linear-gradient(180deg, #95a2ad 0%, #6f7c87 100%);
}

.podium-slot--3 .podium-pedestal {
  height: 68px;
  background: linear-gradient(180deg, #c7814e 0%, #9b5d31 100%);
}

.podium-empty {
  opacity: 0.42;
}

/* Insights row on left bottom */
.insights-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.insight-card__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.active-chip__q {
  color: var(--accent-strong);
  font-weight: 700;
}

.hardest-q-text {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 8px;
}

.hardest-q-stat {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--wrong);
}

/* Right panel: Full leaderboard list */
.dash-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  max-height: calc(100vh - 205px);
  padding-right: 4px;
}

.board-list--two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px 10px;
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.board-row__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.board-row__pos {
  width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.board-row__name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-row__meta {
  font-size: 0.74rem;
  color: var(--ink-subtle);
}

.board-row__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.board-row__score {
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.board-row__del {
  background: none;
  border: none;
  color: var(--ink-subtle);
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.board-row:hover .board-row__del {
  opacity: 1;
}

.board-row__del:hover {
  color: var(--wrong);
  background: var(--wrong-bg);
}

.dash-sig {
  text-align: right;
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding-top: 2px;
}

/* Periodic Table Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(18, 26, 16, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  max-width: 1120px;
  max-height: 92vh;
  padding: 16px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-card__img {
  max-width: 100%;
  max-height: calc(92vh - 82px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Confetti overlay */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61, 154, 72, 0.2); }
  50%      { box-shadow: 0 0 0 7px rgba(61, 154, 72, 0.05); }
}

@media (max-width: 980px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .insights-row {
    grid-template-columns: 1fr;
  }
  .board-list {
    max-height: 460px;
  }
}

@media (hover: hover) {
  .option-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 8px 20px -12px rgba(45, 75, 38, 0.25);
  }
  .btn-primary:hover:not(:disabled) {
    background: #243320;
  }
}
