/* === Decision Maker additions === */

.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.45rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.tab {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover {
  color: var(--ink);
  background: var(--pick-bg);
  transform: none;
  border-color: transparent;
}
.tab.picked {
  background: var(--pick-bg);
  border-color: var(--pick-border);
  color: var(--primary-dark);
}

.mode > .question:not(:last-of-type) {
  margin-bottom: 0.8rem;
}

/* --- Coin --- */
.coin-stage {
  display: flex;
  justify-content: center;
  margin: 2rem 0 2.25rem;
  perspective: 1200px;
}
.coin {
  width: 140px;
  height: 140px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.17, 0.89, 0.32, 1.0);
}
.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  color: #fff;
  border: 4px solid rgba(255, 255, 255, 0.5);
  backface-visibility: hidden;
  box-shadow: inset 0 -10px 25px rgba(0, 0, 0, 0.12),
              inset 0 6px 16px rgba(255, 255, 255, 0.4),
              0 10px 28px rgba(255, 107, 157, 0.28);
}
.coin-face.heads {
  background: linear-gradient(135deg, #ffb3cf 0%, #ff6b9d 100%);
}
.coin-face.tails {
  background: linear-gradient(135deg, #aae0ed 0%, #7bc5d8 100%);
  transform: rotateY(180deg);
}

/* The painted faces are whole coins -- disc, rim, relief and all -- so a face that
   carries one drops the gradient, ring and inset shading it was drawing for itself,
   or you get a coin printed on a coin. The outer glow stays: it sits under the coin
   rather than on it. :has means a 404 (onerror removes the image) restores the old
   look on its own, with no JS. */
.coin-face:has(.coin-art) {
  background: none;
  border: none;
  box-shadow: 0 10px 28px rgba(255, 107, 157, 0.28);
}
.coin-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.coin-art + .coin-letter { display: none; }

/* --- Yes / No --- */
.yesno-prompt {
  text-align: center;
  color: var(--muted);
  margin: 2rem 0 1.25rem;
  font-size: 1rem;
}

/* --- Dice --- */
.dice-row {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.die {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  filter: drop-shadow(0 4px 8px rgba(255, 107, 157, 0.25));
  animation: namePop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.275);
}
.die::before,
.die::after {
  content: "";
  position: absolute;
  pointer-events: none;
  clip-path: var(--die-shape, none);
}
.die::before {
  inset: 0;
  background: var(--pick-border);
}
.die::after {
  inset: 3px;
  background: linear-gradient(135deg, #fff 0%, var(--pick-bg) 100%);
}
.die span {
  position: relative;
  z-index: 1;
}
.dice-total {
  font-family: "Fredoka", "Nunito", sans-serif;
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.7rem;
}
.dice-total strong { color: var(--primary-dark); }

/* --- List input --- */
textarea#list-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  background: #fffaf5;
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.15s ease;
  color: var(--ink);
}
textarea#list-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* --- Big result text (generic counterpart to .name-big) --- */
.big-text {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
  line-height: 1.1;
  margin: 0;
}
.big-text.animating {
  animation: namePop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.275);
}

/* Inline code snippet inside the .hint */
.hint code {
  background: var(--pick-bg);
  color: var(--primary-dark);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  font-size: 0.85em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (max-width: 500px) {
  .coin { width: 110px; height: 110px; }
  .coin-face { font-size: 2.5rem; }
  .big-text { font-size: 3rem; }
  .die { width: 64px; height: 64px; font-size: 1.5rem; }
  .tab { font-size: 0.9rem; padding: 0.45rem 0.65rem; }
}

/* --- question + sound bar --- */
.dm-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.dm-question {
  flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: 1rem;
  padding: 0.6rem 0.9rem; border: 2px solid var(--border); border-radius: 12px;
  background: #fffaf5; color: var(--ink);
}
.dm-question:focus { outline: none; border-color: var(--primary); }
.dm-sound {
  flex: 0 0 auto; width: 48px; padding: 0; font-size: 1.15rem;
  background: var(--card); border: 2px solid var(--border); border-radius: 12px; cursor: pointer;
}
.dm-sound[aria-pressed="true"] { border-color: var(--pick-border); background: var(--pick-bg); }

/* --- list extras --- */
.dm-check {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-weight: 600; font-size: 0.92rem; color: var(--muted); margin: 0 0 0.8rem;
}
.dm-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.dm-list-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.dm-list-actions .primary { flex: 1 1 auto; }

/* --- question echo + ranked list inside the result --- */
.q-echo { color: var(--muted); font-weight: 700; font-style: italic; margin: 0 0 0.3rem; }
.q-echo.hidden { display: none; }
.rank-list { text-align: left; max-width: 340px; margin: 0.4rem auto 0; padding-left: 1.6rem; }
.rank-list li {
  font-family: "Fredoka", "Nunito", sans-serif; font-size: 1.15rem; font-weight: 600;
  color: var(--ink); margin: 0.28rem 0;
}

/* --- spinning (suspense) states --- */
.big-text.spinning { opacity: 0.5; }
.die.spinning { filter: none; opacity: 0.7; }

/* --- recent-decisions history --- */
.history { margin-top: 1.7rem; }
.history.hidden { display: none; }
.history-head { display: flex; align-items: center; justify-content: space-between; }
.history-head h2 { font-size: 1.05rem; margin: 0; }
.link-btn { background: none; border: none; color: var(--muted); font-weight: 700; font-size: 0.85rem; cursor: pointer; padding: 0.2rem 0.35rem; }
.link-btn:hover { color: var(--primary-dark); background: none; }
.history-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.history-list li {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 0.5rem 0.8rem;
}
.h-icon { font-size: 1.1rem; flex: 0 0 auto; }
.h-text { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-q { color: var(--muted); font-style: italic; }

/* inputs stay readable in dark mode (cream bg → eggplant) */
html.dark .dm-question,
html.dark textarea#list-input { background: var(--btn); }

@media (prefers-reduced-motion: reduce) {
  .coin { transition: none; }
  .big-text.animating, .die { animation: none; }
}
