@font-face {
  font-family: "Cute Pixel Local";
  src: local("ZCOOL KuaiLe"), local("Comic Sans MS"), local("Marker Felt"), local("Trebuchet MS");
}

:root {
  --cream: #fff7df;
  --ink: #533d53;
  --pink: #ff8fbc;
  --peach: #ffc99a;
  --mint: #93ebcf;
  --lavender: #c9b9ff;
  --panel: rgba(255, 250, 239, 0.82);
  --stroke: rgba(110, 76, 112, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Cute Pixel Local", "Trebuchet MS", sans-serif;
  touch-action: manipulation;
  user-select: none;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 184, 219, 0.58), transparent 30%),
    radial-gradient(circle at 84% 16%, rgba(147, 235, 207, 0.48), transparent 30%),
    radial-gradient(circle at 52% 82%, rgba(255, 220, 143, 0.60), transparent 34%),
    linear-gradient(135deg, #fff8e8 0%, #f7eeff 48%, #e9fff7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.82) 0 2px, transparent 2px),
    radial-gradient(circle, rgba(255, 143, 188, 0.18) 0 1px, transparent 1px);
  background-size: 42px 42px, 24px 24px;
  background-position: 0 0, 12px 18px;
  opacity: 0.65;
}

#face {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.control-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: min(430px, calc(100vw - 36px));
  padding: 16px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: var(--panel);
  box-shadow:
    0 18px 45px rgba(116, 82, 112, 0.20),
    inset 0 -8px 0 rgba(255, 191, 217, 0.18),
    inset 0 0 0 1px var(--stroke);
  backdrop-filter: blur(18px) saturate(1.25);
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.brand-kicker,
.group-title {
  margin: 0;
  color: #bd6d91;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.group-title {
  margin: 12px 0 7px;
}

.brand strong {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.brand small {
  min-height: 16px;
  color: #8d728f;
  font-size: 12px;
}

.button-grid,
.style-grid {
  display: grid;
  gap: 8px;
}

.button-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.style-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

button,
input {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font: inherit;
  box-shadow:
    inset 0 -4px 0 rgba(255, 156, 195, 0.18),
    0 5px 13px rgba(111, 76, 108, 0.12);
}

button {
  min-height: 42px;
  cursor: pointer;
  transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-2px) rotate(-1deg);
  background: #fffdf8;
  box-shadow:
    inset 0 -4px 0 rgba(255, 143, 188, 0.28),
    0 9px 20px rgba(111, 76, 108, 0.18);
  outline: none;
}

button:active {
  transform: translateY(1px) scale(0.98);
}

button.wide {
  grid-column: span 2;
}

input {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  padding: 0 15px;
  outline: none;
}

.display-mode {
  cursor: none;
}

.display-mode .control-panel {
  display: none;
}

@media (max-width: 720px) {
  .control-panel {
    left: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    padding: 12px;
  }

  .button-grid,
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
