@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,800;1,600&family=Manrope:wght@400;600;800&display=swap");

:root {
  --bg1: #fff5ea; --bg2: #ffe1ec; --ink: #2b1b2e; --muted: #7a6478;
  --accent: #e8457a; --accent2: #ff9a3c; --card: #ffffffd9;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: Manrope, system-ui, sans-serif; color: var(--ink); min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 80% at 10% 0%, var(--bg2), transparent 60%),
              radial-gradient(120% 80% at 100% 100%, #ffe9c7, transparent 60%), var(--bg1);
  background-attachment: fixed;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 28px);
  overflow-x: hidden;
}
a { color: var(--accent); }
.wrap { max-width: 480px; margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.wrap.wide { max-width: 760px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.brand { font-weight: 800; text-decoration: none; color: var(--ink); font-size: 15px; }
.langs { display: flex; gap: 4px; }
.langs button { border: 0; background: transparent; font: 700 13px Manrope, sans-serif; color: var(--muted); padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.langs button.on { background: #fff; color: var(--accent); }
.badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: #fff; padding: 7px 14px; border-radius: 99px; box-shadow: 0 4px 14px #e8457a22; }
h1 { font-family: "Playfair Display", serif; font-weight: 800; font-size: 38px; line-height: 1.08; margin: 16px 0 10px; }
h1 em { font-style: italic; font-weight: 600; background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-family: "Playfair Display", serif; font-size: 26px; margin: 26px 0 12px; }
.sub { color: var(--muted); font-size: 16px; margin: 0 0 22px; line-height: 1.5; }
.hidden { display: none !important; }

button.main, a.main { display: block; appearance: none; border: 0; width: 100%; padding: 19px; border-radius: 22px;
  font: 800 18px Manrope, sans-serif; color: #fff; text-decoration: none; text-align: center;
  background: linear-gradient(95deg, var(--accent), var(--accent2)); box-shadow: 0 12px 28px #e8457a55; cursor: pointer; transition: transform .15s, opacity .2s; }
button.main:active { transform: scale(.97); }
button.main:disabled { opacity: .55; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.ghost { flex: 1; appearance: none; border: 2px solid #e8457a33; background: #fff; color: var(--ink); padding: 13px 16px;
  border-radius: 18px; font: 700 15px Manrope, sans-serif; cursor: pointer; text-decoration: none; display: inline-block; }
.link { background: none; border: 0; color: var(--muted); font: 600 14px Manrope, sans-serif; text-decoration: underline; cursor: pointer; margin-top: 14px; }

.card { background: var(--card); backdrop-filter: blur(8px); border-radius: 22px; padding: 16px; margin-top: 18px; text-align: left; box-shadow: 0 6px 22px #2b1b2e10; }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.error { background: #fff0f0; color: #a3243b; border-radius: 16px; padding: 12px 14px; font-weight: 600; font-size: 14px; margin: 14px 0; text-align: left; }

.features { display: grid; gap: 12px; margin: 26px 0; text-align: left; }
.feature { background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.feature .ic { font-size: 24px; }
.feature b { display: block; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.price { font-size: 15px; color: var(--muted); margin: 10px 0 0; }
.footer { margin-top: 34px; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); margin: 0 6px; }

.accounts { display: grid; gap: 10px; }
.account { display: flex; align-items: center; gap: 12px; background: #fff; border: 0; border-radius: 18px; padding: 12px; cursor: pointer; font: 700 16px Manrope, sans-serif; color: var(--ink); text-align: left; }
.account img, .account .av { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #eee; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile span { position: absolute; left: 6px; bottom: 6px; background: #000a; color: #fff; font: 700 12px Manrope, sans-serif; padding: 3px 7px; border-radius: 99px; }

.post { background: #fff; border-radius: 22px; overflow: hidden; text-align: left; box-shadow: 0 14px 40px #2b1b2e22; margin: 0 auto 18px; max-width: 360px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.post-head img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent2); }
.post-head b { display: block; font-size: 14px; }
.post-head span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 270px; }
.post-img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f3ece6; }
.post-foot { display: flex; align-items: center; gap: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; }
.post-foot a { margin-left: auto; text-decoration: none; font-size: 13px; }

.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; margin: 10px 0; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.toggle small { display: block; color: var(--muted); font-weight: 400; }
.people { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow: auto; }
.chip { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 99px; padding: 3px 10px 3px 3px; font-size: 13px; font-weight: 600; }
.chip.out { opacity: .35; text-decoration: line-through; }
.chip b { color: var(--accent); }
.mini { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; flex: none; }

.stage { position: relative; height: 290px; display: flex; align-items: center; justify-content: center; margin: 6px 0 10px; }
.ring { position: absolute; width: 230px; height: 230px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent2), #ffd36e, var(--accent2), var(--accent)); }
.ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg1); }
.spinning .ring { animation: spin 1.1s linear infinite; }
.won .ring { animation: spin 6s linear infinite; box-shadow: 0 0 60px #ff9a3c88; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar { position: relative; width: 200px; height: 200px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: "Playfair Display", serif; font-size: 84px; font-weight: 800; color: #fff; box-shadow: 0 10px 30px #2b1b2e22; }
.won .avatar { animation: pop .7s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.nick { font-family: "Playfair Display", serif; font-size: 30px; font-weight: 800; margin: 4px 0 2px; word-break: break-all; }
.status { font-weight: 600; color: var(--accent); font-size: 16px; margin-bottom: 16px; min-height: 22px; }
.congrats { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent2); }
.winner-card { margin: 10px 0 6px; }
.share { display: flex; gap: 8px; margin-top: 12px; }
.share input { flex: 1; min-width: 0; border: 2px solid #e8457a22; border-radius: 14px; padding: 10px 12px; font: 13px Manrope, sans-serif; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.spinner { width: 34px; height: 34px; border: 4px solid #e8457a33; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto 10px; }

.result .history { padding-left: 18px; margin: 0; }
.result .history li { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.result .history li b { color: var(--ink); display: block; }
.result .history li span { display: block; font-size: 12px; }
.result .history li.final b { color: var(--accent); font-size: 16px; }
.result .brand { display: inline-block; margin-bottom: 14px; }

.legal { text-align: left; line-height: 1.6; font-size: 15px; }
.legal h1 { font-size: 30px; }
.legal h2 { font-size: 20px; margin-top: 22px; }
