/* v5: the look the operator asked for on 2026-11-19, as the anty-2 lane drew it
   (mockups/antigravity/mockup=2026-11-19 on that lane's branch). Every page loads this
   file: the top bar is the same on every page. What is under html[data-look="v5"] is
   for the pages drawn in v5 (the main page, a realm's page, a wish's page); the pages
   not redrawn yet keep v4's stylesheets under the same top bar. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/static/fonts/Inter.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/IBMPlexMono-500.woff2") format("woff2"); }

/* 1. The tokens: the mockup's, with its tree behind the page ("Blue Tree"), so the
      panels let a little of it through. The top bar and the foot carry them on the
      pages of the v4 look as well. */
html[data-look="v5"],
.v5-topbar,
.v5-foot {
  --bg-canvas: #0E1014;
  --bg-top: #090A0D;
  --bg-sub: rgba(16, 19, 25, 0.74);
  --card-bg: rgba(18, 22, 29, 0.78);
  --card-head: rgba(24, 29, 38, 0.82);
  --card-sub: rgba(16, 19, 26, 0.78);
  --card-foot: rgba(14, 17, 23, 0.84);
  --strip-bg: rgba(11, 14, 19, 0.76);
  --line: #262B35;
  --line-card: rgba(214, 185, 123, 0.24);
  --line-card-hover: rgba(232, 201, 135, 0.62);
  --ink: #ECEFF4;
  --ink-2: #C2C9D4;
  --ink-3: #8791A0;
  --accent: #E5C17B;
  --accent-2: #68D6A8;
  --love: #68D6A8;
  --love-bg: rgba(104, 214, 168, 0.13);
  --hate: #F07178;
  --hate-bg: rgba(240, 113, 120, 0.13);
  --warn: #E89B54;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --topbar-h: 40px;
}

/* 2. A v5 page: the whole width, the tree dimmed behind it. */
html[data-look="v5"] {
  background: #0A0B0D;
  color-scheme: dark;
}
html[data-look="v5"] *,
html[data-look="v5"] *::before,
html[data-look="v5"] *::after { box-sizing: border-box; }
body.v5 {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.v5-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/static/scenes/tree-return-desktop-4k.webp") center 28% / cover no-repeat;
  opacity: 0.42;
  filter: brightness(0.82) saturate(0.92);
  pointer-events: none;
}
@media (max-width: 700px) {
  .v5-backdrop { background-image: url("/static/scenes/tree-return-phone-hi.webp"); }
}
/* The sky the operator asked for on 2026-11-18 ("take from it animated background on
   current background"): the three ribbons and four groups of stars of v4's section 6
   (v3-background.css, drawn by waidrn_ui::chrome::sky), over the dimmed tree and
   behind everything else, dimmer than in v4 because nothing veils it here. */
.v3-sky { display: none; }
.v3-sky-defs { position: absolute; width: 0; height: 0; }
html[data-look="v5"] .v3-sky {
  --v3-sky-op: 0.7;
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--v3-sky-op);
}
html[data-look="v5"] .v3-sky-rib {
  position: absolute;
  top: -14vh;
  left: -6%;
  width: 112%;
  height: 76vh;
  min-height: 520px;
  will-change: transform;
}
html[data-look="v5"] .v3-sky-rib svg { display: block; width: 100%; height: 100%; overflow: visible; }
html[data-look="v5"] .v3-sky-rib--a { opacity: .9; }
html[data-look="v5"] .v3-sky-rib--b { opacity: .8; }
html[data-look="v5"] .v3-sky-rib--c { opacity: .5; }
html[data-look="v5"] .v3-sky-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62vh;
  min-height: 360px;
  opacity: .45;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-look="v5"] .v3-sky-rib--a { animation: v3-sky-drift-a 46s ease-in-out infinite alternate; }
  html[data-look="v5"] .v3-sky-rib--b { animation: v3-sky-drift-b 64s ease-in-out infinite alternate; }
  html[data-look="v5"] .v3-sky-rib--c { animation: v3-sky-drift-c 52s ease-in-out infinite alternate; }
  html[data-look="v5"] .v3-sky-stars--1 { animation: v3-sky-twinkle 6s ease-in-out -0.6s infinite; }
  html[data-look="v5"] .v3-sky-stars--2 { animation: v3-sky-twinkle 5s ease-in-out -2.4s infinite; }
  html[data-look="v5"] .v3-sky-stars--3 { animation: v3-sky-twinkle 7s ease-in-out -1.8s infinite; }
  html[data-look="v5"] .v3-sky-stars--4 { animation: v3-sky-twinkle 8s ease-in-out -3.6s infinite; }
}
@keyframes v3-sky-drift-a { from { transform: translate3d(-3%, 0, 0); } to { transform: translate3d(3%, -2%, 0); } }
@keyframes v3-sky-drift-b { from { transform: translate3d(2%, 1%, 0); } to { transform: translate3d(-2%, -1%, 0); } }
@keyframes v3-sky-drift-c { from { transform: translate3d(1%, -1%, 0); } to { transform: translate3d(-1%, 2%, 0); } }
@keyframes v3-sky-twinkle { 0%, 100% { opacity: .18; } 50% { opacity: .65; } }
@media (max-width: 720px) {
  html[data-look="v5"] .v3-sky-rib--c { display: none; }
}
html[data-v3-bg-paused] .v3-sky-rib,
html[data-v3-bg-paused] .v3-sky-stars { animation-play-state: paused; }
@media (prefers-contrast: more), (forced-colors: active), print {
  html[data-look="v5"] .v3-sky { display: none; }
}

.v5-main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
}
body.v5 a { color: inherit; }
body.v5 :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.v5-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 400;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #14110d;
  font-weight: 600;
  text-decoration: none;
}
.v5-skip:focus { top: 8px; }

/* Words a screen reader says and the page does not show. */
.v5-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* A control whose action is not there yet: shown, switched off, marked "soon". */
.v5-soon {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* What the keyboard or a link brings into view stops below the top bar, which stays
   at the top of the screen on every page (WCAG 2.2, 2.4.11: focus is not hidden). The
   pages still in the v4 look size their sticky parts and their own scroll padding from
   --topbar-h, which was the old bar's 56px: it is this bar's height now. */
html[data-look="v5"] { scroll-padding-top: 52px; }
html[data-shell="v3"] { --topbar-h: 41px; }
@media (max-width: 900px) {
  html[data-look="v5"] { scroll-padding-top: 88px; }
  html[data-shell="v3"] { --topbar-h: 77px; }
}

/* 3. The top bar (the mockup's row 1, 40px). */
.v5-topbar {
  position: sticky;
  top: 0;
  z-index: 150;
  min-height: var(--topbar-h);
  padding: 0 16px;
  background: var(--bg-top);
  border-bottom: 1px solid #1E222B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}
.v5-top-left,
.v5-top-right {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}
.v5-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.v5-brand-mark { color: var(--accent); }
.v5-brand-version {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: none;
}
.v5-kinds {
  display: flex;
  align-items: stretch;
  gap: 15px;
}
.v5-kind,
.v5-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--topbar-h);
  padding: 2px 2px 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.v5-kind:hover,
.v5-menu-toggle:hover { color: #FFF; }
.v5-kind[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.v5-make-wish {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 10px;
  border: 1px solid var(--line-card-hover);
  border-radius: 5px;
  background: rgba(229, 193, 123, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.v5-make-wish:hover { background: rgba(229, 193, 123, 0.22); }
.v5-login,
.v5-signup {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.v5-login:hover { color: #FFF; }
.v5-signup {
  border: 1px solid var(--line);
  color: var(--ink);
}
.v5-signup:hover { border-color: var(--accent); color: var(--accent); }

/* The menus of the top bar are details elements: they open without a script; v5.js
   only closes one when another opens, when the page is clicked elsewhere or on Escape. */
.v5-menu { position: relative; }
.v5-menu > summary { list-style: none; }
.v5-menu > summary::-webkit-details-marker { display: none; }
.v5-menu[open] > .v5-menu-toggle { color: var(--ink); }
.v5-caret {
  color: var(--ink-3);
  font-size: 10px;
}
.v5-account-toggle {
  font-family: var(--mono);
  font-size: 11.5px;
}
.v5-menu-panel {
  position: absolute;
  top: calc(100% + 1px);
  z-index: 250;
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid var(--line-card-hover);
  border-radius: 0 0 8px 8px;
  background: #12151C;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
}
.v5-realms-panel {
  left: -8px;
  width: min(560px, calc(100vw - 24px));
}
.v5-account-panel {
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v5-menu-head {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.v5-menu-note {
  margin: 0 0 8px;
  color: var(--ink-3);
}
.v5-realms-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.v5-realms-list a,
.v5-account-panel > a,
.v5-account-switch button,
.v5-logout button {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: none;
}
.v5-realms-list a:hover,
.v5-account-panel > a:hover,
.v5-account-switch button:hover,
.v5-logout button:hover { background: #1B202B; color: #FFF; }
.v5-menu-all {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}
.v5-menu-all:hover { text-decoration: underline; }
.v5-account-id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
  padding: 0 7px 8px;
  border-bottom: 1px solid var(--line);
}
.v5-account-id b { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.v5-account-id span { color: var(--ink-3); font-size: 11.5px; }
.v5-account-switch {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.v5-account-switch .v5-menu-head { margin: 0 7px 4px; }
.v5-account-switch button,
.v5-logout button {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.v5-account-tag {
  margin-left: 4px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}
.v5-logout { margin: 4px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }

/* On a narrow screen the bar has two rows: the brand, the way to make a wish and the
   account first; the realms menu and the tabs, which scroll sideways, under them. */
@media (max-width: 900px) {
  .v5-topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    column-gap: 12px;
    row-gap: 0;
    padding: 0 12px;
  }
  .v5-top-left,
  .v5-top-right { display: contents; }
  .v5-brand { order: 1; min-height: 40px; }
  .v5-make-wish { order: 2; }
  .v5-account,
  .v5-login { order: 3; margin-left: auto; }
  .v5-signup { order: 3; }
  .v5-topbar::after {
    content: "";
    order: 4;
    flex-basis: 100%;
    height: 0;
  }
  .v5-realms-menu { order: 5; }
  .v5-kinds {
    order: 6;
    flex: 1 1 0;
    min-width: 0;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .v5-kinds::-webkit-scrollbar { display: none; }
  .v5-kind,
  .v5-menu-toggle { min-height: 36px; }
  .v5-realms-panel { left: 0; }
  .v5-realms-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .v5-brand-version { display: none; }
  .v5-topbar { column-gap: 8px; }
  .v5-make-wish { padding: 2px 8px; }
  .v5-login,
  .v5-signup { padding: 2px 6px; }
}

/* 4. The foot of a v5 page. */
.v5-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-top);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
}
.v5-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.v5-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--ink-2);
  text-decoration: none;
}
.v5-foot a:hover { color: var(--ink); text-decoration: underline; }
.v5-foot-version {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
}

/* 5. The shared "give power" control (waidrn_ui::power), usable on any page. */
.v5-power-form { display: inline-flex; margin: 0; flex-shrink: 0; }
.v5-power-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  min-width: 24px;
  padding: 0 6px;
  background: rgba(229, 193, 123, 0.12);
  border: 1px solid rgba(229, 193, 123, 0.42);
  border-radius: 3px;
  color: var(--accent, #E5C17B);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
body.v5 a.v5-power-chip { color: var(--accent, #E5C17B); }
.v5-power-chip:hover {
  background: rgba(229, 193, 123, 0.22);
  border-color: var(--accent, #E5C17B);
}
.v5-power-plus { color: var(--ink, #ECEFF4); font-weight: 500; }
.v5-power-mark { color: var(--accent, #E5C17B); }
.v5-power-tally {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 0 5px;
  color: var(--ink-2, #C2C9D4);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.v5-power-box {
  display: grid;
  gap: 7px;
  padding: 10px 14px;
  background: var(--card-head, rgba(24, 29, 38, 0.88));
  border-bottom: 1px solid var(--line, #262B35);
}
.v5-power-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.v5-power-total {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #E5C17B);
}
.v5-power-held {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--ink-2, #C2C9D4);
}
.v5-power-give {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.v5-power-input {
  width: 68px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line, #262B35);
  border-radius: 5px;
  background: #10141C;
  color: var(--ink, #ECEFF4);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
}
.v5-power-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--accent, #E5C17B);
  border-radius: 5px;
  background: rgba(229, 193, 123, 0.14);
  color: var(--accent, #E5C17B);
  font-family: var(--sans, sans-serif);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
body.v5 a.v5-power-btn { color: var(--accent, #E5C17B); }
.v5-power-btn:hover { background: rgba(229, 193, 123, 0.24); color: #FFFFFF; }
.v5-power-btn--wide { width: 100%; }
.v5-power-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-2, #C2C9D4);
}

@media (prefers-reduced-motion: reduce) {
  html[data-look="v5"] *,
  .v5-topbar * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
