:root {
  --bg: #0f0f1a;
  --bg-2: #1a1a2e;
  --fg: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.65);
  --accent: #ff6b9d;
  --accent-2: #4ecdc4;
  --good: #6bff95;
  --bad: #ff6b6b;
  --card: rgba(20, 20, 35, 0.78);
  --card-border: rgba(255, 255, 255, 0.08);
  --glow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  --r: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-photo {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(1.3);
  transform: scale(1.15);
  transition: background-image 800ms ease;
  z-index: 0;
  opacity: 0.55;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(255, 107, 157, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(78, 205, 196, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(15, 15, 26, 0.35), rgba(15, 15, 26, 0.65));
  z-index: 1;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  width: 100%;
  max-width: 760px;
  animation: fadeUp 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.screen.hidden { display: none; }

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

/* HERO (start + end) */
.hero {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 56px 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--glow);
}

.hero-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 20px rgba(255, 107, 157, 0.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(48px, 9vw, 84px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ff6b9d 0%, #ffd93d 50%, #4ecdc4 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}

.tagline {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 120ms ease, background 200ms ease, opacity 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #ff6b9d, #ff4d8a);
  color: white;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 107, 157, 0.55); }

.btn-secondary {
  background: rgba(78, 205, 196, 0.18);
  color: #4ecdc4;
  border-color: rgba(78, 205, 196, 0.4);
}

.btn-secondary:hover { background: rgba(78, 205, 196, 0.3); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }

/* Category preview chips on start screen */
.categories-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.cat-chip {
  font-size: 13px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
}

/* Category intro */
.category-card {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 56px 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--glow);
}

.category-svg {
  margin: -8px auto 12px;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.4));
  animation: float 4s ease-in-out infinite;
}

.category-svg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-svg.hidden { display: none; }

.category-svg + .category-emoji { display: none; }

.category-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

.category-card h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.category-meta {
  color: var(--muted);
  margin-bottom: 32px;
}

/* Question screen */
.screen-question {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.q-cat {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.q-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

#qNum {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q-bar {
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.q-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.q-body {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 40px 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--glow);
  min-height: 280px;
  display: grid;
  gap: 32px;
}

.q-body.has-image {
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: start;
}

.q-image {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  aspect-ratio: 1 / 1;
}

.q-image.hidden { display: none; }

.q-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.q-image img.michal-photo {
  object-fit: cover;
}

.q-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.q-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.q-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

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

.q-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-size: clamp(15px, 1.6vw, 19px);
  text-align: left;
  font-family: inherit;
  color: var(--fg);
  width: 100%;
  transition: background 220ms ease, border-color 220ms ease, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.q-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.q-option.correct {
  background: linear-gradient(135deg, rgba(107, 255, 149, 0.22), rgba(107, 255, 149, 0.1));
  border-color: rgba(107, 255, 149, 0.7);
  color: var(--good);
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(107, 255, 149, 0.18);
}

.q-option.correct .q-option-letter {
  background: rgba(107, 255, 149, 0.4);
  color: var(--good);
}

/* Order question (drag list, but for this format we just show the list to be sorted on paper) */
.q-order-list {
  display: grid;
  gap: 8px;
}

.q-order-item {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 16px;
}

.q-order-correct {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.q-order-correct .q-order-item {
  background: rgba(107, 255, 149, 0.1);
  border-color: rgba(107, 255, 149, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
}

.q-order-correct .q-order-item .order-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(107, 255, 149, 0.25);
  color: var(--good);
  font-weight: 700;
  font-size: 12px;
}

.q-order-correct-heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--good);
  opacity: 0.85;
  margin-bottom: 4px;
}

.q-extra { margin-top: 16px; }

.q-extra a.video-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 107, 157, 0.12);
  color: #ff6b9d;
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}

.q-extra a.video-link:hover { background: rgba(255, 107, 157, 0.2); }

.q-answer {
  margin-top: 20px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(107, 255, 149, 0.1), rgba(78, 205, 196, 0.08));
  border: 1px solid rgba(107, 255, 149, 0.3);
  border-radius: 14px;
  color: var(--good);
}

.q-answer .answer-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--good);
  margin-bottom: 8px;
  opacity: 0.8;
}

.q-answer .answer-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.q-answer.hidden { display: none; }

.q-answer.open-note {
  background: rgba(255, 217, 61, 0.08);
  border-color: rgba(255, 217, 61, 0.3);
}

.q-answer.open-note .answer-label { color: #ffd93d; }

.q-footer {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.q-footer .btn { flex: 1; }
.q-footer .btn-ghost { flex: 0 0 auto; }

.screen-question { max-width: 1080px; }

@media (max-width: 720px) {
  .q-body.has-image {
    grid-template-columns: 1fr;
  }
  .q-image {
    aspect-ratio: 16 / 9;
    max-height: 280px;
  }
}

@media (max-width: 540px) {
  #app { padding: 16px; }
  .hero, .category-card { padding: 40px 22px; }
  .q-body { padding: 28px 20px; gap: 20px; }
  .q-footer { flex-wrap: wrap; gap: 8px; }
  .q-footer .btn { font-size: 14px; padding: 12px 14px; flex: 1 1 calc(50% - 4px); }
  .q-footer .btn-ghost { flex: 1 1 100%; order: 99; }
  .hero h1 { font-size: 56px; }
  .category-card h2 { font-size: 36px; }
  .category-svg { width: 130px; height: 130px; }
}

/* Larger screens — host on projector */
@media (min-width: 1200px) {
  .screen-question { max-width: 1180px; }
  .q-body { padding: 56px 48px; }
  .q-image { max-width: 320px; }
}
