/* PPSC Quiz Competition — clean, phone-first, blog-family styling. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #f2f6f2; color: #1d2b1d;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 12px; }
.urdu { font-family: "Noto Nastaliq Urdu", "Segoe UI", sans-serif; }
.muted { color: #5a6b5a; }
.small { font-size: 0.85em; }
.err { color: #b3261e; font-weight: 600; }

.site-head { background: #14532d; color: #fff; padding: 14px 0; margin-bottom: 14px; }
.brand { font-size: 1.35rem; font-weight: 700; }
.brand-sub { opacity: 0.9; font-size: 0.95rem; }

.fairplay {
  background: #fff8e1; border: 1px solid #e3c565; border-left: 6px solid #d9a400;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 0.95rem;
}
.fairplay-ur { margin-top: 4px; color: #6b5510; }

.card {
  background: #fff; border: 1px solid #d8e2d8; border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(20, 60, 20, 0.05);
}
.card h2 { margin: 0 0 8px; font-size: 1.15rem; color: #14532d; }

label { display: block; margin: 10px 0; font-weight: 600; font-size: 0.95rem; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 11px;
  border: 1px solid #b9c9b9; border-radius: 8px; font-size: 1rem; background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  appearance: none; border: 1px solid #14532d; background: #fff; color: #14532d;
  border-radius: 8px; padding: 11px 16px; font-size: 1rem; font-weight: 600; cursor: pointer;
  min-height: 46px;
}
.btn.primary { background: #1c7a3f; border-color: #1c7a3f; color: #fff; }
.btn.ghost { border-color: #c3d2c3; color: #5a6b5a; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn:active { transform: translateY(1px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.body-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 10px 12px; min-height: 52px;
  background: #fff; border: 2px solid #c3d2c3; border-radius: 10px; cursor: pointer;
  font: inherit; color: inherit;
}
.body-btn.sel { border-color: #1c7a3f; background: #eef7f0; }
.body-btn:active { transform: translateY(1px); }
.btn-row.between { justify-content: space-between; }

.tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tab {
  border: 1px solid #b9c9b9; background: #eef4ee; border-radius: 999px;
  padding: 7px 14px; font-weight: 600; cursor: pointer;
}
.tab.active { background: #14532d; color: #fff; border-color: #14532d; }

.target-row {
  background: #eaf3ff; border: 1px dashed #4a7dbb; border-radius: 8px;
  padding: 9px 11px; margin-bottom: 10px;
}
.empty {
  background: #eef7ee; border: 1px dashed #7ba87b; border-radius: 8px; padding: 10px 12px;
}

table.board { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.board th, table.board td { padding: 7px 6px; border-bottom: 1px solid #e2eae2; text-align: left; }
table.board th { color: #14532d; }
.rank-badge {
  display: inline-block; min-width: 28px; text-align: center; font-weight: 700;
  background: #e7f2e7; border-radius: 6px; padding: 2px 6px;
}
tr.top1 td { background: #fffbe8; font-weight: 600; }

.quiz-head { position: sticky; top: 0; z-index: 5; }
.quiz-meta { display: flex; justify-content: space-between; font-weight: 600; color: #14532d; }
.timer { font-size: 1.6rem; font-weight: 800; text-align: center; color: #14532d; }
.timer.low { color: #b3261e; }
.bar { height: 8px; background: #e2eae2; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar-fill { height: 100%; background: #1c7a3f; width: 100%; transition: width 1s linear; }

.q-text { font-size: 1.08rem; font-weight: 600; margin-bottom: 12px; overflow-wrap: break-word; }
.opt {
  display: block; width: 100%; text-align: left; margin: 8px 0; padding: 12px;
  border: 1px solid #b9c9b9; border-radius: 8px; background: #fbfdfb; cursor: pointer;
  font-size: 1rem; min-height: 48px;
}
.opt .letter { font-weight: 800; color: #14532d; margin-right: 8px; }
.opt.sel { background: #dff0df; border-color: #1c7a3f; border-width: 2px; }

.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.pal {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid #b9c9b9;
  background: #fff; font-weight: 600; cursor: pointer;
}
.pal.done { background: #1c7a3f; color: #fff; border-color: #1c7a3f; }
.pal.cur { outline: 3px solid #d9a400; }

.result-card { text-align: center; }
.result-pct { font-size: 3rem; font-weight: 800; color: #14532d; }
.result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.result-grid div { background: #f2f6f2; border-radius: 8px; padding: 8px 4px; }
.result-grid span { display: block; font-size: 1.25rem; font-weight: 700; }
.result-grid label { margin: 0; font-size: 0.75rem; color: #5a6b5a; font-weight: 600; }
.result-card .btn-row { justify-content: center; }

.hist-item { border-bottom: 1px solid #e2eae2; padding: 8px 0; }
.hist-item .muted { font-size: 0.85rem; }

.site-foot { text-align: center; padding: 10px 0 26px; }

.sched-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-bottom: 1px solid #e2eae2; padding: 8px 0; }

@media (max-width: 480px) {
  .row2 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  table.board { font-size: 0.88rem; }
  .brand { font-size: 1.2rem; }
}
