/* Crickipedia — vibrant cricket stadium theme (bright / dark) */
html {
  color-scheme: light;
}
html[data-ui-theme="dark"] {
  color-scheme: dark;
}

/* ☀️ Bright — fresh pitch, golden hour, energetic saffron accents */
html[data-ui-theme="bright"],
html:not([data-ui-theme]) {
  --green: #00875a;
  --green2: #00c17c;
  --gold: #ffb020;
  --gold-bright: #ffd24d;
  --accent: #ff6b2c;
  --accent-soft: rgba(255, 107, 44, 0.12);
  --dark: #0a2e24;
  --navy: #0d3d56;
  --light: #f4fbf7;
  --page-tint: #e8f8ef;
  --white: #ffffff;
  --muted: #4a6b5f;
  --line: #b8e6d0;
  --surface: #ffffff;
  --text: #0a241c;
  --text-on-hero: #ffffff;
  --shadow: 0 20px 50px rgba(0, 135, 90, 0.12), 0 4px 16px rgba(13, 61, 86, 0.06);
  --hero-gradient: linear-gradient(
    128deg,
    #0d3d56 0%,
    #067a52 38%,
    #00b87a 68%,
    #009e6a 100%
  );
  --hero-glow: radial-gradient(circle at 88% 12%, rgba(255, 210, 77, 0.45), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(255, 107, 44, 0.15), transparent 40%);
  --preview-gradient: linear-gradient(125deg, #0d3d56, #00875a, #00c17c);
  --fee-gradient: linear-gradient(125deg, #0a2e24, #067a52 55%, #0d4a38);
  --btn-primary: linear-gradient(180deg, #00d68f 0%, #00875a 100%);
  --btn-primary-shadow: 0 10px 28px rgba(0, 135, 90, 0.4);
  --skill-active: linear-gradient(180deg, #d4fce8, #a8f0cf);
  --regid-bg: linear-gradient(180deg, #e6fff2, #ccfae0);
  --regid-border: #7ee0b0;
  --watermark-line: rgba(0, 184, 122, 0.09);
  --watermark-ball: rgba(255, 176, 32, 0.08);
  --wm-stumps: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='112' viewBox='0 0 112 112'%3E%3Cline x1='38' y1='58' x2='38' y2='92' stroke='%2300875a' stroke-width='2.5' opacity='.12'/%3E%3Cline x1='56' y1='58' x2='56' y2='96' stroke='%2300875a' stroke-width='2.5' opacity='.12'/%3E%3Cline x1='74' y1='58' x2='74' y2='92' stroke='%2300875a' stroke-width='2.5' opacity='.12'/%3E%3Cline x1='34' y1='54' x2='78' y2='54' stroke='%23ffb020' stroke-width='2.5' opacity='.16'/%3E%3Cline x1='34' y1='49' x2='78' y2='49' stroke='%23ffb020' stroke-width='2' opacity='.12'/%3E%3C/svg%3E");
  --input-bg: #f0fdf7;
  --top-bar: linear-gradient(90deg, #0a2e24, #067a52);
  --top-bar-text: #ffffff;
  --chip-bg: linear-gradient(180deg, #ffffff, #ecfdf5);
  --notice-bg: linear-gradient(95deg, #fff8e6, #fffef5);
  --notice-border: #ffd666;
  --notice-title: #b45309;
  --focus-ring: rgba(0, 193, 124, 0.25);
}

/* 🌙 Dark — night match, neon pitch, gold floodlights */
html[data-ui-theme="dark"] {
  --green: #3dffa8;
  --green2: #22e890;
  --gold: #ffc933;
  --gold-bright: #ffe066;
  --accent: #ff8a5c;
  --accent-soft: rgba(255, 138, 92, 0.15);
  --dark: #050f1a;
  --navy: #0a1628;
  --light: #0a1628;
  --page-tint: #0d1f35;
  --white: #152a40;
  --muted: #8ba8bc;
  --line: #2a4560;
  --surface: #132337;
  --text: #eef6fc;
  --text-on-hero: #f8fffe;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(61, 255, 168, 0.06);
  --hero-gradient: linear-gradient(
    128deg,
    #050f1a 0%,
    #0f2844 32%,
    #0a5038 62%,
    #0d6b4a 100%
  );
  --hero-glow: radial-gradient(circle at 85% 8%, rgba(255, 201, 51, 0.35), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(61, 255, 168, 0.12), transparent 50%);
  --preview-gradient: linear-gradient(125deg, #050f1a, #0f2844, #0a5038);
  --fee-gradient: linear-gradient(125deg, #050f1a, #0a4030, #0d5c42);
  --btn-primary: linear-gradient(180deg, #3dffa8 0%, #00a86b 100%);
  --btn-primary-shadow: 0 10px 32px rgba(61, 255, 168, 0.25);
  --skill-active: linear-gradient(180deg, rgba(61, 255, 168, 0.22), rgba(34, 232, 144, 0.12));
  --regid-bg: linear-gradient(180deg, rgba(61, 255, 168, 0.15), rgba(19, 35, 55, 0.9));
  --regid-border: rgba(61, 255, 168, 0.45);
  --watermark-line: rgba(61, 255, 168, 0.07);
  --watermark-ball: rgba(255, 201, 51, 0.06);
  --wm-stumps: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='112' viewBox='0 0 112 112'%3E%3Cline x1='38' y1='58' x2='38' y2='92' stroke='%233dffa8' stroke-width='2.5' opacity='.13'/%3E%3Cline x1='56' y1='58' x2='56' y2='96' stroke='%233dffa8' stroke-width='2.5' opacity='.13'/%3E%3Cline x1='74' y1='58' x2='74' y2='92' stroke='%233dffa8' stroke-width='2.5' opacity='.13'/%3E%3Cline x1='34' y1='54' x2='78' y2='54' stroke='%23ffc933' stroke-width='2.5' opacity='.18'/%3E%3Cline x1='34' y1='49' x2='78' y2='49' stroke='%23ffc933' stroke-width='2' opacity='.14'/%3E%3C/svg%3E");
  --input-bg: #0f1e30;
  --top-bar: linear-gradient(90deg, #050f1a, #0f2844);
  --top-bar-text: #eef6fc;
  --chip-bg: linear-gradient(180deg, #1a3050, #132337);
  --notice-bg: linear-gradient(95deg, rgba(255, 201, 51, 0.12), rgba(19, 35, 55, 0.95));
  --notice-border: rgba(255, 201, 51, 0.35);
  --notice-title: var(--gold-bright);
  --focus-ring: rgba(61, 255, 168, 0.2);
}

body.cricket-ui {
  background-color: var(--light);
  background-image: radial-gradient(ellipse 100% 60% at 50% -10%, var(--page-tint), transparent 70%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

/* Cricket watermark — pitch grid, stumps, pitch oval (all cricket-ui pages) */
body.cricket-ui::before,
body.cricket-ui #loginGate::before {
  content: "";
  pointer-events: none;
  background-image:
    var(--wm-stumps),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 56px,
      var(--watermark-line) 56px,
      var(--watermark-line) 57px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 56px,
      var(--watermark-line) 56px,
      var(--watermark-line) 57px
    ),
    radial-gradient(
      ellipse 78% 42% at 50% 94%,
      transparent 56%,
      var(--watermark-line) 57%,
      transparent 58%
    ),
    radial-gradient(ellipse 90% 50% at 50% 100%, var(--watermark-ball), transparent 65%),
    radial-gradient(ellipse 80% 40% at 0% 50%, var(--accent-soft), transparent 55%);
  background-size:
    168px 168px,
    auto,
    auto,
    100% 420px,
    100% 100%,
    100% 100%;
  background-position:
    8% 18%,
    0 0,
    0 0,
    center bottom,
    center bottom,
    0 0;
  background-repeat:
    no-repeat,
    repeat,
    repeat,
    no-repeat,
    no-repeat,
    no-repeat;
}

body.cricket-ui::before {
  position: fixed;
  inset: 0;
  z-index: -2;
}

body.cricket-ui #loginGate::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
}

body.cricket-ui #loginGate .box {
  position: relative;
  z-index: 1;
}

body.cricket-ui .cricket-wm-corner {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  font-size: clamp(72px, 12vw, 140px);
  opacity: 0.05;
  line-height: 1;
  filter: drop-shadow(0 0 24px var(--gold));
}

body.cricket-ui .cricket-wm-corner--tl {
  top: 12%;
  left: 2%;
  transform: rotate(18deg);
}

body.cricket-ui .cricket-wm-corner--br {
  bottom: 18%;
  right: 6%;
  transform: rotate(-12deg);
  opacity: 0.045;
}

html[data-ui-theme="dark"] body.cricket-ui .cricket-wm-corner {
  opacity: 0.08;
}

.ui-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ui-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ui-theme-toggle:active {
  transform: scale(0.97);
}

body.cricket-ui .ui-theme-toggle--surface {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
body.cricket-ui .ui-theme-toggle--surface:hover {
  border-color: var(--green2);
  color: var(--green);
}

.cricket-ui .card,
.cricket-ui .panel,
.cricket-ui .stat {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.cricket-ui input,
.cricket-ui select,
.cricket-ui textarea {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--line);
}

.cricket-ui input:focus,
.cricket-ui select:focus,
.cricket-ui textarea:focus {
  background: var(--surface);
  border-color: var(--green2);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.cricket-ui .hero {
  background: var(--hero-gradient);
  color: var(--text-on-hero);
}

.cricket-ui .hero::before {
  background: var(--hero-glow) !important;
}

.cricket-ui .preview {
  background: var(--preview-gradient);
}

.cricket-ui .top {
  background: var(--top-bar);
  color: var(--top-bar-text);
  border-radius: 14px;
  padding: 18px 20px;
  box-sizing: border-box;
}

.cricket-ui .top h1,
.cricket-ui .top h2 {
  margin: 0 0 8px;
  padding: 0;
}

.cricket-ui .top p {
  margin: 0;
  padding: 0;
}

.cricket-ui .top .muted {
  color: rgba(255, 255, 255, 0.88);
  opacity: 1;
}

html[data-ui-theme="dark"] .cricket-ui .top .muted {
  color: rgba(238, 246, 252, 0.88);
}

.cricket-ui .top .top-link {
  margin-top: 12px;
}

.cricket-ui .top .top-link a {
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cricket-ui .top .top-link a:hover {
  opacity: 0.92;
}

.cricket-ui .primary,
.cricket-ui .btn.primary,
.cricket-ui button.primary {
  background: var(--btn-primary) !important;
  box-shadow: var(--btn-primary-shadow);
  color: #fff !important;
}

html[data-ui-theme="dark"] .cricket-ui .primary,
html[data-ui-theme="dark"] .cricket-ui .btn.primary {
  color: #042218 !important;
  font-weight: 800;
}

.cricket-ui .fee-strip {
  background: var(--fee-gradient) !important;
}

.cricket-ui .form-section-title {
  color: var(--green);
  background: linear-gradient(90deg, var(--green), var(--green2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-ui-theme="bright"] .cricket-ui .form-section-title {
  -webkit-text-fill-color: transparent;
}

html[data-ui-theme="dark"] .cricket-ui .form-section-title {
  background: linear-gradient(90deg, var(--gold-bright), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
}

.cricket-ui .notice strong {
  color: var(--notice-title);
}

.cricket-ui .info-chip {
  background: var(--chip-bg);
  border-color: var(--line);
}

.cricket-ui .info-chip span {
  color: var(--text);
}

.cricket-ui .skill span {
  background: var(--input-bg);
  border-color: var(--line);
}

.cricket-ui .skill input:checked + span {
  background: var(--skill-active) !important;
  border-color: var(--green2) !important;
  color: var(--green) !important;
  box-shadow: 0 6px 16px var(--focus-ring);
}

html[data-ui-theme="dark"] .cricket-ui .skill input:checked + span {
  color: var(--green) !important;
}

.cricket-ui .regid {
  background: var(--regid-bg) !important;
  border-color: var(--regid-border) !important;
  color: var(--green) !important;
}

.cricket-ui .ghost,
.cricket-ui .profile-upload-actions .pick-photo {
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--line);
}

.cricket-ui .photo,
.cricket-ui .profile-preview,
.cricket-ui .sponsor {
  background: var(--input-bg);
  border-color: var(--line);
}

.cricket-ui .hint {
  background: var(--chip-bg);
  border: 1px solid var(--line);
  color: var(--text);
}

.cricket-ui .badge {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
}

.cricket-ui .logo {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 210, 77, 0.35);
}

html[data-ui-theme="dark"] .cricket-ui .tag.pending {
  background: rgba(255, 201, 51, 0.2);
  color: var(--gold-bright);
}

html[data-ui-theme="dark"] .cricket-ui .tag:not(.pending) {
  background: rgba(61, 255, 168, 0.15);
  color: var(--green);
}

html[data-ui-theme="bright"] .cricket-ui .tag {
  background: rgba(0, 135, 90, 0.12);
  color: #006644;
}

html[data-ui-theme="bright"] .cricket-ui .tag.pending {
  background: rgba(255, 176, 32, 0.2);
  color: #9a6700;
}

.cricket-ui .btn {
  transition: filter 0.15s, transform 0.1s;
}

.cricket-ui .btn.primary,
.cricket-ui button.primary,
.cricket-ui .btn:not(.ghost):not(.danger):not(.tab):not(.wa):not(.btn-primary):not(.btn-ghost):not(.btn-muted):not(.roster-open):not(.stats-open) {
  background: var(--btn-primary);
  box-shadow: var(--btn-primary-shadow);
}

html[data-ui-theme="dark"] .cricket-ui .btn:not(.ghost):not(.danger):not(.tab):not(.wa) {
  color: #042218;
}
