/* 泡泡纸 · 样式（.g-bubbles 前缀） */

.g-bubbles {
  gap: 10px;
}

/* ---------------- 顶部计数 ---------------- */

.g-bubbles .bub-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex-wrap: wrap;
}

.g-bubbles .bub-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
}

.g-bubbles .bub-k {
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--faint);
  white-space: nowrap;
}

.g-bubbles .bub-num {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.g-bubbles .bub-badge { margin-left: auto; flex: none; }

/* ---------------- 气泡区 ---------------- */

.g-bubbles .bub-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 122, 184, 0.1), transparent 62%),
    rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

.g-bubbles .bub-board {
  display: grid;
  gap: 5px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.g-bubbles .bub-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
}

/* 气泡本体：纯 CSS 渐变 + 高光 */
.g-bubbles .bub-bubble {
  position: relative;
  flex: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.24) 26%, rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 72% 78%, hsla(var(--h), 100%, 88%, 0.5), transparent 46%),
    linear-gradient(155deg, hsl(var(--h), 92%, 80%), hsl(var(--h), 88%, 58%));
  box-shadow:
    inset -6px -8px 12px hsla(var(--h), 85%, 42%, 0.35),
    inset 5px 6px 12px rgba(255, 255, 255, 0.36),
    0 8px 16px -8px hsla(var(--h), 90%, 42%, 0.7);
  border: 1px solid hsla(var(--h), 100%, 90%, 0.28);
  transform: scale(1);
  will-change: transform, opacity;
}

/* 戳破：先放大再收缩，留下暗色破痕 */
.g-bubbles .bub-bubble.popped {
  z-index: 2;
  animation: bubPop 0.26s ease-out forwards;
  background:
    radial-gradient(circle at 42% 40%, rgba(0, 0, 0, 0.42), transparent 46%),
    radial-gradient(circle at 62% 64%, rgba(0, 0, 0, 0.32), transparent 42%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 2px 8px rgba(0, 0, 0, 0.42);
}

.g-bubbles .bub-bubble.popped::before {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 45%, rgba(0, 0, 0, 0.3), transparent 68%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1);
}

/* 补满：淡入 + 轻微回弹 */
.g-bubbles .bub-bubble.fresh {
  animation: bubIn 0.28s ease-out;
}

@keyframes bubPop {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.26); opacity: 0.95; }
  100% { transform: scale(0.6); opacity: 0.42; }
}

@keyframes bubIn {
  0% { transform: scale(0.35); opacity: 0; }
  70% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------------- 底部控件 ---------------- */

.g-bubbles .bub-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.g-bubbles .bub-themes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.g-bubbles .bub-theme {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.32), 0 3px 10px -5px rgba(0, 0, 0, 0.9);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  touch-action: manipulation;
}

.g-bubbles .bub-theme[data-th="sakura"] {
  background: linear-gradient(150deg, #ffc1dd, #ff7ab8 55%, #c93d82);
}

.g-bubbles .bub-theme[data-th="mint"] {
  background: linear-gradient(150deg, #b7f7ea, #5fe0c8 55%, #1f9e8a);
}

.g-bubbles .bub-theme[data-th="candy"] {
  background: conic-gradient(from 20deg, #ff7ab8, #ffd166, #7ee787, #5fe0c8, #b78cff, #ff7ab8);
}

.g-bubbles .bub-theme.active {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75), 0 4px 14px -5px rgba(0, 0, 0, 0.9);
  transform: scale(1.04);
}

.g-bubbles .bub-theme:active { transform: scale(0.94); }

.g-bubbles .bub-sizes {
  flex: 1 1 auto;
  max-width: 186px;
  min-width: 0;
}

.g-bubbles .bub-sizes .seg { width: 100%; }
.g-bubbles .bub-sizes .seg-item { min-height: 40px; font-size: 12.5px; }

.g-bubbles .bub-hint {
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  min-height: 16px;
}

/* ---------------- 主题氛围 ---------------- */

.g-bubbles[data-theme="sakura"] .bub-board-wrap {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 122, 184, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.018);
}

.g-bubbles[data-theme="mint"] .bub-board-wrap {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(95, 224, 200, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.018);
}

.g-bubbles[data-theme="candy"] .bub-board-wrap {
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(255, 122, 184, 0.1), transparent 60%),
    radial-gradient(60% 60% at 80% 0%, rgba(95, 224, 200, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.018);
}

/* ---------------- 窄屏 ---------------- */

@media (max-width: 359px) {
  .g-bubbles .bub-badge { display: none; }
  .g-bubbles .bub-themes { gap: 6px; }
  .g-bubbles .bub-theme { width: 38px; height: 38px; }
  .g-bubbles .bub-sizes { max-width: 156px; }
  .g-bubbles .bub-hint { font-size: 10.5px; }
}
