:root {
  --bg1: #1a0b16;
  --bg2: #2a0d23;
  --text: #eef2ff;
  --muted: rgba(238, 242, 255, 0.75);
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  --accent: #ec4899;
  --accent2: #f472b6;
  --danger: #ef4444;
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 0%, #5b133c 0%, transparent 60%),
    radial-gradient(1000px 700px at 90% 20%, #6b1448 0%, transparent 55%),
    linear-gradient(145deg, var(--bg1), var(--bg2));
  overflow: hidden;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  padding: 20px 22px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.stage {
  position: relative;
  height: 100%;
  padding: 0;
}

.bubble-layer {
  position: absolute;
  inset: 0;
}

.hint {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--muted);
}

.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  min-width: 96px;
  max-width: 180px;
  border-radius: 999px;
  background: radial-gradient(
      120px 90px at 30% 25%,
      rgba(255, 255, 255, 0.28),
      transparent 60%
    ),
    linear-gradient(135deg, rgba(236, 72, 153, 0.30), rgba(244, 114, 182, 0.20));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  user-select: none;
  transform: translate3d(0, 0, 0);
  transition: transform 120ms ease, filter 150ms ease;
}

.bubble:hover {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.bubble:active {
  transform: scale(0.985);
}

.bubble .content {
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  padding: 0 28px;
  line-height: 1.2;
}

.bubble .count {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.bubble.bump {
  animation: bump 260ms ease-out;
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1.02);
  }
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: white;
  font-weight: 650;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
  cursor: pointer;
}

.dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.dialog-card {
  width: min(420px, calc(100vw - 28px));
  background: rgba(14, 24, 44, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 16px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  line-height: 20px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 10px 0 6px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

input[type="text"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

input[type="text"]:focus {
  border-color: rgba(236, 72, 153, 0.78);
}

.counter {
  justify-self: end;
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  border-radius: 12px;
  border: 1px solid var(--border);
  height: 40px;
  padding: 0 14px;
  font-weight: 650;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: 0;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.footnote {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
