:root {
  --bg: #fdf6ea;
  --bg-alt: #fffdf8;
  --ink: #1f1a17;
  --muted: #6d625c;
  --line: rgba(62, 42, 33, 0.14);
  --panel: rgba(255, 252, 246, 0.88);
  --accent: #e76f51;
  --accent-dark: #bc4f33;
  --accent-soft: #fde0d7;
  --secondary: #264653;
  --secondary-soft: #dbe9ee;
  --success: #3d7a57;
  --shadow: 0 18px 60px rgba(72, 44, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(231, 111, 81, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(38, 70, 83, 0.14), transparent 28%),
    linear-gradient(180deg, #fff8ee 0%, var(--bg) 45%, #f7ecda 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 88%);
}

.page {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero {
  padding: 30px 0 18px;
}

.eyebrow,
.step,
.status-label,
.story-card__label,
.guess-panel__label,
.privacy-card__label,
.reveal-panel__label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-dark);
}

h1,
h2,
h3,
h4,
blockquote {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: "Fraunces", serif;
  line-height: 1;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 5.25rem);
  max-width: 10ch;
}

.hero__text {
  margin: 18px 0 0;
  max-width: 62ch;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--muted);
}

.panel {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel--status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
}

.screen {
  padding: 28px;
}

.screen__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.screen__hint {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.stack {
  display: grid;
  gap: 14px;
}

.input-row,
.input-footer,
.action-row,
.player-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-row {
  margin-top: 24px;
}

.action-row--split {
  flex-wrap: wrap;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 16px 18px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(231, 111, 81, 0.8);
  box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.14);
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.65;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-button {
  background: var(--accent);
  color: #fff9f6;
  box-shadow: 0 10px 24px rgba(231, 111, 81, 0.26);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.primary-button--wide {
  min-width: 240px;
}

.secondary-button {
  background: var(--secondary);
  color: white;
}

.ghost-button {
  background: transparent;
  color: var(--secondary);
  border: 1px solid rgba(38, 70, 83, 0.2);
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.player-list-wrap {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.player-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: var(--bg-alt);
  border: 1px solid rgba(38, 70, 83, 0.08);
}

.player-name {
  font-weight: 700;
}

.icon-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--secondary-soft);
  color: var(--secondary);
}

.privacy-card,
.story-card,
.guess-panel,
.reveal-panel,
.result-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.privacy-card {
  margin-bottom: 20px;
  background:
    linear-gradient(135deg, rgba(38, 70, 83, 0.96), rgba(53, 93, 109, 0.92));
  color: white;
}

.privacy-card__label,
.privacy-card__text {
  color: rgba(255, 255, 255, 0.8);
}

.privacy-card h4 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 10px;
}

.story-card__text {
  margin-top: 12px;
  font-size: clamp(1.25rem, 2.8vw, 1.8rem);
  line-height: 1.55;
  white-space: pre-wrap;
}

.guess-panel {
  margin-top: 18px;
}

.guess-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.guess-option {
  padding: 13px 18px;
  border-radius: 999px;
  background: #fff8f2;
  color: var(--ink);
  border: 1px solid rgba(231, 111, 81, 0.18);
}

.guess-option.is-selected {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.reveal-panel {
  margin-top: 18px;
  border-color: rgba(61, 122, 87, 0.18);
  background: linear-gradient(180deg, rgba(217, 243, 227, 0.78), rgba(255, 255, 255, 0.84));
}

.reveal-panel__text,
.muted {
  color: var(--muted);
}

.results-list {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  gap: 8px;
}

.result-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-card__story {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 960px);
    padding-top: 24px;
  }

  .panel--status,
  .screen__header,
  .input-row,
  .input-footer,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .screen,
  .panel--status {
    padding: 20px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
