/* Platfighters.uy Themes - Generated from Theme Guide Appendix A & Section 3 */

:root,
[data-theme='default'] {
  --bg: #050B1F;
  --glow-1: rgba(0, 56, 168, .70);
  --glow-2: rgba(245, 197, 66, .22);
  --glow-3: rgba(120, 190, 255, .30);
  --text: #F2F5FA;
  --muted: #AEB6C7;
  --line: rgba(255, 255, 255, .14);
  --accent: #9FD6FF;
  --on-accent: #050B1F;
  --gold: #F5C542;
  --silver: #C9D1DC;
  --bronze: #CD7F32;
  --glass-fill: rgba(255, 255, 255, .08);
  --glass-border: rgba(255, 255, 255, .20);
  --glass-highlight: rgba(255, 255, 255, .45);
  --glass-shadow: rgba(0, 0, 0, .35);
  --glass-filter: blur(16px);
  --sheen-a: rgba(255, 255, 255, .16);
  --sheen-b: rgba(255, 255, 255, .06);
  --ph-a: rgba(255, 255, 255, .14);
  --ph-b: rgba(255, 255, 255, .04);
  --faint: rgba(255, 255, 255, .07);

  /* Legacy variable compatibility aliases */
  --blue: #0038A8;
  --sky: var(--accent);
}

[data-theme='daylight'] {
  --bg: #EAF2FF;
  --glow-1: rgba(0, 56, 168, .22);
  --glow-2: rgba(245, 197, 66, .30);
  --glow-3: rgba(120, 190, 255, .40);
  --text: #0B1633;
  --muted: #4A5878;
  --line: rgba(11, 22, 51, .14);
  --accent: #0038A8;
  --on-accent: #FFFFFF;
  --gold: #8A6508;
  --silver: #5F6B7C;
  --bronze: #9A5A1E;
  --glass-fill: rgba(255, 255, 255, .55);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-highlight: rgba(255, 255, 255, .90);
  --glass-shadow: rgba(11, 22, 51, .14);
  --glass-filter: blur(16px);
  --sheen-a: rgba(255, 255, 255, .60);
  --sheen-b: rgba(255, 255, 255, .15);
  --ph-a: rgba(11, 22, 51, .14);
  --ph-b: rgba(11, 22, 51, .04);
  --faint: rgba(11, 22, 51, .07);
}

[data-theme='high-contrast'] {
  --bg: #000000;
  --glow-1: rgba(0, 0, 0, 0);
  --glow-2: rgba(0, 0, 0, 0);
  --glow-3: rgba(0, 0, 0, 0);
  --text: #FFFFFF;
  --muted: #D0D6E0;
  --line: rgba(255, 255, 255, .50);
  --accent: #BFE6FF;
  --on-accent: #000000;
  --gold: #FFD84D;
  --silver: #E6EBF2;
  --bronze: #FF9F52;
  --glass-fill: #0A0A0A;
  --glass-border: rgba(255, 255, 255, .80);
  --glass-highlight: rgba(255, 255, 255, 0);
  --glass-shadow: rgba(0, 0, 0, 0);
  --glass-filter: none;
  --sheen-a: rgba(255, 255, 255, 0);
  --sheen-b: rgba(255, 255, 255, 0);
  --ph-a: rgba(255, 255, 255, .20);
  --ph-b: rgba(255, 255, 255, .08);
  --faint: rgba(255, 255, 255, .12);
}

[data-theme='oled-black'] {
  --bg: #000000;
  --glow-1: rgba(0, 56, 168, .38);
  --glow-2: rgba(245, 197, 66, .10);
  --glow-3: rgba(120, 190, 255, .16);
  --glass-shadow: rgba(0, 0, 0, .60);
}

[data-theme='dusk'] {
  --bg: #1B0F3D;
  --glow-1: rgba(255, 79, 163, .38);
  --glow-2: rgba(255, 184, 77, .26);
  --glow-3: rgba(120, 90, 255, .38);
  --text: #FFF4FB;
  --muted: #D6C3EA;
  --accent: #FF8FD0;
  --on-accent: #1B0F3D;
  --silver: #D4CCE6;
  --bronze: #E0904F;
}

[data-theme='yerba'] {
  --bg: #06201A;
  --glow-1: rgba(16, 185, 129, .35);
  --glow-2: rgba(245, 197, 66, .14);
  --glow-3: rgba(140, 240, 200, .22);
  --text: #EFFAF5;
  --muted: #A9C9BD;
  --accent: #8CF0C8;
  --on-accent: #06201A;
  --silver: #C9D6D0;
  --bronze: #D08A4A;
}

/* Theme color transitions (150ms), disabled under prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  body.theme-transitioning,
  body.theme-transitioning .glass,
  body.theme-transitioning .panel,
  body.theme-transitioning .pill,
  body.theme-transitioning a,
  body.theme-transitioning button,
  body.theme-transitioning input,
  body.theme-transitioning select {
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease !important;
  }
}

/* High contrast specific link underlines and focus outline */
[data-theme='high-contrast'] a:not(.brand):not(.btn):not(.lang-btn) {
  text-decoration: underline;
}
[data-theme='high-contrast'] :focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Theme Selector Widget Styles */
.theme-selector-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--text);
  font: 600 14px 'Space Grotesk', system-ui, sans-serif;
  border-radius: 999px;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
  user-select: none;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle-btn .theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-dropdown {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  min-width: 260px;
  padding: 8px;
  border-radius: 20px;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px var(--glass-shadow), 0 0 0 1px var(--glass-highlight) inset;
}

.theme-dropdown.open {
  display: flex;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: 500 14px 'Space Grotesk', system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.theme-option:hover {
  background: var(--faint);
}

.theme-option.selected {
  background: var(--faint);
  border-color: var(--glass-border);
  font-weight: 700;
}

.theme-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
}

.theme-name {
  flex: 1;
  white-space: nowrap;
}

.theme-tag {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  background: var(--faint);
  padding: 2px 6px;
  border-radius: 6px;
}

.theme-check {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0;
  font-weight: 700;
  font-size: 14px;
}

.theme-option.selected .theme-check {
  opacity: 1;
}
