:root {
  --surface: #fffdfa;
  --surface-warm: #fffefb;
  --text: #1b1a18;
  --muted: #6d675d;
  --muted-sub: #7c7468;
  --line: #d4ccbe;
  --accent: #b96d15;
  --accent-light: #c97a1d;
  --ok: #22663a;
  --ghost-bg: #ece6d8;
  --ghost-text: #4b453d;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Fira Sans", system-ui, sans-serif;
  color: var(--text);
  background: #fff;
  margin: 0;
  padding: 0;
}

.embed-wrap {
  width: 100%;
  height: 650px;
  overflow: hidden;
  border-radius: 16px;
}

.poll {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #fffcf7, var(--surface));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: reveal 560ms ease both;
}

.poll.is-thanks {
  grid-template-rows: minmax(0, 1fr);
}

.poll.is-thanks .top,
.poll.is-thanks .footer {
  display: none;
}

.poll.is-thanks .content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(185, 109, 21, 0.08), transparent 75%);
}

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

/* --- Top / Header --- */

.top {
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, rgba(185, 109, 21, 0.08), transparent 75%);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: clamp(160px, 25vw, 260px);
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.title {
  margin: 6px 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 18px);
}

/* --- Intro state --- */

.poll.is-intro {
  grid-template-rows: minmax(0, 1fr) 0fr 0fr;
}

.poll.is-intro .top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom-color: transparent;
}

.poll.is-intro .content {
  overflow: hidden;
  padding: 0;
  opacity: 0;
}

.poll.is-intro .footer {
  overflow: hidden;
  padding: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.intro-start {
  margin-top: 28px;
  padding: 14px 32px;
  font-size: 17px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #fff;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 250ms ease;
}

.intro-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(185, 109, 21, 0.3);
}

.intro-start:disabled {
  background: #a7a7a7;
  color: #f2f2f2;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.intro-start:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* --- Content --- */

.content {
  padding: 20px 24px 0;
  overflow: hidden;
}

.options::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.options::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cc8a31, var(--accent));
  border-radius: 999px;
}

.options::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d5963d, #c1751c);
}

.options::-webkit-scrollbar-track {
  background: transparent;
}

.options::-webkit-scrollbar-button:single-button,
.options::-webkit-scrollbar-button {
  display: block;
  height: 0;
  width: 0;
  background: none;
  border: none;
}

.options::-webkit-scrollbar-corner {
  display: none;
}

.options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 20px;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #b88033 transparent;
}

.option {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  background: var(--surface-warm);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: #b7ab98;
  background: #fffbf3;
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: #fff6e7;
  box-shadow: 0 0 0 1px rgba(185, 109, 21, 0.22) inset;
}

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

.thumb {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  border: none;
  background: linear-gradient(140deg, #f6ecdb, #efe1c7);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb.thumb--square {
  aspect-ratio: 1 / 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-label {
  color: var(--muted-sub);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.option-title {
  display: grid;
  gap: 3px;
  line-height: 1.25;
}

.option-main {
  font-weight: 700;
  text-wrap: balance;
}

.option-sub {
  font-size: 12px;
  color: var(--muted-sub);
  font-weight: 400;
  text-wrap: balance;
}

/* --- Footer --- */

.footer {
  border-top: 1px solid var(--line);
  padding: 14px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  background: linear-gradient(180deg, transparent, rgba(185, 109, 21, 0.06));
}

.btns {
  display: flex;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button:not(:disabled):active { transform: translateY(1px); }

.ghost {
  background: var(--ghost-bg);
  color: var(--ghost-text);
}

.solid {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #fff;
}

.ok {
  color: var(--ok);
  font-weight: 700;
}

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

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

.thanks-title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
  animation: thanksIn 500ms ease both;
}

.thanks-logo {
  width: clamp(160px, 22vw, 240px);
  height: auto;
  display: block;
  margin: 22px auto 0;
  animation: thanksIn 500ms ease 250ms both;
}

.thanks-text {
  margin: 12px 0 0;
  font-size: clamp(16px, 2.3vw, 20px);
  color: var(--muted);
  font-weight: 600;
  animation: thanksIn 500ms ease 150ms both;
}

.thanks-summary {
  width: min(420px, 100%);
  margin: 22px auto 0;
  display: grid;
  gap: 10px;
  text-align: left;
}

.thanks-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-warm);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  animation: thanksItemIn 400ms ease 300ms both;
}

.thanks-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, #f6ecdb, #efe1c7);
  display: block;
}

.thanks-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thanks-item-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.thanks-pick {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

@media (max-width: 640px) {
  .embed-wrap { height: 550px; }
  .top { padding: 14px 14px 12px; }
  .top .brand-logo { width: clamp(130px, 20vw, 180px); margin-bottom: 8px; }
  .top .title { font-size: clamp(32px, 5vw, 48px); }
  .top .subtitle { font-size: 13px; }
  .content { padding: 14px; gap: 12px; }
  .footer { padding: 10px 14px 14px; }
  .btns { width: 100%; }
  .btns button { flex: 1; }
  .options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .option { padding: 6px; gap: 6px; border-radius: 10px; }
  .option-main { font-size: 13px; }
  .option-sub { font-size: 11px; }

  .poll.is-thanks .content { padding: 14px; }
  .thanks-item { padding: 8px; gap: 10px; grid-template-columns: 56px 1fr; }
  .thanks-thumb { width: 56px; height: 56px; }
  .thanks-pick { font-size: 14px; }
}
