@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Space+Grotesk:wght@400;600&display=swap");

:root {
  color-scheme: only light;
  --ink: #3a1f2b;
  --cream: #fff5f7;
  --gold: #ff6b8a;
  --ember: #f3a45d;
  --sage: #b85c7f;
  --sky: #ffd9e3;
  --shadow: 0 18px 45px rgba(58, 31, 43, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 214, 223, 0.7) 0%, rgba(255, 234, 240, 0.8) 35%, rgba(255, 245, 247, 0.95) 70%),
    repeating-linear-gradient(140deg, rgba(58, 31, 43, 0.05) 0 2px, transparent 2px 28px),
    linear-gradient(120deg, rgba(255, 107, 138, 0.15), rgba(243, 164, 93, 0.1));
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px 48px;
}

.app {
  width: min(960px, 100%);
  display: grid;
  gap: 28px;
}

.hud {
  display: grid;
  gap: 18px;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(58, 31, 43, 0.2);
  box-shadow: 0 6px 16px rgba(58, 31, 43, 0.12);
  font-size: 0.85rem;
  width: fit-content;
}

.time-pill strong {
  font-family: "Playfair Display", "Georgia", serif;
  font-size: 1rem;
}

.title-block h1 {
  font-family: "Playfair Display", "Georgia", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--ember);
}

.meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.meter {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(27, 22, 18, 0.15);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 14px rgba(27, 22, 18, 0.1);
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  position: relative;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(27, 22, 18, 0.08);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--gold), #ffd1dc);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.board {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.card-stack {
  width: min(520px, 92vw);
  height: min(420px, 72vh);
  position: relative;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--cream);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  border: 1px solid rgba(27, 22, 18, 0.12);
  touch-action: none;
  user-select: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card.dragging {
  transition: none;
  box-shadow: 0 28px 60px rgba(30, 18, 10, 0.3);
}

.card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.sigil {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--sky), #fff1f6);
  border: 2px solid rgba(27, 22, 18, 0.1);
  position: relative;
}

.sigil::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold), #ffd1dc);
}

.character {
  font-weight: 600;
  font-size: 1.05rem;
}

.subtitle {
  color: rgba(27, 22, 18, 0.65);
  font-size: 0.9rem;
}

.prompt {
  font-family: "Playfair Display", "Georgia", serif;
  font-size: clamp(1.25rem, 3.5vw, 1.8rem);
  line-height: 1.3;
}

.choice-tags {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(27, 22, 18, 0.6);
}

.hints {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(27, 22, 18, 0.6);
}

.actions {
  display: flex;
  gap: 12px;
}

.action {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(27, 22, 18, 0.18);
}

.action.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(27, 22, 18, 0.3);
  box-shadow: none;
}

.action:active {
  transform: translateY(1px) scale(0.98);
}

.log {
  min-height: 40px;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(27, 22, 18, 0.75);
}

.gameover {
  border: none;
  background: transparent;
  padding: 0;
  max-width: none;
  max-height: none;
}

.gameover::backdrop {
  background: rgba(20, 12, 8, 0.45);
  backdrop-filter: blur(6px);
}

.gameover[open] {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.panel {
  background: var(--cream);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  text-align: center;
}

.panel h2 {
  font-family: "Playfair Display", "Georgia", serif;
  font-size: 2rem;
}

.profile-summary {
  color: rgba(58, 31, 43, 0.75);
  font-size: 0.95rem;
}

.delta {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 12px rgba(58, 31, 43, 0.12);
  animation: delta-rise 1.2s ease forwards;
}

.delta.positive {
  color: #b5365c;
}

.delta.negative {
  color: #7b3d4f;
}

@media (max-width: 720px) {
  body {
    padding: 16px 12px 32px;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .action {
    width: 100%;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  animation: rise 0.4s ease;
}

@keyframes delta-rise {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  15% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}
