:root {
  color-scheme: light;
  --ink: #24212d;
  --muted: #716d7e;
  --panel: rgba(255, 255, 255, 0.76);
  --line: rgba(41, 35, 61, 0.12);
  --violet: #7965e9;
  --violet-dark: #4d3db6;
  --lime: #d6ff70;
  --coral: #ff745f;
  --cream: #fffaf3;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  min-height: 100svh;
  background:
    radial-gradient(circle at 76% 42%, rgba(255, 255, 255, 0.96) 0 9%, transparent 40%),
    linear-gradient(135deg, #f8f3ff 0%, #e9ecff 48%, #dff7f1 100%);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body::before {
  content: "SQUISH";
  position: fixed;
  z-index: 0;
  left: 42%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-5deg);
  color: rgba(255, 255, 255, 0.42);
  font-size: clamp(8rem, 20vw, 19rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.75;
  pointer-events: none;
  -webkit-text-stroke: 1px rgba(105, 91, 178, 0.05);
}

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

#squishy-canvas {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

body.pointer-squeezing #squishy-canvas {
  cursor: grabbing;
}

.soft-light {
  position: fixed;
  z-index: 0;
  width: min(62vw, 800px);
  aspect-ratio: 1;
  right: 4vw;
  top: 48%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 255, 0.54);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand small {
  padding-left: 11px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand-bubble {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 45% 55% 52% 48%;
  background: var(--violet);
  box-shadow: inset -5px -5px 10px rgba(57, 41, 143, 0.24);
  transform: rotate(12deg);
}

.brand-bubble::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 6px;
  left: 6px;
  top: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-18deg);
}

.live-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.language-button {
  min-width: 54px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(73, 62, 119, 0.2);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.language-button:hover {
  border-color: rgba(121, 101, 233, 0.5);
  background: white;
  transform: translateY(-1px);
}

.language-button:focus-visible {
  outline: 3px solid rgba(121, 101, 233, 0.28);
  outline-offset: 2px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa5b7;
  box-shadow: 0 0 0 5px rgba(137, 130, 157, 0.08);
}

.status-dot.live {
  background: #54c99b;
  box-shadow: 0 0 0 5px rgba(84, 201, 155, 0.13);
}

.control-panel {
  position: fixed;
  z-index: 10;
  left: 28px;
  top: 100px;
  bottom: 28px;
  width: 342px;
  padding: 30px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  background: var(--panel);
  box-shadow:
    0 26px 70px rgba(72, 59, 123, 0.12),
    inset 0 0 0 1px rgba(63, 48, 108, 0.04);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
}

.kicker {
  margin: 0 0 19px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4.2vw, 4.6rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

body.lang-en h1 {
  font-size: clamp(2.5rem, 3.6vw, 3.6rem);
  letter-spacing: -0.06em;
}

.lead {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.shape-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.shape-picker legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shape-grid {
  display: grid;
  gap: 8px;
}

.shape-card {
  width: 100%;
  min-height: 64px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.shape-card:hover {
  transform: translateX(3px);
  border-color: rgba(121, 101, 233, 0.3);
  background: rgba(255, 255, 255, 0.82);
}

.shape-card:focus-visible,
.camera-button:focus-visible {
  outline: 3px solid rgba(121, 101, 233, 0.28);
  outline-offset: 2px;
}

.shape-card.active {
  border-color: rgba(121, 101, 233, 0.46);
  background: #f0edff;
  box-shadow: inset 4px 0 0 var(--violet);
}

.shape-emoji {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 25px;
  filter: saturate(0.9);
}

.shape-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.shape-card strong {
  font-size: 14px;
}

.shape-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.camera-button {
  width: 100%;
  min-height: 50px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(36, 33, 45, 0.16);
  transition: transform 180ms ease, background 180ms ease;
}

.camera-button:hover {
  transform: translateY(-2px);
  background: var(--violet-dark);
}

.camera-button.active {
  color: var(--ink);
  background: var(--lime);
}

.camera-button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.camera-icon {
  position: relative;
  width: 17px;
  height: 13px;
  border: 1.7px solid currentColor;
  border-radius: 3px;
}

.camera-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -6px;
  width: 5px;
  height: 5px;
  border: 1.7px solid currentColor;
  border-left: 0;
  border-radius: 0 2px 2px 0;
}

.privacy {
  margin: 10px 8px 0;
  color: #918b9f;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.stage-info {
  position: fixed;
  z-index: 8;
  top: 104px;
  left: 405px;
  min-width: 200px;
  pointer-events: none;
}

.stage-info p {
  margin: 0 0 6px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.stage-info h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.stage-info span {
  color: var(--muted);
  font-size: 12px;
}

.camera-dock {
  position: fixed;
  z-index: 12;
  top: 102px;
  right: 28px;
  width: 190px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  border: 6px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: #d9d7e3;
  box-shadow: 0 18px 40px rgba(64, 52, 111, 0.16);
  transition: opacity 320ms ease, transform 320ms ease;
}

.camera-dock.visible {
  opacity: 1;
  transform: none;
}

.camera-dock video,
.camera-dock canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-dock video {
  opacity: 0.58;
  filter: saturate(0.55) contrast(1.08) brightness(1.08);
}

.camera-caption {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 34px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-radius: 9px;
  background: rgba(31, 28, 40, 0.72);
  color: white;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.camera-caption span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.camera-caption i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #65e3af;
}

.camera-caption strong {
  font-size: 10px;
  white-space: nowrap;
}

.squish-meter {
  position: fixed;
  z-index: 9;
  left: max(405px, calc(50% - 35px));
  right: 28px;
  bottom: 30px;
  max-width: 560px;
  padding: 18px 22px 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 44px rgba(68, 54, 124, 0.1);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.meter-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 750;
}

.meter-copy strong {
  color: var(--violet-dark);
  font-size: 15px;
}

.meter-track {
  position: relative;
  height: 8px;
  margin-top: 12px;
  overflow: visible;
  border-radius: 99px;
  background: rgba(57, 48, 88, 0.1);
}

.meter-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9d8dff, #ff745f);
  transition: width 80ms linear;
}

.meter-track b {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 4px 10px rgba(105, 61, 65, 0.2);
  transform: translate(-50%, -50%);
  transition: left 80ms linear;
}

.squish-meter p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.gesture-guide {
  position: fixed;
  z-index: 8;
  right: 28px;
  top: 274px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 280ms ease, transform 280ms ease;
}

body.tracking-active .gesture-guide {
  opacity: 1;
  transform: none;
}

.gesture-guide span {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.gesture-guide b {
  color: var(--ink);
}

.gesture-guide i {
  font-style: normal;
}

.error-toast {
  position: fixed;
  z-index: 30;
  top: 92px;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  padding: 13px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(183, 62, 73, 0.22);
  border-radius: 13px;
  background: rgba(255, 239, 240, 0.94);
  color: #8b2935;
  box-shadow: 0 14px 32px rgba(96, 37, 44, 0.12);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

noscript {
  position: fixed;
  z-index: 50;
  inset: auto 20px 20px;
  padding: 16px;
  border-radius: 12px;
  background: white;
  text-align: center;
}

@media (max-height: 760px) and (min-width: 901px) {
  .control-panel {
    top: 88px;
    bottom: 18px;
    padding: 22px 26px;
  }

  .kicker {
    margin-bottom: 12px;
  }

  .lead {
    margin: 12px 0 16px;
  }

  .shape-card {
    min-height: 54px;
  }

  .shape-emoji {
    width: 38px;
    height: 38px;
  }

  .camera-button {
    min-height: 44px;
    margin-top: 14px;
  }
}

@media (max-width: 900px) {
  body::before {
    left: 50%;
    top: 32%;
    font-size: 30vw;
  }

  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .brand small {
    display: none;
  }

  .control-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: 238px;
    padding: 16px;
    overflow: hidden;
    border-radius: 24px;
  }

  .kicker,
  .lead {
    display: none;
  }

  h1 {
    font-size: 27px;
    line-height: 1;
    letter-spacing: -0.05em;
  }

  h1 br {
    display: none;
  }

  .shape-picker legend {
    margin: 13px 0 8px;
    font-size: 10px;
  }

  .shape-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .shape-card {
    min-height: 62px;
    padding: 7px;
    grid-template-columns: 34px 1fr;
    gap: 6px;
    border-radius: 13px;
  }

  .shape-card:hover {
    transform: none;
  }

  .shape-emoji {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 20px;
  }

  .shape-card strong {
    font-size: 11px;
  }

  .shape-card small {
    display: none;
  }

  .camera-button {
    width: auto;
    min-height: 40px;
    margin-top: 10px;
    padding: 0 16px;
    border-radius: 13px;
    font-size: 12px;
  }

  .privacy {
    position: absolute;
    right: 16px;
    bottom: 22px;
    max-width: calc(100% - 190px);
    margin: 0;
    text-align: right;
  }

  .stage-info {
    top: 78px;
    left: 18px;
  }

  .stage-info span {
    display: none;
  }

  .camera-dock {
    top: 76px;
    right: 14px;
    width: 124px;
    border-width: 4px;
    border-radius: 15px;
  }

  .camera-caption {
    min-height: 26px;
  }

  .camera-caption span {
    display: none;
  }

  .camera-caption strong {
    width: 100%;
    font-size: 9px;
    text-align: center;
  }

  .squish-meter {
    left: 18px;
    right: 18px;
    bottom: 266px;
    max-width: none;
    padding: 12px 15px;
    border-radius: 16px;
  }

  .squish-meter p {
    display: none;
  }

  .gesture-guide {
    display: none;
  }
}

@media (max-width: 430px) {
  .control-panel {
    height: 228px;
  }

  .squish-meter {
    bottom: 250px;
  }

  .live-state {
    font-size: 10px;
  }

  .top-actions {
    gap: 10px;
  }

  .language-button {
    min-width: 48px;
    min-height: 29px;
    padding: 0 10px;
    font-size: 10px;
  }

  .privacy {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

