:root {
  --dede-navy: #162547;
  --dede-navy-deep: #142546;
  --dede-page: #f4f8fd;
  --dede-ink: #132447;
  --dede-orange: #c4510c;
  --dede-highlight-orange: #f97316;
  --dede-winner-edge: #a54009;
  --dede-winner-text: #8a3508;
  --dede-table-warm: #fff8f1;
  --dede-table-cool: #f4f8ff;
  --dede-page-gradient: linear-gradient(180deg, #f6f9fd, var(--dede-page) 55%, #f2f6fc);
  --dede-sidebar-gradient: linear-gradient(180deg, var(--dede-navy-deep), #192c51);
  --background: var(--dede-page);
  --primary: var(--dede-orange);
  --primary-foreground: #fff;
  --ring: #a34409;
  --dede-action-hover: #a54009;
}

html body,
body .min-h-screen.bg-background.lg\:flex {
  background: var(--dede-page-gradient);
}

aside:has(> div > nav[aria-label="Main navigation"]),
aside:has(> div > nav[aria-label="Main navigation"]) > div,
aside#dede-sidebar {
  background: var(--dede-sidebar-gradient);
}

main section:is([aria-label="Arşiv"], [aria-label="Archive"], [aria-label="İstatistikler"], [aria-label="Statistics"]) > .grid > div:nth-child(1) {
  background-color: #d8eae9;
  background-image: linear-gradient(135deg, #d8eae9, #ecf4f3);
  border-color: #cadfdf;
}

main section:is([aria-label="Arşiv"], [aria-label="Archive"], [aria-label="İstatistikler"], [aria-label="Statistics"]) > .grid > div:nth-child(2) {
  background-color: #dce6f5;
  background-image: linear-gradient(135deg, #dce6f5, #eff4fc);
  border-color: #d1def1;
}

main section:is([aria-label="Arşiv"], [aria-label="Archive"], [aria-label="İstatistikler"], [aria-label="Statistics"]) > .grid > div:nth-child(3) {
  background-color: #e7e3f8;
  background-image: linear-gradient(135deg, #e7e3f8, #f3f1fc);
  border-color: #ded8f3;
}

main section:is([aria-label="Arşiv"], [aria-label="Archive"], [aria-label="İstatistikler"], [aria-label="Statistics"]) > .grid > div:nth-child(4) {
  background-color: #f6eae4;
  background-image: linear-gradient(135deg, #f6eae4, #fcf5f2);
  border-color: #eadcd5;
}

main section:is([aria-label="Arşiv"], [aria-label="Archive"], [aria-label="İstatistikler"], [aria-label="Statistics"]) > .grid > div:nth-child(5) {
  background-color: #f4edda;
  background-image: linear-gradient(135deg, #f4edda, #fbf7eb);
  border-color: #e8ddbd;
}

.rounded-2xl.bg-white:has(> .overflow-x-auto > table[data-dede-horse-table]),
.rounded-2xl.bg-white:has(> table[data-dede-horse-table]) {
  background: linear-gradient(#fff, #f3f6fb);
}

table[data-dede-horse-table] > thead > tr,
table[data-dede-horse-table] > tbody > tr:has(> th):not(:has(> td)) {
  background-color: #f8fafc;
}

:is(table[data-dede-horse-table], table[data-dede-horse-table] > tbody) > tr:has(> td):nth-child(odd of :has(> td)),
[data-dede-horse-list] > :nth-child(odd) {
  --dede-row-background: var(--dede-table-warm);
}

:is(table[data-dede-horse-table], table[data-dede-horse-table] > tbody) > tr:has(> td):nth-child(even of :has(> td)),
[data-dede-horse-list] > :nth-child(even) {
  --dede-row-background: var(--dede-table-cool);
}

:is(table[data-dede-horse-table], table[data-dede-horse-table] > tbody) > tr > td,
[data-dede-horse-list] > * {
  background-color: var(--dede-row-background);
}

/* The score table and analysis both highlight the winning horse number. */
.winner-horse-no,
td:has(> .winner-horse-no),
.puan-leg-table .puan-winner,
.race .horse.winner-horse-no,
.race td.winner-horse-no {
  background-color: var(--dede-highlight-orange) !important;
  color: var(--primary-foreground) !important;
}

.winner-horse-no:not(td) {
  box-shadow: 0 0 0 1px var(--dede-winner-edge);
}

td:has(> .winner-horse-no) > .winner-horse-no:not(td) {
  box-shadow: none;
}

tr:has(.winner-horse-no) > td:not(:has(.winner-horse-no)):not(.winner-horse-no) {
  background-color: var(--dede-row-background, transparent) !important;
}

.kupon-number.winner {
  color: var(--dede-winner-text);
}

@media (max-width: 1023px) {
  header.sticky.top-0.z-20,
  .mobilebar {
    background: var(--dede-navy);
    border-color: #26395d;
    color: #f6f8ff;
  }

  header.sticky.top-0.z-20 > div:first-child :is(button, p:first-child),
  header.sticky.top-0.z-20 > div:last-child > div.relative > button,
  header.sticky.top-0.z-20 > div:last-child > div > a[href="/register"] {
    color: #f6f8ff;
  }

  header.sticky.top-0.z-20 > div:first-child p:last-child,
  .mobilebar .mobilebar-date span {
    color: #c3cfe2;
  }

  header.sticky.top-0.z-20 > div:first-child > button:hover,
  header.sticky.top-0.z-20 > div:last-child > div.relative > button:hover,
  header.sticky.top-0.z-20 > div:last-child > div > a[href="/register"]:hover,
  .mobilebar .header-icon:hover {
    background-color: #364665;
  }

  header.sticky.top-0.z-20 > div:last-child > div:has(> button[aria-pressed]) {
    background-color: #26395d;
  }

  header.sticky.top-0.z-20 > div:last-child button[aria-pressed="false"] {
    color: #c3cfe2;
  }

  .mobilebar .header-icon,
  .mobilebar .account-guest > a {
    color: #f6f8ff;
  }
}

/* Orange brand actions shared by the exported pages and standalone modules. */
:is(button, a, input[type="submit"], [role="button"]):is([class~="bg-[#d74c49]"], .bg-primary),
aside#dede-sidebar nav a[aria-current],
.mobilebar .account-guest .nav-account,
body:has(.page-main) button[aria-pressed="true"]:not(.header-languages button),
.kupon-cities button[aria-pressed="true"],
.kupon-form button,
main.page-main .detay-tabs a[aria-current="page"],
#welcome-trial-page button,
#welcome-trial-page .trial-links a {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

:is(button, a, input[type="submit"], [role="button"])[class~="border-[#d74c49]"],
body:has(.page-main) button[aria-pressed="true"]:not(.header-languages button),
.kupon-cities button[aria-pressed="true"],
main.page-main .detay-tabs a[aria-current="page"] {
  border-color: var(--dede-winner-edge);
}

:is(button, a, [role="button"])[class~="hover:border-[#d74c49]"]:hover,
body:has(.page-main) button:hover:not(.header-languages button) {
  border-color: var(--dede-winner-edge);
}

:is(button, a, input[type="submit"], [role="button"]):is([class~="bg-[#d74c49]"], .bg-primary):hover,
aside#dede-sidebar nav a[aria-current]:hover,
.mobilebar .account-guest .nav-account:hover,
body:has(.page-main) button[aria-pressed="true"]:not(.header-languages button):hover,
.kupon-cities button[aria-pressed="true"]:hover,
.kupon-form button:hover,
main.page-main .detay-tabs a[aria-current="page"]:hover,
#welcome-trial-page button:hover,
#welcome-trial-page .trial-links a:hover {
  background-color: var(--dede-action-hover);
  color: var(--primary-foreground);
}

:is(button, a, [role="button"])[class~="shadow-[#d74c49]/20"] {
  --tw-shadow-color: #c4510c33;
}

:is(button, a, [role="button"])[class~="focus-visible:outline-[#d74c49]"]:focus-visible {
  outline-color: var(--ring);
}

/* Subpage, city and race controls use a filled orange state only when selected. */
main :is(
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-full.border.px-4.py-2.font-semibold.shadow-sm,
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.py-2.font-semibold.shadow-sm,
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.font-semibold.shadow-sm[class~="py-2.5"],
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.size-11.font-semibold.shadow-sm,
  .cities > button,
  [id="kupon-cities"] > button,
  .mt-8.flex.flex-wrap.gap-2.border-b > button.border-b-2,
  .detay-tabs > a[data-section],
  .kupon-cities[id="kupon-games"] > button[data-game],
  [role="tablist"] > [role="tab"],
  a[href^="/admin/siparisler?orders=tools-v3"].inline-flex.mb-4
) {
  background-color: #fff;
  border-color: var(--dede-highlight-orange);
  color: #111827;
}

main :is(
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-full.border.px-4.py-2.font-semibold.shadow-sm,
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.py-2.font-semibold.shadow-sm,
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.font-semibold.shadow-sm[class~="py-2.5"],
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.size-11.font-semibold.shadow-sm,
  .cities > button,
  [id="kupon-cities"] > button,
  .mt-8.flex.flex-wrap.gap-2.border-b > button.border-b-2,
  .detay-tabs > a[data-section],
  .kupon-cities[id="kupon-games"] > button[data-game],
  [role="tablist"] > [role="tab"],
  a[href^="/admin/siparisler?orders=tools-v3"].inline-flex.mb-4
):hover {
  background-color: #fff5eb;
}

main :is(
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-full.border.px-4.py-2.font-semibold.shadow-sm[class~="bg-[#d74c49]"],
  section.mt-6 > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.py-2.font-semibold.shadow-sm[class~="bg-[#d74c49]"],
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.px-4.font-semibold.shadow-sm[class~="py-2.5"][class~="bg-[#d74c49]"],
  section > .flex.flex-wrap.gap-2 > button.rounded-xl.border.size-11.font-semibold.shadow-sm[class~="bg-[#d74c49]"],
  .cities > button[aria-pressed="true"],
  [id="kupon-cities"] > button[aria-pressed="true"],
  .mt-8.flex.flex-wrap.gap-2.border-b > button.border-b-2[class~="text-[#d74c49]"],
  .detay-tabs > a[aria-current="page"],
  .kupon-cities[id="kupon-games"] > button[aria-pressed="true"],
  [role="tablist"] > [role="tab"][aria-selected="true"]
) {
  background-color: var(--dede-highlight-orange);
  border-color: var(--dede-highlight-orange);
  color: var(--primary-foreground);
}
