/* ========================================================
   CalcuHub — Bubble Playful Design System
   ======================================================== */

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette */
  --mint:      #E2F0CB;
  --sky:       #B5EAD7;
  --lavender:  #E0BBE4;
  --peach:     #FFDAC1;
  --rose:      #FFB7B2;
  --vanilla:   #FFF9C4;
  --bg:        #F8FAFC;
  --text:      #3a3a4a;
  --text-soft: #7b7b8e;
  --white:     #ffffff;
  --shadow:    rgba(0, 0, 0, 0.06);
  --shadow-md: rgba(0, 0, 0, 0.10);
  --yellow-info: #FFF8E1;
  --yellow-border: #FFE082;

  /* Derived tints */
  --mint-deep:     #b5d9a0;
  --sky-deep:      #7fd4b8;
  --lavender-deep: #c28ecf;
  --peach-deep:    #f0b58a;
  --rose-deep:     #e8a19c;
  --vanilla-deep:  #e6e0ae;

  /* Sizes */
  --header-h: 72px;
  --radius-pill: 50px;
  --radius-round: 50%;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, var(--mint) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, var(--lavender) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, var(--peach) 0%, transparent 45%);
  opacity: .22;
  z-index: -1;
  pointer-events: none;
}

/* ---------- HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0,0,0,.04);
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.header__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 28px;
  color: var(--lavender-deep);
  line-height: 1;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
}

.logo-accent {
  color: var(--lavender-deep);
}

/* Search */
.header__search {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--white);
  padding: 0 18px 0 44px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  box-shadow: 0 2px 12px var(--shadow);
  transition: var(--transition);
  outline: none;
}

.search-input::placeholder { color: var(--text-soft); }

.search-input:focus {
  border-color: var(--lavender);
  box-shadow: 0 4px 20px rgba(224,187,228,.28);
}

/* Fav toggle */
.header__fav-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--peach-deep);
  padding: 6px;
  border-radius: var(--radius-round);
  transition: var(--transition);
  flex-shrink: 0;
}

.header__fav-toggle:hover {
  background: var(--peach);
  transform: scale(1.12);
}

.header__fav-toggle svg { display: block; }

.fav-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--lavender-deep);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

.fav-count.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---------- MAIN ---------- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------- SECTION TITLES ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.section-title-icon { color: var(--peach-deep); }

.embed-body { background: transparent; width: 100%; box-sizing: border-box; }

/* Shrink inputs inside embedded widget to save space */
.embed-body .calc-input, 
.embed-body .calc-select {
  height: 34px;
  font-size: 12px;
  padding: 0 8px;
}
.embed-body .calc-btn {
  height: 36px;
  font-size: 13px;
  margin-top: 0;
}
.embed-body .calc-label {
  font-size: 11px;
  margin-bottom: 2px;
}
.embed-body .calc-group {
  margin-bottom: 8px;
}
.embed-body .calc-row {
  gap: 8px;
}
.embed-body .calc-result {
  margin-top: 10px;
  padding: 10px;
  min-height: 42px;
}
.embed-body .calc-result__value {
  font-size: 18px;
}

/* ---------- FAVORITES WIDGETS (Home Grid) ---------- */
.favorites-section { display: none; } /* Hidden legacy section */

.bubble-fav-widget {
  float: left;
  text-align: left;
  width: 100%;
  max-width: calc(33.333% - 20px);
  min-width: 270px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 24px var(--shadow);
  margin: 10px;
  overflow: hidden;
  border: 2px solid #e8e8f0;
  animation: fadeSlideUp .5s ease both;
  display: flex;
  flex-direction: column;
}

.bubble-fav-widget__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 2px dashed #e8e8f0;
}

.bubble-fav-widget__icon { font-size: 20px; line-height: 1; }

.bubble-fav-widget__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
}

.bubble-fav-widget__remove {
  background: rgba(231,76,60,.1);
  color: #e74c3c;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.bubble-fav-widget__remove:hover {
  background: #e74c3c;
  color: #fff;
}

.bubble-fav-widget iframe {
  width: 100%;
  min-height: 180px;
  display: block;
  transition: height 0.2s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bubble-fav-widget iframe::-webkit-scrollbar {
  display: none;
}

/* Shrink bubbles when favorites are present */
.bubbles-grid--has-favs .bubble {
  width: 110px;
  height: 110px;
  border-width: 2px;
  margin: 8px; /* Slightly tighter margin when shrunk */
}

.bubbles-grid--has-favs .bubble__icon {
  font-size: 26px;
}

.bubbles-grid--has-favs .bubble__name {
  font-size: 11px;
}

/* ---------- BUBBLES GRID (Categories) — Organic scatter ---------- */
.bubbles-grid {
  display: block; /* Removed flex to allow float wrapping */
  text-align: center;
  padding: 10px 0 80px;
}
.bubbles-grid::after {
  content: "";
  display: table;
  clear: both;
}

/* Specific layout overrides for 1 centered favorite */
.bubbles-col-left, .bubbles-col-right {
  float: left;
  width: calc(50% - 160px);
  text-align: center;
}

.fav-centered-col {
  float: left;
  width: 100%;
  max-width: 300px;
  margin: 10px;
}

@media (max-width: 820px) {
  .bubbles-col-left, .bubbles-col-right {
    width: 100%;
    float: none;
  }
  .fav-centered-col {
    float: none;
    margin: 10px auto;
  }
}

/* Single Bubble */
.bubble {
  display: inline-flex;
  vertical-align: top;
  margin: 10px 8px; /* Replaces flex gap */
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: var(--radius-round);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 6px 28px var(--shadow);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
  user-select: none;
  animation: bubbleIn .55s ease both;
  border: 3px solid rgba(255,255,255,.7);
  will-change: transform;
}

.bubble:hover {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 0 14px 40px var(--shadow-md);
}

/* Bounce on click */
.bubble:active { transform: scale(.92); }

.bubble--bounce {
  animation: bounce .5s cubic-bezier(.34,1.56,.64,1) !important;
}

@keyframes bounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(.88); }
  50%  { transform: scale(1.12); }
  70%  { transform: scale(.96); }
  100% { transform: scale(1); }
}

.bubble__icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.08));
}

.bubble__name {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: var(--text);
  padding: 0 8px;
  max-width: 120px;
}

.bubble__count {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 600;
}

/* Star button on bubble */
.bubble__star {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-round);
  border: none;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  z-index: 2;
}

.bubble__star:hover { transform: scale(1.2); }

.bubble__star svg {
  width: 16px;
  height: 16px;
  transition: var(--transition);
}

.bubble__star--inactive svg {
  fill: none;
  stroke: var(--text-soft);
  stroke-width: 2;
}

.bubble__star--active svg {
  fill: var(--peach-deep);
  stroke: var(--peach-deep);
  stroke-width: 2;
}

.bubble__star--active { background: var(--peach); }

/* Color variants */
.bubble--mint      { background: linear-gradient(145deg, var(--mint), #d4eab8); }
.bubble--sky       { background: linear-gradient(145deg, var(--sky),  #99dfc7); }
.bubble--lavender  { background: linear-gradient(145deg, var(--lavender), #cfaad8); }
.bubble--peach     { background: linear-gradient(145deg, var(--peach), #ffc8a0); }
.bubble--rose      { background: linear-gradient(145deg, var(--rose), #ffcfcc); }
.bubble--vanilla   { background: linear-gradient(145deg, var(--vanilla), #fffee0); }

/* --- Per-bubble scatter offsets (only margin, no animation override) --- */
.bubble:nth-child(1) { margin-top: 12px; }
.bubble:nth-child(2) { margin-top: -6px; }
.bubble:nth-child(3) { margin-top: 18px; }
.bubble:nth-child(4) { margin-top: 2px; }
.bubble:nth-child(5) { margin-top: -10px; }
.bubble:nth-child(6) { margin-top: 14px; }
.bubble:nth-child(7) { margin-top: -4px; }
.bubble:nth-child(8) { margin-top: 10px; }
.bubble:nth-child(9) { margin-top: -8px; }
.bubble:nth-child(10) { margin-top: 6px; }
.bubble:nth-child(11) { margin-top: -12px; }
.bubble:nth-child(12) { margin-top: 8px; }
.bubble:nth-child(13) { margin-top: -5px; }
.bubble:nth-child(14) { margin-top: 12px; }

/* Smooth unique floats — JS sets --float-* custom properties per bubble */
.bubble.bubble--float {
  animation:
    bubbleIn .55s ease both,
    floatUnique var(--float-dur, 6s) var(--float-delay, 0s) ease-in-out infinite;
}

@keyframes floatUnique {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(var(--fx1, 3px), var(--fy1, -8px)) rotate(var(--fr1, 1deg)); }
  50%  { transform: translate(var(--fx2, -2px), var(--fy2, -12px)) rotate(var(--fr2, -1deg)); }
  75%  { transform: translate(var(--fx3, 4px), var(--fy3, -5px)) rotate(var(--fr3, 0.5deg)); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* ========== CATEGORY DETAIL VIEW ========== */
.category-detail {
  animation: fadeSlideUp .4s ease both;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 2px solid #e8e8f0;
  border-radius: var(--radius-pill);
  padding: 10px 22px 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 28px;
}

.back-btn:hover {
  background: var(--lavender);
  border-color: var(--lavender);
  transform: translateX(-4px);
}

.back-btn svg { flex-shrink: 0; }

.category-detail__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.category-detail__icon { font-size: 42px; line-height: 1; }

.category-detail__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

/* Calculator cards inside detail */
.category-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.calc-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  animation: fadeSlideUp .4s ease both;
}

.calc-card:nth-child(1) { animation-delay: .05s; }
.calc-card:nth-child(2) { animation-delay: .10s; }
.calc-card:nth-child(3) { animation-delay: .15s; }
.calc-card:nth-child(4) { animation-delay: .20s; }
.calc-card:nth-child(5) { animation-delay: .25s; }

.calc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 36px var(--shadow-md);
}

.calc-card__star {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.calc-card__star:hover { transform: scale(1.15); }

.calc-card__star svg { width: 17px; height: 17px; transition: var(--transition); }

.calc-card__star--inactive svg { fill: none; stroke: var(--text-soft); stroke-width: 2; }
.calc-card__star--active svg { fill: var(--peach-deep); stroke: var(--peach-deep); stroke-width: 2; }
.calc-card__star--active { background: var(--peach); }

.calc-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.calc-card__icon { font-size: 30px; line-height: 1; }

.calc-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.calc-card__desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.calc-card__color-bar {
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 4px;
  border-radius: 2px;
  opacity: .6;
}

.calc-card__color-bar--mint     { background: var(--mint-deep); }
.calc-card__color-bar--sky      { background: var(--sky-deep); }
.calc-card__color-bar--lavender { background: var(--lavender-deep); }
.calc-card__color-bar--peach    { background: var(--peach-deep); }
.calc-card__color-bar--rose     { background: var(--rose-deep); }
.calc-card__color-bar--vanilla  { background: var(--vanilla-deep); }

/* ---------- NO RESULTS ---------- */
.no-results {
  text-align: center;
  padding: 64px 20px;
  animation: fadeSlideUp .4s ease both;
}

.no-results__emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.no-results p { color: var(--text-soft); font-size: 16px; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .25s ease;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  animation: modalSlideUp .35s cubic-bezier(.16,1,.3,1);
  position: relative;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  border: none;
  background: var(--bg);
  font-size: 22px;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.modal__close:hover {
  background: var(--lavender);
  color: var(--text);
}

.modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 28px 0;
}

.modal__icon { font-size: 32px; line-height: 1; }
.modal__title { font-size: 20px; font-weight: 700; }

.modal__body { padding: 24px 28px 0; }

/* ¿Cómo funciona? info box */
.modal__info {
  margin: 20px 28px 28px;
  padding: 16px 18px;
  background: var(--yellow-info);
  border: 2px solid var(--yellow-border);
  border-radius: var(--radius-sm);
}

.modal__info-title {
  font-size: 14px;
  font-weight: 700;
  color: #b8860b;
  margin-bottom: 6px;
}

.modal__info-text {
  font-size: 13px;
  color: #6d5a00;
  line-height: 1.6;
}

/* ---------- CALC FORM ELEMENTS ---------- */
.calc-group { margin-bottom: 16px; }

.calc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.calc-input {
  width: 100%;
  height: 46px;
  border: 2px solid #e8e8f0;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
}

.calc-input:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 4px rgba(224,187,228,.18);
}

.calc-select {
  width: 100%;
  height: 46px;
  border: 2px solid #e8e8f0;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7b8e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.calc-select:focus { border-color: var(--lavender); }

.calc-row { display: flex; gap: 12px; }
.calc-row > .calc-group { flex: 1; }

.calc-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--lavender), var(--sky));
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(224,187,228,.35);
}

.calc-btn:active { transform: translateY(0); }

.calc-result {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg);
  text-align: center;
  font-size: 15px;
  color: var(--text);
  border: 2px dashed #e0e0ea;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* Subnet auto-filled visual cue */
.calc-input.sn-auto-filled {
  border-color: var(--sky-deep);
  background: linear-gradient(135deg, rgba(181,234,215,.12), rgba(226,240,203,.12));
}

.calc-input.sn-auto-filled:focus {
  border-color: var(--lavender);
  background: var(--bg);
}

.calc-result--filled {
  border-color: var(--sky-deep);
  background: linear-gradient(135deg, rgba(181,234,215,.15), rgba(226,240,203,.15));
}

.calc-result__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--lavender-deep);
}

.calc-result__label {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* Keypad */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calc-key {
  height: 50px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text);
}

.calc-key:hover { transform: scale(1.06); }
.calc-key:active { transform: scale(.97); }
.calc-key--op { background: var(--peach); color: var(--text); }
.calc-key--eq { background: linear-gradient(135deg, var(--lavender), var(--sky)); color: var(--text); font-weight: 800; }
.calc-key--wide { grid-column: span 2; }
.calc-key--clear { background: var(--lavender); }

.calc-display {
  width: 100%;
  min-height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 2px solid #e8e8f0;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
}

.calc-display__expr { font-size: 14px; color: var(--text-soft); min-height: 18px; word-break: break-all; }
.calc-display__value { font-size: 28px; font-weight: 800; color: var(--text); word-break: break-all; }

/* ---------- UTILITY ---------- */
.hidden { display: none !important; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bubbleIn { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(40px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }

.star-pop { animation: pop .35s ease; }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 400px) {
  .bubbles-grid { gap: 22px 18px; }
}

@media (min-width: 600px) {
  .main { padding: 40px 32px 80px; }
  .bubbles-grid { gap: 28px 22px; }
  .bubble { width: 165px; height: 165px; }
  .bubble__icon { font-size: 40px; }
  .bubble__name { font-size: 14px; }
  .section-title { font-size: 22px; }
  .category-detail__grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (min-width: 900px) {
  .bubbles-grid { gap: 32px 28px; }
  .bubble { width: 175px; height: 175px; }
}

@media (max-width: 399px) {
  .header__inner { padding: 0 12px; gap: 10px; }
  .logo-text { font-size: 18px; }
  .logo-icon { font-size: 22px; }
  .search-input { height: 40px; font-size: 14px; }
  .bubbles-grid { gap: 12px 10px; }
  .bubble { width: 130px; height: 130px; }
  .bubble__icon { font-size: 30px; }
  .bubble__name { font-size: 12px; }
  .main { padding: 20px 12px 60px; }
  .modal__header { padding: 22px 20px 0; }
  .modal__body { padding: 20px 20px 0; }
  .modal__info { margin: 16px 20px 20px; }
  .category-detail__grid { grid-template-columns: 1fr; }
}

/* ---------- LOADING PULSE (UI) ---------- */
.loading-pulse {
  background-color: #f0f0f5 !important;
  color: #a0a0b0 !important;
  border-color: #dcdce6 !important;
  animation: pulse-border 1.5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(224,187,228,.4); }
  70% { box-shadow: 0 0 0 6px rgba(224,187,228, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224,187,228, 0); }
}
