/* =========================================================================
   PMTECH QUIZ PLAY UI — PIXEL PERFECT MATCH TO MOBILE DESIGN SPEC
   ========================================================================= */

:root {
  --pm-primary: #0c3c60;
  --pm-primary-dark: #082842;
  --pm-green: #00aa55;
  --pm-green-dark: #008f47;
  --pm-green-light: #eaf8e7;
  --pm-green-badge-bg: #eaf7e6;
  --pm-green-badge-txt: #00aa55;
  --pm-blue-badge-bg: #e8f3fe;
  --pm-blue-badge-txt: #0c3c60;
  --pm-bg: #ffffff;
  --pm-card: #ffffff;
  --pm-border: #e2e8f0;
  --pm-card-shadow: 0 4px 18px rgba(12, 60, 96, 0.06);
  --pm-text: #0f172a;
  --pm-muted: #64748b;
  --pm-radius-card: 20px;
  --pm-radius-pill: 999px;
  --font-family: 'Almarai', 'Cairo', system-ui, -apple-system, sans-serif;
}

html:has(body.quiz-play-theme),
body.quiz-play-theme {
  background: #f8fafc !important;
  color: var(--pm-text) !important;
  font-family: var(--font-family) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y !important;
  user-select: auto !important;
  -webkit-user-select: auto !important;
}

body.quiz-play-theme * {
  font-family: 'Almarai', 'Cairo', sans-serif;
}

body.quiz-play-theme .pm-app-screen {
  display: flex !important;
  justify-content: center !important;
  padding: clamp(8px, 3vw, 16px) clamp(10px, 3.5vw, 18px) 140px !important;
  overflow-y: visible !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  touch-action: pan-y !important;
  box-sizing: border-box !important;
}

body.quiz-play-theme .pm-quiz-wrapper {
  width: 100% !important;
  max-width: 480px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(10px, 2.8vw, 16px) !important;
  margin: 0 auto !important;
}

button, .pm-choice-card, .pm-green-action-btn, .pm-next-btn, .pm-tool-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================================
   1. MOBILE APP HEADER (MATCHING THE HUB SPEC)
   ========================================================================= */
.mobile-app-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 70 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  margin: 0 0 8px 0 !important;
  padding: 0 4px !important;
  border-bottom: 1px solid rgba(226, 237, 247, 0.88) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 2px 10px rgba(12, 60, 96, 0.05) !important;
  backdrop-filter: blur(12px) !important;
  box-sizing: border-box !important;
}

.mobile-app-menu {
  position: relative !important;
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-app-menu summary {
  list-style: none !important;
  outline: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mobile-app-menu summary::-webkit-details-marker,
.mobile-app-menu summary::marker {
  display: none !important;
}

.mobile-app-header-action svg {
  width: 24px !important;
  height: 24px !important;
  stroke: #0c3c60 !important;
  fill: none !important;
  stroke-width: 2.2 !important;
}

.mobile-app-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  height: 42px !important;
}

.mobile-app-brand img {
  max-width: 160px !important;
  max-height: 38px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

.mobile-app-header-spacer {
  width: 42px !important;
  height: 42px !important;
  display: block !important;
}

.mobile-app-menu-panel {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  z-index: 100 !important;
  width: 230px !important;
  padding: 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 36px rgba(12, 60, 96, 0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.mobile-app-menu-panel a {
  display: block !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  text-decoration: none !important;
  border-radius: 10px !important;
  transition: background 0.15s !important;
}

.mobile-app-menu-panel a:hover {
  background: #f1f5f9 !important;
  color: #0c3c60 !important;
}

/* Hide desktop navbar on mobile screens */
@media (max-width: 991px) {
  .pm-desktop-navbar,
  .hub-desktop-only {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-app-header,
  .hub-mobile-only {
    display: none !important;
  }
}

.pm-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: right;
}

.pm-logo-brand {
  font-size: 20px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  letter-spacing: 0.5px;
}

.pm-logo-brand em {
  font-style: italic;
  color: var(--pm-primary);
}

.pm-logo-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--pm-primary-dark);
  opacity: 0.85;
}

/* =========================================================================
   2. USER & SCORE CARD
   ========================================================================= */
.pm-user-score-card {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-card);
  box-shadow: var(--pm-card-shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fafd 100%);
}

.pm-user-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pm-user-avatar-circle {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: #e0eefc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-user-avatar-circle svg {
  width: 28px;
  height: 28px;
}

.pm-user-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pm-welcome-txt {
  font-size: 13px;
  color: var(--pm-muted);
  font-weight: 600;
}

.pm-user-fullname {
  font-size: 18px;
  font-weight: 800;
  color: var(--pm-primary-dark);
  line-height: 1.25;
}

.pm-user-status-txt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--pm-muted);
  font-weight: 600;
  margin-top: 1px;
}

.pm-status-leaf {
  width: 14px;
  height: 14px;
}

.pm-card-divider {
  width: 1px;
  height: 52px;
  background: #e6edf5;
}

.pm-score-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  justify-content: flex-end;
}

.pm-trophy-svg {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-trophy-svg svg {
  width: 34px;
  height: 34px;
}

.pm-score-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.pm-score-digit {
  font-size: 24px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  letter-spacing: -0.5px;
}

.pm-score-txt {
  font-size: 12px;
  font-weight: 700;
  color: var(--pm-muted);
}

/* =========================================================================
   3. CATEGORY & QUESTION META PILLS ROW
   ========================================================================= */
.pm-meta-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: nowrap;
}

.pm-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pm-green-badge-bg);
  color: var(--pm-green-badge-txt);
  border-radius: var(--pm-radius-pill);
  padding: 5px 10px;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 800;
  white-space: nowrap;
}

.pm-badge-leaf {
  width: 14px;
  height: 14px;
}

.pm-points-value-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #b45309;
  border-radius: var(--pm-radius-pill);
  padding: 5px 10px;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid #fde68a;
}

.pm-points-value-badge svg {
  width: 14px;
  height: 14px;
  color: #d97706;
}

.pm-question-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #edf4fc;
  color: var(--pm-primary-dark);
  border-radius: var(--pm-radius-pill);
  padding: 5px 10px;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 800;
  white-space: nowrap;
}

.pm-question-counter-badge svg {
  width: 14px;
  height: 14px;
  color: var(--pm-primary);
}

/* =========================================================================
   4. PROGRESS TRACK & COUNTDOWN TIMER
   ========================================================================= */
.pm-progress-timer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-bar-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-track {
  flex: 1;
  height: 10px;
  background: #e2ebf5;
  border-radius: var(--pm-radius-pill);
  overflow: hidden;
}

.pm-fill {
  height: 100%;
  background: var(--pm-green);
  border-radius: var(--pm-radius-pill);
  transition: width 0.4s ease;
}

.pm-pct-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--pm-muted);
  min-width: 32px;
}

.pm-circular-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pm-card);
  border: 2.5px solid var(--pm-green);
  border-radius: var(--pm-radius-pill);
  padding: 5px 14px;
  color: var(--pm-primary-dark);
  font-weight: 900;
  font-size: 15px;
  min-width: 88px;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(86, 185, 55, 0.12);
  transition: border-color .3s;
}

.pm-circular-timer-pill svg {
  width: 18px;
  height: 18px;
  color: var(--pm-primary-dark);
}

.pm-circular-timer-pill.is-warning {
  border-color: #f59e0b;
}

.pm-circular-timer-pill.is-danger {
  border-color: #ef4444;
  color: #ef4444;
}
.pm-circular-timer-pill.is-danger svg {
  color: #ef4444;
}

/* =========================================================================
   5. QUESTION TEXT HEADING
   ========================================================================= */
.pm-question-section {
  padding: 4px 2px;
  text-align: center;
}

.pm-question-heading {
  font-size: clamp(16px, 4.8vw, 20px);
  font-weight: 800;
  color: var(--pm-primary-dark);
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

/* =========================================================================
   6. OPTIONS LIST (4 Cards)
   ========================================================================= */
.pm-options-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-choice-card {
  width: 100% !important;
  min-height: 56px !important;
  background: var(--pm-card) !important;
  border: 1.5px solid var(--pm-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 6px rgba(12, 60, 96, 0.04) !important;
  padding: 10px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  cursor: pointer !important;
  text-align: right !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.pm-choice-card:hover:not(:disabled) {
  border-color: #94a3b8 !important;
  transform: translateY(-1px) !important;
}

.pm-choice-text {
  flex: 1 !important;
  font-size: clamp(14px, 4vw, 16px) !important;
  font-weight: 700 !important;
  color: var(--pm-text) !important;
  line-height: 1.45 !important;
  text-align: right !important;
  word-break: break-word !important;
}

.pm-choice-badge {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  color: #0c3c60 !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

/* Selected item */
.pm-choice-card.selected {
  border-color: var(--pm-green) !important;
  background: #f0fdf4 !important;
  box-shadow: 0 4px 14px rgba(0, 170, 85, 0.15) !important;
}

.pm-choice-card.selected .pm-choice-badge {
  background: var(--pm-green) !important;
  color: #ffffff !important;
}

/* Correct state */
.pm-choice-card.is-correct {
  border-color: var(--pm-green) !important;
  background: #f0fdf4 !important;
}

.pm-choice-card.is-correct .pm-choice-badge {
  background: var(--pm-green) !important;
  color: #ffffff !important;
}

/* Wrong state */
.pm-choice-card.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.pm-choice-card.is-wrong .pm-choice-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.pm-choice-card.is-hidden {
  opacity: 0.18;
  pointer-events: none;
}

/* =========================================================================
   7. LIFELINES TOOLS (3 CARDS IN A ROW)
   ========================================================================= */
.pm-tools-three-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.pm-tool-item {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  box-shadow: var(--pm-card-shadow);
  padding: 8px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  border: none;
  min-width: 0;
}

.pm-tool-item:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 63, 115, 0.08);
}

.pm-tool-item.is-used {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(1);
}

.pm-tool-icon-circle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-tool-icon-circle svg {
  width: 18px;
  height: 18px;
}

.pm-ico-blue {
  background: #eef6fe;
  color: #1D4F91;
}

.pm-ico-cyan {
  background: #e8f7fa;
  color: #0284c7;
}

.pm-ico-green {
  background: #edf9ec;
  color: #56B937;
}

.pm-tool-label-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}

.pm-tool-name {
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 800;
  color: var(--pm-primary-dark);
  white-space: nowrap;
}

.pm-tool-desc {
  font-size: clamp(9px, 2.5vw, 10.5px);
  color: var(--pm-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================================
   8. MAIN GREEN SUBMIT CTA
   ========================================================================= */
.pm-submit-btn-row {
  margin-top: 4px;
}

.pm-green-action-btn {
  width: 100%;
  height: 56px;
  border: none;
  background: var(--pm-green);
  color: #ffffff;
  border-radius: var(--pm-radius-pill);
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(86, 185, 55, 0.28);
  transition: all 0.22s ease;
}

.pm-green-action-btn:hover:not(:disabled) {
  background: var(--pm-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(86, 185, 55, 0.35);
}

.pm-green-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pm-cta-arrow {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

.pm-green-action-btn:hover:not(:disabled) .pm-cta-arrow {
  transform: translateX(-4px);
}

/* =========================================================================
   FEEDBACK RESULT BOX
   ========================================================================= */
.pm-feedback-card {
  background: var(--pm-card);
  border: 2px solid var(--pm-green);
  border-radius: 18px;
  box-shadow: var(--pm-card-shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: pmPop 0.25s ease;
}

.pm-feedback-card.is-wrong {
  border-color: #ef4444;
}

.pm-fb-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pm-fb-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: #edf9ec;
  color: var(--pm-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-fb-icon svg {
  width: 20px;
  height: 20px;
}

.pm-feedback-card.is-wrong .pm-fb-icon {
  background: #fef2f2;
  color: #ef4444;
}

.pm-fb-text strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--pm-primary-dark);
  margin-bottom: 2px;
}

.pm-fb-text p {
  font-size: 13px;
  color: var(--pm-muted);
  line-height: 1.4;
  margin: 0;
}

.pm-next-btn {
  width: 100%;
  height: 46px;
  border: none;
  background: var(--pm-primary);
  color: #ffffff;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.pm-next-btn:hover {
  background: var(--pm-primary-dark);
}

.pm-next-btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================================================
   9. BOTTOM NAVIGATION BAR
   ========================================================================= */
.pm-bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e6edf5;
  box-shadow: 0 -4px 20px rgba(22, 63, 115, 0.06);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}

.pm-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #8fa0b5;
  padding: 4px 2px;
  transition: all 0.2s;
}

.pm-nav-link svg {
  width: 24px;
  height: 24px;
}

.pm-nav-link span {
  font-size: 12px;
  font-weight: 700;
}

.pm-nav-link.is-active {
  color: var(--pm-green);
  font-weight: 900;
}

.pm-nav-link.is-active svg {
  stroke: var(--pm-green);
}

/* =========================================================================
   WAGER BOX (Climax Levels 11-15)
   ========================================================================= */
.pm-wager-box {
  background: var(--pm-card);
  border: 2px solid #f59e0b;
  border-radius: var(--pm-radius-card);
  box-shadow: var(--pm-card-shadow);
  padding: 14px 16px;
  margin-bottom: 4px;
}

.pm-wager-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pm-wager-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pm-primary-dark);
  font-weight: 800;
  font-size: 15px;
}

.pm-wager-heading svg {
  width: 18px;
  height: 18px;
}

.pm-wager-tag {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--pm-radius-pill);
}

.pm-wager-sub {
  font-size: 12px;
  color: var(--pm-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.pm-wager-num-view {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  margin-bottom: 8px;
}

.pm-wager-num-view small {
  font-size: 13px;
  font-weight: 700;
  color: var(--pm-muted);
  margin-right: 4px;
}

.pm-wager-range {
  width: 100%;
  accent-color: #f59e0b;
  height: 6px;
  margin-bottom: 10px;
}

.pm-wager-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pm-preset-btn {
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pm-primary-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.pm-preset-btn.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

@keyframes pmPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   JOIN VIEW STYLING (MATCHING THE PROJECT THEME)
   ========================================================================= */
.pm-join-hero-card {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-card);
  box-shadow: var(--pm-card-shadow);
  padding: 18px 20px;
  text-align: center;
}

.pm-join-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  margin-bottom: 6px;
}

.pm-join-subtitle {
  font-size: 13px;
  color: var(--pm-muted);
  line-height: 1.5;
  margin: 0;
}

.pm-join-form-card {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-card);
  box-shadow: var(--pm-card-shadow);
  padding: 20px;
}

.pm-form-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--pm-primary-dark);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.pm-form-hdr svg {
  width: 20px;
  height: 20px;
  color: var(--pm-primary);
}

.pm-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pm-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.pm-field-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--pm-primary-dark);
}

.pm-req {
  color: #ef4444;
}

.pm-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pm-input-wrapper svg {
  position: absolute;
  right: 14px;
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
}

.pm-input-wrapper input,
.pm-input-wrapper select {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 0 44px 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pm-primary-dark);
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.pm-input-wrapper input:focus,
.pm-input-wrapper select:focus {
  outline: none;
  border-color: var(--pm-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

.pm-alert-box {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.pm-rules-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--pm-muted);
  line-height: 1.6;
}

.pm-rules-box strong {
  display: block;
  color: var(--pm-primary-dark);
  font-size: 13px;
  margin-bottom: 6px;
}

.pm-rules-box ul {
  padding-right: 18px;
  margin: 0;
}

/* =========================================================================
   GLOBAL ALMARAI FONT IMPORT & UNIVERSAL RULE
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

*, *::before, *::after,
body, button, input, select, textarea,
h1, h2, h3, h4, h5, h6, p, span, strong, small, a, div, label {
  font-family: 'Almarai', system-ui, -apple-system, sans-serif !important;
}

/* =========================================================================
   RESULT / HONOR PAGE STYLING
   ========================================================================= */
.pm-result-honor-card {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-card);
  box-shadow: var(--pm-card-shadow);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.pm-honor-trophy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pm-honor-trophy-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fffbeb;
  border: 2.5px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-honor-trophy-circle svg {
  width: 44px;
  height: 44px;
}

.pm-honor-ribbon-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #edf9ec;
  color: #16a34a;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 800;
}

.pm-honor-ribbon-tag svg {
  width: 16px;
  height: 16px;
}

.pm-honor-player-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  line-height: 1.2;
  margin: 0;
}

.pm-honor-subtitle {
  font-size: 13.5px;
  color: var(--pm-muted);
  line-height: 1.5;
  margin: 0;
}

.pm-final-score-box {
  width: 100%;
  background: linear-gradient(135deg, #f8fbfe 0%, #eef5fc 100%);
  border: 1.5px solid #bcd5f0;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pm-final-score-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--pm-muted);
}

.pm-final-score-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pm-final-score-value strong {
  font-size: 36px;
  font-weight: 900;
  color: var(--pm-primary-dark);
  letter-spacing: -0.5px;
}

.pm-final-score-value small {
  font-size: 16px;
  font-weight: 800;
  color: var(--pm-primary);
}

.pm-honor-stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pm-honor-stat-item {
  background: #f8fafc;
  border: 1px solid var(--pm-border);
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.pm-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-stat-icon svg {
  width: 18px;
  height: 18px;
}

.pm-stat-ico-blue {
  background: #eef6fe;
  color: var(--pm-primary);
}

.pm-stat-ico-green {
  background: #edf9ec;
  color: var(--pm-green-dark);
}

.pm-stat-ico-gold {
  background: #fef3c7;
  color: #b45309;
}

.pm-stat-lbl {
  font-size: 11px;
  color: var(--pm-muted);
  font-weight: 600;
}

.pm-stat-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--pm-primary-dark);
}

.pm-gift-claim-card {
  width: 100%;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 14px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-gift-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-gift-pin-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-gift-pin-ico svg {
  width: 16px;
  height: 16px;
}

.pm-gift-title {
  font-size: 14px;
  font-weight: 800;
  color: #15803d;
}

.pm-gift-desc {
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
  margin: 0;
}

.pm-result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.pm-outline-action-btn {
  width: 100%;
  height: 48px;
  background: #ffffff;
  border: 1.5px solid var(--pm-border);
  color: var(--pm-primary-dark);
  border-radius: var(--pm-radius-pill);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.pm-outline-action-btn:hover {
  background: #f8fafc;
  border-color: #bcd5f0;
}

.pm-outline-action-btn svg {
  width: 18px;
  height: 18px;
  color: var(--pm-primary);
}

/* =========================================================================
   10. MOBILE RESPONSIVE ADAPTATIONS
   ========================================================================= */
@media screen and (max-width: 360px) {
  .pm-app-screen {
    padding: 6px 8px 120px;
  }
  .pm-user-score-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .pm-user-avatar-circle {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
  .pm-user-avatar-circle svg {
    width: 22px;
    height: 22px;
  }
  .pm-user-fullname {
    font-size: 15px;
  }
  .pm-score-digit {
    font-size: 19px;
  }
  .pm-meta-pills-row {
    gap: 4px;
  }
  .pm-category-badge,
  .pm-points-value-badge,
  .pm-question-counter-badge {
    padding: 4px 7px;
    font-size: 11px;
  }
  .pm-question-heading {
    font-size: 15px;
  }
  .pm-choice-card {
    min-height: 46px;
    padding: 6px 10px;
  }
  .pm-choice-badge {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
  }
  .pm-choice-text {
    font-size: 13px;
  }
  .pm-tool-item {
    padding: 6px 4px;
    gap: 4px;
  }
  .pm-tool-icon-circle {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  .pm-tool-icon-circle svg {
    width: 14px;
    height: 14px;
  }
  .pm-tool-name {
    font-size: 10.5px;
  }
  .pm-tool-desc {
    font-size: 8.5px;
  }
  .pm-green-action-btn {
    height: 48px;
    font-size: 16px;
  }
}

@media screen and (min-width: 480px) {
  .pm-quiz-wrapper {
    max-width: 460px;
  }
  .pm-question-heading {
    font-size: 21px;
  }
  .pm-choice-card {
    min-height: 56px;
    padding: 10px 18px;
  }
}

/* =========================================================================
   11. GRAND CELEBRATION VICTORY MODAL
   ========================================================================= */
.pm-celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 25, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  animation: pmFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pm-celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.pm-celebration-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 26px;
  border: 2px solid #fde68a;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 30px rgba(245, 158, 11, 0.25);
  padding: 24px 20px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: pmPopBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pm-celebration-trophy-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.pm-celebration-pulse-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(245, 158, 11, 0) 70%);
  animation: pmGlowPulse 2.2s infinite ease-in-out;
}

.pm-celebration-trophy-circle {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2.5px solid #f59e0b;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-trophy-gold-svg {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.3));
}

.pm-trophy-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.pm-star-svg {
  position: absolute;
  width: 18px;
  height: 18px;
  animation: pmStarShine 1.8s infinite alternate ease-in-out;
}

.pm-star-svg.star-l {
  top: -4px;
  right: 6px;
  animation-delay: 0.2s;
}

.pm-star-svg.star-c {
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
}

.pm-star-svg.star-r {
  top: -4px;
  left: 6px;
  animation-delay: 0.5s;
}

.pm-celebration-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.pm-celebration-ribbon svg {
  width: 15px;
  height: 15px;
}

.pm-celebration-title {
  margin: 0;
  font-size: clamp(20px, 5.2vw, 24px);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
}

.pm-celebration-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.45;
}

.pm-celebration-score-box {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pm-celebration-score-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.pm-celebration-score-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pm-celebration-score-num strong {
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 900;
  color: #15803d;
  letter-spacing: -0.5px;
}

.pm-celebration-score-num small {
  font-size: 14px;
  font-weight: 800;
  color: #64748b;
}

.pm-celebration-vip-box {
  width: 100%;
  background: #fefce8;
  border: 1.5px solid #fef08a;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}

.pm-vip-ico {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #fef08a;
  color: #a16207;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-vip-ico svg {
  width: 20px;
  height: 20px;
}

.pm-vip-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-vip-details strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #854d0e;
}

.pm-vip-details span {
  font-size: 11.5px;
  color: #a16207;
  line-height: 1.35;
}

.pm-celebration-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  color: #ffffff;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(22, 101, 52, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 4px;
}

.pm-celebration-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease;
}

.pm-celebration-btn:hover,
.pm-celebration-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(22, 101, 52, 0.45);
  color: #ffffff;
}

.pm-celebration-btn:active {
  transform: scale(0.98);
}

.pm-celebration-btn:hover svg {
  transform: translateX(-4px);
}

@keyframes pmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pmPopBounce {
  0% { opacity: 0; transform: scale(0.78) translateY(20px); }
  70% { transform: scale(1.03) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pmGlowPulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.35); opacity: 0.9; }
}

@keyframes pmStarShine {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.6; }
  100% { transform: scale(1.2) rotate(15deg); opacity: 1; }
}

/* =========================================================================
   JOIN PAGE AVATAR PICKER / CAMERA CAPTURE
   ========================================================================= */
.pm-avatar-upload-group {
  margin-top: 4px;
}

.pm-join-avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.pm-join-avatar-picker:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.pm-avatar-circle-preview {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid #0284c7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
  position: relative;
}

.pm-avatar-circle-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pm-avatar-cam-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  color: #64748b;
  padding: 4px;
}

.pm-avatar-cam-box svg {
  width: 22px;
  height: 22px;
  color: #0284c7;
}

.pm-avatar-cam-box span {
  font-size: 9px;
  font-weight: 700;
  color: #475569;
}

.pm-avatar-picker-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pm-avatar-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #0284c7;
  color: #0284c7;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pm-avatar-btn-action:hover,
.pm-avatar-btn-action:active {
  background: #0284c7;
  color: #ffffff;
}

.pm-avatar-btn-action svg {
  width: 15px;
  height: 15px;
}

.pm-avatar-hint {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
  line-height: 1.25;
}

/* =========================================================================
   COMPACT QUIZ MODE — 20% smaller on player phones and tablets
   Keeps the same usable viewport width while fitting more quiz detail.
   ========================================================================== */
@media screen and (max-width: 991px) {
  body.quiz-play-theme .pm-app-screen {
    padding: 8px 10px calc(112px + env(safe-area-inset-bottom)) !important;
  }

  body.quiz-play-theme .pm-quiz-wrapper {
    width: 125% !important;
    max-width: 600px !important;
    zoom: .8;
  }
}

/* Gift phone confirmation must never inherit the full-width primary action.
   That inherited width was pushing the button out of the result card. */
.pm-claim-phone-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.pm-claim-phone-input {
  box-sizing: border-box;
  min-width: 0;
  flex: 1 1 170px;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: monospace !important;
  font-size: 14px;
  outline: none;
}

.pm-claim-phone-input:focus {
  border-color: #00aa55;
  box-shadow: 0 0 0 3px rgba(0, 170, 85, .14);
}

.pm-claim-phone-btn.pm-green-action-btn {
  width: auto !important;
  min-width: 112px;
  height: auto;
  min-height: 42px;
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

@media screen and (max-width: 390px) {
  .pm-claim-phone-row { flex-direction: column; }
  .pm-claim-phone-input { flex-basis: auto; min-height: 42px; }
  .pm-claim-phone-btn.pm-green-action-btn { width: 100% !important; min-height: 50px; }
}


