:root {
  color-scheme: light;
  --shell: #f6f2ea;
  --shell-edge: #d9d3c9;
  --shell-glow: #fffdf8;
  --screen: #f8fbff;
  --ink: #111317;
  --muted: #5d6672;
  --blue: #1c82e8;
  --blue-top: #48b7ff;
  --screen-border: #272b31;
  --wheel: #e9e6df;
  --wheel-shadow: #c8c1b5;
  --center: #f8f6f0;
  --accent: #8f2d42;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 34rem),
    linear-gradient(155deg, #22252c 0%, #15181d 58%, #101217 100%);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  touch-action: none;
  user-select: none;
}

button {
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: transparent;
}

.mobile-stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
}

.pod {
  position: relative;
  width: min(93vw, 390px, calc(96dvh * 0.585));
  aspect-ratio: 2.4 / 4.1;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: clamp(30px, 9vw, 48px);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, var(--shell-glow) 0%, var(--shell) 48%, #e4ded3 100%);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.94),
    inset 0 -20px 42px rgba(116, 101, 84, 0.16),
    0 30px 70px rgba(0, 0, 0, 0.42);
}

.pod audio {
  display: none;
}

.pod::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.screen-shell {
  width: 82%;
  margin-top: clamp(31px, 5.3dvh, 45px);
  padding: 9px;
  border-radius: 13px;
  background:
    linear-gradient(180deg, #343941 0%, #171a1f 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    0 10px 20px rgba(61, 49, 37, 0.18);
}

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  border: 2px solid #0a0c0f;
  background: var(--screen);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 0 18px rgba(61, 126, 190, 0.12);
}

.screen.booting,
.screen.sleeping {
  background: #fff;
}

.screen.dimmed {
  filter: saturate(0.8) brightness(0.82);
}

.status-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 23px;
  display: grid;
  grid-template-columns: 1fr auto 27px;
  align-items: center;
  gap: 6px;
  padding: 0 5px 0 7px;
  border-bottom: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.status-brand {
  visibility: hidden;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-now {
  visibility: hidden;
  max-width: 100px;
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.battery {
  justify-self: end;
  position: relative;
  display: block;
  width: 24px;
  height: 10px;
  border: 1px solid #242832;
  border-radius: 2px;
  background: #fff;
}

.battery::after {
  content: "";
  position: absolute;
  top: 2px;
  right: -4px;
  width: 2px;
  height: 4px;
  border-radius: 0 1px 1px 0;
  background: #242832;
}

.battery-fill {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, #74c966, #bfe87b);
}

.screen-title {
  position: relative;
  z-index: 1;
  height: 23px;
  display: flex;
  align-items: center;
  padding: 0 39px 0 8px;
  border-bottom: 1px solid #a9b0bb;
  background:
    linear-gradient(180deg, #ffffff 0%, #dfe4ea 54%, #cdd4dc 100%);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.screen-body {
  position: absolute;
  inset: 23px 0 0;
  overflow: hidden;
  background: var(--screen);
}

.screen.booting .status-bar,
.screen.booting .screen-title,
.screen.sleeping .status-bar,
.screen.sleeping .screen-title {
  display: none;
}

.screen.booting .screen-body,
.screen.sleeping .screen-body,
.boot-body,
.sleep-body {
  inset: 0;
}

.sleep-body {
  background: #050505;
}

.pear-boot {
  height: 100%;
  display: grid;
  place-items: center;
  background: #fff;
}

.pear-boot-mark {
  position: relative;
  width: 34px;
  height: 43px;
  border-radius: 48% 48% 54% 54%;
  background: #111;
  transform: rotate(-5deg);
  animation: pearBoot 950ms ease-out both;
}

.pear-boot-mark::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 4px;
  width: 11px;
  height: 11px;
  border-radius: 100% 0 100% 0;
  background: #111;
  transform: rotate(24deg);
}

@keyframes pearBoot {
  0% {
    opacity: 0;
    transform: translateY(3px) rotate(-5deg) scale(0.94);
  }

  28%,
  76% {
    opacity: 1;
    transform: translateY(0) rotate(-5deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(0) rotate(-5deg) scale(1);
  }
}

.menu-scroll {
  height: 100%;
  overflow: hidden auto;
  scrollbar-width: none;
  background: #fff;
}

.menu-scroll::-webkit-scrollbar {
  width: 0;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 2px 0;
}

.menu-item {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0 7px 0 10px;
  color: #15171b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.08;
}

.menu-item small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.menu-item.is-selected {
  color: #fff;
  background:
    linear-gradient(180deg, var(--blue-top) 0%, var(--blue) 50%, #0969ca 100%);
}

.menu-item.is-selected small,
.menu-item.is-selected .menu-meta,
.menu-item.is-selected .chevron {
  color: #fff;
}

.menu-item.is-disabled {
  color: #9aa3af;
}

.menu-main {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chevron,
.menu-meta {
  color: #596270;
  font-size: 13px;
  font-weight: 800;
}

.menu-meta {
  font-size: 10px;
}

.preview-pane {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-left: 1px solid #d1d8e0;
  background:
    linear-gradient(180deg, #fbfdff 0%, #edf4fb 100%);
}

.preview-art {
  width: min(74%, 115px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #c4ccd6;
  border-radius: 5px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #363f4a 0%, #9bb7c7 46%, #e4cc86 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.pear-mark {
  position: relative;
  width: 48%;
  height: 58%;
  border-radius: 48% 48% 55% 55%;
  background: rgba(255, 255, 255, 0.84);
  transform: rotate(-5deg);
}

.pear-mark::before {
  content: "";
  position: absolute;
  top: -14%;
  right: 10%;
  width: 22%;
  height: 20%;
  border-radius: 100% 0 100% 0;
  background: rgba(255, 255, 255, 0.84);
  transform: rotate(24deg);
}

.preview-label {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  overflow: hidden;
  color: #53606d;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-view,
.about-view,
.player-view,
.video-view,
.game-view,
.quiz-view {
  height: 100%;
  padding: 8px;
  background: #fff;
}

.detail-view {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
}

.detail-copy {
  overflow: hidden;
  color: #1d2229;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-copy p {
  margin: 0 0 7px;
}

.detail-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.player-view {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 8px 10px;
}

.album-art {
  width: 78px;
  height: 78px;
  align-self: start;
  display: grid;
  place-items: center;
  border: 1px solid #b9c0c9;
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #b22f48 0%, #f0b85c 48%, #315c9a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.album-art .pear-mark {
  width: 35%;
  height: 48%;
}

.album-cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.track-copy {
  min-width: 0;
  padding-top: 4px;
}

.track-title {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.08;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-artist,
.track-album {
  margin: 0 0 4px;
  overflow: hidden;
  color: #38404a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-state {
  margin-top: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.progress-area {
  grid-column: 1 / -1;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #353b44;
  font-size: 10px;
  font-weight: 800;
}

.progress-track,
.volume-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid #aab2bd;
  border-radius: 2px;
  background: #e8edf2;
}

.progress-fill,
.volume-fill {
  height: 100%;
  background: linear-gradient(180deg, #4cb9ff 0%, #1378dc 100%);
}

.control-row,
.volume-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: #4c5561;
  font-size: 10px;
  font-weight: 800;
}

.rating-dots {
  display: none;
  grid-template-columns: repeat(5, 10px);
  gap: 4px;
  align-items: center;
}

.rating-dots span {
  width: 9px;
  height: 9px;
  border: 1px solid #7f8894;
  border-radius: 50%;
  background: #edf2f7;
}

.rating-dots span.is-on {
  border-color: #126fc7;
  background: linear-gradient(180deg, #4cb9ff 0%, #1378dc 100%);
}

.control-row[data-mode="rating"] .volume-track {
  display: none;
}

.control-row[data-mode="rating"] .rating-dots {
  display: grid;
}

.video-view {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 42px;
  gap: 6px;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #242a32;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #11151b, #222b35);
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050608;
}

.video-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #f2f5f8;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(160deg, #202936 0%, #603549 54%, #e1a94b 100%);
}

.video-placeholder strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.video-placeholder span {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.video-osd {
  display: grid;
  gap: 3px;
}

.video-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #303741;
  font-size: 10px;
  font-weight: 800;
}

.video-caption span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-view {
  padding: 4px;
  background: #dfe6ee;
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid #616b77;
  border-radius: 2px;
  background: #f8fbff;
}

.quiz-view {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
}

.quiz-question {
  color: #11171f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.quiz-score {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.search-view {
  height: 100%;
  display: grid;
  grid-template-rows: 29px 1fr 44px;
  background: #fff;
}

.search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 55px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-bottom: 1px solid #c6ccd4;
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  font-size: 13px;
  font-weight: 800;
}

.search-field span {
  min-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-field span::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: #111;
  animation: blinkCursor 1s steps(1) infinite;
}

.search-field b {
  min-width: 0;
  overflow: hidden;
  color: #1c82e8;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-picker .menu-item {
  min-height: 24px;
  font-size: 13px;
}

.search-results {
  overflow: hidden;
  padding: 4px 8px;
  border-top: 1px solid #d2d8df;
  color: #4d5661;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.search-results div {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@keyframes blinkCursor {
  50% {
    opacity: 0;
  }
}

.toast {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  z-index: 5;
  padding: 7px 8px;
  border: 1px solid rgba(17, 22, 30, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  color: #15191f;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.brand-engrave {
  margin-top: clamp(10px, 1.9dvh, 18px);
  color: rgba(70, 65, 58, 0.42);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.wheel {
  position: relative;
  width: min(72vw, 282px, calc(96dvh * 0.36));
  aspect-ratio: 1;
  margin-top: clamp(14px, 3dvh, 28px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 29%, rgba(255, 255, 255, 0.4) 30%, transparent 31%),
    linear-gradient(145deg, #f8f6ef 0%, var(--wheel) 54%, #d7d1c7 100%);
  box-shadow:
    inset 0 4px 9px rgba(255, 255, 255, 0.86),
    inset 0 -12px 18px rgba(103, 91, 76, 0.18),
    0 9px 16px rgba(88, 76, 62, 0.18);
  touch-action: none;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.wheel.is-spinning {
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.88),
    inset 0 -10px 16px rgba(103, 91, 76, 0.22),
    0 7px 12px rgba(88, 76, 62, 0.2);
}

.wheel-button,
.center-button {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #8f98a4;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
}

.wheel-button {
  width: 32%;
  height: 23%;
  font-size: 13px;
}

.wheel-top {
  top: 5%;
  left: 34%;
}

.wheel-left {
  top: 38.5%;
  left: 4%;
  font-size: 15px;
}

.wheel-right {
  top: 38.5%;
  right: 4%;
  font-size: 15px;
}

.wheel-bottom {
  bottom: 6%;
  left: 34%;
  font-size: 13px;
}

.center-button {
  top: 31.5%;
  left: 31.5%;
  width: 37%;
  height: 37%;
  border-radius: 50%;
  background:
    linear-gradient(145deg, #fffefa 0%, var(--center) 56%, #e5ded3 100%);
  box-shadow:
    inset 0 3px 8px rgba(255, 255, 255, 0.9),
    inset 0 -8px 12px rgba(95, 82, 65, 0.18),
    0 2px 2px rgba(255, 255, 255, 0.64);
}

.wheel-button.is-pressed,
.center-button.is-pressed {
  transform: translateY(1px) scale(0.985);
  color: #5c6672;
}

.center-button.is-pressed {
  box-shadow:
    inset 0 2px 9px rgba(99, 85, 69, 0.22),
    0 1px 1px rgba(255, 255, 255, 0.72);
}

@media (max-height: 660px) {
  .screen-shell {
    width: 80%;
    margin-top: 26px;
    padding: 8px;
  }

  .brand-engrave {
    margin-top: 8px;
  }

  .wheel {
    width: min(66vw, 246px, calc(96dvh * 0.35));
    margin-top: 10px;
  }

  .menu-item {
    min-height: 23px;
    font-size: 13px;
  }
}

@media (min-width: 680px) {
  .mobile-stage {
    padding: 18px;
  }
}
