/* ═══ WINTER · Frost & Snowman ═════════════════════════════════════════════
   Loaded by the live build. Independent of Cherry: cinematic gouache,
   blue-hour snow, snow-laden pine, aurora, snowman. */

[data-palette="winter"] {
  --ground: light-dark(#f5f8fb, #070b12);
  --surface: light-dark(#ffffff, #0d1420);
  --surface-2: light-dark(#eef3f8, #14202e);
  --line: light-dark(#dde7f0, #1f2e3f);
  --line-strong: light-dark(#c4d5e4, #30455a);
  --ink: light-dark(#172230, #eaf3ff);
  --ink-2: light-dark(#4e6072, #a8bdd2);
  --ink-3: light-dark(#7e8f9e, #7089a0);
  --accent: light-dark(#3d6fa8, #9cc7ff);
  --accent-ink: light-dark(#ffffff, #08111c);
  --accent-wash: light-dark(#eaf2fb, #15253a);
  --accent-line: light-dark(#bcd3ea, #33506f);
  --console: light-dark(#0f1724, #05080d);
  --chrome: light-dark(#14202e, #101b27);
  --chrome-2: light-dark(#1e2e3f, #182736);
  --chrome-line: light-dark(#33485c, #2a4157);
  --chrome-ink: light-dark(#eef6ff, #edf7ff);
  --chrome-muted: light-dark(#b6c8d8, #a9bfd2);
}

@media (min-width: 921px) {
  :root[data-palette="winter"] .sakura-host {
    background: #101b27;
    border-right-color: #2a4157;
    isolation: isolate;
  }

  :root[data-palette="winter"] .sakura-host > .sakura-scene {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(180deg, #070b12 0%, #101b27 58%, #172b42 100%);
  }

  :root[data-palette="winter"] .sakura-host > :not(.sakura-scene) {
    position: relative;
    z-index: 2;
  }

  .sakura-scene > div { position: absolute; inset: 0; pointer-events: none; }

  :root[data-palette="winter"] .sakura-sky {
    background-image: url("images/themes/winter/sky.webp");
    opacity: .9;
  }

  :root[data-palette="winter"] .sakura-tree-back {
    background-image: url("images/themes/winter/tree-back.webp");
    opacity: .98;
  }

  :root[data-palette="winter"] .sakura-tree-mid {
    background-image: url("images/themes/winter/tree-mid.webp");
    opacity: .38;
    filter: brightness(.82) saturate(.9);
  }

  :root[data-palette="winter"] .sakura-branch-front {
    background-image: url("images/themes/winter/branch-front.webp");
    opacity: .9;
  }

  :root[data-palette="winter"] .sakura-branch-hanging {
    background-image: url("images/themes/winter/branch-hanging.webp");
    opacity: .93;
  }

  :root[data-palette="winter"] .sakura-scrim {
    background:
      linear-gradient(90deg, rgb(7 11 18 / .9) 0%, rgb(7 11 18 / .68) 34%, rgb(16 27 39 / .2) 70%, rgb(7 11 18 / .5) 100%),
      linear-gradient(180deg, rgb(10 17 27 / .12) 0%, transparent 38%, rgb(22 36 52 / .55) 100%);
  }

  :root[data-palette="winter"] .sakura-theme-extra {
    z-index: 5;
    background-image: url("images/themes/winter/extra.webp");
    background-position: 6px calc(100% - 52px);
    background-size: 45% auto;
    background-repeat: no-repeat;
    opacity: 1;
    filter: drop-shadow(0 0 16px rgb(156 199 255 / .22));
  }

  :root[data-palette="winter"] .sakura-host .side-brand {
    border: 1px solid rgb(156 199 255 / .28);
    background: linear-gradient(135deg, rgb(20 32 46 / .86), rgb(16 27 39 / .62));
    box-shadow: inset 0 1px 0 rgb(238 246 255 / .12), 0 12px 28px rgb(0 0 0 / .3);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
  }

  :root[data-palette="winter"] .sakura-host .side-brand::after {
    display: none;
    content: none;
  }

  :root[data-palette="winter"] .sakura-host .side-brand .brand-mark {
    color: #9cc7ff;
    border-color: rgb(156 199 255 / .5);
    background: #101b27 url("images/themes/winter/mark.webp") center / cover no-repeat;
    filter: drop-shadow(0 0 10px rgb(156 199 255 / .25));
  }

  :root[data-palette="winter"] .sakura-host .side-brand-name {
    color: #eef6ff;
    font-size: 15px;
    letter-spacing: .1em;
  }

  :root[data-palette="winter"] .sakura-host .side-brand-name em { color: #9cc7ff; }

  :root[data-palette="winter"] .sakura-host .side-brand-sub {
    color: #b6c8d8;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  :root[data-palette="winter"] .sakura-host .nav-section {
    color: #b7c9da;
    text-shadow: 0 1px 3px rgb(0 0 0 / .65);
  }

  :root[data-palette="winter"] .sakura-host .nav-item {
    color: #eaf3ff;
    border: 1px solid transparent;
    border-radius: 8px;
    text-shadow: 0 1px 3px rgb(0 0 0 / .6);
  }

  :root[data-palette="winter"] .sakura-host .nav-item svg { color: #9cc7ff; }

  :root[data-palette="winter"] .sakura-host .nav-item:hover {
    background: rgb(156 199 255 / .1);
    border-color: rgb(156 199 255 / .2);
    color: #eef6ff;
  }

  :root[data-palette="winter"] .sakura-host .nav-item.active {
    background: linear-gradient(90deg, rgb(156 199 255 / .34), rgb(156 199 255 / .08));
    border-color: rgb(156 199 255 / .3);
    color: #eef6ff;
    box-shadow: inset 3px 0 0 #9cc7ff, 0 4px 14px rgb(0 0 0 / .18);
  }

  :root[data-palette="winter"] .sakura-host .nav-item.active::before {
    display: none;
    content: none;
  }

  :root[data-palette="winter"] .sakura-host .nav-item.active svg {
    color: #9cc7ff;
    filter: drop-shadow(0 0 6px rgb(156 199 255 / .35));
  }

  :root[data-palette="winter"] .sakura-host .side-conn {
    color: #b7c9da;
    border-top-color: rgb(156 199 255 / .16);
    text-shadow: 0 1px 3px rgb(0 0 0 / .55);
  }

  :root[data-palette="winter"] .sakura-host > .btn-danger-ghost {
    color: #c45a68;
    border-color: rgb(156 199 255 / .18);
    background: rgb(10 17 27 / .35);
  }

  :root[data-palette="winter"] .sakura-topbar {
    padding: 5.5px clamp(9px, 1.3vw, 18px);
    border-bottom-color: rgb(156 199 255 / .16);
    background: linear-gradient(180deg, rgb(10 17 27 / .72), rgb(10 17 27 / .38));
    box-shadow: 0 10px 32px rgb(0 0 0 / .3);
    -webkit-backdrop-filter: blur(14px) saturate(1.06);
    backdrop-filter: blur(14px) saturate(1.06);
    isolation: isolate;
  }

  :root[data-palette="winter"] .sakura-topbar > :not(.sakura-topbar-scene) {
    position: relative;
    z-index: 2;
  }

  :root[data-palette="winter"] .sakura-topbar .page-title {
    color: #eef6ff;
    text-shadow: 0 1px 3px rgb(0 0 0 / .55);
  }

  :root[data-palette="winter"] .sakura-topbar .page-title::before { color: #b7c9da; }

  :root[data-palette="winter"] .sakura-topbar .acct-select,
  :root[data-palette="winter"] .sakura-topbar .btn:not(.run-pill) {
    border-color: rgb(156 199 255 / .22);
    background: rgb(10 17 27 / .62);
    color: #eaf3ff;
    box-shadow: inset 0 1px 0 rgb(238 246 255 / .06);
  }

  :root[data-palette="winter"] .sakura-topbar .acct-select { color-scheme: dark; }

  :root[data-palette="winter"] .sakura-topbar .btn:not(.run-pill):hover {
    border-color: rgb(156 199 255 / .34);
    background: rgb(156 199 255 / .12);
    color: #eef6ff;
  }

  :root[data-palette="winter"] .sakura-topbar .connect-pill {
    border-color: rgb(156 199 255 / .22);
    background: rgb(10 17 27 / .55);
    color: #c9d8e8;
  }

  :root[data-palette="winter"] .sakura-topbar .connect-pill.connected {
    border-color: rgb(127 191 143 / .42);
    background: rgb(47 122 82 / .22);
    color: #b7e3c5;
  }

  :root[data-palette="winter"] .sakura-topbar .run-pill {
    border-color: rgb(156 199 255 / .22);
    box-shadow: 0 5px 16px rgb(0 0 0 / .28), inset 0 1px 0 rgb(255 255 255 / .12);
  }

  :root[data-palette="winter"] .sakura-topbar .run-pill.running {
    border-color: rgb(127 191 143 / .55);
    background: linear-gradient(135deg, #3f8a5f, #2f6b49);
    color: #f2fff6;
  }

  :root[data-palette="winter"] .sakura-topbar .run-pill.stopped {
    border-color: rgb(196 90 104 / .45);
    background: linear-gradient(135deg, #c45a68, #8f2f3e);
    color: #fff3f5;
  }

  :root[data-palette="winter"] .sakura-topbar .run-pending { color: #bcd3ea; }

  :root[data-palette="winter"] .sakura-main {
    position: relative;
    isolation: isolate;
    background: #070b12;
  }

  :root[data-palette="winter"] .sakura-main::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: clamp(230px, 20vw, 286px);
    z-index: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgb(10 17 27 / .12) 0%, rgb(10 17 27 / .32) 36%, rgb(10 17 27 / .72) 100%),
      url("images/themes/winter/main-hero.webp") center top / cover no-repeat;
  }

  :root[data-palette="winter"] .sakura-main > .content {
    position: relative;
    z-index: 1;
    padding: clamp(10px, 1.5vw, 21px);
  }

  :root[data-palette="winter"] .sakura-main .command-hero {
    align-self: stretch;
    min-height: 126px;
    padding: clamp(9px, 1.2vw, 15px);
    background: linear-gradient(90deg, rgb(7 11 18 / .9) 0%, rgb(7 11 18 / .62) 42%, rgb(16 27 39 / .12) 78%, rgb(7 11 18 / .35) 100%);
    border-color: rgb(156 199 255 / .16);
    box-shadow: 0 18px 42px rgb(0 0 0 / .28);
  }

  :root[data-palette="winter"] .sakura-main .command-hero-copy {
    flex: 1 1 auto;
    max-width: 760px;
  }

  :root[data-palette="winter"] .sakura-main .command-hero h1 { margin: 4px 0 2px; }

  :root[data-palette="winter"] .sakura-main .command-hero p {
    max-width: 720px;
    margin: 0;
  }

  :root[data-palette="winter"] .sakura-main .command-hero::before {
    background: linear-gradient(120deg, rgb(156 199 255 / .18), transparent 64%);
  }

  :root[data-palette="winter"] .sakura-main .page-banner {
    background: linear-gradient(90deg, rgb(7 11 18 / .9) 0%, rgb(7 11 18 / .62) 45%, rgb(16 27 39 / .14) 80%);
    border-color: rgb(156 199 255 / .16);
    box-shadow: 0 14px 34px rgb(0 0 0 / .24);
  }

  :root[data-palette="winter"] .sakura-main .page-banner::before {
    background: linear-gradient(120deg, rgb(156 199 255 / .18), transparent 64%);
  }

  :root[data-palette="winter"] .sakura-main .panel {
    border-color: color-mix(in srgb, var(--line-strong) 64%, transparent);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    box-shadow: 0 12px 32px rgb(0 0 0 / .16), inset 0 1px 0 rgb(238 246 255 / .05);
    -webkit-backdrop-filter: blur(12px) saturate(1.06);
    backdrop-filter: blur(12px) saturate(1.06);
  }

  :root[data-palette="winter"] .sakura-main .status-strip {
    grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
    border-color: rgb(156 199 255 / .16);
    background: color-mix(in srgb, #07111c 46%, transparent);
    box-shadow: 0 8px 24px rgb(0 0 0 / .18), inset 0 1px 0 rgb(238 246 255 / .05);
    -webkit-backdrop-filter: blur(18px) saturate(1.06);
    backdrop-filter: blur(18px) saturate(1.06);
  }

  /* The strip is the same glass as the dashboard's command panel: the winter art stays visible
     through it instead of a white bar cutting across the scene. */
  :root[data-palette="winter"] .sakura-main .status-strip .stat-value { color: var(--chrome-ink); }
  :root[data-palette="winter"] .sakura-main .status-strip .stat-label { color: var(--chrome-muted); }
  :root[data-palette="winter"] .sakura-main .status-strip .stat-card {
    box-shadow: inset 1px 0 0 rgb(156 199 255 / .12);
  }
  :root[data-palette="winter"] .sakura-main .status-strip .stat-card:first-child { box-shadow: none; }
  :root[data-palette="winter"] .sakura-main .status-strip .stat-card:hover {
    background: rgb(156 199 255 / .08);
  }

  :root[data-palette="winter"] .sakura-main .stat-card { padding: 7px 9px; }

  :root[data-palette="winter"] .sakura-main .stat-ico {
    width: 36px;
    height: 36px;
    right: 7px;
    opacity: .6;
  }

  :root[data-palette="winter"] .sakura-main .seg {
    border-color: color-mix(in srgb, var(--line-strong) 60%, transparent);
    background: color-mix(in srgb, var(--surface) 66%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  :root[data-palette="winter"] .sakura-main .seg-btn.active {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
  }

  :root[data-palette="winter"] .sakura-main .bot-card {
    border-color: color-mix(in srgb, var(--line-strong) 60%, transparent);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  :root[data-palette="winter"] .sakura-main .bot-card:hover {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
  }

  :root[data-palette="winter"] .sakura-main .bot-card.on {
    background: linear-gradient(100deg,
      color-mix(in srgb, var(--accent-wash) 72%, transparent),
      color-mix(in srgb, var(--surface) 82%, transparent) 72%);
  }

  :root[data-palette="winter"] .sakura-main .console-col {
    border-color: color-mix(in srgb, var(--chrome-line) 80%, transparent);
    background: color-mix(in srgb, var(--console) 84%, transparent);
    box-shadow: 0 14px 34px rgb(0 0 0 / .24), inset 0 1px 0 rgb(238 246 255 / .04);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
  }

  :root[data-palette="winter"] .sakura-main .console-head {
    border-bottom-color: color-mix(in srgb, var(--chrome-line) 80%, transparent);
    background: color-mix(in srgb, var(--console) 72%, transparent);
  }

  :root[data-palette="winter"] .sakura-main .console-body { background: transparent; }

  :root[data-palette="winter"] .sakura-main .session-gains {
    border-color: color-mix(in srgb, var(--chrome-line) 70%, transparent);
    background: color-mix(in srgb, var(--console) 55%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sakura-petals { display: none; }
}
