:root {
  --bg: #f3eadc;
  --paper: #fffdf8;
  --ink: #2c241c;
  --muted: #6d6258;
  --line: #e4d8c6;
  --accent: #8b5a2b;
  --accent-ink: #fffaf3;
  --shadow: 0 10px 30px rgba(70, 48, 24, 0.08);
  --ivoire: #f3e6d0;
  --ocre: #e0b86a;
  --lin: #d2c0a8;
  --argile: #d3927a;
  --sauge: #9eaf96;
  --brume: #b7c4cc;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fff8ec 0%, transparent 55%),
    var(--bg);
}

#app { max-width: 920px; margin: 0 auto; padding: 20px 16px 64px; }

h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; }
h2 { font-size: 1.35rem; }
p { margin: 0; color: var(--muted); line-height: 1.5; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
}
.brand { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.step { font-size: 0.9rem; color: var(--muted); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.hero p { margin-top: 10px; font-size: 1.05rem; }
.hero { margin-bottom: 18px; }

label { display: block; font-weight: 700; margin-bottom: 8px; }
input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
button {
  font: inherit;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 20px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-tiny { padding: 8px 12px; font-size: 0.9rem; }

.progress {
  height: 6px;
  background: #eadfcf;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 18px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}

.view-title { margin-bottom: 6px; }
.hint { margin: 6px 0 16px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 740px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

.choice {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  text-align: left;
  color: inherit;
  width: 100%;
}
.choice.rank-1 { border-color: #b45309; box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18); }
.choice.rank-2 { border-color: #a16207; }
.choice.rank-3 { border-color: #854d0e; }
.choice img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eee4d4;
}
.choice .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 10px;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  flex: none;
}
.choice .name { font-weight: 700; font-size: 0.95rem; }
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
  font-size: 0.88rem;
  color: var(--muted);
}
.legend b { color: var(--ink); }

.recap { display: grid; gap: 14px; }
.recap-view {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.recap-view h3 { font-size: 1rem; margin-bottom: 8px; }
.picks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.picks figure { margin: 0; }
.picks img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; }
.picks figcaption { font-size: 0.78rem; margin-top: 4px; color: var(--muted); }

.status { margin-top: 14px; font-size: 0.92rem; }
.err { color: #9f1239; margin-top: 10px; font-weight: 600; }
.ok { color: #3f6212; }

.footer-link {
  display: block;
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  background: none;
  border: 0;
  width: 100%;
  text-decoration: underline;
  cursor: pointer;
}

.bars { display: grid; gap: 10px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; }
.bar-track { height: 12px; background: #eadfcf; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.winner {
  margin: 8px 0 18px;
  padding: 16px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #f0d3a8;
}
.winner strong { font-family: Fraunces, Georgia, serif; font-size: 1.4rem; display: block; margin-bottom: 4px; }

.names { margin-top: 8px; color: var(--muted); }

.detail { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.swatch.ivoire { background: var(--ivoire); }
.swatch.ocre { background: var(--ocre); }
.swatch.lin { background: var(--lin); }
.swatch.argile { background: var(--argile); }
.swatch.sauge { background: var(--sauge); }
.swatch.brume { background: var(--brume); }
.fill-ivoire { background: var(--ivoire); }
.fill-ocre { background: var(--ocre); }
.fill-lin { background: var(--lin); }
.fill-argile { background: var(--argile); }
.fill-sauge { background: var(--sauge); }
.fill-brume { background: var(--brume); }
