:root {
  color-scheme: dark;
  --bg: #061019;
  --panel: #101e28;
  --panel-2: #172b36;
  --line: rgba(124, 238, 239, 0.2);
  --cyan: #19ece4;
  --green: #8cf17d;
  --danger: #ff6f6f;
  --scale: 1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(30, 196, 204, 0.18), transparent 43%),
    linear-gradient(150deg, #08131c 0%, #03080d 100%);
  color: #eefcfd;
  overflow-x: hidden;
}

button, label { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.topbar {
  width: min(980px, 100%);
  min-height: 64px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(12, 27, 37, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 290px; }
.brand-logo { width: 112px; height: 49px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.brand strong { display: block; font-size: 13px; letter-spacing: 0.14em; }
.brand small { display: block; margin-top: 3px; color: #85a2af; font-size: 11px; letter-spacing: 0.08em; }

.toolbar { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.tool-button {
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(156, 222, 226, 0.18);
  border-radius: 10px;
  background: #172a34;
  color: #d9f3f4;
  cursor: pointer;
  transition: 0.16s ease;
}
.tool-button:hover { border-color: var(--cyan); color: #fff; transform: translateY(-1px); }
.tool-button:focus-visible { outline: 3px solid rgba(25, 236, 228, 0.48); outline-offset: 2px; }
.tool-button.sound-off { color: #81949c; border-color: rgba(129, 148, 156, 0.22); }

.device {
  width: min(920px, 100%);
  padding: 14px;
  border: 1px solid rgba(190, 229, 231, 0.19);
  border-radius: 28px;
  background: linear-gradient(145deg, #263945, #0d1921 52%, #1c2c35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.19),
    inset 0 -1px 0 rgba(0,0,0,0.85),
    0 28px 90px rgba(0,0,0,0.52);
}

.device-top { height: 46px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; }
.device-brandline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.device-logo { width: 82px; height: 37px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,.38)); }
.device-model { color: #94aab5; font-size: 11px; letter-spacing: 0.18em; }
.demo-badge { color: #79aab1; font-size: 10px; letter-spacing: 0.13em; }

.viewport-shell {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border: 8px solid #050a0d;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px #40545d, 0 0 0 1px #60727a, 0 10px 32px rgba(0,0,0,0.48);
}

.screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 800px;
  height: 600px;
  overflow: hidden;
  background: #fff;
  transform: scale(var(--scale));
  transform-origin: 0 0;
  user-select: none;
}

.screen-image { position: absolute; inset: 0; width: 800px; height: 600px; display: block; pointer-events: none; }
.screen-layer { position: absolute; inset: 0; }
[hidden] { display: none !important; }

.hotspot,
.skin-controls button,
.body-zones button {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.hotspot:focus-visible,
.skin-controls button:focus-visible,
.body-zones button:focus-visible {
  outline: 4px solid rgba(25, 236, 228, 0.85);
  outline-offset: -3px;
  border-radius: 8px;
}

.menu-hotspot { left: 114px; width: 565px; height: 118px; border-radius: 59px; }
.skin-menu { top: 214px; }
.hair-menu { top: 341px; }
.pico-menu { top: 414px; }
.menu-layer.three-menu .skin-menu { top: 160px; }
.menu-layer.three-menu .hair-menu { top: 287px; }
.menu-hotspot:hover { background: rgba(25, 236, 228, 0.12); box-shadow: inset 0 0 30px rgba(25,236,228,0.28); }

.home-hotspot { left: 8px; top: 19px; width: 79px; height: 77px; border-radius: 10px; }
.gender-hotspot { top: 113px; width: 82px; height: 74px; border-radius: 12px; }
.gender-male { left: 372px; }
.gender-female { left: 459px; }

.screen-value,
.screen-status,
.value-hotspot,
.param-value {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 7px rgba(0, 255, 246, 0.38);
}

.screen-value { position: absolute; z-index: 3; font-size: 25px; line-height: 1; text-align: right; }
.flow-value { left: 332px; top: 42px; width: 52px; }
.temp-value { left: 457px; top: 42px; width: 43px; }
.screen-status {
  position: absolute;
  z-index: 3;
  left: 548px;
  top: 39px;
  width: 142px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.08em;
}
.screen-status.running { color: #9cff91; animation: statusPulse 1s infinite; }
@keyframes statusPulse { 50% { opacity: 0.68; } }

.skin-mask {
  position: absolute;
  z-index: 2;
  left: 432px;
  top: 225px;
  width: 291px;
  height: 61px;
  border-radius: 31px;
  background: linear-gradient(#dce3e4, #aeb8b9 48%, #d6dddd);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.75);
}
.skin-controls { position: absolute; z-index: 4; left: 437px; top: 233px; width: 279px; height: 47px; display: flex; }
.skin-controls button { position: relative; width: 56px; height: 47px; font: 800 28px/47px Arial, sans-serif; color: #080808; text-align: center; }
.skin-controls button.active { color: var(--cyan); text-shadow: 0 0 8px rgba(25,236,228,0.45); }

.value-hotspot { z-index: 4; left: 562px; top: 129px; width: 213px; height: 48px; padding: 0 67px 0 86px; text-align: right; font-size: 25px; }
.param-value { z-index: 4; height: 48px; font-size: 24px; text-align: center; }
.power-value { left: 620px; top: 293px; width: 70px; }
.pulse-value { left: 620px; top: 358px; width: 70px; }
.frequency-value { left: 608px; top: 419px; width: 58px; }

.arrow { z-index: 5; width: 57px; height: 48px; border-radius: 8px; }
.arrow:active { background: rgba(25,236,228,0.18); }
.power-minus { left: 561px; top: 293px; }
.power-plus { left: 712px; top: 293px; }
.pulse-minus { left: 557px; top: 358px; }
.pulse-plus { left: 711px; top: 358px; }
.frequency-minus { left: 548px; top: 419px; }
.frequency-plus { left: 687px; top: 419px; }

.body-zones { position: absolute; z-index: 5; left: 0; top: 0; width: 430px; height: 600px; pointer-events: none; }
.body-zones button { pointer-events: auto; opacity: 0; border-radius: 45%; }
.body-zones button:hover { opacity: 1; background: rgba(25,236,228,0.1); }
.zone-neck { left: 197px; top: 164px; width: 68px; height: 68px; }
.zone-arms { left: 132px; top: 225px; width: 202px; height: 183px; }
.zone-abdomen { left: 186px; top: 267px; width: 90px; height: 98px; }
.zone-bikini { left: 181px; top: 350px; width: 104px; height: 74px; }
.zone-legs { left: 169px; top: 414px; width: 122px; height: 160px; }

.screen-run-controls {
  position: absolute;
  z-index: 7;
  left: 365px;
  top: 498px;
  width: 300px;
  height: 48px;
  display: flex;
  justify-content: center;
  gap: 26px;
}
.screen-run-button {
  width: 112px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.68);
  border-radius: 21px;
  color: #fff;
  font: 800 17px/1 Arial, sans-serif;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.32), 0 2px 7px rgba(0,0,0,.22);
}
.screen-run-button:active { transform: translateY(2px); filter: brightness(.9); }
.screen-stop { background: linear-gradient(#fa8179, #d84b43); }
.screen-start { background: linear-gradient(#9aed83, #4fc55c); }
.screen-start.running { animation: screenWorking 1s ease-in-out infinite; }
@keyframes screenWorking { 50% { box-shadow: 0 0 18px rgba(99,255,113,.82), inset 0 2px 4px rgba(255,255,255,.32); } }

.photo-overlay {
  position: absolute;
  z-index: 2;
  left: 65px;
  top: 173px;
  width: 336px;
  height: 336px;
  overflow: hidden;
  border-radius: 50%;
  background: #4d6071;
  box-shadow: inset 0 0 28px rgba(25,236,228,0.28);
}
.photo-overlay img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-overlay span { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); padding: 4px 10px; border-radius: 12px; background: rgba(0,0,0,0.62); color: #d8ffff; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }

.keypad-backdrop { position: absolute; z-index: 20; inset: 0; display: grid; place-items: center; background: rgba(6,20,29,0.7); backdrop-filter: blur(3px); }
.keypad { width: 320px; padding: 17px; border: 2px solid #c8d4d6; border-radius: 12px; background: linear-gradient(#edf2f3, #b6c1c3); box-shadow: 0 18px 45px rgba(0,0,0,.5); color: #17262d; }
.keypad-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; font-weight: 800; }
.keypad-head output { min-width: 115px; padding: 8px 10px; border: 1px solid #839297; border-radius: 6px; background: #fff; text-align: right; font-size: 25px; }
.keypad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keypad-grid button { min-height: 48px; border: 1px solid #87979b; border-radius: 7px; background: linear-gradient(#fff, #d9e0e1); color: #17262d; font-weight: 800; font-size: 19px; cursor: pointer; }
.keypad-grid button:active { transform: translateY(1px); background: #c7f6f3; }
.keypad-grid .zero { grid-column: span 2; }
.keypad-grid .confirm { background: linear-gradient(#3fded8, #12aaa6); color: #05211f; }

.toast { position: absolute; z-index: 30; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: 80%; padding: 10px 17px; border-radius: 18px; background: rgba(5,21,29,.9); color: #e8ffff; border: 1px solid rgba(25,236,228,.42); font-weight: 700; white-space: nowrap; box-shadow: 0 8px 28px rgba(0,0,0,.4); }

.device-controls {
  min-height: 108px;
  padding: 16px 14px 3px;
  display: grid;
  grid-template-columns: 1fr 104px 1fr;
  align-items: center;
  gap: 18px;
}
.run-metrics { display: grid; grid-template-columns: auto auto; gap: 2px 12px; align-items: baseline; }
.run-metrics span { grid-column: 1 / -1; color: #6f98a2; font-size: 11px; letter-spacing: .15em; }
.run-metrics strong { font-size: 27px; color: #d6ffff; font-variant-numeric: tabular-nums; }
.run-metrics small { color: #78a0a8; font-size: 11px; }

.start-button {
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border: 2px solid #739099;
  border-radius: 50%;
  display: grid;
  place-content: center;
  gap: 2px;
  background: radial-gradient(circle at 40% 32%, #31505b, #10222b 68%);
  color: #9db5bb;
  box-shadow: inset 0 0 0 7px #132932, 0 7px 18px rgba(0,0,0,.42);
  cursor: pointer;
}
.start-button:not(:disabled):hover { border-color: var(--cyan); color: var(--cyan); }
.start-button[aria-pressed="true"] { border-color: #84ef78; color: #b2ffac; box-shadow: inset 0 0 0 7px #15331a, 0 0 25px rgba(111,255,97,.34); }
.start-button:disabled { cursor: not-allowed; opacity: .5; }
.power-symbol { font-size: 27px; line-height: 1; }
.start-button span:last-child { font-size: 10px; letter-spacing: .12em; }

.device-hint { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #809ba4; font-size: 12px; text-align: right; }
.status-light { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #74868d; box-shadow: 0 0 0 5px rgba(116,134,141,.1); }
.device.running .status-light { background: #91ff86; box-shadow: 0 0 0 5px rgba(145,255,134,.09), 0 0 14px #91ff86; }

.power-credit {
  padding: 1px 12px 7px;
  color: #728f99;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  letter-spacing: .08em;
}
.power-credit strong { color: #c7f9f7; font-weight: 700; }

.notice { width: min(900px,100%); color: #6d858f; font-size: 11px; line-height: 1.7; text-align: center; }

.device:fullscreen { width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.device:fullscreen .device-top { max-width: 900px; width: 100%; align-self: center; }
.device:fullscreen .device-controls { max-width: 900px; width: 100%; align-self: center; }

@media (max-width: 720px) {
  .app { padding-left: 8px; padding-right: 8px; }
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .toolbar { gap: 5px; }
  .tool-button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
  .device { padding: 7px; border-radius: 17px; }
  .device-top { height: 38px; }
  .device-logo { width: 66px; height: 30px; }
  .device-model { font-size: 9px; letter-spacing: .11em; }
  .viewport-shell { border-width: 4px; }
  .device-controls { grid-template-columns: 1fr 72px 1fr; min-height: 82px; padding-top: 10px; gap: 8px; }
  .start-button { width: 66px; height: 66px; box-shadow: inset 0 0 0 5px #132932, 0 5px 14px rgba(0,0,0,.42); }
  .power-symbol { font-size: 20px; }
  .run-metrics strong { font-size: 20px; }
  .device-hint { font-size: 10px; }
}

@media (max-width: 520px) {
  .topbar { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .brand { display: none; }
  .toolbar { justify-content: center; }
  .device-hint span:last-child { display: none; }
  .notice { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
