/* (added) A look for each style mode. style.css is the Base look and stays untouched; script.js sets
   <body data-theme="..."> to the current mode's id (styles/styles.json), and copies --c0..--c7 into the
   colors of the floating notes. A new mode gets a look by adding a block of variables below. */

body[data-theme="jazz"] {
  /* a wood-panelled jazz club: stained-wood and brass buttons, warm to cool like the original rainbow */
  --c0: #C9634A; /* cherry */
  --c1: #D07A3E; /* copper */
  --c2: #E0A04F; /* amber */
  --c3: #E6C46A; /* brass */
  --c4: #D8C9A0; /* maple */
  --c5: #A9B37A; /* olive felt */
  --c6: #7FA394; /* patina */
  --c7: #8A96B8; /* smoky blue */
  --label: #2A170C;
  --accent: #E3B25C;
  --panel: #2E1C10;
}

body[data-theme="jpop"] {
  /* city-pop night: pastel neon buttons on a violet sky with a pink glow */
  --c0: #FF8FAB; /* sakura */
  --c1: #FFB38A; /* peach */
  --c2: #FFE27A; /* lemon */
  --c3: #A8E6A1; /* mint */
  --c4: #7FE0D8; /* aqua */
  --c5: #8EC5FF; /* sky */
  --c6: #B39DFF; /* lavender */
  --c7: #E59BFF; /* orchid */
  --label: #24164F;
  --accent: #FF8FAB;
  --panel: #23185A;
}

/* ---- backgrounds: one layer per look over the page's .background, cross-faded on a mode change ---- */

.background {
  position: relative;
  overflow: hidden;
}

.background::before,
.background::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.background::before {
  /* walnut planks: a warm stage light, plank seams, two layers of grain, the stain */
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(255, 196, 120, 0.22), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 158px, rgba(0, 0, 0, 0.35) 158px 160px),
    repeating-linear-gradient(91deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(92.5deg, rgba(60, 30, 10, 0.14) 0 2px, transparent 2px 23px),
    repeating-linear-gradient(89deg, rgba(255, 214, 160, 0.05) 0 3px, transparent 3px 17px),
    linear-gradient(180deg, #6b4226 0%, #4a2c18 50%, #2a170c 100%);
}

.background::after {
  /* night sky: pink and aqua glows, scattered sparkles, violet gradient */
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 143, 171, 0.45), transparent 40%),
    radial-gradient(circle at 12% 72%, rgba(127, 224, 216, 0.2), transparent 45%),
    radial-gradient(circle at 20px 30px, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle at 95px 75px, rgba(255, 205, 230, 0.6) 0 1.2px, transparent 2px),
    radial-gradient(circle at 55px 118px, rgba(205, 240, 255, 0.55) 0 1px, transparent 1.6px),
    linear-gradient(180deg, #3a2a86 0%, #2a1b63 45%, #170f3b 100%);
  background-size: auto, auto, 140px 140px, 190px 190px, 230px 230px, auto; /* unequal tiles: no visible grid */
}

body[data-theme="jazz"] .background::before,
body[data-theme="jpop"] .background::after {
  opacity: 1;
}

/* ---- buttons, piano-key highlights and accents (only when a mode has its own look) ---- */

.controls button.color {
  transition: transform 0.2s linear, background-color 0.5s ease, color 0.5s ease;
}

body[data-theme]:not([data-theme="base"]) .color-0 { background: var(--c0); fill: var(--c0); }
body[data-theme]:not([data-theme="base"]) .color-1 { background: var(--c1); fill: var(--c1); }
body[data-theme]:not([data-theme="base"]) .color-2 { background: var(--c2); fill: var(--c2); }
body[data-theme]:not([data-theme="base"]) .color-3 { background: var(--c3); fill: var(--c3); }
body[data-theme]:not([data-theme="base"]) .color-4 { background: var(--c4); fill: var(--c4); }
body[data-theme]:not([data-theme="base"]) .color-5 { background: var(--c5); fill: var(--c5); }
body[data-theme]:not([data-theme="base"]) .color-6 { background: var(--c6); fill: var(--c6); }
body[data-theme]:not([data-theme="base"]) .color-7 { background: var(--c7); fill: var(--c7); }

body[data-theme]:not([data-theme="base"]) .controls button.color {
  color: var(--label);
}

body[data-theme]:not([data-theme="base"]) .controls button.settings:hover {
  fill: var(--accent);
}

body[data-theme]:not([data-theme="base"]) .controls button.settings.style:hover {
  color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) .dialog {
  background: var(--panel);
  border-color: var(--accent);
  -webkit-box-shadow: 8px 8px 0 var(--accent);
  box-shadow: 8px 8px 0 var(--accent);
}

body[data-theme]:not([data-theme="base"]) .dialog a:link,
body[data-theme]:not([data-theme="base"]) .dialog a:visited {
  color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) .dialog select {
  border-bottom-color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) .control-indicator {
  border-color: var(--accent);
  color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) label.radio > input:checked ~ .control-indicator {
  background-color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) button.splash-button {
  border-color: var(--accent);
  color: var(--accent);
}

body[data-theme]:not([data-theme="base"]) button.splash-button:hover {
  background-color: var(--accent);
  color: var(--label);
}
