/* Circle Awards: the gacha's green felt and gold, dressed for a gala. Parchment trophy cards, one spotlight. */
:root {
  --felt: #0F241D;
  --felt-hi: #1E4A3B;
  --felt-lo: #08140F;
  --gold: #E7C46E;
  --gold-hi: #FFE7A6;
  --gold-lo: #A97B2C;
  --ivory: #ECE2CB;
  --ivory-2: #E0D4B7;
  --ink: #24170F;
  --ink-soft: #6A5A49;
  --on-felt: #F0E8D6;
  --on-felt-soft: #C6C4B0;
  --line: rgba(231, 196, 110, .22);
  --panel: rgba(255, 240, 220, .04);
  --display: 'Unbounded', system-ui, sans-serif;
  --text: 'Bricolage Grotesque', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--on-felt); font-family: var(--text); font-size: 17px; line-height: 1.45;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, var(--felt-hi), var(--felt) 55%, var(--felt-lo)) fixed, var(--felt);
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: var(--grain); opacity: .16; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
[hidden] { display: none !important; }

.top { max-width: 1040px; margin: 0 auto; padding: 16px; display: flex; align-items: center; gap: 12px; }
.home { font-family: var(--display); font-weight: 900; font-size: 1.15rem; text-decoration: none; letter-spacing: -.03em; }
.home .x { color: #FF5C8A; display: inline-block; transform: rotate(-8deg); }
.tool-name { font-family: var(--display); font-weight: 500; font-size: .8rem; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 24px; }

.eyebrow { margin: 0; font-family: var(--display); font-weight: 500; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }

/* ---------- intro ---------- */
.intro { text-align: center; padding: 36px 0 20px; }
.intro h1 {
  margin: 10px 0 12px; font-family: var(--display); font-weight: 900; letter-spacing: -.03em; line-height: 1;
  font-size: clamp(2.3rem, 8vw, 4.6rem);
}
.intro h1 em {
  font-style: normal; display: block;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 0 auto 22px; max-width: 34ch; color: var(--on-felt-soft); font-size: 1.05rem; }
.ask { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 520px; margin: 0 auto; }
.field {
  flex: 1 1 220px; display: flex; align-items: center; gap: 4px; background: var(--ivory); color: var(--ink);
  border-radius: 14px; padding: 0 14px; box-shadow: inset 0 2px 0 rgba(0,0,0,.08), 0 0 0 2px var(--gold-lo);
}
.field span { font-family: var(--display); font-weight: 700; color: var(--ink-soft); }
.field input { flex: 1; min-width: 0; border: 0; background: none; font: 800 1.1rem var(--text); color: var(--ink); padding: 14px 0; outline: none; }
.fine { margin: 14px auto 0; max-width: 46ch; font-size: .85rem; color: var(--on-felt-soft); }

/* ---------- buttons ---------- */
.btn {
  font: 700 .92rem var(--display); border-radius: 14px; padding: 13px 18px; cursor: pointer; color: var(--on-felt);
  background: var(--panel); border: 1px solid var(--line); transition: transform .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: var(--ink); border: 0; box-shadow: 0 4px 0 #6E4C17; }
.btn.ghost { background: none; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 40px 0; }
.spot {
  width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem;
  background: radial-gradient(circle, rgba(255,231,166,.35), transparent 70%);
  animation: glow 1.6s ease-in-out infinite alternate;
}
@keyframes glow { from { transform: scale(.94); opacity: .7; } to { transform: scale(1.04); opacity: 1; } }
.steps { list-style: none; padding: 0; margin: 0 auto; max-width: 320px; text-align: left; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--on-felt-soft); }
.steps li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold-lo); flex: none; }
.steps li.now { color: var(--on-felt); }
.steps li.now::before { border-color: var(--gold-hi); background: radial-gradient(var(--gold-hi) 40%, transparent 45%); }
.steps li.done::before { background: var(--gold); border-color: var(--gold); }

.error { text-align: center; margin: 20px auto; max-width: 44ch; background: rgba(160, 50, 40, .25); border: 1px solid rgba(255, 140, 120, .4); border-radius: 14px; padding: 12px 16px; }

/* ---------- result head: one line ---------- */
.head { text-align: center; padding: 14px 0 6px; }
.presenter { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.presenter .av { width: 44px; height: 44px; padding: 2px; }
.presenter b { font-weight: 800; font-size: 1.1rem; }
.presenter em {
  font: normal 900 clamp(1.3rem, 4.6vw, 1.9rem) var(--display); letter-spacing: -.02em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.basis { margin: 6px auto 0; max-width: 52ch; color: var(--on-felt-soft); font-size: .85rem; }

/* ---------- poster + post text ---------- */
.show { display: grid; gap: 18px; margin-top: 14px; align-items: start; }
.poster { margin: 0; position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; border-radius: 16px; overflow: hidden; background: var(--felt-lo); box-shadow: 0 24px 50px rgba(0,0,0,.45); }
.poster img { width: 100%; height: 100%; display: block; }
.poster img:not([src]) { visibility: hidden; }
.poster-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--on-felt-soft); font-weight: 700; }
.side { display: grid; gap: 14px; align-content: start; }
.post-text { background: var(--ivory); color: var(--ink); border-radius: 16px; padding: 12px 14px; box-shadow: 0 0 0 2px var(--gold-lo); }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.post-head b { font: 700 .82rem var(--display); }
.switch { display: inline-flex; background: var(--ivory-2); border-radius: 999px; padding: 3px; }
.switch button { border: 0; background: none; font: 700 .78rem var(--text); color: var(--ink-soft); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.switch button.on { background: var(--ink); color: var(--ivory); }
.text { margin: 10px 0; white-space: pre-wrap; word-break: break-word; font: 600 .92rem/1.45 var(--text); max-height: 340px; overflow: auto; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count { font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.btn.small { padding: 9px 14px; font-size: .8rem; white-space: nowrap; }
.post-text .btn.small { background: var(--ink); color: var(--ivory); border: 0; }
.actions.minor { margin: 0; }

/* avatars: gold ring */
.av {
  border-radius: 50%; padding: 3px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: conic-gradient(from 210deg, var(--gold-hi), var(--gold-lo), var(--gold), var(--gold-hi));
}
.av img, .av i { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--felt-lo); }
.av i { font: 900 1.1em var(--display); font-style: normal; color: var(--gold); }

.section-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin: 30px 0 14px; color: var(--gold); text-align: center; }

/* names in the ranking */
.who { min-width: 0; }
.who b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }

.won { font: normal 700 .72rem var(--text); color: var(--ink); background: var(--gold); border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: 2px; white-space: nowrap; }

/* ---------- actions ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.actions .btn { flex: 1 1 auto; }

/* ---------- full circle ---------- */
.circle { margin-top: 26px; }
.circle-head { text-align: center; }
.circle-head .section-title { margin-bottom: 4px; }
.meta { margin: 0 0 14px; color: var(--on-felt-soft); font-size: .88rem; }
.tiers { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; justify-content: safe center; scrollbar-width: none; }
.tiers button {
  flex: none; font: 700 .85rem var(--text); color: var(--on-felt); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.tiers button small { color: var(--on-felt-soft); margin-left: 4px; font-weight: 600; }
.tiers button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.tiers button[disabled] { opacity: .4; cursor: default; }
.tier-pick { margin-top: 12px; text-align: center; }
.tier-label { display: block; font: 500 .7rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tiers button.on small { color: var(--ink-soft); }
/* Phones: all 8 ranges visible in two rows of 4, no sideways scrolling. */
@media (max-width: 640px) {
  .tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow: visible; }
  .tiers button { padding: 7px 2px; font-size: .78rem; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
  .tiers button small { margin-left: 0; font-size: .7rem; }
}
.rank { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; display: grid; gap: 6px; }
.rank li a {
  display: grid; grid-template-columns: 2.2em 44px 1fr auto; gap: 10px; align-items: center; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px;
}
.rank li a:hover { border-color: var(--gold); }
.rank .n { font: 700 .85rem var(--display); color: var(--gold); text-align: right; }
.rank .av { width: 44px; height: 44px; padding: 2px; }
.rank .who b { font-size: .98rem; }
.rank .who span { color: var(--on-felt-soft); font-size: .8rem; white-space: normal; }
.rank .f { font-weight: 800; font-size: .85rem; color: var(--on-felt-soft); text-align: right; }
.rank .bar { grid-column: 3 / 5; height: 3px; border-radius: 3px; background: rgba(231,196,110,.12); overflow: hidden; margin-top: -4px; }
.rank .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.empty { text-align: center; color: var(--on-felt-soft); padding: 18px; }

.how { margin: 10px 0 0; font-size: .82rem; color: var(--on-felt-soft); line-height: 1.4; }
.how b { color: var(--on-felt); }
.faq { max-width: 720px; margin: 8px auto 0; padding: 0 16px; }
.faq .section-title { text-align: center; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 8px; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style-position: inside; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--on-felt-soft); }
.foot .legal { font-size: .76rem; }
.foot { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; color: var(--on-felt-soft); font-size: .82rem; text-align: center; }
.foot a { color: var(--on-felt); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; background: var(--ivory); color: var(--ink);
  font-weight: 800; border-radius: 999px; padding: 10px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  width: max-content; max-width: calc(100% - 32px); text-align: center;
}

@media (min-width: 760px) {
  .intro { padding-top: 64px; }
  .show { grid-template-columns: minmax(0, 560px) minmax(0, 380px); justify-content: center; }
  .actions .btn { flex: 0 1 auto; }
  .side .actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
