/*
 QPLUSLOTTO GLOBAL COLOR BALANCE V4
 Loaded LAST after every stylesheet.
 Color-only presentation layer.
*/

:root {
  --background: #FBF3F8 !important;
  --surface: #FFFAFD !important;
  --foreground: #49384F !important;
  --brand: #80549A !important;
  --brand-dark: #624071 !important;
  --brand-deep: #3B244C !important;

  --qpl-bg: #FBF3F8;
  --qpl-white: #FFFAFD;
  --qpl-pink: #F9EAF2;
  --qpl-lilac: #EDE2F3;
  --qpl-lilac-deep: #E3D3EC;
  --qpl-ink: #49384F;
  --qpl-muted: #705C76;
  --qpl-border: #E5C9DA;
  --qpl-gold: #916815;
}

/* Background */
html,
body {
  background-color: var(--qpl-bg) !important;
  color: var(--qpl-ink) !important;
}

body {
  background-image: repeating-linear-gradient(
    to bottom,
    #FBF3F8 0px,
    #FBF3F8 27px,
    #E9CADB 27px,
    #E9CADB 28px
  ) !important;
  background-size: 100% 28px !important;
  background-attachment: scroll !important;
}

/* Content hero and announcement areas.
   Keep the global header and fixed navigation unchanged. */
body .brand-pattern:not(header .brand-pattern):not(.quick-dock .brand-pattern) {
  background-color: #F9EAF2 !important;
  background-image: linear-gradient(
    140deg,
    #FFFCFE 0%,
    #F5E7F0 100%
  ) !important;
  color: var(--qpl-ink) !important;
  border-color: var(--qpl-border) !important;
}

/* Common dark background tokens in public content */
body [class~="bg-[#200d0f]"]:not(header *):not(.quick-dock *),
body [class~="bg-[#1e0c0e]"]:not(header *):not(.quick-dock *),
body [class~="bg-[#220d10]/95"]:not(header *):not(.quick-dock *) {
  background-color: #F5E8F1 !important;
  color: var(--qpl-ink) !important;
}

/* Standard cards */
body .panel,
body .notice {
  background: linear-gradient(
    145deg,
    #FFFCFE 0%,
    #FFF7FB 100%
  ) !important;
  color: var(--qpl-ink) !important;
  border: 1px solid var(--qpl-border) !important;
  box-shadow: 0 5px 16px rgba(83,48,78,.09) !important;
}

/* Secondary cards */
body .panel:nth-child(even) {
  background: linear-gradient(
    145deg,
    #FFF9FC 0%,
    #F9EAF2 100%
  ) !important;
}

/* Highlight cards and prize panels */
body .plaque {
  background:
    radial-gradient(
      120% 90% at 50% 0%,
      rgba(255,255,255,.75),
      transparent 65%
    ),
    linear-gradient(
      145deg,
      #F1E7F6 0%,
      #E3D3EC 100%
    ) !important;
  color: var(--qpl-ink) !important;
  border: 1px solid #CDB5D9 !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.85),
    0 5px 16px rgba(83,48,78,.12) !important;
}

/* Text inside light cards: fix faded white and opacity utilities */
body :is(.panel,.plaque,.notice,.brand-pattern)
:is(
  .text-white,
  .text-white\/50,
  .text-white\/62,
  .text-white\/70,
  .text-white\/85,
  .text-white\/90,
  .text-foreground\/50,
  .text-foreground\/55,
  .text-foreground\/60,
  .text-foreground\/65,
  .text-foreground\/70,
  .text-foreground\/75,
  .text-foreground\/80,
  .text-foreground\/85,
  .text-foreground\/90
) {
  color: var(--qpl-ink) !important;
  -webkit-text-fill-color: var(--qpl-ink) !important;
  opacity: 1 !important;
}

/* Normal content text */
body .panel p,
body .panel li,
body .panel small,
body .plaque p,
body .plaque li,
body .plaque small,
body .notice p,
body .notice small {
  color: var(--qpl-ink) !important;
}

/* Headings */
body main h1,
body main h2,
body main h3,
body main h4,
body .brand-pattern h1,
body .brand-pattern h2,
body .brand-pattern h3 {
  color: #493052 !important;
}

/* Gold headings and prize numbers */
body .gold-text,
body .text-gold,
body .text-gold-soft,
body .text-gold-soft\/70,
body .text-gold-soft\/90,
body .text-gold-soft\/95 {
  color: var(--qpl-gold) !important;
  -webkit-text-fill-color: var(--qpl-gold) !important;
  text-shadow: none !important;
}

/* Preserve original gold CTA appearance */
body .gold-btn,
body .gold-btn * {
  color: #38233D !important;
  -webkit-text-fill-color: #38233D !important;
}

/* Tables and schedule information */
body table,
body th,
body td {
  color: var(--qpl-ink);
  border-color: var(--qpl-border);
}

body .panel table,
body .plaque table {
  background-color: transparent !important;
}

body .panel td,
body .panel th,
body .plaque td,
body .plaque th {
  color: var(--qpl-ink) !important;
}

/* Nested dark translucent rows */
body [class~="bg-black/20"]:not(header *):not(.quick-dock *),
body [class~="bg-black/25"]:not(header *):not(.quick-dock *),
body [class~="bg-black/30"]:not(header *):not(.quick-dock *),
body [class~="bg-black/40"]:not(header *):not(.quick-dock *),
body [class~="bg-black/45"]:not(header *):not(.quick-dock *) {
  background-color: rgba(255,255,255,.78) !important;
  border-color: var(--qpl-border) !important;
}

/* Existing gradient cards */
body .from-brand\/90:not(header *):not(.quick-dock *) {
  --tw-gradient-from: #FFFCFE !important;
  --tw-gradient-stops: var(--tw-gradient-position),
    #FFFCFE var(--tw-gradient-from-position),
    var(--tw-gradient-to) var(--tw-gradient-to-position) !important;
}

body .to-brand-dark\/90:not(header *):not(.quick-dock *) {
  --tw-gradient-to: #F0E2EF !important;
}

/* Header remains deep purple */
body header,
body header .brand-pattern {
  background-color: #24113D !important;
  color: #FFFFFF !important;
}

/* Fixed bottom navigation remains deep purple */
body .quick-dock {
  background:
    radial-gradient(
      90% 140% at 50% -30%,
      rgba(252,194,1,.20) 0%,
      transparent 45%
    ),
    linear-gradient(
      180deg,
      #371D59 0%,
      #180A2E 100%
    ) !important;
}

body .quick-dock,
body .quick-dock * {
  color: revert !important;
}

/* Gold borders and hover */
body .panel:hover,
body .plaque:hover {
  border-color: rgba(174,133,40,.55) !important;
}

