/* CarkedIt Online — Single Player Screen */

.screen--solo {
  align-items: center;
}

.solo__prompt {
  text-align: center;
  padding: 0 var(--space-sm);
}

/* ── Question intro ─────────────────────────────────────── */
/* Each question shows big and centred first (js/screens/solo-intro.js sets
   --intro-dy), then glides up into place before the cards deal in. */

.screen--solo-intro {
  cursor: pointer;
}

.screen--solo-intro > :not(.solo__prompt):not(.solo__skip-hint) {
  opacity: 0;
  pointer-events: none;
}

/* Header, hint and dots fade back while the question settles; the cards stay
   hidden until the re-render flips them in. */
.screen--solo-intro-settling > :not(.solo__prompt):not(.solo__skip-hint):not(.solo__pair) {
  opacity: 1;
  transition: opacity 600ms ease;
}

.solo__prompt[data-solo-intro] {
  position: relative;
  z-index: 2;
  font-size: clamp(36px, 11vw, 72px);
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
  transform: translateY(var(--intro-dy, 0px));
  visibility: hidden;
}

.solo__prompt[data-solo-intro].solo__prompt--placed {
  visibility: visible;
  animation: solo-intro-in 450ms ease-out both;
}

.solo__prompt[data-solo-intro].solo__prompt--settling {
  font-size: 1rem;
  font-weight: 400;
  line-height: normal;
  transform: translateY(0);
  transition:
    font-size 600ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1),
    line-height 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.solo__skip-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--space-lg, 24px) + env(safe-area-inset-bottom, 0px));
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: var(--color-text-80);
  animation: solo-intro-in 450ms ease-out 900ms both;
}

.screen--solo-intro-settling .solo__skip-hint {
  animation: none;
  opacity: 0;
}

@keyframes solo-intro-in {
  from { opacity: 0; scale: 0.92; }
  to   { opacity: 1; scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .solo__prompt[data-solo-intro].solo__prompt--placed,
  .solo__skip-hint {
    animation: none;
  }
}

.solo__loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.solo__loading-text {
  color: var(--color-text-80);
  font-style: italic;
}

/* ── The pair ───────────────────────────────────────────── */

.solo__pair {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  align-items: start;
  container-type: size;
}

/* Four-up rounds: always two rows of two, so both rows fit the viewport. */
.solo__pair--four {
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
}

.solo__pair--four .solo__choice .card-flip {
  width: min(100%, calc((50cqh - var(--space-sm)) * 5 / 7));
}

.solo__choice {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.solo__choice:hover,
.solo__choice:focus-visible {
  transform: translateY(-4px) scale(1.02);
  filter: drop-shadow(0 8px 12px var(--color-shadow-sm));
  outline: none;
}

.solo__choice:active {
  transform: scale(0.98);
}

/* Cards share the viewport: never taller than the pair area. */
.solo__choice .card-flip {
  width: min(100%, calc(100cqh * 5 / 7));
  margin: 0 auto;
}

.solo__choice .card-flip__inner {
  transition-delay: var(--solo-delay, 0ms);
}

/* ── "How I'd rather" corner ribbon ─────────────────────── */
/* Marks the card carried over from "would rather" into the "more likely"
   hand. Sits over the flip (not inside it) and fades in once the card has
   turned face-up, so it never shows on the card back. */

.solo__choice--rather .card-flip {
  position: relative;
}

.solo__rather-clip {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: var(--radius-md);
  pointer-events: none;
  container-type: inline-size;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-flip--revealed .solo__rather-clip {
  opacity: 1;
  transition-delay: calc(var(--solo-delay, 0ms) + 0.6s);
}

.solo__rather-ribbon {
  position: absolute;
  top: 12cqw;
  right: -22cqw;
  width: 80cqw;
  padding: 1.2cqw 0;
  transform: rotate(45deg);
  background: rgba(20, 18, 30, 0.92);
  border-block: 0.8cqw solid var(--color-live);
  color: #fff;
  font-size: clamp(5px, 4cqw, 11px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.solo__pair--die  .solo__rather-ribbon { border-color: var(--color-die); }
.solo__pair--live .solo__rather-ribbon { border-color: var(--color-live); }
.solo__pair--bye  .solo__rather-ribbon { border-color: var(--color-bye); }

.solo__hint {
  font-size: 13px;
  font-style: italic;
  color: var(--color-text-80);
  text-align: center;
}

/* ── Deck progress dots ─────────────────────────────────── */

.solo__progress {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  padding-bottom: var(--space-xs);
}

.solo__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  opacity: 0.4;
}

.solo__dot--die  { border-color: var(--color-die); }
.solo__dot--live { border-color: var(--color-live); }
.solo__dot--bye  { border-color: var(--color-bye); }

.solo__dot--active { opacity: 1; }
.solo__dot--done { opacity: 1; }
.solo__dot--done.solo__dot--die  { background: var(--color-die); }
.solo__dot--done.solo__dot--live { background: var(--color-live); }
.solo__dot--done.solo__dot--bye  { background: var(--color-bye); }

/* ── Summary ────────────────────────────────────────────── */

.solo__summary {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  align-items: start;
  container-type: size;
}

.solo__pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.solo__pick .card {
  width: min(100%, calc((100cqh - 2em) * 5 / 7));
}

.solo__pick-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-80);
}

.solo__pick--die  .solo__pick-label { color: var(--color-die); }
.solo__pick--live .solo__pick-label { color: var(--color-live); }
.solo__pick--bye  .solo__pick-label { color: var(--color-bye); }

.solo__actions {
  width: 100%;
}

/* ── ? answer step ──────────────────────────────────────── */

.solo__answer-step {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* The card gets whatever room the text box and buttons leave, and is sized
   by whichever of width or height runs out first — never cropped. */
.solo__answer-card {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  container-type: size;
}

.solo__answer-card .card {
  width: min(100%, calc(100cqh * 5 / 7));
  max-height: 100%;
}

.solo__textarea {
  width: 100%;
  max-width: 480px;
  padding: var(--space-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface, transparent);
  color: var(--color-text);
  font: inherit;
  resize: vertical;
}

.solo__textarea:focus-visible {
  outline: none;
  border-color: var(--color-live);
}

.solo__answer {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  color: var(--color-text-80);
}

/* The "would rather" card, when the more-likely pick differs. */
.solo__rather {
  margin: 0;
  max-width: 100%;
  font-size: 11px;
  text-align: center;
  color: var(--color-text-80);
  overflow-wrap: anywhere;
}

/* ── Write your own eulogy ──────────────────────────────── */

.solo__eulogy-screen {
  gap: var(--space-sm);
}

/* The three picks, small, in a row across the top. */
.solo__eulogy-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  align-items: start;
}

.solo__eulogy-cards .solo__pick .card {
  width: min(100%, 110px);
}

/* The text box takes most of the screen. */
.solo__textarea--eulogy {
  flex: 1;
  min-height: 40vh;
  max-width: none;
  resize: none;
}

.solo__eulogy-done {
  width: 100%;
}

/* ── Life story ─────────────────────────────────────────── */

.solo__lifestory-screen {
  gap: var(--space-sm);
}

.solo__story {
  width: 100%;
  max-width: 60ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text-80);
}

.solo__story p {
  margin: 0 0 var(--space-sm);
}

/* The AI story sits plain on the page; the player's eulogy is a card below it. */
.solo__story-section,
.solo__eulogy-panel {
  width: 100%;
  max-width: 60ch;
  margin: 0 auto;
}

.solo__eulogy-panel {
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(75, 53, 181, 0.25), transparent 60%),
    var(--color-surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.solo__section-title {
  margin: 0 0 var(--space-xs);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-80);
}

.solo__story-section .solo__story,
.solo__eulogy-panel .solo__story {
  max-width: none;
}

.solo__eulogy-panel .solo__story p:last-child {
  margin-bottom: 0;
}

.solo__eulogy-text {
  font-style: italic;
}

.solo__story--loading,
.solo__story--error {
  text-align: center;
  padding: var(--space-md) 0;
}

.solo__story-share {
  width: 100%;
}

/* ── Share your story (reuses .share-panel__* from the invite panel) ── */

.story-share__panel {
  max-height: calc(100dvh - 2 * var(--space-md));
  overflow-y: auto;
}

.story-share__preview {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.story-share__socials-label {
  margin: var(--space-sm) 0 var(--space-xs);
  font-size: 13px;
  text-align: center;
  color: var(--color-text-80);
}

.story-share__socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
}

.story-share__social {
  padding-inline: 0;
  font-size: 13px;
  text-decoration: none;
  text-align: center;
}

/* ── Share link ─────────────────────────────────────────── */

.solo__share-btn {
  width: 100%;
  transition: color 0.15s ease;
}

.solo__share-btn--copied {
  color: var(--color-live);
}

.solo__share-link {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-80);
}

.solo__share-url {
  user-select: all;
  -webkit-user-select: all;
  font-weight: 600;
  color: var(--color-text);
}
