:root {
  --paper: #f6efdf;
  --paper-2: #efe4cc;
  --ink: #23150f;
  --muted: #705746;
  --line: rgba(35, 21, 15, 0.14);
  --card: rgba(255, 250, 241, 0.86);
  --shadow: 0 24px 60px rgba(73, 40, 14, 0.18);
  --relax: #9dc08b;
  --picante: #e58a3a;
  --fuerte: #c94b4b;
  --accent: #b44f2d;
  --accent-2: #4f7a6f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(180, 79, 45, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(79, 122, 111, 0.18), transparent 22%),
    linear-gradient(180deg, #f9f4ea 0%, var(--paper) 54%, #ead9b6 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: '';
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 248, 235, 0.9), rgba(248, 234, 206, 0.72));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  position: absolute;
  right: -70px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 40px;
  transform: rotate(16deg);
  background: linear-gradient(180deg, rgba(180, 79, 45, 0.18), rgba(79, 122, 111, 0.1));
  content: '';
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: end;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Fraunces', serif;
  line-height: 0.96;
}

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

.hero-copy {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.hero-actions {
  margin-top: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(35, 21, 15, 0.12);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.58);
}

.hero-card {
  position: relative;
  z-index: 1;
  padding: 20px;
  border: 1px solid rgba(35, 21, 15, 0.08);
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.8);
  backdrop-filter: blur(10px);
}

.hero-card-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-card strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.hero-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
}

.filters-panel,
.results-panel {
  min-width: 0;
}

.filters-panel {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 249, 239, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.ghost-button {
  border: 1px solid rgba(35, 21, 15, 0.14);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.8);
}

.filters-form {
  display: grid;
  gap: 14px;
}

.filter-field {
  display: grid;
  gap: 8px;
}

.filter-field span,
.legend p {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-field select {
  width: 100%;
  border: 1px solid rgba(35, 21, 15, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.filter-field select:focus {
  border-color: rgba(180, 79, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(180, 79, 45, 0.12);
}

.legend {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(35, 21, 15, 0.14);
}

.legend ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 0;
  margin: 12px 0 0;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.player-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed rgba(35, 21, 15, 0.14);
}

.section-title.compact {
  margin-bottom: 14px;
}

.filter-field input {
  width: 100%;
  border: 1px solid rgba(35, 21, 15, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.filter-field input:focus {
  border-color: rgba(180, 79, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(180, 79, 45, 0.12);
}

.player-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.player-meta div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.memory-block {
  margin-top: 16px;
}

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

.ghost-button.small {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.memory-list {
  display: grid;
  gap: 8px;
}

.memory-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(35, 21, 15, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.memory-item.favorite {
  background: rgba(180, 79, 45, 0.08);
}

.memory-item.history {
  background: rgba(79, 122, 111, 0.08);
}

.memory-id {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.memory-question {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
}

.memory-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
  line-height: 1.5;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dot.relax,
.intensity-chip.relax {
  background: var(--relax);
}

.dot.picante,
.intensity-chip.picante {
  background: var(--picante);
}

.dot.fuerte,
.intensity-chip.fuerte {
  background: var(--fuerte);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.draw-panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(35, 21, 15, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(180, 79, 45, 0.18), transparent 26%),
    linear-gradient(135deg, rgba(255, 251, 243, 0.92), rgba(238, 228, 201, 0.82));
  box-shadow: var(--shadow);
}

.draw-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.draw-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.draw-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #b44f2d, #8e3112);
  box-shadow: 0 14px 28px rgba(142, 49, 18, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.draw-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(142, 49, 18, 0.34);
}

.draw-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.featured-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  min-height: 280px;
  border: 1px solid rgba(35, 21, 15, 0.08);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.86);
}

.featured-card.empty {
  align-content: center;
}

.featured-topline,
.featured-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.featured-id,
.featured-age,
.featured-category {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-id {
  color: var(--accent);
}

.featured-age,
.featured-category {
  color: var(--muted);
}

.featured-question {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  max-width: 18ch;
}

.featured-empty-title {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.featured-empty-copy {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.65;
}

.featured-player {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.favorite-button {
  border: 1px solid rgba(35, 21, 15, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.favorite-button.active {
  color: white;
  background: linear-gradient(135deg, #b44f2d, #8e3112);
  border-color: transparent;
}

.te-creo-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(35, 21, 15, 0.08);
  border-radius: 24px;
  background: rgba(255, 251, 244, 0.82);
}

.te-creo-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.mode-note {
  padding: 18px;
  border: 1px dashed rgba(35, 21, 15, 0.16);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.5);
}

.round-block {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px dashed rgba(35, 21, 15, 0.12);
}

.round-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.round-copy strong {
  display: block;
  margin-bottom: 6px;
}

.round-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.question-track,
.question-actions,
.vote-actions,
.reveal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.question-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-slot {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(35, 21, 15, 0.06);
}

.question-slot.used {
  color: white;
  background: linear-gradient(135deg, #4f7a6f, #2e5a50);
}

.mini-button,
.vote-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.mini-button {
  color: white;
  background: linear-gradient(135deg, #4f7a6f, #2e5a50);
}

.mini-button.subtle {
  color: var(--ink);
  background: rgba(35, 21, 15, 0.08);
}

.vote-button.believe {
  color: #183f33;
  background: rgba(157, 192, 139, 0.45);
}

.vote-button.doubt {
  color: #6a2f0f;
  background: rgba(229, 138, 58, 0.34);
}

.mini-button:hover:not(:disabled),
.vote-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.mini-button:disabled,
.vote-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vote-score {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
}

.vote-divider {
  opacity: 0.4;
}

.reveal-result {
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 800;
}

.reveal-result.truth {
  color: #183f33;
  background: rgba(157, 192, 139, 0.28);
}

.reveal-result.lie {
  color: #6a2f0f;
  background: rgba(229, 138, 58, 0.24);
}

.card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(35, 21, 15, 0.1);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 16px 30px rgba(88, 56, 23, 0.12);
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 44px rgba(88, 56, 23, 0.18);
}

.card-topline,
.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-id,
.card-age,
.card-category {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-id {
  color: var(--accent);
}

.card-age,
.card-category {
  color: var(--muted);
}

.card-question {
  font-size: 1.42rem;
  line-height: 1.08;
}

.pill-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.intensity-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.pill {
  background: rgba(35, 21, 15, 0.06);
}

.pill-mode {
  background: rgba(79, 122, 111, 0.12);
  color: #23443d;
}

.pill-tag {
  background: rgba(180, 79, 45, 0.1);
  color: #7b351d;
}

.intensity-chip {
  color: white;
}

.empty-state {
  padding: 32px;
  border: 1px dashed rgba(35, 21, 15, 0.18);
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.72);
  text-align: center;
}

.empty-kicker {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.empty-state h3 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.empty-state p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .draw-header {
    align-items: start;
    flex-direction: column;
  }

  .te-creo-header {
    align-items: start;
    flex-direction: column;
  }

  .featured-utility {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 20px;
  }

  .hero,
  .filters-panel,
  .card,
  .empty-state {
    border-radius: 22px;
  }

  h1 {
    max-width: none;
  }
}
