.worry-pop-shell {
  --worry-ink: #173247;
  --worry-muted: #6a7c8d;
  --worry-line: rgba(74, 107, 128, 0.18);
  --worry-card: rgba(255, 255, 255, 0.84);
  --worry-primary: #168aad;
  --worry-primary-dark: #0b5d78;
  --worry-accent: #ffb26b;
  --worry-board-a: #dff7ff;
  --worry-board-b: #b9e7f5;
  --worry-bubble-a: #effcff;
  --worry-bubble-b: #75d6ee;
  --worry-bubble-c: #1898bd;
  color: var(--worry-ink);
}

.worry-pop-card {
  width: 100%;
  max-width: none;
  margin: 0;
}

.worry-intro {
  position: relative;
  overflow: hidden;
}

.worry-intro::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(117, 214, 238, 0.4), rgba(117, 214, 238, 0));
  pointer-events: none;
}

.worry-stage-panel,
.worry-info-panel,
.panel-related,
.panel-comments {
  position: relative;
  overflow: hidden;
}

.worry-stage-head,
.worry-game-layout,
.worry-lower-grid,
.worry-actions,
.worry-metrics,
.worry-stat-row,
.worry-control-card label {
  display: flex;
}

.worry-stage-head {
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.worry-stage-head p {
  margin: 10px 0 0;
  color: var(--worry-muted);
  line-height: 1.7;
}

.worry-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--worry-primary), var(--worry-primary-dark));
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(22, 138, 173, 0.18);
}

.worry-pill.soft {
  color: var(--worry-primary-dark);
  background: linear-gradient(135deg, #eefbff, #fff7eb);
  box-shadow: inset 0 0 0 1px var(--worry-line);
}

.worry-actions {
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.worry-actions button,
.worry-info-panel button,
.worry-control-card select {
  border: 1px solid var(--worry-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--worry-ink);
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.worry-actions button:hover,
.worry-info-panel button:hover,
.worry-control-card select:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 138, 173, 0.35);
  box-shadow: 0 10px 22px rgba(20, 54, 84, 0.09);
}

.worry-actions .primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--worry-primary), var(--worry-primary-dark));
}

.worry-game-layout {
  gap: 18px;
  align-items: stretch;
}

.worry-board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(300px, 52vh, 390px);
  border-radius: 28px;
  padding: 18px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 28%),
    linear-gradient(150deg, var(--worry-board-a), var(--worry-board-b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.62), 0 24px 60px rgba(27, 76, 111, 0.14);
  overflow: hidden;
}

.worry-board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.18));
  pointer-events: none;
}

.worry-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--bubble-cols, 10), minmax(30px, 1fr));
  gap: var(--bubble-gap, 10px);
  width: 100%;
  height: 100%;
  min-height: clamp(260px, 46vh, 350px);
  align-content: center;
}

.worry-bubble {
  position: relative;
  aspect-ratio: 1;
  min-width: 30px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.98) 0 12%, rgba(255,255,255,0.25) 18%, transparent 24%),
    radial-gradient(circle at 64% 68%, var(--worry-bubble-b), var(--worry-bubble-c));
  box-shadow:
    inset 8px 10px 18px rgba(255,255,255,0.42),
    inset -9px -12px 18px rgba(13, 76, 104, 0.16),
    0 10px 20px rgba(22, 89, 124, 0.16);
  transform: translateY(0) scale(1);
  transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
  animation: worryFloat calc(3.2s + var(--float-extra, 0s)) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.worry-bubble:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.05);
}

.worry-bubble.popped {
  pointer-events: none;
  opacity: 0;
  transform: scale(1.7) rotate(14deg);
  filter: blur(3px) saturate(1.6);
}

.worry-bubble.pop-flash::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: worryRing 0.42s ease-out forwards;
}

.worry-breath {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(23, 50, 71, 0.72);
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}

.worry-pop-shell.mode-calm .worry-breath {
  opacity: 1;
  animation: breatheText 8s ease-in-out infinite;
}

.worry-side {
  width: 300px;
  display: grid;
  gap: 14px;
}

.worry-control-card,
.worry-meter,
.worry-metrics,
.worry-info-panel {
  border: 1px solid var(--worry-line);
  border-radius: 22px;
  padding: 16px;
  background: var(--worry-card);
  backdrop-filter: blur(10px);
}

.worry-control-card {
  display: grid;
  gap: 14px;
}

.worry-control-card label {
  flex-direction: column;
  gap: 7px;
  color: var(--worry-muted);
  font-size: 13px;
}

.worry-control-card select {
  width: 100%;
}

.worry-meter span,
.worry-metrics span,
.worry-stat-row span {
  color: var(--worry-muted);
  font-size: 13px;
}

.worry-meter strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}

.worry-meter div {
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 70, 102, 0.08);
  overflow: hidden;
}

.worry-meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #52c6df, var(--worry-accent));
  transition: width 0.28s ease;
}

.worry-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.worry-metrics div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.58);
}

.worry-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.worry-lower-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1.2fr;
  gap: 14px;
}

.worry-info-panel {
  min-width: 0;
}

.worry-stat-row {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--worry-line);
}

.worry-stat-row strong {
  font-size: 22px;
}

.worry-info-panel button {
  width: 100%;
  margin-top: 14px;
}

.worry-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.worry-achievements span {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--worry-muted);
  background: rgba(255,255,255,0.58);
  border: 1px dashed var(--worry-line);
}

.worry-achievements span.unlocked {
  color: #0f5f2f;
  background: #e9f9ef;
  border-style: solid;
  border-color: #9fdfba;
}

.worry-guide ol {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--worry-muted);
  line-height: 1.8;
}

.worry-notice {
  background: #fff7e8;
  border: 1px solid #ffd8a8;
  border-radius: 16px;
}

.worry-notice p {
  margin: 0;
  color: #8a5100;
}

.worry-pop-shell.theme-candy {
  --worry-primary: #de5b8c;
  --worry-primary-dark: #a93262;
  --worry-accent: #ffd166;
  --worry-board-a: #fff0f6;
  --worry-board-b: #ffd3e3;
  --worry-bubble-b: #ff9bc0;
  --worry-bubble-c: #d94f83;
}

.worry-pop-shell.theme-forest {
  --worry-primary: #2d9b73;
  --worry-primary-dark: #1f6f56;
  --worry-accent: #b4e197;
  --worry-board-a: #edfff5;
  --worry-board-b: #c9f0dc;
  --worry-bubble-b: #83d9a9;
  --worry-bubble-c: #2c9b74;
}

.worry-pop-shell.theme-sunset {
  --worry-primary: #e76f51;
  --worry-primary-dark: #a94a35;
  --worry-accent: #ffd166;
  --worry-board-a: #fff4df;
  --worry-board-b: #ffc9a3;
  --worry-bubble-b: #ffb26b;
  --worry-bubble-c: #dc6b4a;
}

.worry-pop-shell.mode-calm .worry-bubble {
  animation-duration: 8s;
}

.worry-pop-shell.is-complete .worry-board-wrap {
  animation: completePulse 1s ease;
}

@keyframes worryFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.015); }
}

@keyframes worryRing {
  from { opacity: 0.9; transform: scale(0.5); }
  to { opacity: 0; transform: scale(1.9); }
}

@keyframes breatheText {
  0%, 100% { transform: translateX(-50%) scale(0.96); }
  50% { transform: translateX(-50%) scale(1.08); }
}

@keyframes completePulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@media (max-width: 980px) {
  .worry-game-layout,
  .worry-stage-head {
    flex-direction: column;
  }

  .worry-side {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .worry-metrics {
    grid-column: 1 / -1;
  }

  .worry-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .worry-actions {
    justify-content: flex-start;
  }

  .worry-actions button {
    flex: 1 1 calc(50% - 8px);
  }

  .worry-board-wrap {
    min-height: clamp(260px, 42vh, 320px);
    padding: 12px;
    border-radius: 22px;
  }

  .worry-board {
    min-height: clamp(220px, 38vh, 290px);
    gap: 7px;
  }

  .worry-side,
  .worry-metrics {
    grid-template-columns: 1fr;
  }
}

.worry-board-wrap:fullscreen,
.worry-board-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  box-sizing: border-box;
}

.worry-board-wrap:fullscreen .worry-board,
.worry-board-wrap:-webkit-full-screen .worry-board {
  min-height: calc(100vh - 36px);
}
