/* Desk Cats themes.
 *
 * One vocabulary of tokens, two skins. Set data-theme on <html>:
 *   (none) | istanbul  the default: warm cream wearing İstanbul's colours, İznik tile
 *                      band and a rooftop skyline. Follows the OS for dark mode.
 *   gece               the night sky. Always dark. Drawn from duaaelhassan.it.com.
 *   "cream" is an alias for istanbul, so settings saved before the two merged still work.
 *
 * Everything else in the project reads these and nothing else, so a new theme is just
 * another block in this file.
 */

/* ── İstanbul ─────────────────────────────────────────────────────────────
 * The default. Cream's warmth and chunky friendly borders, wearing İstanbul's
 * colours: rooftop terracotta, simit gold, Bosphorus blue, İznik tile.
 * Follows the OS for dark mode. "cream" is kept as an alias for saved settings.
 */
:root, :root[data-theme=istanbul], :root[data-theme=cream] {
  --bg: #FBF3E6; --bg2: #F2E6D2; --card: #FFFDF8; --well: #F8EFE0;
  --ink: #3A322C; --muted: #857465; --line: #E7D8C2; --outline: #4A3B36; --focus: #2A6682;
  --peach: #DD8A5F; --sage: #A9D3AB; --butter: #E8B54A; --accent: #E8B54A;
  --on: #A9D3AB; --on-ink: #2F4A31;
  --btn-bg: #FFFDF8; --btn-ink: #3A322C; --primary-ink: #2F4A31;
  --warn-bg: #F5C3A8; --warn-ink: #4A2A18;
  --face-bg: #FBF3E6; --face-bd: #E7D8C2;
  --shadow-rgb: 74, 59, 54;
  --shadow: 0 2px 0 rgba(74, 59, 54, .08), 0 10px 24px rgba(74, 59, 54, .08);
  --r: 18px; --r-sm: 13px;
  --heading: #B2603A; --card-bd: 1px solid #EFE2CE;
  --head: Fredoka, ui-rounded, system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --label-font: var(--body); --label-track: .01em;
}

/* İstanbul follows the OS. Gece has made its mind up, so it opts out. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=gece]) {
    --bg: #262019; --bg2: #1E1915; --card: #342C25; --well: #2C241E;
    --ink: #F6EDE3; --muted: #BCAA99; --line: #4C4138; --outline: #1B1612;
    --heading: #E8A273; --card-bd: 1px solid #40372E;
    --face-bg: #262019; --face-bd: #4C4138;
    --btn-bg: #FFFDF8; --warn-bg: #E8A98C;
    --shadow-rgb: 0, 0, 0;
    --shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 10px 24px rgba(0, 0, 0, .3);
  }
}

/* ── Gece ─────────────────────────────────────────────────────────────────
 * #0c0818 / #ff3eb5 / #7b4fca come straight off duaaelhassan.it.com.
 */
:root[data-theme=gece] {
  --bg: #0B0A1A; --bg2: #140F2B; --card: rgba(27, 20, 52, .76); --well: rgba(123, 79, 202, .16);
  --ink: #EDE5FF; --muted: #A692D0; --line: rgba(123, 79, 202, .38); --outline: rgba(247, 215, 116, .5);
  --focus: #9BC8FF;
  --peach: #FF6FC5; --sage: #6FD6C4; --butter: #F7D774; --accent: #F7D774;
  --on: rgba(255, 62, 181, .26); --on-ink: #FFC4E8;
  --btn-bg: rgba(123, 79, 202, .24); --btn-ink: #EDE5FF; --primary-ink: #0E2420;
  --warn-bg: #FF6FC5; --warn-ink: #2A0A1C;
  --face-bg: #140F2B; --face-bd: rgba(123, 79, 202, .55);
  --shadow-rgb: 0, 0, 0;
  --shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 12px 28px rgba(0, 0, 0, .5);
  --r: 16px; --r-sm: 12px;
  --heading: #EDE5FF; --card-bd: 1px solid rgba(123, 79, 202, .3);
  --label-font: var(--mono); --label-track: .04em;
}

/* ── Gece: star dust and the faint grid from her site ──────────────────── */
:root[data-theme=gece] body { position: relative; }
:root[data-theme=gece] body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 12%, rgba(255, 255, 255, .85), transparent),
    radial-gradient(1.2px 1.2px at 72% 8%, rgba(247, 215, 116, .8), transparent),
    radial-gradient(1px 1px at 41% 30%, rgba(255, 255, 255, .55), transparent),
    radial-gradient(1.6px 1.6px at 88% 44%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1.1px 1.1px at 8% 58%, rgba(255, 62, 181, .75), transparent),
    radial-gradient(1.3px 1.3px at 60% 72%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1px 1px at 30% 88%, rgba(247, 215, 116, .6), transparent),
    radial-gradient(1.2px 1.2px at 93% 90%, rgba(255, 255, 255, .5), transparent),
    linear-gradient(rgba(123, 79, 202, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 79, 202, .05) 1px, transparent 1px),
    radial-gradient(ellipse at 12% 0%, rgba(255, 62, 181, .16), transparent 55%),
    radial-gradient(ellipse at 96% 32%, rgba(123, 79, 202, .2), transparent 52%);
  background-size: auto, auto, auto, auto, auto, auto, auto, auto, 64px 64px, 64px 64px, auto, auto;
}
:root[data-theme=gece] body > * { position: relative; z-index: 1; }

/* ── An İznik tile band across the top of the page ─────────────────────── */
:root:not([data-theme=gece]) body::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(90deg,
    #2A6682 0 10px, #C96F4A 10px 14px, #D9A441 14px 18px, #2A6682 18px 20px);
}

/* A dome-and-minaret silhouette. Drop <div class="dc-skyline"></div> where you want it. */
.dc-skyline { display: none; }
:root:not([data-theme=gece]) .dc-skyline {
  display: block; height: 42px; width: 100%; margin-bottom: 2px; opacity: .42;
  background: var(--peach);
  -webkit-mask: var(--dc-skyline) center / 100% 100% no-repeat;
  mask: var(--dc-skyline) center / 100% 100% no-repeat;
}
:root {
  --dc-skyline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 40' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0 40V36h16V12l2.5-8 2.5 8v24h9a15 12 0 0 1 30 0h8V26h20v10h2a22 18 0 0 1 44 0h6V11l2.5-8 2.5 8v25h7V28h26v8h3a17 14 0 0 1 34 0h5V24h30v12h6a14 11 0 0 1 28 0h4V13l2.5-8 2.5 8v23h9v4z'/%3E%3C/svg%3E");
}

/* Stars that mark a kept streak, used by the popup and the website. */
.dc-constellation { display: inline-flex; gap: 3px; align-items: center; }
.dc-constellation i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); font-style: normal; }
.dc-constellation i.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
