:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #66615a;
  --line: #ddd6cb;
  --paper: #fffdf8;
  --panel: #ffffff;
  --red: #e85245;
  --green: #138a61;
  --blue: #2f6fbd;
  --gold: #b7791f;
  --shadow: 0 12px 36px rgba(27, 24, 20, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 12vw, 4.5rem);
  line-height: .92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.lede {
  max-width: 34rem;
  color: #403b35;
  font-size: 1.08rem;
  line-height: 1.45;
}

.eyebrow,
.tag {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.panel,
.prompt,
.result,
.admin-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

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

label span,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

input,
select,
textarea,
button,
.button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
}

textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.prompt-link {
  color: inherit;
}

.prompt-header {
  padding: 22px 0;
}

.game-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.game-cta p,
.game-cta h2 {
  margin: 0;
}

.game-cta .button {
  width: auto;
  flex: 0 0 auto;
}

.cta-button {
  flex-direction: column;
  line-height: 1.15;
}

.cta-button small {
  margin-top: 3px;
  font-size: .68rem;
  font-weight: 650;
  opacity: .78;
}

.included-prompt {
  margin: 0;
  border-left: 3px solid var(--green);
  padding-left: 10px;
  color: var(--muted);
  font-size: .85rem;
}

.player-dashboard {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.account-bar,
.account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-bar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.account-bar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .8rem;
}

.account-bar form,
.account-bar button,
.account-actions .button {
  width: auto;
}

.account-panel {
  margin-top: 24px;
}

.account-switch {
  margin: 16px 0 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  .account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .account-actions .button,
  .account-bar form,
  .account-bar button {
    width: 100%;
  }
}

.dashboard-header,
.section-heading,
.summary-row,
.opponent-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-header h2,
.section-heading h3 {
  margin: 0;
}

.games-played {
  text-align: right;
}

.games-played strong,
.games-played span,
.summary-row span {
  display: block;
}

.games-played strong {
  font-size: 2rem;
}

.games-played span,
.summary-row span,
.section-heading h3 span {
  color: var(--muted);
  font-size: .8rem;
}

.summary-section {
  margin-top: 24px;
}

.summary-section h3 {
  font-size: 1rem;
}

.summary-list {
  border-top: 1px solid var(--line);
}

.summary-row {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.prompt-directory-header h1 {
  font-size: 2.4rem;
  line-height: 1;
}

.prompt-directory {
  border-top: 1px solid var(--line);
}

.prompt-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 10px 4px;
  color: inherit;
  text-decoration: none;
}

.prompt-directory-row:hover .prompt-directory-title,
.prompt-directory-row:focus-visible .prompt-directory-title {
  text-decoration: underline;
}

.prompt-directory-title {
  min-width: 0;
  font-weight: 750;
  line-height: 1.3;
}

.prompt-directory-count {
  min-width: 54px;
  text-align: right;
}

.prompt-directory-count strong,
.prompt-directory-count span {
  display: block;
}

.prompt-directory-count span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

@media (max-width: 420px) {
  .prompt-directory-row {
    gap: 9px;
  }

  .prompt-directory-count {
    min-width: 44px;
  }
}

.opponent-score,
.usage {
  flex: 0 0 auto;
  text-align: right;
}

.opponent-score span {
  min-width: 64px;
}

.comment-summary {
  color: inherit;
  text-decoration: none;
}

.top-cta {
  margin: 18px 0;
}

.closing-cta {
  align-items: flex-start;
  flex-direction: column;
  margin-top: 30px;
  padding: 22px 0;
}

.vote-counts,
.argument-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vote-counts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.vote-counts strong,
.vote-counts span {
  display: block;
}

.vote-counts strong {
  font-size: 2rem;
}

.editorial-intro {
  font-size: 1.1rem;
  line-height: 1.6;
}

.arguments {
  border-top: 3px solid var(--line);
  padding-top: 14px;
}

.arguments.for { border-color: var(--green); }
.arguments.against { border-color: var(--red); }
.arguments li { margin-bottom: 10px; line-height: 1.45; }

.comments-section {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.comment {
  border-left: 2px solid var(--line);
  padding: 12px 0 4px 12px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: .8rem;
}

.comment-replies { margin-left: 12px; }
.comment summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.reply-form { margin-top: 8px; }
.moderation-actions { display: flex; gap: 6px; }
.moderation-actions button { min-width: 72px; }
.comment-admin { display: block; }

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0 16px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--ink);
  color: #fff;
}

.secondary {
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
}

.prompt,
.result {
  padding: 16px;
}

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

.prompt.unanswered {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(232, 82, 69, .18), var(--shadow);
}

.prompt.unanswered fieldset:not(:has(input:checked)) legend {
  color: #8d261d;
}

fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset legend {
  grid-column: 1 / -1;
}

fieldset label {
  position: relative;
}

fieldset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

fieldset span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1rem;
}

fieldset input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

fieldset input:focus-visible + span {
  outline: 3px solid rgba(47, 111, 189, .35);
  outline-offset: 2px;
}

.tag.everyday {
  color: var(--blue);
}

.tag.controversial {
  color: var(--gold);
}

.tag.edgy {
  color: var(--red);
}

.sticky {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}

.score {
  text-align: center;
}

.score h1 {
  font-size: 2rem;
  line-height: 1.1;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.score-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 8px;
}

.score-grid strong,
.score-grid span {
  display: block;
}

.score-grid strong {
  margin-bottom: 6px;
  font-size: 2rem;
}

.score-grid span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.3;
}

.results-list,
.admin-list,
.suggestion-list {
  display: grid;
  gap: 12px;
}

.suggestion-panel {
  margin-top: 16px;
}

.suggestion-create {
  margin-bottom: 12px;
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 750;
}

.suggestion {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.suggestion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.suggestion-heading .stats {
  margin: 0;
  text-align: right;
}

.status {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status.accepted {
  border-color: rgba(19, 138, 97, .45);
  color: var(--green);
}

.status.duplicate,
.status.rejected,
.status.error {
  border-color: rgba(232, 82, 69, .45);
  color: #8d261d;
}

.decision,
.duplicate-note,
.accepted-note {
  margin: 10px 0 0;
  line-height: 1.45;
}

.decision {
  border-left: 3px solid var(--line);
  padding-left: 10px;
  color: #403b35;
}

.success {
  border: 1px solid rgba(19, 138, 97, .45);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(19, 138, 97, .08);
  color: #0d6848;
}

.admin-suggestions {
  margin-bottom: 24px;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.suggestion-actions form,
.suggestion-actions button {
  width: auto;
}

.danger {
  border: 1px solid var(--red);
  background: #fff;
  color: #8d261d;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: wait;
  opacity: .55;
}

.admin-notice {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10;
  min-width: 120px;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(19, 138, 97, .45);
  border-radius: 8px;
  padding: 12px 16px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.admin-notice.error {
  border-color: rgba(232, 82, 69, .45);
  color: #8d261d;
}

.prediction {
  margin-top: 14px;
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.prediction.correct {
  border-left-color: var(--green);
}

.prediction.miss {
  border-left-color: var(--red);
}

.prediction-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.prediction.correct .prediction-heading strong {
  color: var(--green);
}

.prediction.miss .prediction-heading strong {
  color: #8d261d;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compare div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare span,
.stats {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .8rem;
}

.compare strong {
  font-size: 1.1rem;
}

.error {
  border: 1px solid rgba(232, 82, 69, .45);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(232, 82, 69, .08);
  color: #8d261d;
}

.form-error {
  position: sticky;
  top: 10px;
  z-index: 2;
  margin: 0;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 12px;
  background: #fff4f2;
  color: #8d261d;
  font-weight: 750;
  box-shadow: var(--shadow);
}

.admin-add,
.admin-row {
  display: grid;
  gap: 8px;
}

.admin-row {
  padding: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.check input {
  width: 18px;
  min-height: 18px;
}

@media (min-width: 680px) {
  .admin-add {
    grid-template-columns: 1.5fr 160px 160px 90px;
  }

  .admin-row {
    grid-template-columns: 1.5fr 140px 140px 80px 1fr 90px 110px;
    align-items: center;
  }
}

@media (max-width: 520px) {
  .top-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-cta .button {
    width: 100%;
  }
}
