/* White surfaces for the player popup family. These scoped rules also cover
   styles injected by the rating/selfie/title controllers and their dark mode.
   Important declarations are needed for their existing inline colors. */
body :is(.dopamine-leaderboard-intro, .ps-takeover, .game-continuation-fs,
    .group-name-fs, .rating-fullscreen, .pt-titles-intro,
    #dopamine-hole-transition, #auto-selfie-popup, #goodbye-page,
    #rank-celebration-standard, #rank-celebration-group, #hole-in-one-popup) {
  background: #fff !important;
  color: #0f172a !important;
}

body #rank-celebration-group .rc2-group-card {
  background: #fff !important;
}

body :is(.dopamine-leaderboard-intro-card, .ps-takeover-inner,
    .game-continuation-inner, .group-name-inner, .rating-fs-inner,
    .pt-titles-card, .rank-celebration-card-v2, .rc2-group-card) {
  color: #0f172a !important;
}

body :is(.dopamine-leaderboard-intro-title, .ps-takeover-title,
    .game-continuation-title, .group-name-title, .rating-fs-title,
    .rating-fs-thanks-title, .rating-fs-public-headline,
    .pt-titles-name, .pt-titles-item-title,
    .dopamine-transition-hole, .dopamine-transition-next-hole,
    .dopamine-transition-player-name),
body #auto-selfie-popup :is(.selfie-popup-title, .selfie-popup-text),
body #goodbye-page :is(h1, #end-message, .text-gray-900, .text-gray-700, .dark\:text-white),
body #hole-in-one-popup :is(#hole-in-one-message, #hole-in-one-eyebrow),
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-title,
    .rc2-title-big, .rc2-title-lead, .rc2-card-name, .rc2-sub strong) {
  color: #0f172a !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

body :is(.dopamine-leaderboard-intro-body, .ps-takeover-sub,
    .game-continuation-sub, .group-name-sub, .rating-fs-sub,
    .rating-fs-thanks-sub, .rating-fs-public-sub, .pt-titles-score,
    .pt-titles-item-desc, .dopamine-transition-next-par),
body #auto-selfie-popup :is(.selfie-popup-subtitle, .selfie-popup-text-muted),
body #goodbye-page :is(p, #finish-message, .text-gray-500, .text-gray-600, .text-gray-400),
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-sub,
    .rc2-pitch, .rc2-card-rank, .rc2-rowlabel, .rc2-count, .rc2-consent) {
  color: #475569 !important;
  opacity: 1;
  text-shadow: none !important;
}

body :is(.dopamine-leaderboard-intro-eyebrow, .ps-takeover-eyebrow,
    .game-continuation-eyebrow, .group-name-eyebrow, .rating-fs-eyebrow,
    .pt-titles-eyebrow, .dopamine-transition-next-label),
body #auto-selfie-popup .selfie-popup-eyebrow,
body .dopamine-transition-hole::before,
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-eyebrow {
  color: #475569 !important;
  text-shadow: none !important;
}

body .dopamine-leaderboard-intro-body strong,
body .pt-titles-score strong { color: #0f172a !important; }

/* Solid primary actions retain the existing PuttScores button color. */
body :is(.dopamine-leaderboard-intro-cta, .ps-takeover-primary,
    .game-continuation-primary, .group-name-primary, .rating-fs-submit,
    .rating-fs-public-btn, .pt-titles-primary),
body #auto-selfie-popup #auto-selfie-take,
body #goodbye-page :is(.goodbye-btn-primary, .goodbye-btn-secondary),
body #hole-in-one-popup #download-hole-in-one {
  background: #007a61 !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .12) !important;
  text-shadow: none !important;
}

body :is(.dopamine-leaderboard-intro-cta, .ps-takeover-primary,
    .game-continuation-primary, .group-name-primary, .rating-fs-submit,
    .rating-fs-public-btn, .pt-titles-primary):hover,
body #auto-selfie-popup #auto-selfie-take:hover,
body #goodbye-page :is(.goodbye-btn-primary, .goodbye-btn-secondary):hover {
  background: #006b55 !important;
  filter: none !important;
}

body :is(.ps-takeover-secondary, .game-continuation-secondary,
    .rating-fs-public-skip, .pt-titles-secondary),
body #auto-selfie-popup .selfie-btn-secondary,
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-decline, .rc2-add) {
  color: #334155 !important;
  opacity: 1;
}

body :is(.ps-takeover-secondary, .game-continuation-secondary,
    .rating-fs-public-skip, .pt-titles-secondary):hover,
body #auto-selfie-popup .selfie-btn-secondary:hover,
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-decline:hover {
  color: #0f172a !important;
  opacity: 1;
}

body #finish-game-confirm-no,
body #larger-group-modal #enter-share-code-btn,
body #goodbye-page #goodbye-download-selfie-button,
body #hole-in-one-popup #close-hole-in-one-popup {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: none !important;
}

body :is(.rating-fs-close, .ps-takeover .min-w-\[44px\]),
body #hole-in-one-popup #close-hole-in-one-popup-x,
body :is(#rank-celebration-standard, #rank-celebration-group) .rank-celebration-close {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

/* Light cards and visible field borders replace translucent dark-theme panels. */
body .ps-takeover .ps-takeover-card,
body .rating-fullscreen .rating-fs-public-card,
body .pt-titles-intro .pt-titles-item,
body #auto-selfie-popup :is(.selfie-share-toggle-container, .selfie-legal-container, #legal-consent-details),
body #goodbye-page .goodbye-card,
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  color: #334155 !important;
}

body .ps-takeover .ps-takeover-input,
body #group-name-popup .group-name-input,
body .rating-fullscreen .rating-fs-textarea,
body #goodbye-page .goodbye-input,
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-input {
  background: #fff !important;
  border: 1px solid #94a3b8 !important;
  color: #0f172a !important;
}

body .ps-takeover .ps-takeover-input::placeholder,
body #group-name-popup .group-name-input::placeholder,
body .rating-fullscreen .rating-fs-textarea::placeholder,
body #goodbye-page .goodbye-input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

body .ps-takeover .ps-takeover-input:focus,
body #group-name-popup .group-name-input:focus,
body .rating-fullscreen .rating-fs-textarea:focus,
body #goodbye-page .goodbye-input:focus {
  border-color: #007a61 !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 97, .2) !important;
}

/* Readable inline copy in the existing group/share-code markup. */
body #larger-group-modal .ps-takeover-card li,
body #share-code-display-modal > .ps-takeover-inner > div,
body #waiting-for-groups > div,
body #enter-share-code-modal #pin-input-container p,
body #challenge-info-content { color: #475569 !important; }
body #share-code-display-modal #share-code-value { color: #0f172a !important; }
body #larger-group-modal .ps-takeover-card li > span { color: #007a61 !important; }
body #enter-share-code-modal #share-code-error,
body #group-name-popup .group-name-warning { color: #b91c1c !important; }

body #auto-selfie-popup :is(.selfie-legal-link, #legal-terms-toggle),
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-consent a {
  color: #006b55 !important;
}

body #auto-selfie-popup .selfie-camera-icon-bg {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body .rating-fullscreen .rating-star {
  color: #64748b;
  text-shadow: none !important;
}
body .rating-fullscreen .rating-star:is(:hover, .selected) { color: #a16207 !important; }

body #dopamine-hole-transition .dopamine-transition-player-score {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
body #dopamine-hole-transition .dopamine-score-under .dopamine-transition-player-val { color: #007a61; }
body #dopamine-hole-transition .dopamine-score-par .dopamine-transition-player-val { color: #334155; }
body #dopamine-hole-transition .dopamine-score-over .dopamine-transition-player-val,
body #dopamine-hole-transition .dopamine-transition-momentum { color: #92400e; }

/* Only the green top-ten stages change; gold awards keep their own palette. */
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-title, .rc2-title-big) {
  background: none !important;
}
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-rays,
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-band::after {
  background: none !important;
}
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-period-badge {
  background: #f1f5f9 !important;
  color: #334155 !important;
  box-shadow: none !important;
}
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-avatar, .rc2-card-avatar) {
  background: #007a61 !important;
}
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-badge, .rc2-card-badge) {
  border-color: #fff !important;
}
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-rowx {
  background: #f1f5f9;
  color: #334155;
}
body :is(#rank-celebration-standard, #rank-celebration-group) .rc2-done { color: #007a61; }

/* Keep illustrations and animations, soften shadows intended for dark surfaces. */
body :is(.lb-intro-trophy-emoji, .ps-takeover-emoji, .game-continuation-emoji,
    .group-name-emoji, .rating-fs-emoji, .pt-titles-emoji, .pt-titles-item-icon),
body #goodbye-page .goodbye-trophy,
body :is(#rank-celebration-standard, #rank-celebration-group) :is(.rc2-hero-emoji, .rc2-bell) {
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, .12)) !important;
}

body :is(.dopamine-leaderboard-intro, .ps-takeover, .game-continuation-fs,
    .group-name-fs, .rating-fullscreen, .pt-titles-intro,
    #auto-selfie-popup, #goodbye-page, #rank-celebration-standard,
    #rank-celebration-group, #hole-in-one-popup) :is(button, a):focus-visible {
  outline: 2px solid #0f172a !important;
  outline-offset: 3px;
}
