* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: #0e0e11; color: #e9e9ef; overflow: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  touch-action: none; overscroll-behavior: none;
}
.app-root { width: 100%; height: 100svh; position: relative; display: flex; flex-direction: column; }
.safe-top-spacer { height: 24px; }
.safe-bottom-spacer { height: 18px; }

h1,h2 { margin: 0 0 10px; }

/* Splash */
.splash { position: absolute; inset: 0; display: none; }
.splash.show { display: block; }
.splash-img {
  position: absolute; inset: 0;
  background-image: url('https://upload.wikimedia.org/wikipedia/commons/0/05/Diego_Vel%C3%A1zquez_-_Cristo_crucificado_-_Museo_del_Prado.jpg');
  background-size: cover; background-position: center;
  filter: saturate(1) contrast(1) brightness(.85);
}
.splash-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.75));
  display: grid; place-content: center; text-align: center; padding: 24px;
}
.splash-overlay h1 { font-size: clamp(22px, 4vw, 42px); letter-spacing: .2px; }
.splash-overlay p { opacity: .9; margin: 6px 0 16px; font-size: clamp(14px, 2.2vw, 18px); }
.splash-credit { position: absolute; bottom: 10px; left: 12px; right: 12px; font-size: 12px; opacity: .7; text-align: center; }

.btn {
  background: #4f46e5; color: white; border: 0; border-radius: 14px; padding: 10px 16px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(79,70,229,.45);
}
.btn.primary { font-size: 16px; }
.btn.outline { background: transparent; border: 1px solid #7c7c88; color: #e9e9ef; }

.icon-btn { background: transparent; border: 1px solid #3a3a47; color: #e9e9ef; border-radius: 12px; padding: 6px 8px; }

/* HUD */
.hud {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 8px 12px; position: relative;
}
.hud .pill { background: #17171c; border: 1px solid #262630; border-radius: 999px; padding: 6px 10px; font-weight: 700; }
.hud-left, .hud-right { display: flex; gap: 8px; align-items: center; }
.hud-center { justify-self: center; display: flex; gap: 10px; align-items: center; font-size: 14px; opacity: .9; }
.hud-center a { color: #c3c3ff; text-decoration: none; }
.hud-center .dot { opacity: .6; }

/* Category Bar */
.category-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px 0; opacity: .95; }
.category-bar select {
  background: #17171c; color: #e9e9ef; border: 1px solid #3a3a47; border-radius: 10px; padding: 6px 10px;
}

/* Card */
.card {
  margin: 10px 12px; background: #101015; border: 1px solid #272732; border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 16px; flex: 1; display: flex; flex-direction: column;
}
.prompt { font-size: clamp(18px, 2.6vw, 22px); line-height: 1.35; margin-bottom: 12px; }
.choices { display: grid; gap: 10px; margin-top: auto; padding-bottom: 6px; }
.choice {
  display: flex; gap: 10px; align-items: center; padding: 12px;
  border-radius: 14px;
  background: #f2f2f5; /* light grey-white */
  color: #111;
  border: 1px solid #ccc;
  cursor: pointer; user-select: none;
  transition: transform .04s ease, border-color .15s ease, background .15s ease;
}
.choice:hover { transform: translateY(-1px); border-color: #3a3a47; }
.choice.correct { background: #103618; border-color: #1e7b33; }
.choice.wrong { background: #3a0f11; border-color: #6b2a2f; }

/* CTA Dock */
.cta-dock {
  padding: 10px 12px 12px; position: relative;
}
.cta-btn {
  display: block; width: 100%; text-align: center; font-weight: 800; letter-spacing: .2px;
  padding: 12px 16px; border-radius: 16px; text-decoration: none;
  background: #f8fafc; color: #0f172a; border: 2px solid #0f172a;
  box-shadow: 0 8px 24px rgba(248,250,252,.2), inset 0 -2px 0 rgba(0,0,0,.2);
}

/* Modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(10,10,14,.72); }
.modal.show { display: flex; }
.modal-content {
  width: min(520px, 92vw); background: #0f0f14; border: 1px solid #3a3a47; border-radius: 18px; padding: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* No scroll/jitter */
.app-root, .card, .choices { overflow: hidden; }
