/* RudyOS themes. Each theme redefines the colour tokens and adds a few
   decorations: window edges (.win-decor), the taskbar and the sticky note.
   Decorations are pseudo-elements with inline SVG, pointer-events: none. */

/* ─── Тильт (default tokens live in os.css) ─────────────── */
:root { --note-top: #ffc2dc; --note-bottom: #ff9cc8; }
[data-theme='tilt'] .win-decor::before {
  /* raindrops on the title bar glass */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 42px; border-radius: var(--win-radius) var(--win-radius) 0 0;
  background:
    radial-gradient(circle at 18% 32%, rgba(255, 236, 248, 0.45) 0 1px, rgba(255, 236, 248, 0.08) 1.6px, transparent 2.6px),
    radial-gradient(circle at 31% 70%, rgba(255, 236, 248, 0.35) 0 0.8px, transparent 2px),
    radial-gradient(circle at 44% 24%, rgba(255, 236, 248, 0.4) 0 1.3px, rgba(255, 236, 248, 0.06) 2px, transparent 3.2px),
    radial-gradient(circle at 57% 62%, rgba(255, 236, 248, 0.3) 0 0.8px, transparent 2px),
    radial-gradient(circle at 68% 38%, rgba(255, 236, 248, 0.38) 0 1px, transparent 2.4px),
    radial-gradient(circle at 76% 78%, rgba(255, 236, 248, 0.28) 0 0.7px, transparent 1.8px);
  opacity: 0.7;
}
[data-theme='tilt'] .win.is-max .win-decor::before { border-radius: 0; }

/* ─── Осень ─────────────────────────────────────────────── */
[data-theme='autumn'] {
  --void: #0c0b0a; --surface: #16120f; --surface-2: #1e1814; --surface-3: #2a211b; --surface-4: #382c23;
  --line: rgba(255, 222, 186, 0.08); --line-strong: rgba(255, 222, 186, 0.15);
  --text: #f6ede3; --text-2: #cbb59f; --text-3: #947d68;
  --accent: #f08a3c; --accent-2: #ffae6e; --accent-ink: #2a1204; --accent-soft: rgba(240, 138, 60, 0.15); --accent-line: rgba(240, 138, 60, 0.42);
  --good: #a8d672; --neon: #ffe7c4; --neon-glow: #ff8a2a; --neon-halo: rgba(255, 138, 42, 0.32);
  --bar-bg: rgba(18, 14, 11, 0.9); --selection: rgba(240, 138, 60, 0.2);
  --icon-a: #f08a3c; --icon-b: #b8452a; --icon-c: #f2c14e; --icon-d: #2c221b; --icon-e: #fff3e3;
  --note-top: #ffd89a; --note-bottom: #f5bb5c;
}
[data-theme='autumn'] .win-decor::before {
  content: ''; position: absolute; top: -11px; left: 26px; width: 92px; height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 26'%3E%3Cg transform='translate(10 16) rotate(-32)'%3E%3Cpath d='M0-9C7-5 8 4 0 9-8 4-7-5 0-9z' fill='%23d9772b'/%3E%3Cpath d='M0-8V10' stroke='%235a2308' stroke-width='.9'/%3E%3C/g%3E%3Cg transform='translate(29 18) rotate(48)'%3E%3Cpath d='M0-8C6-4 7 3 0 8-7 3-6-4 0-8z' fill='%23b8431f'/%3E%3Cpath d='M0-7V9' stroke='%235a2308' stroke-width='.9'/%3E%3C/g%3E%3Cg transform='translate(46 15) rotate(-75)'%3E%3Cpath d='M0-7C5-3 6 3 0 7-6 3-5-3 0-7z' fill='%23e8b04a'/%3E%3Cpath d='M0-6V8' stroke='%236a4108' stroke-width='.8'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
}
[data-theme='autumn'] .win-decor::after {
  content: ''; position: absolute; top: -8px; right: 150px; width: 26px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 22'%3E%3Cg transform='translate(13 12) rotate(62)'%3E%3Cpath d='M0-9C7-5 8 4 0 9-8 4-7-5 0-9z' fill='%23c9611f'/%3E%3Cpath d='M0-8V10' stroke='%235a2308' stroke-width='.9'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
}
[data-theme='autumn'] .win.is-max .win-decor::before, [data-theme='autumn'] .win.is-max .win-decor::after { display: none; }

/* ─── Хэллоуин ──────────────────────────────────────────── */
[data-theme='halloween'] {
  --void: #0a0610; --surface: #140c18; --surface-2: #1b1020; --surface-3: #26162b; --surface-4: #341e3a;
  --line: rgba(255, 210, 240, 0.08); --line-strong: rgba(255, 210, 240, 0.15);
  --text: #f7ecf2; --text-2: #c7afc6; --text-3: #8e748f;
  --accent: #ff7a1a; --accent-2: #ffa24d; --accent-ink: #250b00; --accent-soft: rgba(255, 122, 26, 0.15); --accent-line: rgba(255, 122, 26, 0.45);
  --good: #a6e36b; --neon: #ffe2bd; --neon-glow: #ff6a00; --neon-halo: rgba(255, 106, 0, 0.38);
  --bar-bg: rgba(14, 8, 18, 0.9); --selection: rgba(255, 122, 26, 0.2);
  --icon-a: #ff7a1a; --icon-b: #7b3fb8; --icon-c: #a6e36b; --icon-d: #22132a; --icon-e: #fff0e6;
  --note-top: #ffbf7a; --note-bottom: #ff9640;
}
[data-theme='halloween'] .app-h, [data-theme='halloween'] .rl-title, [data-theme='halloween'] .theme-wipe b { font-family: 'Rubik Wet Paint', var(--font-display); letter-spacing: 0.01em; }
/* v116: the decorations of «Хэллоуин» live in halloween.css */

/* ─── Зима ──────────────────────────────────────────────── */
[data-theme='winter'] {
  --void: #070c16; --surface: #0e1624; --surface-2: #131e30; --surface-3: #1b2a41; --surface-4: #263953;
  --line: rgba(205, 228, 255, 0.09); --line-strong: rgba(205, 228, 255, 0.17);
  --text: #eef5ff; --text-2: #a9bdd6; --text-3: #7189a7;
  --accent: #8fd3ff; --accent-2: #bfe6ff; --accent-ink: #04121f; --accent-soft: rgba(143, 211, 255, 0.14); --accent-line: rgba(143, 211, 255, 0.42);
  --good: #7ee2b4; --neon: #e9f7ff; --neon-glow: #4fb8ff; --neon-halo: rgba(79, 184, 255, 0.35);
  --bar-bg: rgba(9, 15, 26, 0.9); --selection: rgba(143, 211, 255, 0.18);
  --icon-a: #8fd3ff; --icon-b: #e8546b; --icon-c: #ffd66e; --icon-d: #17243a; --icon-e: #f4fbff;
  --note-top: #e0f3ff; --note-bottom: #bde3ff;
}
[data-theme='winter'] .win-decor::before {
  /* snow drift sitting on the window */
  content: ''; position: absolute; top: -13px; left: 10px; width: min(58%, 540px); height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24C8 15 18 11 34 12S62 6 82 8s34-3 54 0 32-7 52-5 36 3 56 2 32-6 50-2 36 1 52 4 26 3 34 9l6 8z' fill='%23dfeaf8'/%3E%3Cpath d='M0 24C8 17 18 13 34 14S62 8 82 10s34-3 54 0 32-7 52-5 36 3 56 2 32-6 50-2 36 1 52 4 26 3 34 9l6 8z' fill='%23fbfdff'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
[data-theme='winter'] .win-decor::after {
  content: ''; position: absolute; inset: 42px 0 0; border-radius: 0 0 var(--win-radius) var(--win-radius);
  background: radial-gradient(circle at 0 100%, rgba(220, 240, 255, 0.13), transparent 110px), radial-gradient(circle at 100% 100%, rgba(220, 240, 255, 0.1), transparent 90px);
}
[data-theme='winter'] .win.is-max .win-decor::before { display: none; }
[data-theme='winter'] .taskbar::before, [data-theme='winter'] .taskbar::after {
  /* a garland along the taskbar; the second layer blinks in other colours */
  content: ''; position: absolute; left: 0; right: 0; top: -7px; height: 16px; pointer-events: none;
  background-repeat: repeat-x; background-size: 96px 16px;
}
[data-theme='winter'] .taskbar::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 16'%3E%3Cpath d='M0 3Q24 11 48 3T96 3' fill='none' stroke='%23213247' stroke-width='1.4'/%3E%3Cg%3E%3Crect x='21' y='6' width='3' height='3' fill='%23213247'/%3E%3Cellipse cx='22.5' cy='11.5' rx='3' ry='4' fill='%23ff5a6e'/%3E%3Crect x='69' y='6' width='3' height='3' fill='%23213247'/%3E%3Cellipse cx='70.5' cy='11.5' rx='3' ry='4' fill='%23ffd66e'/%3E%3C/g%3E%3C/svg%3E");
  filter: drop-shadow(0 0 4px rgba(255, 200, 120, 0.7));
}
[data-theme='winter'] .taskbar::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 16'%3E%3Cellipse cx='22.5' cy='11.5' rx='3' ry='4' fill='%237ee2b4'/%3E%3Cellipse cx='70.5' cy='11.5' rx='3' ry='4' fill='%238fd3ff'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 5px rgba(140, 220, 255, 0.9));
  animation: garland 2.6s steps(1, end) infinite;
}
@keyframes garland { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

/* ─── Хогвартс ──────────────────────────────────────────── */
[data-theme='magic'] {
  --void: #0b0906; --surface: #16110c; --surface-2: #1e1711; --surface-3: #2a2018; --surface-4: #392c20;
  --line: rgba(236, 204, 140, 0.1); --line-strong: rgba(236, 204, 140, 0.2);
  --text: #f4e9d3; --text-2: #cfb994; --text-3: #95815f;
  --accent: #d9a441; --accent-2: #f0c36a; --accent-ink: #241703; --accent-soft: rgba(217, 164, 65, 0.15); --accent-line: rgba(217, 164, 65, 0.48);
  --good: #7fc79a; --neon: #fff2cf; --neon-glow: #ffb52e; --neon-halo: rgba(255, 181, 46, 0.35);
  --bar-bg: rgba(17, 13, 9, 0.92); --selection: rgba(217, 164, 65, 0.2);
  --icon-a: #d9a441; --icon-b: #7d1f2a; --icon-c: #2f6b44; --icon-d: #231a12; --icon-e: #f6e8c8;
  --note-top: #f4e4bf; --note-bottom: #e4cb91;
  --display-font: 'Cormorant Garamond', Georgia, serif; --display-tracking: 0;
}
[data-theme='magic'] :is(.app-h, .dt-title, .rl-title, .rl-result p b, .np-page h2, .tm-kpis b, .rats-count b, .tm-place, .theme-wipe b, .cover-fallback) { font-style: italic; font-weight: 600; }
[data-theme='magic'] .taskbar { border-top-color: rgba(217, 164, 65, 0.4); }
[data-theme='magic'] .win { border-color: rgba(217, 164, 65, 0.3); }
[data-theme='magic'] .win-decor::after {
  /* gold corners */
  content: ''; position: absolute; inset: 3px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23d9a441' stroke-width='1.2'%3E%3Cpath d='M2 38V9a7 7 0 0 1 7-7h29'/%3E%3Cpath d='M7 30V13a6 6 0 0 1 6-6h17'/%3E%3Ccircle cx='13' cy='13' r='2.6'/%3E%3C/svg%3E") no-repeat left top / 34px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23d9a441' stroke-width='1.2'%3E%3Cpath d='M38 38V9a7 7 0 0 0-7-7H2'/%3E%3Cpath d='M33 30V13a6 6 0 0 0-6-6H10'/%3E%3Ccircle cx='27' cy='13' r='2.6'/%3E%3C/svg%3E") no-repeat right top / 34px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23d9a441' stroke-width='1.2'%3E%3Cpath d='M2 2v29a7 7 0 0 0 7 7h29'/%3E%3Cpath d='M7 10v17a6 6 0 0 0 6 6h17'/%3E%3Ccircle cx='13' cy='27' r='2.6'/%3E%3C/svg%3E") no-repeat left bottom / 34px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23d9a441' stroke-width='1.2'%3E%3Cpath d='M38 2v29a7 7 0 0 1-7 7H2'/%3E%3Cpath d='M33 10v17a6 6 0 0 1-6 6H10'/%3E%3Ccircle cx='27' cy='27' r='2.6'/%3E%3C/svg%3E") no-repeat right bottom / 34px;
  opacity: 0.6;
}
[data-theme='magic'] .win-decor::before {
  /* a candle floating above the window */
  content: ''; position: absolute; top: -60px; right: 72px; width: 14px; height: 50px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 50'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.5' cy='.35' r='.6'%3E%3Cstop offset='0' stop-color='%23fffbe8'/%3E%3Cstop offset='.5' stop-color='%23ffd46b'/%3E%3Cstop offset='1' stop-color='%23ff8a1e' stop-opacity='0'/%3E%3C/radialGradient%3E%3ClinearGradient id='w' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23bda883'/%3E%3Cstop offset='.45' stop-color='%23f6ead0'/%3E%3Cstop offset='1' stop-color='%23a8926b'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cellipse cx='7' cy='8' rx='4' ry='7.5' fill='url(%23g)'/%3E%3Cpath d='M7 14v3' stroke='%232a2016'/%3E%3Crect x='3' y='17' width='8' height='33' rx='1' fill='url(%23w)'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 10px rgba(255, 190, 90, 0.8));
  animation: candle-float 4.8s ease-in-out infinite;
}
[data-theme='magic'] .win.is-max .win-decor::before { display: none; }
@keyframes candle-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
/* The preview pane and the Свойства card become a letter on parchment. */
[data-theme='magic'] :is(.xp-preview, .props) {
  --text: #2d1f10; --text-2: #4d3920; --text-3: #7a6243; --line: rgba(90, 60, 20, 0.16); --line-strong: rgba(90, 60, 20, 0.28);
  --surface-2: rgba(120, 80, 30, 0.06); --surface-3: rgba(120, 80, 30, 0.1); --surface-4: rgba(120, 80, 30, 0.18);
  --accent: #7d1f2a; --accent-2: #9c2a37; --accent-ink: #fff4e0; --accent-soft: rgba(125, 31, 42, 0.1); --accent-line: rgba(125, 31, 42, 0.35);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.35), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(120, 70, 20, 0.22), transparent 55%),
    linear-gradient(170deg, #f1e3c2, #e3cd9e 60%, #d8bd86);
  box-shadow: inset 0 0 40px rgba(110, 70, 20, 0.35);
}
[data-theme='magic'] .xp-preview .dt-pv .dt-poster::after {
  /* wax seal */
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #b23a46, #7d1f2a 60%, #5a121c);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 0 0 4px rgba(0, 0, 0, 0.12);
}

/* ─── Лето ──────────────────────────────────────────────── */
[data-theme='summer'] {
  --void: #120b1a; --surface: #1a1224; --surface-2: #22172d; --surface-3: #2e2039; --surface-4: #3d2b4a;
  --line: rgba(255, 220, 210, 0.09); --line-strong: rgba(255, 220, 210, 0.17);
  --text: #fff2ec; --text-2: #e2c3bc; --text-3: #a88c96;
  --accent: #ff8a5c; --accent-2: #ffb088; --accent-ink: #2b0d02; --accent-soft: rgba(255, 138, 92, 0.15); --accent-line: rgba(255, 138, 92, 0.45);
  --good: #6fe0c8; --neon: #fff1de; --neon-glow: #ff6b4a; --neon-halo: rgba(255, 107, 74, 0.35);
  --bar-bg: rgba(20, 12, 28, 0.9); --selection: rgba(255, 138, 92, 0.2);
  --icon-a: #ff8a5c; --icon-b: #3fc1c9; --icon-c: #ffd36b; --icon-d: #2a1d33; --icon-e: #fff6ef;
  --note-top: #ffe59a; --note-bottom: #ffc95c;
}
[data-theme='summer'] .win-decor::before {
  content: ''; position: absolute; left: 0; top: 0; width: 60%; height: 120px; border-top-left-radius: var(--win-radius);
  background: radial-gradient(ellipse at 0 0, rgba(255, 176, 110, 0.16), transparent 65%);
}
[data-theme='summer'] .win.is-max .win-decor::before { border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-theme='magic'] .win-decor::before, [data-theme='winter'] .taskbar::after { animation: none; }
}
@media (max-width: 759px) {
  [data-theme='magic'] .win-decor::before, [data-theme='autumn'] .win-decor::before, [data-theme='autumn'] .win-decor::after, [data-theme='winter'] .win-decor::before { display: none; }
  [data-theme='winter'] .taskbar::before, [data-theme='winter'] .taskbar::after { left: 18px; right: 18px; }
}
