/* ── Font ── */
@font-face {
  font-family: 'Lexend';
  src: url('lexend-variable.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
body {
  font-family: 'Lexend', system-ui, -apple-system, sans-serif;
  background: #eadea9;
  color: #3a3226;
  line-height: 1.6;
  scrollbar-gutter: stable;
}

h1,
button,
.level-tab,
.paper-title,
.category-name,
.topic-checkbox {
  -webkit-user-select: none;
  user-select: none;
}

.screen {
  min-height: 100vh;
  padding: 2rem;
}

/* ── Selection Screen ── */
#selection-screen {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 0;
}

/* Sticky header */
.selection-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eadea9;
  padding: 1.5rem 0 1rem;
}

.selection-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

h1 {
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
  color: #4a6741;
}

/* Level tabs */
.level-tabs {
  display: flex;
}

.level-tab {
  padding: 0.65rem 2rem;
  border: 2px solid #5b7a52;
  background: transparent;
  color: #5b7a52;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.level-tab:first-child {
  border-radius: 8px 0 0 8px;
}

.level-tab:last-child {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

.level-tab.active {
  background: #5b7a52;
  color: #f5f0d0;
  box-shadow: 0 2px 8px rgba(91, 122, 82, 0.3);
}

.level-tab:hover:not(.active) {
  background: rgba(91, 122, 82, 0.1);
}

/* Topic controls */
.topic-controls {
  display: flex;
  gap: 0.5rem;
}

.topic-controls button {
  padding: 0.6rem 1.2rem;
  background: #d8cd85;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  color: #5a4f2e;
  transition: background 0.2s, transform 0.1s;
}

.topic-controls button:hover {
  background: #c9bc6e;
  transform: translateY(-1px);
}

.topic-controls button:active {
  transform: translateY(0);
}

/* Category groups */
.category-group {
  margin-bottom: 1.25rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #c9bc7d;
  margin-bottom: 0.35rem;
}

.category-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #4a6741;
}

.category-toggle {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid #b5a86a;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  color: #6b5f3a;
  transition: background 0.2s;
}

.category-toggle:hover {
  background: rgba(91, 122, 82, 0.08);
}

/* Topic checkboxes */
.topic-checkbox {
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem; 
  border-radius: 8px; 
  cursor: pointer;
  transition: background 0.15s ease;
}

.topic-checkbox:hover {
  background: rgba(91, 122, 82, 0.08); 
}

.topic-checkbox span {
  font-size: 0.95rem;
  line-height: 1.4;
}

.topic-checkbox input[type="checkbox"] {
  accent-color: #5b7a52;
  width: 24px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Start button */
#start-btn {
  margin-left: auto;
  padding: 0.55rem 2rem;
  background: #5b7a52;
  color: #f5f0d0;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(91, 122, 82, 0.25);
}

#start-btn:hover:not(:disabled) {
  background: #4a6741;
  box-shadow: 0 4px 12px rgba(91, 122, 82, 0.35);
  transform: translateY(-1px);
}

#start-btn:active:not(:disabled) {
  transform: translateY(0);
}

#start-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Paper columns layout */
.paper-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .paper-columns {
    grid-template-columns: 1fr 1fr;
    gap: 0 2.5rem;
  }
}

.paper-column {
  min-width: 0;
}

.paper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(91, 122, 82, 0.12);
  border-radius: 8px;
  border: 1px solid rgba(91, 122, 82, 0.2);
}

.paper-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #4a6741;
  letter-spacing: 0.01em;
}

.paper-toggle {
  padding: 0.35rem 0.9rem;
  background: #5b7a52;
  color: #f5f0d0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.paper-toggle:hover {
  background: #4a6741;
  transform: translateY(-1px);
}

.paper-toggle:active {
  transform: translateY(0);
}

/* ── Presentation Screen ── */
#presentation-screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  cursor: pointer;
  padding: 3.5rem 3vw 4rem;
  user-select: none;
  min-height: 100vh;
}

/* Close button */
.close-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  background: #d8cd85;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a4f2e;
  transition: background 0.2s, transform 0.15s;
}

.close-btn:hover {
  background: #c9bc6e;
  transform: scale(1.08);
}

/* Slide content */
#slide-content {
  width: 100%;
}

.slide-title {
  font-size: clamp(2.2rem, 6vh, 3.5rem);
  margin-bottom: 2rem;
  color: #4a6741;
}

/* Questions overview — sized to fit viewport without scroll */
.question-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid #d8cd85;
  font-size: clamp(1.3rem, 4.5vh, 2.2rem);
  line-height: 1.5;
}

.question-item:last-child {
  border-bottom: none;
}

.question-number {
  font-weight: 700;
  color: #5b7a52;
  margin-right: 0.4rem;
}

/* Q+A reveal slides — maximally large for projectors */
.reveal-question {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-weight: 600;
}

.reveal-answer {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  line-height: 1.7;
  padding: 1.5rem 2rem;
  background: #f2ebc4;
  border-radius: 12px;
  white-space: pre-line;
  border: 1px solid #d8cd85;
}

/* Nav arrows */
.nav-arrows {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  display: flex;
  gap: 0.4rem;
  z-index: 10;
}

.nav-btn {
  width: 44px;
  height: 44px;
  background: #d8cd85;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a4f2e;
  transition: background 0.2s, transform 0.15s;
}

.nav-btn:hover:not(:disabled) {
  background: #c9bc6e;
  transform: scale(1.08);
}

.nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Slide indicator */
#slide-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-size: 0.85rem;
  color: #8a7e5e;
  z-index: 10;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #8a7e5e;
  font-size: 1rem;
}
