:root {
  --p1: #0066ff;
  --p2: #8b5cf6;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #111827;
  --border-light: #e5e7eb;
}
[data-theme="dark"] {
  --bg: #0f1724;
  --card: #1e293b;
  --text: #f1f5f9;
  --border-light: #334155;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding-bottom: 90px;
  transition: background 0.2s, color 0.2s;
}
.container{max-width:1100px;margin:auto;padding:16px;}
.header{display:flex;justify-content:space-between;align-items:center;background:var(--card);padding:16px;border-radius:24px;box-shadow:0 6px 14px rgba(0,0,0,0.05);flex-wrap:wrap;gap:10px;border:1px solid var(--border-light);}
.brand-badge{background:linear-gradient(135deg,var(--p1),var(--p2));color:white;padding:6px 16px;border-radius:40px;font-weight:bold;}
.title-text{font-weight:800;font-size:18px;}
.question{
  font-size:1.2rem;
  line-height:1.5;
  font-weight:500;
  margin:20px 0;
  text-align: left;
  overflow-x: auto;
  padding: 8px 4px;
  background: var(--bg);
  border-radius: 16px;
}
.options{display:flex;flex-direction:column;gap:12px;margin-bottom:90px;}
.option{padding:14px 16px;border:1px solid var(--border-light);border-radius:18px;cursor:pointer;background:var(--card);transition:0.2s;font-weight:500;}
.option.selected{background:linear-gradient(95deg,var(--p1),var(--p2));color:white;border:none;}
.navigation{position:fixed;bottom:0;left:0;right:0;background:var(--card);display:flex;gap:12px;padding:12px 20px;z-index:10;border-top:1px solid var(--border-light);}
.navigation button{flex:1;border:none;border-radius:60px;padding:12px;font-weight:bold;cursor:pointer;}
.prev{background:#475569;color:white;}
.next{background:linear-gradient(90deg,var(--p1),var(--p2));color:white;}
.submit{background:#10b981;color:white;}
.bookmark-btn{background:var(--card);border:1.5px solid var(--border-light);padding:8px 18px;border-radius:40px;cursor:pointer;margin-bottom:6px;}
.bookmark-btn.active{background:#facc15;border-color:#eab308;}
.palette-fab{position:fixed;right:20px;bottom:100px;width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,var(--p1),var(--p2));color:white;display:flex;align-items:center;justify-content:center;font-size:26px;cursor:pointer;box-shadow:0 8px 22px rgba(0,0,0,0.25);z-index:20;}
.palette-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.6);display:none;z-index:99;backdrop-filter:blur(2px);}
.question-palette{position:fixed;right:-100%;top:0;width:400px;max-width:88%;height:100%;background:var(--card);transition:right 0.3s;z-index:100;display:flex;flex-direction:column;border-radius:28px 0 0 28px;}
.question-palette.active{right:0;}
.palette-header{padding:18px;background:linear-gradient(95deg,var(--p1),var(--p2));color:white;display:flex;justify-content:space-between;align-items:center;}
.palette-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;padding:20px;overflow-y:auto;}
.palette-btn{padding:12px 0;border-radius:16px;border:none;background:#eef2ff;cursor:pointer;font-weight:bold;}
.palette-btn.current{background:var(--p1);color:white;}
.palette-btn.answered{background:#10b981;color:white;}
.palette-btn.bookmarked::after{content:"📌";margin-left:4px;}
.result-section{background:var(--card);padding:20px;border-radius:24px;margin-top:20px;}
.correct{background:#d1fae5;border-color:#10b981;}
.wrong{background:#ffe4e2;border-color:#f97316;}
#timer{font-family:monospace;background:rgba(0,0,0,0.05);padding:4px 12px;border-radius:40px;}
@media(max-width:600px){
  .palette-grid{grid-template-columns:repeat(5,1fr);}
  .question{font-size:1rem;}
}

/* WordPress theme integration */
.gp-quiz-wrap .container { max-width: 1100px; margin: 0 auto; }
body.page-template-page-quiz-chemistry .footer { margin-top: 40px; }
body.page-template-page-quiz-chemistry .navigation {
  z-index: 100;
}
body.page-template-page-quiz-chemistry .palette-fab {
  z-index: 101;
}

/* Shortcode embed: contain fixed nav inside wrapper on wide layouts */
.gp-quiz-shortcode {
  position: relative;
  margin: 24px 0 100px;
}
.gp-quiz-shortcode .navigation {
  /* keep fixed for usability; offset if theme header is sticky */
  z-index: 90;
}
.entry-content .gp-quiz-shortcode .container {
  padding: 0;
}
