@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Uncial+Antiqua&display=swap");

:root {
  --bg: #06130a;
  --forest: #0e2a17;
  --forest-deep: #07170d;
  --panel: rgba(8, 23, 12, 0.82);
  --panel-strong: rgba(9, 25, 14, 0.94);
  --line: rgba(181, 242, 93, 0.22);
  --text: #fff8df;
  --muted: #cfccb9;
  --ember: #ff4b16;
  --flame: #ffc51f;
  --gold: #e7b64e;
  --acid: #c9ff00;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: url("fon3.png") center center / cover no-repeat fixed, var(--bg);
}

body[data-side="robin"] {
  background:
    linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)),
    url("fon.png") center center / cover no-repeat fixed,
    var(--bg);
}

body[data-side="sheriff"] {
  background: url("fon2.png") center center / cover no-repeat fixed, var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.app-shell::before {
  display: none;
}

.view {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: clamp(22px, 4vw, 54px);
}

.view.is-active {
  display: grid;
}

.view-choice {
  align-content: center;
  gap: clamp(26px, 4vw, 54px);
}

.hero-copy {
  text-align: center;
}

.crest {
  margin: 0 0 10px;
  color: #fff8df;
  font-family: "Uncial Antiqua", Georgia, serif;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0;
  text-shadow: none;
}

.flame-title {
  --title-size: clamp(3.2rem, 9vw, 8.8rem);
  margin: 0;
  position: relative;
  display: inline-block;
  color: #fff8df;
  font-family: "Uncial Antiqua", "Cinzel", Georgia, serif;
  font-size: var(--title-size);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: none;
}

.flame-title::after {
  display: none;
}

.flame-title.small {
  --title-size: clamp(2.4rem, 8vw, 5rem);
}

.side-grid {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 500px));
  justify-content: space-between;
  gap: clamp(58px, 8vw, 150px);
}

.side-card {
  min-height: clamp(390px, 58vh, 650px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.side-card:hover,
.side-card:focus-visible {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.side-card img {
  width: min(96%, 500px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  align-self: center;
  justify-self: center;
  filter: drop-shadow(0 28px 32px rgba(0, 0, 0, 0.58));
  transform: translateY(4px);
  transition: transform 180ms ease;
}

.side-card:hover img,
.side-card:focus-visible img {
  transform: translateY(-4px) scale(1.015);
}

.side-card-sheriff img {
  transform: translateY(4px) scaleX(-1);
}

.side-card-sheriff:hover img,
.side-card-sheriff:focus-visible img {
  transform: translateY(-4px) scaleX(-1) scale(1.015);
}

.side-glow {
  display: none;
}

.side-name {
  margin-top: -14px;
  color: #fff3c4;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.55rem, 3vw, 2.65rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

.quest-layout {
  width: min(1080px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.selected-side,
.quest-panel,
.done-panel {
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.selected-side {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.selected-side.compact {
  min-height: 640px;
}

.selected-side::before {
  display: none;
}
.selected-side-image {
  width: min(100%, 330px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  position: relative;
  margin: auto 0 8px;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.58));
}

.selected-kicker {
  position: relative;
  margin: 0 0 6px;
  color: #fff8df;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-name {
  position: relative;
  margin: 0 0 10px;
  color: #fff0b3;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.quest-panel {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
}

.panel-heading {
  margin-bottom: 28px;
}

.step-label {
  margin: 0 0 8px;
  color: #fff8df;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-heading h2 {
  margin: 0;
  color: #fff0b3;
  font-family: "Uncial Antiqua", "Cinzel", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  text-shadow: none;
}

.entry-form {
  display: grid;
  gap: 20px;
}

.entry-form label {
  display: grid;
  gap: 9px;
}

.entry-form span {
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
}

.entry-form input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  color: var(--text);
  border: 1px solid rgba(201, 255, 0, 0.24);
  border-radius: 8px;
  background: rgba(0, 8, 3, 0.75);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.entry-form input:focus {
  border-color: rgba(201, 255, 0, 0.82);
  box-shadow: 0 0 0 4px rgba(201, 255, 0, 0.12);
}

.form-error {
  min-height: 22px;
  margin: -4px 0 0;
  color: #ffcc79;
  font-weight: 800;
}

.primary-button,
.ghost-button,
.task-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
}

.primary-button {
  width: 100%;
  border: 0;
  color: #091006;
  background: var(--acid);
  box-shadow: none;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled),
.task-button:hover:not(:disabled),
.task-button:focus-visible:not(:disabled),
.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.ghost-button {
  min-height: 42px;
  position: relative;
  z-index: 2;
  align-self: flex-start;
  padding: 0 12px;
  border: 1px solid rgba(255, 238, 179, 0.24);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}

.ghost-button.centered {
  align-self: center;
  min-width: 160px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.profile-chip {
  width: 100%;
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 238, 179, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.profile-chip span {
  overflow: hidden;
  color: #fff8df;
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.task-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(136px, auto);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 238, 179, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.task-index {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #081104;
  background: var(--acid);
  font-weight: 950;
  box-shadow: none;
}

.task-title {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 950;
}

.task-meta {
  margin: 0;
  color: #fff8df;
  font-size: 0.96rem;
  line-height: 1.45;
}

.task-button {
  min-width: 136px;
  padding: 0 16px;
  border: 1px solid rgba(201, 255, 0, 0.5);
  color: var(--acid);
  background: rgba(201, 255, 0, 0.08);
}

.task-button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.task-item.is-complete .task-button {
  cursor: default;
  color: #091006;
  background: var(--acid);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(201, 255, 0, 0.26);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: spin 820ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.done-panel {
  width: min(760px, 100%);
  margin: auto;
  display: grid;
  justify-items: center;
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
}

.done-image {
  width: min(330px, 70vw);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 25px 34px rgba(0, 0, 0, 0.55));
}

.done-copy {
  max-width: 520px;
  margin: 18px 0 24px;
  color: #fff8df;
  font-size: 1.05rem;
  line-height: 1.55;
}

.app-shell[data-side="sheriff"] {
  --acid: #f3bd47;
  --line: rgba(243, 189, 71, 0.28);
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.tweet-modal {
  width: min(560px, 100%);
  position: relative;
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.tweet-modal h2 {
  margin: 0;
  color: #fff8df;
  font-family: "Uncial Antiqua", "Cinzel", Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1;
  text-shadow: none;
}

.modal-copy {
  margin: 0;
  color: #fff8df;
  line-height: 1.5;
}

.tweet-preview {
  min-height: 112px;
  padding: 16px;
  color: #fff8df;
  border: 1px solid rgba(255, 248, 223, 0.2);
  border-radius: 8px;
  background: rgba(0, 8, 3, 0.58);
  line-height: 1.55;
  white-space: pre-wrap;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.modal-close {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  outline: 1px solid rgba(255, 248, 223, 0.36);
}
@media (max-width: 860px) {
  .side-grid {
    justify-content: stretch;
    gap: 28px;
  }

  .view {
    padding: 20px;
  }

  .side-grid,
  .quest-layout {
    grid-template-columns: 1fr;
  }

  .side-card {
    min-height: 360px;
  }

  .side-card img {
    width: min(88%, 390px);
  }

  .selected-side,
  .selected-side.compact,
  .quest-panel {
    min-height: auto;
  }

  .selected-side {
    padding: 16px;
  }

  .selected-side-image {
    width: min(58vw, 270px);
    margin-top: 10px;
  }

  .task-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .task-index {
    width: 42px;
    height: 42px;
  }

  .task-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .view-choice {
    align-content: start;
    gap: 20px;
  }

  .flame-title {
    --title-size: clamp(2.55rem, 16vw, 4.3rem);
  }

  .side-card {
    min-height: 320px;
    padding: 18px;
  }

  .side-card img {
    width: min(92%, 310px);
  }

  .side-name {
    font-size: 1.45rem;
  }

  .quest-panel {
    padding: 22px;
  }
}
