/* Popups in the World / Collection concept (DECISIONS 2026-10-16(7)):
   cream card, thin gold edge, soft depth, blue title ribbon and blue close /
   secondary buttons; the green primary button stays the strongest action.
   Looks only — copy, buttons and flows are unchanged. Loaded after the other
   game styles and before the UI layer tool's overrides, so the tool still
   wins. No pseudo-elements, no forced priority (web-ui-style.md §6).
   Tokens (--cs-*) live in css/contentScreens.css. */

.popup-overlay {
  background: rgba(24, 14, 6, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* The thick framed SVG is replaced by a real border, so the UI tool edits it as a normal box. */
.popup-card {
  border: 2px solid var(--cs-gold);
  border-image: none;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf5 0%, var(--cs-cream) 45%, var(--cs-cream-deep) 100%);
  box-shadow: inset 0 2px 0 #fff, inset 0 -3px 0 rgba(185, 129, 31, 0.35), 0 3px 0 var(--cs-gold-lo), 0 16px 36px rgba(0, 0, 0, 0.45);
  color: var(--cs-brown);
  padding: 28px 22px 22px;
}

/* Clear results keep a blue interior (white reward text reads on it), with the same thin gold edge. */
.popup-card--clear {
  border-image: none;
  background: linear-gradient(180deg, #2a95ff 0%, #0f63d8 55%, #0a4fb8 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(6, 52, 138, 0.6), 0 3px 0 var(--cs-blue-edge), 0 16px 36px rgba(0, 0, 0, 0.45);
}

/* Title ribbon: white outlined text on the shared blue pill. */
.popup-card h2 {
  align-self: center;
  max-width: calc(100% - 56px);
  margin: -4px 0 0;
  padding: 6px 22px 7px;
  border: 2px solid #ffd34e;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cs-blue-top), var(--cs-blue-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 var(--cs-blue-edge);
  color: #fff;
  font-size: clamp(1.3rem, 5.6vw, 1.7rem);
  line-height: 1.2;
}

/* On the blue clear card the ribbon would vanish: the title stays bright text. */
.popup-card--clear h2 {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--color-accent);
}

.popup-card--challenge h2 {
  background: linear-gradient(180deg, #5fdc2a, #1f9a0c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 #146b07;
}

.popup-close-btn {
  top: 10px;
  right: 10px;
  border: 2px solid #ffd34e;
  background: linear-gradient(180deg, var(--cs-blue-top), var(--cs-blue-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 var(--cs-blue-edge);
}

.popup-close-btn:focus-visible,
.popup-card .btn:focus-visible,
.popup-card .options-link:focus-visible {
  outline: 3px solid #0a55c9;
  outline-offset: 2px;
}

/* Secondary actions (cancel, sound, "see collection"): blue, a step below the green primary. */
.popup-card .btn-ghost {
  border: 2px solid #ffd34e;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--cs-blue-top), var(--cs-blue-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--cs-blue-edge);
  color: #fff;
}

.popup-card .btn-ghost:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 1px 0 var(--cs-blue-edge);
}

.popup-card .options-link {
  border: 2px solid #ffd34e;
  background: linear-gradient(180deg, var(--cs-blue-top), var(--cs-blue-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--cs-blue-edge);
}

/* Long copy on cream stays plain brown (no outline). */
.popup-coming-soon-body,
.popup-dream-confirm-body,
.popup-first-complete-body,
.manual-content p {
  color: var(--cs-brown);
}

.manual-content h3 {
  color: #0a55c9;
}

/* Item popup: the main action (buy / play / showcase) on its own row, then goal and
   cancel side by side; a lone button takes the whole row. */
.popup-dream-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#btn-dream-confirm-ok,
#btn-dream-confirm-goal.hidden + #btn-dream-confirm-cancel {
  grid-column: 1 / -1;
}

.popup-dream-confirm-actions .btn {
  min-height: 52px;
  min-width: 0;
  padding: 8px 12px;
  font-size: 1.1rem;
}

/* Rows inside popups (quests): the same thin gold edge as the collection cards. */
.popup-card .quest-row {
  border-color: var(--cs-gold);
  background: linear-gradient(180deg, #fffdf5, var(--cs-cream));
  box-shadow: inset 0 2px 0 #fff, 0 2px 0 rgba(185, 129, 31, 0.45);
}

.popup-card .quest-row[data-state="done"] {
  border-color: #8fd16a;
  background: #f2fbe8;
}

/* Language choice: cream pills, the chosen one in the shared blue. */
.popup-card .lang-btn {
  border: 2px solid var(--cs-gold);
  background: linear-gradient(180deg, #fffdf5, var(--cs-cream-deep));
  box-shadow: inset 0 2px 0 #fff, 0 2px 0 var(--cs-gold-lo);
  color: #fff;
}

.popup-card .lang-btn.active {
  border-color: #ffd34e;
  background: linear-gradient(180deg, var(--cs-blue-top), var(--cs-blue-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 2px 0 var(--cs-blue-edge);
  color: #fff;
}

/* ---------- Out of hearts / hints: buy one at a time with coins (GAME_SPEC §5.3) ---------- */
.refill-status {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.refill-owned,
.refill-balance {
  padding: 4px 12px;
  border: 2px solid #f0cf7c;
  border-radius: 999px;
  background: #fff6dc;
  color: var(--cs-brown, #4a3220);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.refill-note {
  margin: 0;
  color: #b23a00;
  font-size: 14px;
  font-weight: 800;
}

.popup-card .refill-done {
  font-size: 1.1rem;
}
