:root {
  --cyan: #55c9df;
  --cyan-dark: #18aeca;
  --ink: #8b9196;
  --soft-shadow: rgba(110, 124, 135, 0.3);
  --slot-border: #c7cdd1;
  --slot-inner: rgba(255, 255, 255, 0.72);
  --channel-gap: clamp(13px, 1.15vw, 18px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: "Segoe UI Rounded", "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), transparent 42vh),
    linear-gradient(180deg, #f7f8f8 0%, #edf0f1 48%, #e4e8eb 100%);
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.rem-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(132px, 25vh, 190px);
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
}

.channel-stage {
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(14px, 2.2vh, 26px) clamp(42px, 6vw, 96px) 0;
  overflow: hidden;
}

.channel-viewport {
  z-index: 2;
  width: min(1540px, 88vw);
  height: min(540px, 68vh);
  margin: 0 auto;
  overflow: visible;
  transform: translateX(clamp(-62px, -4.6vw, -34px));
}

.rem-shell.is-launching .channel-viewport,
.rem-shell.is-launching .channel-pages,
.rem-shell.is-launching .channel-grid {
  overflow: visible;
}

.rem-shell.is-launching .channel-viewport {
  position: relative;
  z-index: 25;
}

.channel-pages {
  display: grid;
  grid-template-columns: repeat(4, 25%);
  width: 400%;
  height: 100%;
  transition: transform 520ms cubic-bezier(0.2, 0.78, 0.16, 1);
  will-change: transform;
}

.channel-pages[data-page="0"] {
  transform: translate3d(0, 0, 0);
}

.channel-pages[data-page="1"] {
  transform: translate3d(-25%, 0, 0);
}

.channel-pages[data-page="2"] {
  transform: translate3d(-50%, 0, 0);
}

.channel-pages[data-page="3"] {
  transform: translate3d(-75%, 0, 0);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  grid-template-rows: repeat(3, minmax(128px, 1fr));
  gap: var(--channel-gap);
  width: 100%;
  height: 100%;
  padding-right: var(--channel-gap);
}

.channel {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--slot-border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(237, 239, 240, 0.76)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 2px, rgba(128, 136, 142, 0.045) 2px 4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -12px 24px rgba(170, 178, 184, 0.12),
    0 2px 8px rgba(92, 104, 112, 0.16);
}

.channel.is-launching,
.channel.is-hold-exiting,
.channel.is-hold-canceling {
  z-index: 30;
  transform-origin: center;
}

.channel.is-launching {
  pointer-events: none;
}

.channel.is-launching.is-launch-fading {
  opacity: 0 !important;
  transition: opacity 160ms ease-out;
}

.rem-shell.is-launching .channel:not(.is-launching) {
  visibility: hidden;
  opacity: 0 !important;
  filter: brightness(0.28);
  transition: opacity 140ms ease-out;
}

.channel::before {
  position: absolute;
  inset: 7px 10px auto;
  height: 45%;
  content: "";
  border-radius: 9px 9px 30px 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.1));
}

.channel::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(136, 143, 148, 0.13);
  content: "Rem";
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 800;
}

.channel:hover,
.channel:focus-visible {
  outline: none;
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(85, 201, 223, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 3px 12px rgba(37, 160, 188, 0.22);
}

.channel.selected {
  border-color: #aeb5ba;
  background:
    radial-gradient(circle at 50% 47%, rgba(210, 216, 219, 0.72), rgba(240, 242, 243, 0.72) 46%, rgba(255, 255, 255, 0.62) 100%),
    repeating-linear-gradient(90deg, rgba(130, 137, 143, 0.065) 0 1px, transparent 1px 4px);
}

.app-channel {
  isolation: isolate;
}

.launch-scrim {
  position: fixed;
  inset: 0;
  z-index: 22;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.96);
  transition: opacity 360ms ease-out;
}

.launch-scrim.is-active {
  opacity: 1;
}

.app-channel::before {
  inset: -14%;
  z-index: 0;
  height: auto;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 42%),
    var(--app-background, url("assets/chat-room-bg.webp")) center / cover;
  transform: translate3d(-1.5%, -1%, 0) scale(1.13);
  transform-origin: center;
  will-change: transform;
  animation: channelDrift 8s ease-in-out infinite alternate;
}

.novella-channel::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 46%),
    url("assets/novella-bg.webp") center / cover;
}

.health-channel::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 48%),
    url("assets/health-bg.png") center / cover;
}

.app-channel::after {
  z-index: 1;
  color: transparent;
  content: "";
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(67, 199, 218, 0.13)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, rgba(80, 150, 165, 0.035) 2px 4px);
  transition: opacity 150ms ease-out;
  will-change: opacity;
  animation: channelGlow 3.2s ease-in-out infinite alternate;
}

.app-channel::before {
  transition: opacity 150ms ease-out;
}

.channel-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}

.channel-launch-frame {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(236, 240, 242, 0.96) 58%, rgba(213, 220, 224, 0.96)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 2px, rgba(134, 143, 149, 0.035) 2px 4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -14px 26px rgba(177, 185, 190, 0.13);
  transition: opacity 150ms ease-out;
}

.channel.is-launching.is-launch-fading.app-channel::before,
.channel.is-launching.is-launch-fading.app-channel::after {
  opacity: 0;
}

.channel.is-launching.is-launch-fading .channel-motion {
  opacity: 1;
  z-index: 6;
}

.channel.is-launching.is-launch-fading .channel-launch-frame {
  opacity: 1;
}

.chat-sprite {
  position: absolute;
  display: block;
  height: auto;
  pointer-events: none;
  backface-visibility: hidden;
  filter: drop-shadow(0 3px 5px rgba(45, 86, 99, 0.16));
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.novella-title-sprite {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 82%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(8, 45, 24, 0.42));
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  animation: novellaTitleBounce 3.8s ease-in-out infinite;
}

.health-heart-path {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 3;
  display: block;
  pointer-events: none;
  offset-rotate: 0deg;
  animation: healthHeartCurvePath 24s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  animation-delay: -7.2s;
}

.health-heart-channel-path {
  width: 42%;
  --health-enter-path: path("M -520 155 C -420 -88 -190 -155 0 0");
  --health-exit-path: path("M 0 0 C 170 -132 420 -84 560 155");
}

.health-heart-sprite {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 7px rgba(105, 79, 83, 0.22));
  transform: translate3d(0, 0, 0);
  will-change: transform;
  animation: healthHeartSlowBounce 24s ease-in-out infinite;
  animation-delay: -7.2s;
}

.health-dot {
  position: absolute;
  z-index: 4;
  display: block;
  width: 8.5%;
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.88), transparent 24%),
    linear-gradient(180deg, #77e2ec, #26bfd0);
  box-shadow:
    inset 0 -3px 5px rgba(22, 137, 153, 0.18),
    0 2px 5px rgba(57, 124, 139, 0.18);
  will-change: transform;
}

.health-dot-two {
  right: 15%;
  top: 45%;
  width: 7.5%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(180deg, #ff9990, #ff655b);
  animation: healthDotFloatB 5.4s ease-in-out 360ms infinite;
}

.health-dot-three {
  left: 16%;
  bottom: 25%;
  width: 7.5%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.92), transparent 25%),
    linear-gradient(180deg, #ffffff, #e8edf0);
  animation: healthDotFloatC 5.1s ease-in-out 720ms infinite;
}

.sprite-bubble-teal {
  top: 12%;
  left: 22%;
  width: 43%;
  animation: spriteFloatA 5.8s ease-in-out infinite;
}

.sprite-bubble-coral {
  right: 23%;
  bottom: 20%;
  width: 38%;
  animation: spriteFloatB 6.2s ease-in-out 500ms infinite;
}

.sprite-avatar-teal {
  top: 38%;
  left: 12%;
  width: 18%;
  animation: spriteFloatC 6.6s ease-in-out 260ms infinite;
}

.sprite-avatar-coral {
  top: 37%;
  right: 13%;
  width: 18%;
  animation: spriteFloatC 6.4s ease-in-out 880ms infinite reverse;
}

.chat-room-channel.is-hold-exiting .sprite-bubble-teal,
.chat-room-channel.is-hold-exiting .sprite-avatar-teal,
.chat-room-channel.is-launching .sprite-bubble-teal,
.chat-room-channel.is-launching .sprite-avatar-teal {
  animation: chatTileExitLeft 620ms cubic-bezier(0.38, 0, 0.1, 1) both;
}

.chat-room-channel.is-hold-exiting .sprite-bubble-coral,
.chat-room-channel.is-hold-exiting .sprite-avatar-coral,
.chat-room-channel.is-launching .sprite-bubble-coral,
.chat-room-channel.is-launching .sprite-avatar-coral {
  animation: chatTileExitRight 620ms cubic-bezier(0.38, 0, 0.1, 1) both;
}

.novella-channel.is-hold-exiting .novella-title-sprite,
.novella-channel.is-launching .novella-title-sprite {
  animation: novellaTileExitUp 680ms cubic-bezier(0.38, 0, 0.1, 1) both;
}

.health-channel.is-hold-exiting .health-heart-channel-path,
.health-channel.is-launching .health-heart-channel-path {
  animation: healthTileExitCurve 760ms cubic-bezier(0.34, 0, 0.1, 1) both;
}

.chat-room-channel.is-hold-canceling .sprite-bubble-teal,
.chat-room-channel.is-hold-canceling .sprite-avatar-teal {
  animation: chatTileExitLeft 420ms cubic-bezier(0.18, 0.78, 0.18, 1) reverse both;
}

.chat-room-channel.is-hold-canceling .sprite-bubble-coral,
.chat-room-channel.is-hold-canceling .sprite-avatar-coral {
  animation: chatTileExitRight 420ms cubic-bezier(0.18, 0.78, 0.18, 1) reverse both;
}

.novella-channel.is-hold-canceling .novella-title-sprite {
  animation: novellaTileExitUp 420ms cubic-bezier(0.18, 0.78, 0.18, 1) reverse both;
}

.health-channel.is-hold-canceling .health-heart-channel-path {
  animation: healthTileExitCurve 420ms cubic-bezier(0.18, 0.78, 0.18, 1) reverse both;
}

@keyframes channelDrift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1.13);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.18);
  }
}

@keyframes channelGlow {
  from {
    opacity: 0.58;
  }

  to {
    opacity: 0.96;
  }
}

@keyframes spriteFloatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(2.5%, -6%, 0) scale(1.025);
  }
}

@keyframes spriteFloatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-2%, -5%, 0) scale(1.02);
  }
}

@keyframes spriteFloatC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -7%, 0) scale(1.025);
  }
}

@keyframes novellaTitleBounce {
  0%,
  100% {
    transform: translate3d(-50%, -50%, 0) scale(0.98);
  }

  50% {
    transform: translate3d(-50%, -56%, 0) scale(1.04);
  }
}

@keyframes chatTileExitLeft {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate3d(-150%, -3%, 0) scale(0.96);
  }
}

@keyframes chatTileExitRight {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate3d(150%, -3%, 0) scale(0.96);
  }
}

@keyframes novellaTileExitUp {
  from {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate3d(-50%, -180%, 0) scale(1.32);
  }
}

@keyframes healthTileExitCurve {
  from {
    opacity: 1;
    offset-path: path("M 0 0 C 120 -70 250 -95 390 -150");
    offset-distance: 0%;
  }

  to {
    opacity: 0;
    offset-path: path("M 0 0 C 120 -70 250 -95 390 -150");
    offset-distance: 100%;
  }
}

@keyframes healthHeartCurvePath {
  0% {
    opacity: 0;
    offset-path: var(--health-enter-path);
    offset-distance: 0%;
  }

  6% {
    opacity: 1;
  }

  30% {
    opacity: 1;
    offset-path: var(--health-enter-path);
    offset-distance: 100%;
  }

  70% {
    opacity: 1;
    offset-path: var(--health-exit-path);
    offset-distance: 0%;
  }

  94% {
    opacity: 1;
    offset-path: var(--health-exit-path);
    offset-distance: 100%;
  }

  100% {
    opacity: 0;
    offset-path: var(--health-exit-path);
    offset-distance: 100%;
  }
}

@keyframes healthHeartSlowBounce {
  0%,
  30%,
  70%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  40%,
  56% {
    transform: translate3d(0, -0.8%, 0) scale(1.003);
  }

  48%,
  64% {
    transform: translate3d(0, 0.6%, 0) scale(0.999);
  }
}

@keyframes healthDotFloatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-10%, -18%, 0) scale(1.06);
  }
}

@keyframes healthDotFloatC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(12%, -16%, 0) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .channel-pages,
  .app-channel::before,
  .app-channel::after,
  .chat-sprite,
  .novella-title-sprite,
  .health-heart-sprite,
  .health-dot {
    animation: none;
    transition: none;
  }

  .launch-scrim,
  .app-channel-screen.is-launch-revealing.is-visible,
  .channel-motion,
  .channel-launch-frame {
    animation: none;
    transition: none;
  }
}

.page-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(46px, 6vw, 70px);
  height: clamp(74px, 13vh, 106px);
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
}

.page-button-left {
  left: clamp(5px, 2vw, 22px);
}

.page-button-right {
  right: clamp(5px, 2vw, 22px);
}

.page-button span {
  width: clamp(22px, 3.3vw, 34px);
  height: clamp(34px, 5.4vw, 52px);
  filter: drop-shadow(0 1px 2px rgba(87, 103, 112, 0.35));
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: linear-gradient(180deg, #78e9f4, #1abed6);
}

.page-button-right span {
  transform: scaleX(-1);
}

.page-button:hover span,
.page-button:focus-visible span {
  background: linear-gradient(180deg, #b4f7fb, #20cbe2);
}

.page-button:disabled {
  cursor: default;
  opacity: 0.28;
}

.page-button:disabled span {
  background: linear-gradient(180deg, #b6c2c7, #8f9aa1);
}

.system-tray {
  position: relative;
  display: block;
  padding: 34px clamp(28px, 5vw, 66px) 20px;
  background: linear-gradient(180deg, #e3e7ea 0%, #d9dee2 100%);
  box-shadow: inset 0 12px 28px rgba(255, 255, 255, 0.54);
}

.tray-wave {
  position: absolute;
  top: -93px;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 132px;
  pointer-events: none;
  overflow: visible;
}

.tray-wave-fill {
  fill: #e3e7ea;
}

.tray-wave-line {
  vector-effect: non-scaling-stroke;
}

.tray-wave-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3.5;
  stroke-linecap: round;
}

.orb {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(72px, 9vw, 92px);
  aspect-ratio: 1;
  justify-self: start;
  cursor: pointer;
  border: 3px solid rgba(72, 202, 225, 0.72);
  border-radius: 50%;
  color: #a5aaae;
  font-size: clamp(20px, 2.6vw, 29px);
  font-weight: 800;
  background:
    radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.95), rgba(226, 232, 235, 0.9) 52%, rgba(201, 209, 214, 0.9)),
    linear-gradient(180deg, #f7f9f9, #cfd6da);
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.95),
    0 3px 10px rgba(110, 127, 138, 0.28);
}

.rem-orb {
  position: absolute;
  top: 31px;
  left: clamp(28px, 5vw, 66px);
}

.message-orb {
  position: absolute;
  top: 31px;
  right: clamp(28px, 5vw, 66px);
}

.sd-card {
  position: absolute;
  top: 50px;
  left: clamp(122px, 16vw, 178px);
  z-index: 2;
  width: 37px;
  height: 50px;
  cursor: pointer;
  border: 3px solid #21bad0;
  border-radius: 4px;
  background: linear-gradient(180deg, #faffff 0 68%, #31bcd3 69% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    0 3px 8px rgba(90, 111, 122, 0.26);
}

.sd-notch {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 10px;
  height: 9px;
  border-radius: 1px;
  background: #c7eef4;
}

.sd-lines {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 9px;
  height: 12px;
  border-top: 3px solid rgba(255, 255, 255, 0.75);
  border-bottom: 3px solid rgba(255, 255, 255, 0.75);
}

.volume-control {
  position: absolute;
  top: 42px;
  left: clamp(181px, 23vw, 255px);
  z-index: 4;
  display: grid;
  justify-items: center;
}

.volume-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  cursor: pointer;
  border: 3px solid rgba(72, 202, 225, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 30%, rgba(255, 255, 255, 0.98), rgba(229, 235, 238, 0.94) 53%, rgba(205, 214, 219, 0.94)),
    linear-gradient(180deg, #f8fbfb, #d0d8dc);
  box-shadow:
    inset 0 2px 9px rgba(255, 255, 255, 0.96),
    0 3px 9px rgba(98, 116, 126, 0.24);
}

.speaker-icon {
  position: relative;
  width: 31px;
  height: 27px;
}

.speaker-body {
  position: absolute;
  left: 1px;
  top: 8px;
  width: 13px;
  height: 12px;
  border-radius: 3px;
  background: #9aa2a8;
}

.speaker-body::after {
  position: absolute;
  top: -5px;
  left: 8px;
  width: 15px;
  height: 22px;
  content: "";
  clip-path: polygon(0 34%, 100% 0, 100% 100%, 0 66%);
  background: #9aa2a8;
}

.speaker-wave {
  position: absolute;
  top: 50%;
  border: 3px solid #9aa2a8;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
  transform: translateY(-50%);
}

.speaker-wave-one {
  right: 4px;
  width: 8px;
  height: 16px;
}

.speaker-wave-two {
  right: -2px;
  width: 13px;
  height: 24px;
}

.volume-control.is-muted .speaker-wave {
  opacity: 0;
}

.volume-control.is-muted .speaker-icon::after {
  position: absolute;
  top: 2px;
  right: 1px;
  width: 4px;
  height: 25px;
  content: "";
  border-radius: 999px;
  background: #ef7f7f;
  transform: rotate(45deg);
}

.volume-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  display: grid;
  place-items: center;
  width: 172px;
  height: 54px;
  padding: 0 16px;
  pointer-events: none;
  opacity: 0;
  border: 2px solid #c7cfd4;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(228, 235, 238, 0.96)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 2px, rgba(130, 139, 145, 0.04) 2px 4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 5px 14px rgba(94, 111, 123, 0.22);
  transform: translateY(8px) scale(0.97);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.volume-control:hover .volume-popover,
.volume-control:focus-within .volume-popover {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.volume-slider {
  width: 128px;
  accent-color: var(--cyan-dark);
  cursor: pointer;
}

.volume-button:hover,
.volume-button:focus-visible {
  outline: none;
  filter: brightness(1.06);
}

.center-clock {
  position: absolute;
  top: 26px;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  line-height: 1;
  transform: translateX(-50%);
}

.page-dots {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  min-height: 12px;
  margin-bottom: 6px;
}

.page-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aeb5ba;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.page-dot.active {
  background: #6f777e;
}

.time-row {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 13px;
}

#ampm {
  min-width: 34px;
  color: #9aa0a5;
  font-size: clamp(17px, 2.2vw, 25px);
  font-weight: 800;
}

#clock {
  color: #858b91;
  font-family: "Consolas", "Lucida Console", monospace;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 400;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

#dateLine {
  color: #92989d;
  font-size: clamp(24px, 4vw, 39px);
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.envelope {
  position: relative;
  width: 46px;
  height: 32px;
  border: 4px solid #aab1b7;
  border-radius: 3px;
  background: linear-gradient(180deg, #f7f7f7, #dadfe2);
}

.envelope::before,
.envelope::after {
  position: absolute;
  top: 3px;
  width: 28px;
  height: 4px;
  content: "";
  border-radius: 999px;
  background: #aab1b7;
  transform-origin: left center;
}

.envelope::before {
  left: 1px;
  transform: rotate(32deg);
}

.envelope::after {
  right: -3px;
  transform: rotate(148deg);
}

.orb:hover,
.orb:focus-visible,
.sd-card:hover,
.sd-card:focus-visible {
  outline: none;
  filter: brightness(1.06);
}

.app-channel-screen {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(132px, 25vh, 190px);
  min-height: 520px;
  overflow: hidden;
  opacity: 1 !important;
  transform: none;
  transform-origin: top left;
  background: #000;
  will-change: transform, border-radius, filter;
}

.app-channel-screen.is-launch-revealing {
  opacity: 1 !important;
}

.app-channel-screen.is-visible {
  opacity: 1 !important;
  transform: none;
}

.app-channel-screen.is-visible:not(.is-launch-revealing) .channel-preview-card {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.app-channel-screen.is-visible:not(.is-launch-revealing) .channel-menu-tray {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.app-channel-screen.is-launch-revealing.is-visible {
  opacity: 1 !important;
}

.app-channel-screen.is-launch-revealing .channel-preview-card {
  animation: channelMenuTakeover 980ms cubic-bezier(0.18, 0.78, 0.18, 1) both;
}

.app-channel-screen.is-launch-revealing .channel-menu-tray {
  animation: channelTrayTakeover 620ms cubic-bezier(0.18, 0.78, 0.18, 1) 860ms both;
}

.app-channel-screen.is-launch-revealing.is-visible .channel-preview-card {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.app-channel-screen.is-launch-revealing.is-visible .channel-menu-tray {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@keyframes channelMenuTakeover {
  from {
    opacity: 0.72;
    filter: brightness(1.08);
  }

  to {
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes channelTrayTakeover {
  from {
    opacity: 0;
    transform: translateY(115%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.channel-preview-card {
  position: relative;
  z-index: 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f8fbfc;
  box-shadow: none;
  transform-origin: center;
}

.channel-preview-card::before {
  content: none;
}

.channel-preview-card::after {
  content: none;
}

.channel-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  opacity: 0;
  border-radius: 0;
  transition: opacity 260ms ease;
}

.app-channel-screen[data-app="chat-room"] .channel-preview-chat,
.app-channel-screen[data-app="novella"] .channel-preview-novella,
.app-channel-screen[data-app="health"] .channel-preview-health {
  opacity: 1;
}

.channel-preview img {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

.preview-chat-bg,
.preview-novella-bg,
.preview-health-bg {
  inset: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  animation: previewDrift 8s ease-in-out infinite alternate;
}

.channel-preview-chat::after,
.channel-preview-novella::after,
.channel-preview-health::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.34), transparent 22%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 2px, rgba(42, 82, 94, 0.028) 2px 4px);
}

.preview-chat-bubble,
.preview-chat-avatar,
.preview-novella-title,
.preview-health-heart,
.preview-health-dot {
  z-index: 2;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(32, 77, 89, 0.18));
  will-change: transform;
}

.preview-health-heart-path {
  left: 50%;
  top: 53%;
  width: min(36%, 380px);
  --health-enter-path: path("M -760 250 C -610 -190 -260 -255 0 0");
  --health-exit-path: path("M 0 0 C 250 -225 660 -160 820 250");
}

.preview-chat-bubble-teal {
  left: 25%;
  top: 18%;
  width: 33%;
  animation: previewFloatA 5.8s ease-in-out infinite;
}

.preview-chat-bubble-coral {
  right: 25%;
  top: 39%;
  width: 34%;
  animation: previewFloatB 6.2s ease-in-out 460ms infinite;
}

.preview-chat-avatar-teal {
  left: 14%;
  bottom: 20%;
  width: 17%;
  animation: previewFloatC 6.4s ease-in-out 240ms infinite;
}

.preview-chat-avatar-coral {
  right: 16%;
  top: 28%;
  width: 17%;
  animation: previewFloatC 6.6s ease-in-out 840ms infinite reverse;
}

.app-channel-screen.is-launch-revealing .preview-chat-bubble-teal,
.app-channel-screen.is-launch-revealing .preview-chat-avatar-teal {
  animation: chatMenuReturnLeft 520ms cubic-bezier(0.18, 0.78, 0.18, 1) 920ms both;
}

.app-channel-screen.is-launch-revealing .preview-chat-bubble-coral,
.app-channel-screen.is-launch-revealing .preview-chat-avatar-coral {
  animation: chatMenuReturnRight 520ms cubic-bezier(0.18, 0.78, 0.18, 1) 1080ms both;
}

.preview-novella-title {
  left: 50%;
  top: 50%;
  width: min(72%, 760px);
  transform: translate3d(-50%, -50%, 0);
  animation: previewTitleBounce 3.8s ease-in-out infinite;
}

.app-channel-screen.is-launch-revealing .preview-novella-title {
  animation: novellaMenuReturn 640ms cubic-bezier(0.18, 0.78, 0.18, 1) 940ms both;
}

.preview-health-heart {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  transform: translate3d(0, 0, 0);
  animation: healthHeartSlowBounce 24s ease-in-out infinite;
  animation-delay: -7.2s;
}

.app-channel-screen.is-launch-revealing .preview-health-heart-path {
  animation: healthMenuHeartReturn 720ms cubic-bezier(0.34, 0, 0.12, 1) 940ms both;
}

.app-channel-screen.is-launch-revealing .preview-health-dot {
  animation: healthMenuDotReturn 420ms ease-out 1240ms both;
}

.preview-health-dot {
  position: absolute;
  display: block;
  width: clamp(28px, 5vw, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(180deg, #72e0eb, #25bccc);
  box-shadow:
    inset 0 -5px 8px rgba(20, 134, 150, 0.18),
    0 4px 12px rgba(42, 116, 132, 0.18);
}

.preview-health-dot-two {
  right: 16%;
  top: 42%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(180deg, #ff9e96, #ff675d);
  animation: previewHealthDotB 5.2s ease-in-out 380ms infinite;
}

.preview-health-dot-three {
  left: 16%;
  bottom: 28%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.92), transparent 25%),
    linear-gradient(180deg, #ffffff, #e4eaee);
  animation: previewHealthDotC 5.8s ease-in-out 720ms infinite;
}

.channel-menu-tray {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(38px, 8vw, 92px);
  padding: 24px clamp(42px, 16vw, 280px) 30px;
  border-top: 2px solid rgba(123, 132, 138, 0.34);
  background:
    linear-gradient(180deg, rgba(241, 245, 247, 0.98), rgba(215, 222, 226, 0.98)),
    repeating-linear-gradient(0deg, rgba(121, 130, 136, 0.09) 0 2px, rgba(255, 255, 255, 0.08) 2px 4px);
}

.channel-crt-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.channel-menu-button,
.channel-start-button {
  min-height: clamp(56px, 9vh, 78px);
  cursor: pointer;
  border: 3px solid #c8d0d5;
  border-radius: 999px;
  color: #7d858b;
  font-size: clamp(28px, 4.6vw, 52px);
  font-weight: 400;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0 34%, rgba(235, 241, 244, 0.96) 35% 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.11) 0 2px, rgba(126, 135, 141, 0.04) 2px 4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.98),
    0 4px 12px rgba(76, 91, 102, 0.22);
}

.channel-menu-button {
  border-color: rgba(58, 201, 224, 0.9);
}

.channel-menu-button:hover,
.channel-menu-button:focus-visible,
.channel-start-button:hover,
.channel-start-button:focus-visible {
  outline: none;
  filter: brightness(1.05);
  box-shadow:
    0 0 0 4px rgba(85, 201, 223, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.98),
    0 4px 12px rgba(76, 91, 102, 0.22);
}

@keyframes previewDrift {
  from {
    transform: translate3d(-1.4%, -1%, 0) scale(1.02);
  }

  to {
    transform: translate3d(1.4%, 1%, 0) scale(1.06);
  }
}

@keyframes previewFloatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(2%, -5%, 0) scale(1.025);
  }
}

@keyframes previewFloatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-2%, -4%, 0) scale(1.02);
  }
}

@keyframes previewFloatC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -6%, 0) scale(1.02);
  }
}

@keyframes chatMenuReturnLeft {
  from {
    opacity: 0;
    transform: translate3d(-130vw, -3%, 0) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes chatMenuReturnRight {
  from {
    opacity: 0;
    transform: translate3d(130vw, -3%, 0) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes previewTitleBounce {
  0%,
  100% {
    transform: translate3d(-50%, -50%, 0) scale(0.96);
  }

  50% {
    transform: translate3d(-50%, -55%, 0) scale(1.02);
  }
}

@keyframes novellaMenuReturn {
  from {
    opacity: 0;
    transform: translate3d(-50%, -170%, 0) scale(1.28);
  }

  to {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
}

@keyframes healthMenuHeartReturn {
  from {
    opacity: 0;
    offset-path: var(--health-enter-path);
    offset-distance: 0%;
  }

  to {
    opacity: 1;
    offset-path: var(--health-enter-path);
    offset-distance: 100%;
  }
}

@keyframes healthMenuDotReturn {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes previewHealthDotB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-12%, -16%, 0) scale(1.08);
  }
}

@keyframes previewHealthDotC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(13%, -15%, 0) scale(1.08);
  }
}

.app-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(18px, 4vh, 38px);
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 74% 18%, rgba(93, 207, 224, 0.24), transparent 28vw),
    linear-gradient(180deg, #f9fbfb 0%, #e7ecef 100%);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.chat-header p,
.chat-header h1 {
  margin: 0;
}

.chat-header p {
  color: #20abc4;
  font-size: clamp(14px, 1.7vw, 19px);
  font-weight: 800;
}

.chat-header h1 {
  color: #717a80;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 0.95;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

.back-button {
  display: grid;
  place-items: center;
  width: clamp(54px, 7vw, 76px);
  aspect-ratio: 1;
  cursor: pointer;
  border: 3px solid rgba(72, 202, 225, 0.75);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 28%, #ffffff, #e6ecef 54%, #cdd6db);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.95),
    0 3px 10px rgba(96, 112, 124, 0.25);
}

.back-button span {
  width: 24px;
  height: 34px;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: linear-gradient(180deg, #77e8f4, #1abed6);
}

.back-button:hover,
.back-button:focus-visible {
  outline: none;
  filter: brightness(1.05);
}

.chat-room-shell {
  display: grid;
  grid-template-columns: minmax(138px, 190px) minmax(0, 1fr);
  gap: clamp(14px, 2.4vw, 26px);
  min-height: 0;
}

.chat-sidebar,
.chat-panel {
  border: 2px solid #c7cfd4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 3px 12px rgba(97, 114, 126, 0.16);
}

.chat-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.room-tab {
  width: 100%;
  min-height: 46px;
  cursor: pointer;
  border: 2px solid #d1d8dc;
  border-radius: 9px;
  color: #7c858b;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff, #e8eef1);
}

.room-tab.active {
  border-color: var(--cyan);
  color: #199fb8;
  background: linear-gradient(180deg, #ffffff, #dff8fb);
}

.chat-panel {
  display: grid;
  align-content: end;
  gap: 18px;
  min-height: 0;
  padding: clamp(18px, 3vw, 34px);
  overflow: hidden;
}

.message-line {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(720px, 100%);
}

.message-line.outgoing {
  justify-self: end;
}

.message-line p {
  margin: 0;
  padding: 14px 18px;
  border: 2px solid #d1d8dc;
  border-radius: 20px;
  color: #707980;
  font-size: clamp(15px, 2vw, 21px);
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff, #eef4f6);
  box-shadow: 0 2px 7px rgba(92, 107, 119, 0.12);
}

.message-line.outgoing p {
  border-color: #8fdce9;
  background: linear-gradient(180deg, #f5feff, #dff7fb);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 2px solid #8fdce9;
  border-radius: 50%;
  color: #1aa8c0;
  font-weight: 800;
  background: #f8ffff;
}

.health-room-shell {
  display: grid;
  place-items: center;
  min-height: 0;
}

.health-heart-stage {
  position: relative;
  width: min(940px, 86vw);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid #c8d3d8;
  border-radius: clamp(18px, 4vw, 44px);
  background: #ecf8fb;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    0 8px 24px rgba(83, 111, 124, 0.18);
}

.health-screen-bg {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  animation: previewDrift 8s ease-in-out infinite alternate;
}

.health-screen-heart-path {
  position: absolute;
  left: 50%;
  top: 53%;
  width: min(34%, 310px);
  --health-enter-path: path("M -760 250 C -610 -190 -260 -255 0 0");
  --health-exit-path: path("M 0 0 C 250 -225 660 -160 820 250");
}

.health-screen-heart {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(92, 70, 76, 0.22));
  transform: translate3d(0, 0, 0);
  animation: healthHeartSlowBounce 24s ease-in-out infinite;
  animation-delay: -7.2s;
}

.screen-enter {
  animation: screenEnter 220ms ease-out both;
}

.screen-exit {
  animation: screenExit 220ms ease-in both;
}

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes screenExit {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.015);
  }
}

@media (max-width: 760px) {
  .rem-shell {
    grid-template-rows: minmax(0, 1fr) 145px;
    min-height: 470px;
  }

  .channel-stage {
    padding-inline: 38px;
  }

  .channel-viewport {
    width: min(520px, 80vw);
    height: min(310px, 52vh);
  }

  .channel-grid {
    grid-template-columns: repeat(3, minmax(74px, 1fr));
    grid-template-rows: repeat(4, minmax(48px, 1fr));
    gap: 8px;
  }

  .channel {
    border-radius: 9px;
  }

  .system-tray {
    padding: 29px 15px 16px;
  }

  .rem-orb {
    top: 33px;
    left: 15px;
  }

  .message-orb {
    top: 33px;
    right: 15px;
  }

  .sd-card {
    top: 50px;
    left: 95px;
  }

  .volume-control {
    top: 46px;
    left: 133px;
  }

  .volume-button {
    width: 39px;
    border-width: 2px;
  }

  .speaker-icon {
    transform: scale(0.74);
  }

  .volume-popover {
    width: 142px;
    height: 46px;
  }

  .volume-slider {
    width: 104px;
  }

  .tray-wave {
    top: -78px;
    height: 112px;
  }

  .sd-card {
    width: 29px;
    height: 39px;
    border-width: 2px;
  }

  .time-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  #ampm {
    min-width: 24px;
  }

  .app-screen {
    gap: 15px;
    padding: 14px;
  }

  .chat-room-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-sidebar {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .room-tab {
    min-height: 40px;
  }

  .chat-panel {
    gap: 12px;
  }
}

@media (max-width: 460px) {
  .channel-stage {
    padding-inline: 30px;
  }

  .page-button {
    width: 34px;
  }

  .system-tray {
    padding-inline: 10px;
  }

  .rem-orb {
    left: 10px;
  }

  .message-orb {
    right: 10px;
  }

  .sd-card {
    left: 73px;
  }

  .volume-control {
    top: 46px;
    left: 112px;
  }

  .volume-popover {
    transform: translateX(-18px) translateY(8px) scale(0.97);
  }

  .volume-control:hover .volume-popover,
  .volume-control:focus-within .volume-popover {
    transform: translateX(-18px) translateY(0) scale(1);
  }

  .orb {
    border-width: 2px;
  }
}
