:root {
  --bg: #0a1120;
  --bg-deep: #111f38;
  --card: rgba(14, 23, 42, 0.84);
  --card-strong: rgba(17, 29, 53, 0.96);
  --line: rgba(255, 255, 255, 0.1);
  --text: #fbf5e8;
  --muted: #d0cade;
  --accent: #ffd77d;
  --accent-2: #ff9e75;
  --mint: #9ff6d6;
  --rose: #ffb7d5;
  --danger: #ffc5ba;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --title-font: "Georgia", "Times New Roman", serif;
  --body-font: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 215, 125, 0.16), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(255, 183, 213, 0.18), transparent 24%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.6px),
    radial-gradient(circle at 76% 14%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 42% 56%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 72%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.6px);
}

.orb {
  position: fixed;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.32;
}

.orb-left {
  top: -5rem;
  left: -5rem;
  background: rgba(255, 183, 213, 0.6);
}

.orb-right {
  right: -4rem;
  bottom: 6rem;
  background: rgba(159, 246, 214, 0.38);
}

.app {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.card {
  position: relative;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  background:
    linear-gradient(140deg, rgba(255, 215, 125, 0.08), rgba(255, 158, 117, 0.04)),
    var(--card-strong);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -2rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 125, 0.18), transparent 66%);
  filter: blur(8px);
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--title-font);
}

h1 {
  margin-top: 8px;
  font-size: clamp(2rem, 10vw, 3.2rem);
  line-height: 0.92;
}

h2 {
  font-size: 1.45rem;
}

.hero-copy,
.muted,
.result-note,
.tiny {
  color: var(--muted);
}

.hero-copy {
  margin: 10px 0 0;
  line-height: 1.6;
}

.hero-badges,
.row,
.inline-actions,
.section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.hero-badges {
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.hero-marquee {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.marquee-card {
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.marquee-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 215, 125, 0.14);
  color: var(--accent);
  font-size: 0.86rem;
}

.pill-soft {
  background: rgba(159, 246, 214, 0.12);
  color: var(--mint);
}

.pill-danger {
  background: rgba(255, 197, 186, 0.12);
  color: var(--danger);
}

.banner {
  display: none;
  line-height: 1.5;
}

.banner.show {
  display: block;
}

.hidden {
  display: none;
}

.section-head {
  margin-bottom: 14px;
  align-items: flex-start;
}

.field {
  display: block;
  margin-top: 14px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 14px 15px;
  font: inherit;
  color: var(--text);
  background: rgba(7, 12, 25, 0.58);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 215, 125, 0.68);
  box-shadow: 0 0 0 4px rgba(255, 215, 125, 0.12);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
}

.primary-btn {
  color: #261a06;
  background: linear-gradient(135deg, var(--accent), #fff0bf);
}

.secondary-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-btn {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.wide-btn {
  width: 100%;
  margin-top: 16px;
}

.role-grid,
.score-list,
.assign-list {
  display: grid;
  gap: 12px;
}

.role-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invitation-card {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 183, 213, 0.15), transparent 28%),
    radial-gradient(circle at left bottom, rgba(159, 246, 214, 0.14), transparent 24%),
    rgba(12, 20, 36, 0.74);
}

.invite-frame {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.invite-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 215, 125, 0.22);
  pointer-events: none;
}

.invite-title {
  margin-top: 8px;
  font-size: clamp(1.7rem, 7vw, 2.8rem);
  line-height: 0.95;
}

.invite-copy {
  max-width: 28rem;
  margin: 12px 0 0;
  line-height: 1.65;
  color: var(--muted);
}

.invite-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invite-pill {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.invite-pill strong {
  display: block;
  margin-top: 6px;
}

.top-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.top-role-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 125, 0.14);
  color: var(--accent);
  font-size: 0.86rem;
}

.role-chip {
  min-height: 138px;
  padding: 14px;
  text-align: left;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(9, 15, 29, 0.5);
  border: 1px solid transparent;
}

.role-chip.active {
  border-color: rgba(255, 215, 125, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 215, 125, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(9, 15, 29, 0.62);
}

.role-chip.selected:not(.active) {
  border-color: rgba(151, 213, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(151, 213, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(9, 15, 29, 0.58);
}

.role-chip.locked {
  opacity: 0.48;
}

.role-chip p,
.score-card p,
.assign-card p {
  margin: 8px 0 0;
}

.role-chip .small {
  font-size: 0.85rem;
  color: var(--accent);
}

.role-chip h3 {
  color: #fff7df;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 34px;
}

.selected-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 125, 0.14);
  color: var(--accent);
  font-size: 0.86rem;
}

.empty {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(7, 12, 25, 0.38);
}

.score-card,
.assign-card,
.vote-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(8, 14, 28, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-track {
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--role-color), rgba(255, 255, 255, 0.88));
}

.mono {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.poster-shell {
  display: grid;
  gap: 14px;
}

.poster-preview {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 11, 23, 0.72);
}

.poster-image {
  display: block;
  width: 100%;
  height: auto;
}

.poster-meta {
  padding: 14px;
}

.stack-actions {
  display: grid;
  gap: 10px;
}

.poster-status {
  margin-top: 12px;
}

.tips p {
  margin: 10px 0 0;
}

@media (min-width: 700px) {
  .app {
    padding: 24px 20px 36px;
  }

  .card {
    padding: 22px;
  }

  .role-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .poster-shell {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}
