:root {
  --pg-black: #0b0b0c;
  --pg-black-soft: #17171a;
  --pg-panel: #1f1f23;
  --pg-gold: #cda44e;
  --pg-gold-light: #eccd82;
  --pg-gold-dark: #8f7130;
  --pg-cream: #f6f2e8;
  --pg-white: #ffffff;
  --pg-muted: #9c9c9c;
  --radius: 18px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--pg-black);
  color: var(--pg-cream);
  font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.pg-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #111113 0%, #0b0b0c 100%);
  border-bottom: 2px solid var(--pg-gold);
}

.pg-monogram {
  height: 44px;
  width: auto;
  display: block;
}

.pg-hero-logo {
  height: 92px;
  width: auto;
  margin: 0 auto 18px;
  display: block;
}

.pg-wordmark {
  line-height: 1.1;
}

.pg-wordmark .name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pg-white);
}

.pg-wordmark .tagline {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--pg-gold);
  text-transform: uppercase;
  font-weight: 600;
}

.pg-header .quiz-title {
  margin-left: auto;
  text-align: right;
  font-weight: 800;
  color: var(--pg-gold-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

h1 {
  font-size: 2.4rem;
  font-weight: 900;
  margin: 0 0 8px;
  color: var(--pg-white);
  letter-spacing: 0.5px;
}

h2 {
  font-weight: 800;
  color: var(--pg-gold-light);
  margin: 0 0 18px;
  letter-spacing: 0.5px;
}

p.lede {
  color: #cfc9b8;
  max-width: 560px;
  line-height: 1.5;
}

.pg-btn {
  border: none;
  cursor: pointer;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--pg-gold-light), var(--pg-gold-dark));
  color: var(--pg-black);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(205, 164, 78, 0.25);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.pg-btn:hover:not(:disabled) { transform: translateY(-2px); }

.pg-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.pg-btn.secondary {
  background: transparent;
  color: var(--pg-gold-light);
  border: 2px solid var(--pg-gold-dark);
  box-shadow: none;
}

.pg-btn.danger {
  background: transparent;
  color: var(--pg-muted);
  border: 2px solid #3a3a3f;
  box-shadow: none;
}

input[type="text"] {
  font-size: 1.1rem;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--pg-gold-dark);
  background: var(--pg-black-soft);
  color: var(--pg-white);
  width: 100%;
  max-width: 340px;
  outline: none;
}

input[type="text"]:focus { border-color: var(--pg-gold-light); }

.pg-card {
  background: var(--pg-panel);
  border: 1px solid #2c2c31;
  border-radius: var(--radius);
  padding: 22px;
}

.timer-ring {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
}

.timer-ring svg { transform: rotate(-90deg); }

.timer-ring circle {
  fill: none;
  stroke-width: 8;
}

.timer-ring .bg { stroke: #2c2c31; }
.timer-ring .fg {
  stroke: var(--pg-gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--pg-white);
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 760px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .options-grid { grid-template-columns: 1fr; }
}

.opt {
  border-radius: 14px;
  padding: 16px 18px;
  min-height: 56px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pg-cream);
  background: var(--pg-panel);
  border: 2px solid #303035;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: transform 0.12s ease, opacity 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.opt:active:not(:disabled) { transform: scale(0.97); }
.opt:disabled { cursor: default; }
.opt.dim { opacity: 0.35; }

.opt .opt-letter {
  min-width: 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pg-gold-light), var(--pg-gold-dark));
  color: var(--pg-black);
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.opt.selected {
  border-color: var(--pg-gold-light);
  background: linear-gradient(135deg, var(--pg-gold-light), var(--pg-gold));
  color: var(--pg-black);
  box-shadow: 0 0 0 3px var(--pg-gold-light), 0 8px 20px rgba(205, 164, 78, 0.45);
}

.opt.selected .opt-letter {
  background: var(--pg-black);
  color: var(--pg-gold-light);
}

.opt.correct {
  border-color: var(--pg-gold-light);
  background: linear-gradient(135deg, rgba(205, 164, 78, 0.28), rgba(205, 164, 78, 0.08));
  box-shadow: 0 0 0 2px var(--pg-gold-light) inset;
}

.opt.wrong {
  opacity: 0.4;
}

.opt.wrong .opt-letter {
  background: #3a3a3f;
  color: #8f8f8f;
}

.badge {
  display: inline-block;
  background: var(--pg-black-soft);
  border: 1px solid var(--pg-gold-dark);
  color: var(--pg-gold-light);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.leaderboard {
  width: 100%;
  max-width: 640px;
  text-align: left;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.lb-rank {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pg-black-soft);
  border: 2px solid var(--pg-gold-dark);
  color: var(--pg-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.lb-row.top1 .lb-rank { background: var(--pg-gold); color: var(--pg-black); border-color: var(--pg-gold-light); }
.lb-row.top2 .lb-rank { background: #a9a9a9; color: var(--pg-black); border-color: #d4d4d4; }
.lb-row.top3 .lb-rank { background: #a6702f; color: var(--pg-black); border-color: #cc9152; }

.lb-bar-wrap {
  flex: 1;
  background: var(--pg-black-soft);
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
  position: relative;
}

.lb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pg-gold-dark), var(--pg-gold-light));
  border-radius: 8px 0 0 8px;
}

.lb-label {
  position: absolute;
  left: 12px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--pg-black);
  font-size: 0.9rem;
  mix-blend-mode: normal;
}

.lb-score {
  min-width: 60px;
  text-align: right;
  font-weight: 800;
  color: var(--pg-gold-light);
}

.pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.join-url {
  font-family: "Courier New", monospace;
  font-size: 1.3rem;
  color: var(--pg-gold-light);
  background: var(--pg-black-soft);
  border: 1px dashed var(--pg-gold-dark);
  padding: 10px 18px;
  border-radius: 10px;
  margin: 14px 0;
  word-break: break-all;
}

footer.pg-footer {
  text-align: center;
  padding: 10px;
  font-size: 0.75rem;
  color: #6b6b6b;
}
