:root {
  --bg: #07080d;
  --panel: #111522;
  --panel-2: #171c2c;
  --cyan: #6df7e8;
  --cyan-soft: rgba(109, 247, 232, 0.2);
  --yellow: #ffd45c;
  --pink: #ff6f91;
  --text: #f4f7ff;
  --muted: #8e97ad;
}

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

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

button {
  color: inherit;
  font: inherit;
}

.shell {
  position: relative;
  width: 100%;
  height: var(--app-height, 100%);
  min-height: 0;
  padding: calc(10px + env(safe-area-inset-top)) 18px calc(10px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 28%, rgba(61, 129, 141, 0.19), transparent 40%),
    linear-gradient(180deg, #090b12 0%, #07080d 78%);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.topbar {
  height: 28px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(255, 212, 92, 0.7);
}

.status-dot.online {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(109, 247, 232, 0.8);
}

.date { margin-left: auto; }

.face-stage {
  position: relative;
  height: 186px;
  margin-top: 2px;
  border: 1px solid rgba(109, 247, 232, 0.16);
  background: #0b0f18;
  box-shadow: inset 0 0 35px rgba(63, 227, 211, 0.07), 0 10px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.pixel-grid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(109, 247, 232, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 247, 232, 0.18) 1px, transparent 1px);
  background-size: 12px 12px;
}

.antenna {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 4px;
  height: 21px;
  margin-left: -2px;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(109, 247, 232, 0.7);
}

.antenna i {
  position: absolute;
  width: 10px;
  height: 10px;
  left: -3px;
  top: -6px;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(255, 212, 92, 0.7);
}

.face {
  position: absolute;
  left: 50%;
  top: 38px;
  width: 214px;
  height: 124px;
  margin-left: -107px;
  border: 5px solid #252d41;
  background: #090c13;
  box-shadow: 0 0 0 4px #111827, 0 0 25px rgba(109, 247, 232, 0.09);
}

.eye {
  position: absolute;
  top: 28px;
  width: 46px;
  height: 34px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(109, 247, 232, 0.7);
  -webkit-animation: blink 5.2s infinite;
  animation: blink 5.2s infinite;
  -webkit-transform-origin: center;
  transform-origin: center;
}

.eye i {
  position: absolute;
  width: 10px;
  height: 10px;
  right: 8px;
  top: 7px;
  background: #ecfffd;
}

.eye-left { left: 30px; }
.eye-right { right: 30px; }

.brow {
  position: absolute;
  top: 17px;
  width: 43px;
  height: 5px;
  background: #384158;
}

.brow-left { left: 31px; }
.brow-right { right: 31px; }

.cheek {
  position: absolute;
  top: 74px;
  width: 18px;
  height: 7px;
  background: var(--pink);
  opacity: 0.45;
}

.cheek-left { left: 23px; }
.cheek-right { right: 23px; }

.mouth {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 64px;
  height: 18px;
  margin-left: -32px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: end;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
}

.mouth i {
  width: 10px;
  height: 5px;
  margin: 0 1px;
  background: var(--cyan);
}

.mouth i:first-child,
.mouth i:last-child { height: 10px; }

.face-button {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.voice-capture {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.voice-hint {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 5px;
  text-align: center;
  color: var(--muted);
  font: 9px "Courier New", monospace;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.mic-meter {
  position: absolute;
  z-index: 2;
  left: 22%;
  right: 22%;
  bottom: 18px;
  height: 3px;
  overflow: hidden;
  background: rgba(109, 247, 232, 0.1);
  opacity: 0;
  pointer-events: none;
}

.mic-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(109, 247, 232, 0.85);
  -webkit-transition: width .08s linear;
  transition: width .08s linear;
}

.mic-meter.ready,
.mic-meter.recording { opacity: 1; }
.mic-meter.recording i { background: var(--pink); }

.face-stage.voice-active {
  border-color: rgba(109, 247, 232, 0.7);
  box-shadow: inset 0 0 42px rgba(63, 227, 211, 0.13), 0 0 20px rgba(109, 247, 232, 0.12);
}

.face-stage.voice-active .antenna i {
  -webkit-animation: voice-pulse 0.7s infinite alternate;
  animation: voice-pulse 0.7s infinite alternate;
}

.face.happy .eye {
  height: 12px;
  top: 43px;
}

.face.happy .mouth i:nth-child(3) { height: 15px; }
.face.happy .cheek { opacity: 0.9; }

.face.listening .eye {
  width: 39px;
  height: 39px;
  border: 7px solid var(--cyan);
  background: transparent;
}

.face.listening .eye i { display: none; }
.face.listening + .face-button {}

.face.thinking .eye {
  height: 8px;
  top: 43px;
  -webkit-animation: think-eye 0.75s infinite alternate;
  animation: think-eye 0.75s infinite alternate;
}

.face.thinking .eye-right {
  -webkit-animation-delay: -0.75s;
  animation-delay: -0.75s;
}

.face.playing .mouth i {
  -webkit-animation: talk 0.58s infinite alternate;
  animation: talk 0.58s infinite alternate;
}
.face.playing .mouth i:nth-child(2) { animation-delay: -0.25s; }
.face.playing .mouth i:nth-child(3) { animation-delay: -0.4s; }
.face.playing .mouth i:nth-child(4) { animation-delay: -0.12s; }

.clock-panel {
  text-align: center;
  padding: 9px 0 7px;
}

.time {
  font-family: "Courier New", monospace;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.07em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(109, 247, 232, 0.16);
}

.greeting {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.now-playing {
  min-height: 63px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: var(--panel);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.album-art {
  position: relative;
  width: 42px;
  height: 42px;
  margin-right: 11px;
  background: #1e2638;
  overflow: hidden;
}

.album-art span {
  position: absolute;
  width: 15px;
  height: 15px;
  background: var(--cyan);
}
.album-art span:nth-child(1) { left: 4px; top: 4px; }
.album-art span:nth-child(2) { right: 4px; top: 4px; background: var(--yellow); }
.album-art span:nth-child(3) { left: 4px; bottom: 4px; background: var(--pink); }
.album-art span:nth-child(4) { right: 4px; bottom: 4px; opacity: 0.35; }

.track-copy {
  min-width: 0;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
}

.track-name,
.artist-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-name { font-size: 13px; font-weight: 700; }
.artist-name { margin-top: 4px; font-size: 10px; color: var(--muted); }

.equalizer {
  width: 22px;
  height: 22px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: end;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
}

.equalizer i {
  width: 5px;
  height: 5px;
  background: #35405a;
}

.equalizer.playing i {
  background: var(--cyan);
  -webkit-animation: bars 0.7s infinite alternate;
  animation: bars 0.7s infinite alternate;
}
.equalizer.playing i:nth-child(2) { animation-delay: -0.35s; }
.equalizer.playing i:nth-child(3) { animation-delay: -0.52s; }

.controls {
  padding: 10px 28px 7px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
}

.control {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: visible;
}

.control span {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 700;
}

.control.secondary {
  width: 56px;
  height: 46px;
  color: var(--muted);
}

.skip-icon {
  position: relative;
  width: 43px;
  height: 24px;
  margin: 0 auto;
}

.skip-icon i {
  position: absolute;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.skip-icon.next i { border-left: 13px solid var(--muted); }
.skip-icon.previous i { border-right: 13px solid var(--muted); }
.skip-icon i:first-child { left: 6px; }
.skip-icon i:nth-child(2) { left: 20px; }

.skip-icon b {
  position: absolute;
  top: 3px;
  width: 4px;
  height: 18px;
  background: var(--muted);
}

.skip-icon.next b { right: 2px; }
.skip-icon.previous b { left: 2px; }

.control.primary {
  width: 58px;
  height: 58px;
  color: #06100f;
  background: var(--cyan);
  border: 5px solid rgba(109, 247, 232, 0.14);
  box-shadow: 0 0 22px rgba(109, 247, 232, 0.24);
}

.control.primary span { font-size: 22px; padding-left: 3px; }

.utility-controls {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

.utility-controls button {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.utility-controls button + button { margin-left: 6px; }

button:active { -webkit-transform: translateY(1px); transform: translateY(1px); }

footer {
  margin-top: auto;
  padding-top: 9px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  color: #3e475d;
  font-family: "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
}

footer a {
  color: inherit;
  text-decoration: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 82%;
  max-width: 82%;
  padding: 8px 12px;
  background: var(--yellow);
  color: #1c180c;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translate(-50%, 10px);
  transform: translate(-50%, 10px);
  -webkit-transition: opacity .2s, -webkit-transform .2s;
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
}

@-webkit-keyframes blink {
  0%, 44%, 48%, 100% { -webkit-transform: scaleY(1); }
  46% { -webkit-transform: scaleY(0.08); }
}
@keyframes blink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(0.08); }
}

@-webkit-keyframes talk { from { height: 5px; } to { height: 17px; } }
@keyframes talk { from { height: 5px; } to { height: 17px; } }

@-webkit-keyframes bars { from { height: 5px; } to { height: 21px; } }
@keyframes bars { from { height: 5px; } to { height: 21px; } }

@-webkit-keyframes voice-pulse { from { opacity: 0.45; -webkit-transform: scale(0.75); } to { opacity: 1; -webkit-transform: scale(1.15); } }
@keyframes voice-pulse { from { opacity: 0.45; transform: scale(0.75); } to { opacity: 1; transform: scale(1.15); } }

@-webkit-keyframes think-eye { from { width: 28px; } to { width: 48px; } }
@keyframes think-eye { from { width: 28px; } to { width: 48px; } }

@media (max-height: 600px) {
  .face-stage { height: 172px; }
  .face { top: 33px; -webkit-transform: scale(.92); transform: scale(.92); }
  .clock-panel { padding: 7px 0 5px; }
  .time { font-size: 42px; }
  .controls { padding-top: 7px; padding-bottom: 4px; }
  .control.primary { width: 52px; height: 52px; }
  footer { display: none; }
}

@media (max-height: 480px) {
  .shell { padding: 6px 18px 7px; }
  .topbar { height: 24px; }
  .face-stage { height: 154px; }
  .face {
    top: 27px;
    -webkit-transform: scale(.82);
    transform: scale(.82);
    -webkit-transform-origin: top center;
    transform-origin: top center;
  }
  .antenna { top: 10px; height: 17px; }
  .clock-panel { padding: 5px 0 4px; }
  .time { font-size: 38px; }
  .greeting { margin-top: 2px; font-size: 10px; }
  .now-playing { min-height: 57px; padding: 7px 9px; }
  .album-art { width: 38px; height: 38px; }
  .controls { padding-top: 5px; padding-bottom: 3px; }
  .control.primary { width: 48px; height: 48px; }
  .utility-controls button { height: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
