:root {
  --charcoal: #090806;
  --brown: #1b120d;
  --brown-soft: rgba(62, 42, 28, 0.68);
  --gold: #d4ad63;
  --gold-bright: #f0d28c;
  --beige: #e8d8bd;
  --warm-white: #fff8ed;
  --muted: rgba(255, 248, 237, 0.72);
  --glass: rgba(15, 12, 10, 0.64);
  --line: rgba(212, 173, 99, 0.26);
  --line-strong: rgba(240, 210, 140, 0.62);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--charcoal);
  color: var(--warm-white);
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, rgba(212, 173, 99, 0.18), transparent 28rem),
    radial-gradient(circle at 76% 12%, rgba(120, 68, 35, 0.2), transparent 30rem),
    linear-gradient(135deg, #050403, #20140e 46%, #080706);
}

/* Coloca aqui la imagen del set oficial: assets/set-oficial.png */
.set-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(8, 7, 6, 0.18), rgba(8, 7, 6, 0.42)),
    url("assets/set-oficial.png") center / cover no-repeat;
  transform: scale(1.02);
  transition: transform 780ms ease, filter 780ms ease;
}

body[data-screen="guest"] .set-backdrop,
body[data-screen="vote"] .set-backdrop,
body[data-screen="results"] .set-backdrop,
body[data-screen="library"] .set-backdrop {
  transform: scale(1.065);
  filter: saturate(1.04) contrast(1.02);
}

.set-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0 34%, rgba(0, 0, 0, 0.54) 82%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.1) 48%, rgba(0, 0, 0, 0.72)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.8));
}

.ambient-glow {
  position: fixed;
  inset: auto 12% 6% 12%;
  z-index: -2;
  height: 22vh;
  background: radial-gradient(ellipse, rgba(212, 173, 99, 0.24), transparent 68%);
  filter: blur(22px);
  opacity: 0.8;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 56px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.992);
  transition: opacity 560ms ease, transform 560ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.screen-inner {
  width: min(1120px, 100%);
  animation: riseIn 680ms ease both;
}

.hero-content {
  align-self: end;
  max-width: 760px;
  padding-bottom: min(8vh, 72px);
}

#welcome .kicker,
#welcome h1,
#welcome .hero-line,
#welcome .hero-button {
  opacity: 0;
  transform: translateY(12px);
  animation: sequenceIn 760ms ease forwards;
}

#welcome h1 {
  animation-delay: 120ms;
}

#welcome .hero-line {
  animation-delay: 240ms;
}

#welcome .hero-button {
  animation-delay: 360ms;
}

.kicker,
.section-label {
  margin: 0 0 14px;
  color: var(--gold-bright);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 920px;
  color: var(--warm-white);
  font-weight: 500;
  line-height: 0.96;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.56);
}

h1 {
  font-size: clamp(2.45rem, 6.8vw, 5.75rem);
}

h2 {
  font-size: clamp(2.15rem, 5vw, 4.5rem);
}

.hero-line {
  max-width: 650px;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.back-button {
  min-height: 52px;
  border: 1px solid rgba(240, 210, 140, 0.58);
  border-radius: var(--radius);
  padding: 0 24px;
  cursor: pointer;
  color: #160f08;
  background: linear-gradient(135deg, #b98935, var(--gold-bright) 52%, #a97728);
  box-shadow: 0 14px 42px rgba(212, 173, 99, 0.22);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 190ms ease, box-shadow 190ms ease, filter 190ms ease, opacity 190ms ease, border-color 190ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.back-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1) brightness(1.05);
  box-shadow: 0 18px 52px rgba(212, 173, 99, 0.34);
}

.hero-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 48px rgba(212, 173, 99, 0.36), 0 0 0 3px rgba(240, 210, 140, 0.08);
}

.primary-button.is-disabled {
  cursor: default;
  opacity: 0.48;
  filter: grayscale(0.4);
}

.primary-button.is-disabled:hover {
  transform: none;
  box-shadow: 0 14px 42px rgba(212, 173, 99, 0.14);
}

.secondary-button {
  color: var(--warm-white);
  background: rgba(255, 248, 237, 0.08);
  border-color: var(--line);
}

.back-button {
  position: absolute;
  top: clamp(16px, 3vw, 32px);
  left: clamp(16px, 3vw, 32px);
  z-index: 3;
  min-height: 42px;
  padding: 0 15px;
  color: var(--beige);
  background: rgba(10, 8, 7, 0.58);
  border-color: rgba(232, 216, 189, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.centered-panel {
  display: grid;
  place-items: center;
}

.glass-card {
  width: min(760px, 100%);
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 248, 237, 0.08), transparent 42%),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.guest-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 36%);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  width: min(860px, 100%);
  min-height: 390px;
  overflow: hidden;
}

.guest-card .primary-button {
  min-width: min(100%, 240px);
}

.guest-card.has-portrait {
  padding-right: clamp(18px, 3vw, 34px);
}

.guest-card.no-portrait {
  grid-template-columns: 1fr;
  width: min(700px, 100%);
  min-height: auto;
}

.guest-copy {
  position: relative;
  z-index: 2;
}

.guest-portrait {
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-height: 300px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.guest-card.has-portrait .guest-portrait {
  opacity: 1;
  transform: translateX(0);
}

.guest-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(15, 12, 10, 0.82), rgba(15, 12, 10, 0.18) 34%, rgba(15, 12, 10, 0.08)),
    linear-gradient(180deg, rgba(15, 12, 10, 0.06), rgba(15, 12, 10, 0.58));
  pointer-events: none;
}

.guest-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) sepia(0.18) contrast(1.08);
}

.guest-card.no-portrait .guest-portrait {
  display: none;
}

.guest-subtitle,
.muted,
.vote-header p,
.release-note {
  color: var(--muted);
  line-height: 1.55;
}

.guest-subtitle {
  margin: 16px 0 22px;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.guest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.guest-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--beige);
  background: rgba(0, 0, 0, 0.24);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

.guest-note {
  max-width: 520px;
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.65;
  font-style: italic;
}

.vote-layout,
.library-layout {
  display: grid;
  gap: 22px;
}

.vote-header,
.library-header {
  max-width: 820px;
}

.vote-header h2 {
  max-width: 700px;
  font-size: clamp(1.75rem, 3.65vw, 3.2rem);
  line-height: 1.02;
}

.vote-header h2,
.library-header h2 {
  margin-bottom: 14px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.question-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 116px;
  border: 1px solid rgba(232, 216, 189, 0.16);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: var(--warm-white);
  background: rgba(10, 8, 7, 0.66);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
}

.question-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.34);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 180ms ease, transform 180ms ease;
}

.question-card::before {
  content: "";
  position: absolute;
  right: 23px;
  top: 21px;
  z-index: 1;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  opacity: 0;
  transform: rotate(-45deg) scale(0.82);
  transition: opacity 180ms ease, transform 180ms ease;
}

.question-card:hover,
.question-card.is-selected {
  border-color: var(--line-strong);
  background: rgba(37, 25, 16, 0.78);
  transform: translateY(-2px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38), 0 0 34px rgba(212, 173, 99, 0.14);
}

.question-card.is-selected {
  animation: selectedPulse 360ms ease both;
}

.question-card.is-selected::after {
  opacity: 1;
  transform: scale(1);
}

.question-card.is-selected::before {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.question-letter {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #120c07;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

.question-text {
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  line-height: 1.4;
}

.vote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notice {
  min-height: 24px;
  margin: 0;
  color: var(--gold-bright);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.results-card h2 {
  margin-bottom: 12px;
  animation: resultMessageIn 620ms ease both;
}

.results-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 24px;
}

.result-row {
  display: grid;
  grid-template-columns: 32px 1fr 46px;
  gap: 12px;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
}

.result-letter {
  color: var(--gold-bright);
  font-weight: 900;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.1);
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b6025, var(--gold-bright));
  box-shadow: 0 0 22px rgba(240, 210, 140, 0.36);
  transition: width 1000ms cubic-bezier(0.2, 0.72, 0.18, 1) 220ms;
}

.screen.is-active .bar-fill {
  width: var(--result-width);
}

.result-value {
  color: var(--beige);
  font-weight: 800;
  text-align: right;
}

.result-row.is-winner {
  padding: 10px 12px;
  border: 1px solid rgba(240, 210, 140, 0.32);
  border-radius: var(--radius);
  background: rgba(212, 173, 99, 0.08);
}

.result-row.is-winner .result-letter,
.result-row.is-winner .result-value {
  color: var(--gold-bright);
}

.result-row.is-winner .bar-fill {
  box-shadow: 0 0 30px rgba(240, 210, 140, 0.5);
}

.countdown {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  margin: 4px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.28);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 26px rgba(212, 173, 99, 0.08), 0 14px 38px rgba(0, 0, 0, 0.28);
}

.guest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.library-layout {
  align-self: end;
  padding-bottom: min(5vh, 48px);
}

.library-layout .secondary-button {
  justify-self: center;
  min-width: min(100%, 280px);
}

.library-card {
  position: relative;
  min-height: 210px;
  border: 1px solid rgba(232, 216, 189, 0.16);
  border-radius: var(--radius);
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(212, 173, 99, 0.13), transparent 42%),
    rgba(10, 8, 7, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  overflow: hidden;
}

.library-card.has-image {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.library-card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--guest-image);
  background-position: center 18%;
  background-size: cover;
  filter: grayscale(1) sepia(0.16) contrast(1.08);
  opacity: 0.34;
  transform: scale(1.02);
  transition: opacity 180ms ease, transform 180ms ease;
}

.library-card.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 8, 7, 0.1), rgba(10, 8, 7, 0.62) 54%, rgba(10, 8, 7, 0.92)),
    linear-gradient(90deg, rgba(10, 8, 7, 0.62), transparent 54%);
  pointer-events: none;
}

.library-card.has-image:hover::before {
  opacity: 0.42;
  transform: scale(1.055);
}

.library-card:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 210, 140, 0.48);
  background:
    linear-gradient(180deg, rgba(212, 173, 99, 0.18), transparent 44%),
    rgba(18, 12, 9, 0.76);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.42), 0 0 30px rgba(212, 173, 99, 0.1);
}

.library-card h3 {
  position: relative;
  z-index: 2;
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.08;
}

.library-card p {
  position: relative;
  z-index: 2;
  margin: 0 0 42px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.status-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.24);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(212, 173, 99, 0.1);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sequenceIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes selectedPulse {
  0% {
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }
  55% {
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.4), 0 0 44px rgba(240, 210, 140, 0.2);
  }
  100% {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38), 0 0 34px rgba(212, 173, 99, 0.14);
  }
}

@keyframes resultMessageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .screen {
    overflow-y: auto;
    align-items: start;
    padding: 22px;
  }

  .hero-content {
    align-self: end;
    padding-bottom: 48px;
  }

  .question-grid,
  .guest-grid {
    grid-template-columns: 1fr;
  }

  .vote-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .library-card {
    min-height: 160px;
  }

  .guest-card,
  .guest-card.has-portrait {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .guest-portrait {
    display: none;
  }
}

@media (max-width: 520px) {
  .screen {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.9rem);
  }

  h2 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .hero-line {
    margin: 20px 0 28px;
    font-size: 1rem;
  }

  .glass-card {
    padding: 22px;
  }

  .question-card {
    grid-template-columns: 40px 1fr;
    gap: 12px;
    min-height: 104px;
    padding: 15px;
  }

  .question-letter {
    width: 38px;
    height: 38px;
  }
}
