/* Invictus premium presentation. Existing DOM, events and transaction flows are unchanged. */
html body #im-root {
  --im-gold: #e9c995;
  --im-text: #f5f1e8;
  --im-muted: #aaa79f;
  --im-line: #d6b8792b;
  --iv-premium-ivory: #f5f1e8;
  --iv-premium-gold: #e9c995;
  --iv-premium-glass: #0b0d0ee0;
  --iv-safe-top: env(safe-area-inset-top, 0px);
  --iv-safe-bottom: env(safe-area-inset-bottom, 0px);
  background: #010303;
  color: var(--iv-premium-ivory);
  font-family: Arial, Helvetica, sans-serif;
}

/* The clean ocean plate replaces the old line-grid only on the flat portal. */
html body #im-root:is([data-page="home"], [data-page="i"], [data-page="map"], [data-page="wallet"], [data-page="profile"], [data-page="settings"], [data-page="support"]) .im-universe {
  background: #010303 url('/assets/invictus-midnight-ocean.svg') center 56% / cover no-repeat;
}
html body #im-root:is([data-page="home"], [data-page="i"], [data-page="map"], [data-page="wallet"], [data-page="profile"], [data-page="settings"], [data-page="support"]) .iv-living-ocean {
  display: none;
}
html body #im-root :is([data-screen="home"], [data-screen="i"], [data-screen="map"], [data-screen="wallet"], [data-screen="profile"], [data-screen="settings"], [data-screen="support"]) {
  background: transparent;
}
html body #im-root:is([data-page="home"], [data-page="i"], [data-page="map"], [data-page="wallet"], [data-page="profile"], [data-page="settings"], [data-page="support"]) .im-universe::after {
  content: '';
  position: absolute;
  inset: 48% 0 7%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 22%, #eac7900b, transparent 42%);
  animation: iv-premium-reflection 11s ease-in-out infinite;
}
html body #im-root .im-page {
  background: transparent !important;
}
html body #im-root .im-screen-bar {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #c4bba7;
}
html body #im-root .im-screen-bar p {
  font: 10px/1.4 Arial, Helvetica, sans-serif;
  letter-spacing: .2em;
  color: #b6ad9c;
}

/* Thin, spaced lettering and unframed account/world controls. */
html body #im-root.im-infinity-navigation .im-universe-bar {
  inset: calc(14px + var(--iv-safe-top)) max(20px, env(safe-area-inset-right)) auto max(20px, env(safe-area-inset-left)) !important;
  height: 44px !important;
  min-height: 44px;
}
html body #im-root .im-universe-brand {
  padding: 10px 5px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body #im-root .im-universe-brand span {
  font: 300 11px/1.4 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: .52em;
  color: #f1ecdf;
  padding-left: .52em;
}
html body #im-root :is(#im-universe-avatar, .iv-wrld-link) {
  border-color: transparent !important;
  background: transparent !important;
  color: #e7d2a7;
  box-shadow: none !important;
}
html body #im-root #im-universe-avatar::before {
  width: 18px;
  height: 24px;
}
html body #im-root .iv-wrld-link {
  font-size: 22px;
}
html body #im-root :is(#im-universe-avatar, .iv-wrld-link, .im-universe-brand):hover {
  color: #fff2cf;
  filter: drop-shadow(0 0 10px #e9c99525);
}

/* Existing destination labels stay available without a heavy capsule dock. */
html body #im-root .im-feed-dock {
  width: min(460px, calc(100% - 42px)) !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  bottom: calc(14px + var(--iv-safe-bottom)) !important;
}
html body #im-root .im-feed-dock button {
  position: relative;
  min-height: 44px !important;
  min-width: 44px !important;
  height: 44px;
  padding: 7px 12px !important;
  gap: 0;
  border-radius: 0 !important;
  font: 400 12px/1.2 Arial, Helvetica, sans-serif !important;
  color: #c2c1bc !important;
  text-shadow: 0 2px 12px #000;
}
html body #im-root .im-feed-dock button::before {
  content: none !important;
}
html body #im-root .im-feed-dock button.is-selected {
  color: #f3dcab !important;
}
html body #im-root .im-feed-dock button.is-selected::after {
  content: '';
  position: absolute;
  left: calc(50% - 2px);
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffdf9e;
  box-shadow: 0 0 10px #ffdf9e90;
}
html body #im-root .iv-explore-toggle {
  bottom: calc(65px + var(--iv-safe-bottom)) !important;
  min-height: 44px !important;
  padding: 8px 14px;
  font: 10px/1.4 Arial, Helvetica, sans-serif;
  letter-spacing: .12em;
  color: #b0aa9d !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html body #im-root.im-infinity-navigation .im-top-menu {
  bottom: calc(119px + var(--iv-safe-bottom)) !important;
  border: 1px solid #d8b87930;
  border-radius: 22px;
  background: #070b0af5;
  box-shadow: 0 20px 70px #000c;
  max-height: calc(100dvh - 210px - var(--iv-safe-top) - var(--iv-safe-bottom));
}
html body #im-root .im-infinity-stop .im-nav-dot::before {
  background: #eed7aa;
  box-shadow: 0 0 8px #e9c99544;
}
html body #im-root .im-infinity-stop .im-star-name {
  color: #c7c3ba;
}
html body #im-root .im-universe-bar .im-infinity-stop.is-selected {
  background: #d8b8790c !important;
}

/* I: a white/gold living light, with the existing voice-state animation hook. */
html body #im-root[data-page="i"] .im-chat {
  height: 100%;
  min-height: 0;
  padding-top: calc(70px + var(--iv-safe-top)) !important;
  padding-bottom: calc(116px + var(--iv-safe-bottom));
  background: transparent !important;
}
html body #im-root[data-page="i"] .im-chat > .im-screen-bar {
  position: relative;
  flex: 0 0 44px;
  min-height: 44px;
  padding: 0 24px !important;
}
html body #im-root[data-page="i"] .im-screen-bar .im-back {
  font: 11px/1.4 Arial, Helvetica, sans-serif !important;
  color: #bbb6a8;
  min-height: 44px;
}
html body #im-root[data-page="i"] .iv-i-tools summary {
  color: #d8c7a5;
  font-size: 22px;
}
html body #im-root[data-page="i"] .iv-i-tools[open] > div {
  background: #0a0d0df5;
  border: 1px solid #d6b87930;
  border-radius: 15px;
  box-shadow: 0 15px 50px #0009;
}
html body #im-root[data-page="i"] .iv-i-light {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  flex: 0 0 auto;
  height: clamp(228px, 31dvh, 304px);
  padding: 0;
  gap: 0;
  overflow: visible;
}
html body #im-root[data-page="i"] .iv-i-orb {
  position: relative;
  width: clamp(184px, 25dvh, 260px);
  height: clamp(184px, 25dvh, 260px);
  max-width: 65vw;
  max-height: 65vw;
  pointer-events: none;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent url('/assets/invictus-living-light.svg') center / contain no-repeat;
  box-shadow: none;
  filter: brightness(.93) drop-shadow(0 0 16px #f4c57720);
  transform-origin: 50% 58%;
  animation: iv-premium-light-rest 9s ease-in-out infinite;
  transition: width .5s ease, height .5s ease, filter .45s ease;
}
html body #im-root[data-page="i"] .iv-i-orb::before {
  content: '';
  position: absolute;
  inset: -10%;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ffe4a71b, transparent 66%);
  transform: none;
  opacity: .5;
  pointer-events: none;
}
html body #im-root[data-page="i"] .iv-i-orb::after {
  content: '';
  position: absolute;
  inset: -9%;
  border: 0;
  border-radius: 0;
  background: transparent url('/assets/invictus-living-light.svg') center / contain no-repeat;
  opacity: 0;
  transform: scale(.9) rotate(8deg);
  transition: opacity .5s ease;
  pointer-events: none;
}
html body #im-root[data-page="i"] .iv-i-light.is-speaking .iv-i-orb {
  animation: iv-premium-light-speaking 1.75s ease-in-out infinite;
  filter: brightness(1.07) drop-shadow(0 0 22px #f4c57738);
}
html body #im-root[data-page="i"] .iv-i-light.is-speaking .iv-i-orb::before {
  animation: iv-premium-radiance 1.9s ease-in-out infinite;
}
html body #im-root[data-page="i"] .iv-i-light.is-speaking .iv-i-orb::after {
  opacity: .2;
  animation: iv-premium-wisps 3.3s ease-in-out infinite;
}
html body #im-root[data-page="i"] .iv-i-light button {
  min-height: 44px;
  padding: 7px 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #b9af97;
  font: 10px/1.3 Arial, Helvetica, sans-serif;
  letter-spacing: .09em;
}
html body #im-root[data-page="i"] .im-chat-log {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 26px 8px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #d6b87935 transparent;
}
html body #im-root[data-page="i"] .im-chat-intro {
  margin: auto;
  padding: 0 0 8px;
}
html body #im-root[data-page="i"] .im-chat-intro h2 {
  margin: 0;
  font: 400 clamp(32px, 8.5vw, 47px)/1.18 'Bodoni Moda', Georgia, serif;
  color: #f6f3ec;
  letter-spacing: -.015em;
  text-shadow: 0 2px 25px #0009;
}
html body #im-root[data-page="i"] .im-chat-message {
  flex: 0 0 auto;
  padding: 10px 0;
  margin: 8px 0;
  border: 0;
  background: transparent !important;
  color: #eae7df;
  font: 14px/1.75 Arial, Helvetica, sans-serif;
  max-width: 100%;
  text-shadow: 0 2px 10px #0008;
}
html body #im-root[data-page="i"] .im-chat-message.is-user {
  max-width: 88%;
  margin-left: auto;
  color: #d8c9ac;
}
html body #im-root[data-page="i"] .im-chat-note {
  flex: 0 0 auto;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 5px;
  padding: 6px 26px;
  color: #c5b79c;
  font: 11px/1.6 Arial, Helvetica, sans-serif;
  text-shadow: 0 2px 8px #000;
  overflow-wrap: anywhere;
}
html body #im-root[data-page="i"] .im-chat-note:empty {
  margin: 0;
  padding-block: 0;
}
html body #im-root[data-page="i"] .im-chat-retry {
  min-height: 44px;
  margin: 7px 0 0;
  padding: 8px 16px;
  border: 1px solid #d7b78042;
  background: #080c0dbd;
  color: #eedbb5;
  font-size: 11px;
  box-shadow: none;
}
html body #im-root[data-page="i"] .iv-i-actions {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0;
  gap: 24px;
}
html body #im-root[data-page="i"] .iv-i-actions button {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  width: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 50%;
  color: #bfb8a6;
}
html body #im-root[data-page="i"] .iv-i-actions .iv-microphone {
  height: 48px;
  min-height: 48px;
  width: 48px;
  background: #0b0d0d80;
  border: 1px solid #d6b87934;
  box-shadow: none;
}
html body #im-root[data-page="i"] .iv-i-actions svg {
  height: 21px;
  width: 21px;
  stroke: #e8d8b6;
  stroke-width: 1.3;
}
html body #im-root[data-page="i"] .iv-i-actions [aria-pressed="true"] {
  border-color: #e9c99588;
  box-shadow: 0 0 20px #e9c99515;
}
html body #im-root[data-page="i"] .im-chat-composer {
  width: min(680px, calc(100% - 40px));
  margin: 7px auto 0;
  padding: 0;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
  background: #080c0ca6;
  border: 1px solid #d8b88060;
  border-radius: 32px;
  box-shadow: inset 0 1px 0 #ffffff05, 0 6px 28px #0004;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
html body #im-root[data-page="i"] .im-chat-composer textarea {
  min-height: 54px;
  height: 54px;
  max-height: 112px;
  min-width: 0;
  padding: 16px 0 14px 22px;
  background: transparent;
  border: 0;
  border-radius: 30px;
  font: 16px/1.4 Arial, Helvetica, sans-serif;
  color: #f3eee3;
  box-shadow: none;
}
html body #im-root[data-page="i"] .im-chat-composer textarea::placeholder {
  color: #93928d;
  opacity: 1;
}
html body #im-root[data-page="i"] .im-chat-composer textarea:focus-visible {
  outline-offset: -5px;
}
html body #im-root[data-page="i"] .im-chat-composer button {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  margin-right: 5px;
  padding: 0;
  background: transparent !important;
  border: 0;
  color: #eedab0;
  box-shadow: none;
  font-size: 21px;
}
html body #im-root[data-page="i"].iv-has-conversation .iv-i-light {
  height: 112px;
}
html body #im-root[data-page="i"].iv-has-conversation .iv-i-orb {
  width: 112px;
  height: 112px;
}

/* Warm materials for flat screens; statuses, loan controls and error copy remain visible. */
html body #im-root :is(.im-card, .im-history-list > button, .im-support-grid > button) {
  background: #0a0e0da3;
  border-color: #d6b8792b;
  box-shadow: none;
}
html body #im-root .im-space,
html body #im-root .im-space::before {
  background: none !important;
}
html body #im-root .im-search input {
  border-bottom-color: #d6b8793b;
  color: #f3eee3;
}
html body #im-root .im-search input::placeholder {
  color: #aea799;
}
html body #im-root .im-star .im-stellar-core {
  fill: #fff6dd !important;
  filter: drop-shadow(0 0 5px #ffe9b6) drop-shadow(0 0 12px #edc88870);
}
html body #im-root .im-star .im-stellar-rays {
  fill: #edd4a0;
  filter: drop-shadow(0 0 3px #edc88860);
}
html body #im-root .im-distant-star {
  fill: #dac192;
}
html body #im-root .im-star text {
  fill: #eee8d9;
  stroke: #020403;
}
html body #im-root .im-star .im-star-amount {
  fill: #c3b595;
}
html body #im-root .im-sheet {
  border-color: #d6b87938;
  background: linear-gradient(145deg, #0f1411f5, #030606fa) !important;
  box-shadow: 0 20px 80px #0009;
}
html body #im-root .im-toast {
  background: #0a0f0cf5;
  border-color: #d6b87938;
  color: #efdfbb;
}
html body #im-root .im-screen :is(button, a, input, textarea, select, summary):focus-visible,
html body #im-root :is(.im-universe-bar, .im-feed-dock, .iv-explore-toggle, .im-sheet) :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 1px solid #edcc92;
  outline-offset: 4px;
}
html body #im-root .iv-ripple {
  border-color: #eed6a760;
}

@keyframes iv-premium-light-rest {
  0%, 100% { transform: scale(.96) rotate(-2deg); opacity: .93; }
  50% { transform: scale(1.025) rotate(2deg); opacity: 1; }
}
@keyframes iv-premium-light-speaking {
  0%, 100% { transform: scale(1.025) rotate(-3deg); }
  48% { transform: scale(1.15) rotate(3deg); }
  72% { transform: scale(1.075) rotate(1deg); }
}
@keyframes iv-premium-wisps {
  0%, 100% { transform: scale(.96) rotate(6deg); opacity: .1; }
  55% { transform: scale(1.14) rotate(-7deg); opacity: .22; }
}
@keyframes iv-premium-radiance {
  0%, 100% { transform: scale(.97); opacity: .5; }
  50% { transform: scale(1.2); opacity: .8; }
}
@keyframes iv-premium-reflection {
  0%, 100% { opacity: .35; transform: scaleX(.94); }
  50% { opacity: .85; transform: scaleX(1.04); }
}

@media (min-width: 900px) {
  html body #im-root .im-universe-brand span { font-size: 12px !important; letter-spacing: .6em; }
  html body #im-root[data-page="i"] .im-chat > .im-screen-bar { width: min(750px, 100%); margin: 0 auto; }
  html body #im-root[data-page="i"] .iv-i-light { height: clamp(264px, 36dvh, 344px); }
  html body #im-root[data-page="i"] .iv-i-orb { width: clamp(220px, 30dvh, 290px); height: clamp(220px, 30dvh, 290px); }
}
@media (max-height: 690px) {
  html body #im-root[data-page="i"] .im-chat { padding-top: calc(60px + var(--iv-safe-top)) !important; padding-bottom: calc(104px + var(--iv-safe-bottom)); }
  html body #im-root[data-page="i"] .iv-i-light { height: 156px; }
  html body #im-root[data-page="i"] .iv-i-orb { width: 112px; height: 112px; }
  html body #im-root[data-page="i"] .iv-i-light button { min-height: 44px; padding: 5px 10px; }
  html body #im-root[data-page="i"] .im-chat-intro h2 { font-size: 29px; }
  html body #im-root[data-page="i"] .iv-i-actions { min-height: 48px; }
  html body #im-root[data-page="i"] .im-chat-composer { margin-top: 3px; }
}
/* A shrinking visual viewport gives the conversation and its real status room above the keyboard. */
@media (max-height: 500px) {
  html body #im-root[data-page="i"] .im-chat { padding-top: calc(58px + var(--iv-safe-top)) !important; padding-bottom: calc(76px + var(--iv-safe-bottom)); }
  html body #im-root[data-page="i"] .im-chat > .im-screen-bar { flex-basis: 36px; min-height: 36px; }
  html body #im-root[data-page="i"] .iv-i-light,
  html body #im-root[data-page="i"].iv-has-conversation .iv-i-light { height: 70px; }
  html body #im-root[data-page="i"] .iv-i-orb,
  html body #im-root[data-page="i"].iv-has-conversation .iv-i-orb { width: 74px; height: 74px; }
  html body #im-root[data-page="i"] .iv-i-light button { position: absolute; right: 22px; bottom: 13px; max-width: 120px; }
  html body #im-root[data-page="i"] .im-chat-log { padding-bottom: 0; }
  html body #im-root[data-page="i"] .im-chat-intro h2 { font-size: 24px; }
  html body #im-root[data-page="i"] .im-chat-note { margin-bottom: 0; padding-block: 2px; }
  html body #im-root[data-page="i"] .iv-i-actions { min-height: 44px; }
  html body #im-root[data-page="i"] .im-chat-composer textarea { min-height: 48px; height: 48px; padding-top: 12px; padding-bottom: 12px; }
  html body #im-root[data-page="i"] .iv-explore-toggle { bottom: calc(56px + var(--iv-safe-bottom)) !important; min-height: 44px !important; }
}
html body #im-root.iv-motion-paused .iv-i-orb,
html body #im-root.iv-motion-paused .iv-i-orb::before,
html body #im-root.iv-motion-paused .iv-i-orb::after,
html body #im-root.iv-motion-paused .im-universe::after,
html body #im-root[data-motion="off"] .iv-i-orb,
html body #im-root[data-motion="off"] .iv-i-orb::before,
html body #im-root[data-motion="off"] .iv-i-orb::after,
html body #im-root[data-motion="off"] .im-universe::after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  html body #im-root .iv-i-orb,
  html body #im-root .iv-i-orb::before,
  html body #im-root .iv-i-orb::after,
  html body #im-root .im-universe::after {
    animation: none !important;
    transition: none !important;
  }
}
