:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #123c2c;
  background: #f0f6ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #146344;
  --dark: #0b3928;
  --lime: #d8f584;
  --muted: #496454;
  --line: #cbded0;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at top left, #e0efda, transparent 65%); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #167445; outline-offset: 4px; }
[hidden] { display: none !important; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1.4px; color: #346448; line-height: 1.6; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6vw; max-width: 1500px; margin: auto; padding: clamp(28px, 6vw, 90px); }
.login-copy { max-width: 560px; }
.login-copy > .eyebrow { display: inline-block; padding: 9px 15px; border: 1px solid #b8d2bb; border-radius: 100px; background: #e1efd9; }
.login-copy h1 { font-size: clamp(60px, 7vw, 100px); line-height: 1.02; font-weight: 850; letter-spacing: -4px; margin: 30px 0 24px; }
.login-copy h1 span { color: var(--green); position: relative; }
.login-copy h1 span::after { content: ""; display: block; width: 160px; height: 9px; margin-top: 16px; background: var(--lime); border-radius: 100px; transform: rotate(-3deg); }
.login-copy > p { max-width: 440px; color: var(--muted); font-size: 19px; line-height: 1.75; margin-bottom: 30px; }
.google-button { display: inline-flex; gap: 12px; align-items: center; justify-content: center; min-height: 58px; padding: 16px 28px; border: 1px solid var(--dark); border-radius: 14px; background: var(--green); color: white; font-size: 17px; font-weight: 700; box-shadow: 0 5px 0 var(--dark); transition: transform .18s, box-shadow .18s; }
.google-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--dark); }
.google-button:disabled { background: #dce8de; color: #466452; border-color: #a7bfad; box-shadow: none; }
.google-icon { display: grid; place-items: center; width: 28px; height: 28px; background: white; color: #146344; border-radius: 50%; font-size: 19px; font-weight: 800; }
.login-note { margin-top: 28px; color: #3f634b; font-size: 15px; line-height: 1.7; }
.login-art { min-height: 490px; height: min(700px, 78vh); display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid #123f2c; border-radius: 36px 36px 110px 36px; background: radial-gradient(circle at 50% 45%, #367e54, #0c3928 80%); box-shadow: 0 22px 55px #0b392821; }
.login-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#d8f58445 1px, transparent 1px); background-size: 24px 24px; }
.poster-sticker { position: absolute; z-index: 2; background: var(--lime); color: var(--dark); padding: 16px 20px; border: 2px solid var(--dark); border-radius: 12px; font-size: 16px; line-height: 1.3; font-weight: 900; letter-spacing: 1px; box-shadow: 4px 5px 0 #082b20; }
.sticker-top { top: 10%; left: 7%; transform: rotate(-9deg); }
.sticker-bottom { bottom: 15%; right: 7%; transform: rotate(9deg); }
.wheel { position: relative; aspect-ratio: 1; width: 100%; max-width: 300px; border: 9px solid #f6ffe8; border-radius: 50%; background: repeating-conic-gradient(#d8f584 0deg 30deg, #2b8458 30deg 60deg, #8ecfa2 60deg 90deg, #155039 90deg 120deg); box-shadow: 0 0 0 3px #103e2b, 0 15px 30px #051e2540; }
.login-art .wheel { width: 76%; max-width: 380px; }
.wheel::before { content: ""; position: absolute; inset: 8%; border: 2px dashed #f6ffe8a0; border-radius: 50%; }
.wheel-center { position: absolute; z-index: 1; width: 32%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--dark); background: #f7ffef; color: var(--dark); font-size: 24px; font-weight: 900; box-shadow: 0 4px 0 #092b22; }
.wheel-center span { font-size: 42px; }
.wheel.spinning { animation: spin-wheel 8s cubic-bezier(.12,.45,.08,1) forwards; }
@keyframes spin-wheel { to { transform: rotate(4320deg); } }
.app-shell { max-width: 1500px; min-height: 100vh; margin: auto; padding: 0 clamp(20px, 4vw, 64px); display: flex; flex-direction: column; }
.topbar { min-height: 92px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid #bdd4c1; }
.wordmark { color: var(--dark); text-decoration: none; font-size: 20px; font-weight: 900; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.wordmark-icon { display: grid; place-items: center; height: 38px; width: 38px; border-radius: 12px; background: var(--green); color: var(--lime); font-size: 28px; }
.wordmark-muted { color: #45634e; font-size: 13px; letter-spacing: .8px; }
.user-menu { display: flex; align-items: center; gap: 15px; }
.user-name { font-size: 15px; color: #34543e; font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { min-height: 44px; padding: 8px 15px; border: 1px solid #bdd0bf; border-radius: 10px; background: #fff; color: #244c33; font-weight: 700; }
.text-button:hover { background: #e3f0dd; }
.uid-note { overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; padding: 16px 20px; margin: 20px 0 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #365b41; }
.welcome-row { padding: 38px 0 30px; display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.welcome-row h1 { font-size: clamp(30px, 3.5vw, 46px); letter-spacing: -1.4px; line-height: 1.2; margin: 10px 0 0; }
.title-sparkle { color: #398143; padding-left: 12px; }
.participant-counter { flex-shrink: 0; display: flex; align-items: center; gap: 14px; color: #35573d; font-size: 13px; line-height: 1.6; padding: 16px 22px; border: 1px solid #c1d9ba; border-radius: 16px; background: #e0efd4; }
.counter-number { color: var(--green); font-size: 44px; font-weight: 800; letter-spacing: -2px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr); gap: 24px; padding-bottom: 36px; }
.card { min-width: 0; border: 1px solid #c5d9c8; border-radius: 24px; background: #fff; box-shadow: 0 7px 25px #17452a08; }
.ticket-card, .live-card { padding: clamp(20px, 2.3vw, 32px); }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-heading h2 { font-size: 29px; letter-spacing: -.8px; margin: 5px 0 0; }
.legend { display: flex; align-items: center; gap: 6px; padding-top: 12px; font-size: 13px; color: #48614e; flex-wrap: wrap; }
.legend-free, .legend-taken { width: 12px; height: 12px; border-radius: 4px; background: #187344; border: 1px solid #105632; margin-left: 4px; }
.legend-taken { background: #b83232; border-color: #8f2525; }
.number-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; margin-top: 26px; }
.number-cell { min-width: 0; min-height: 46px; padding: 0; border: 1px solid #105632; border-radius: 10px; background: #187344; color: #fff; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; transition: transform .15s, background .15s; }
.number-cell:not(:disabled):hover { background: #105632; border-color: #0b3928; transform: translateY(-2px); }
.number-cell.selected { background: #0b3928; border: 2px solid #fff; color: #fff; box-shadow: 0 0 0 3px #187344; }
.number-cell.taken { color: #fff; background: #b83232; border-style: dashed; border-color: #8f2525; text-decoration: line-through; }
.number-cell:disabled:not(.taken) { color: #fff; background: #187344; }
.ticket-footer { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; display: flex; align-items: center; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.ticket-footer p { margin: 0; max-width: 230px; color: #48614e; font-size: 14px; line-height: 1.7; }
.primary-button, .draw-button { min-height: 48px; padding: 12px 20px; border: 1px solid #0b3928; border-radius: 12px; color: #fff; background: var(--green); font-size: 15px; font-weight: 750; line-height: 1.5; transition: background .15s, transform .15s; }
.primary-button:not(:disabled):hover, .draw-button:not(:disabled):hover { background: #0b4930; transform: translateY(-1px); }
.primary-button:disabled, .draw-button:disabled { background: #dce8de; color: #48614e; border-color: #bdcdbf; }
.my-ticket { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding: 20px; border: 1px solid #b9d59c; border-radius: 16px; background: #eff8e2; }
.ticket-check { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #146344; color: white; font-size: 23px; }
.my-ticket div { display: flex; flex-direction: column; gap: 4px; }
.my-ticket small { font-size: 12px; letter-spacing: 1px; color: #37603d; font-weight: 700; }
.my-ticket strong { font-size: 38px; line-height: 1; }
.my-ticket p { flex: 1 1 160px; margin: 0; color: #365b3d; font-size: 15px; line-height: 1.6; }
.closed-message { padding: 18px 22px; margin: 0 0 22px; border: 1px solid #c5d9be; border-radius: 14px; background: #e7f1df; color: #35523a; font-size: 15px; line-height: 1.7; }
.ticket-card .closed-message { margin: 20px 0 0; }
.live-card { display: flex; flex-direction: column; }
.live-badge { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #bcd5b1; border-radius: 100px; background: #e5f3dc; color: #245e37; font-size: 12px; font-weight: 800; }
.live-badge::before { content: ""; width: 7px; height: 7px; background: #247642; border-radius: 50%; }
.wheel-stage { position: relative; display: grid; place-items: center; min-height: 280px; margin-top: 24px; border: 1px solid #bfd7b4; border-radius: 18px; background: radial-gradient(circle, #e8f6d5, #d4e9c9); overflow: hidden; }
.wheel-stage::before, .wheel-stage::after { content: "✳"; position: absolute; font-size: 30px; color: #4e8352; }
.wheel-stage::before { top: 24px; left: 22px; transform: rotate(15deg); }
.wheel-stage::after { bottom: 20px; right: 24px; font-size: 22px; }
.wheel-stage .wheel { width: 200px; border-width: 7px; }
.wheel-stage .wheel-center { font-size: 22px; }
.wheel-pointer { position: absolute; z-index: 3; top: 18px; color: #0b3928; font-size: 27px; }
.draw-message { padding: 26px 0; text-align: center; }
.draw-message h3 { font-size: 23px; line-height: 1.4; letter-spacing: -.5px; margin: 0 0 12px; }
.draw-message p { max-width: 370px; color: #49614f; margin: auto; font-size: 15px; line-height: 1.8; }
.draw-message h3 span { display: inline-block; color: #146344; font-size: 34px; }
.admin-panel { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: auto; }
.admin-label { color: #315a3e; font-size: 12px; letter-spacing: 1px; font-weight: 800; }
.draw-button { width: 100%; }
.admin-panel > small { text-align: center; color: #4a614f; font-size: 13px; line-height: 1.7; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 5; max-width: min(480px, calc(100vw - 44px)); padding: 16px 20px; border-radius: 14px; color: #fff; font-size: 15px; line-height: 1.7; box-shadow: 0 8px 32px #0b392830; }
.toast button { width: 36px; height: 36px; margin-left: 10px; border: 0; border-radius: 8px; background: #ffffff20; color: white; font-size: 24px; vertical-align: middle; }
.error-toast { background: #943329; }
.success-toast { background: #125738; }
.page-footer { margin-top: auto; border-top: 1px solid #bdd4c1; padding: 22px 0; color: #3e5e46; font-size: 12px; letter-spacing: 1px; font-weight: 700; line-height: 1.6; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #345b40; font-size: 18px; }
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 18px; }
  .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .login-screen { gap: 30px; padding: 36px; }
  .login-art { min-height: 440px; }
}
@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; padding: 40px 24px; gap: 38px; }
  .login-copy { max-width: none; }
  .login-copy h1 { font-size: clamp(60px, 12vw, 84px); letter-spacing: -3px; }
  .login-copy > p { font-size: 18px; }
  .login-art { height: 450px; min-height: 0; border-radius: 28px 28px 70px 28px; }
  .login-art .wheel { width: 65%; max-width: 280px; }
  .content-grid { grid-template-columns: 1fr; }
  .topbar { min-height: 84px; flex-wrap: wrap; padding: 16px 0; gap: 14px; }
  .wordmark { font-size: 17px; gap: 7px; }
  .wordmark-muted { font-size: 12px; }
  .user-menu { margin-left: auto; }
  .welcome-row { align-items: flex-start; flex-direction: column; gap: 20px; padding: 30px 0 24px; }
  .welcome-row h1 { font-size: 34px; letter-spacing: -1px; }
  .participant-counter { padding: 10px 18px; width: 100%; }
  .counter-number { font-size: 36px; }
  .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .number-cell { min-height: 48px; font-size: 17px; }
  .card-heading h2 { font-size: 27px; }
  .ticket-footer { flex-direction: column; align-items: stretch; }
  .ticket-footer p { max-width: none; }
  .primary-button { width: 100%; }
  .user-name { max-width: 150px; }
  .page-footer { font-size: 11px; letter-spacing: .6px; }
}
@media (max-width: 380px) {
  .app-shell { padding: 0 14px; }
  .ticket-card, .live-card { padding: 18px; }
  .number-grid { gap: 6px; }
  .login-screen { padding: 32px 20px; }
  .poster-sticker { padding: 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.reset-button { min-height: 48px; padding: 12px 20px; border: 1px solid #ad3a32; border-radius: 12px; color: #912f27; background: #fff4f1; font-size: 15px; font-weight: 750; }
.reset-button:not(:disabled):hover { background: #ffe2dc; }
.reset-button:disabled { color: #735b57; background: #efe8e6; border-color: #c8b5b0; }
.winner-email { overflow-wrap: anywhere; margin-top: 12px !important; padding: 12px; border: 1px solid #b9d59c; border-radius: 12px; background: #eff8e2; font-weight: 700; color: #123c2c !important; }

/* Full-screen winner reveal. Confetti stops after one fall. */
.celebration-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: clamp(18px, 4vw, 56px); border: 0; background: transparent; color: #fff; overflow-y: auto; }
.celebration-dialog[open] { display: grid; place-items: center; }
.celebration-dialog::backdrop { background: #082c2040; }
.celebration-card { position: relative; z-index: 1; width: min(850px, 100%); text-align: center; padding: clamp(20px, 4vw, 40px); border: 1px solid #ffffff70; border-radius: 28px; background: #0b3928e8; box-shadow: 0 24px 80px #082c2055; }
.celebration-star { display: inline-block; color: #d8f584; font-size: 62px; line-height: 1; }
.celebration-kicker { color: #d8f584; font-size: 13px; font-weight: 800; letter-spacing: 2px; margin: 18px 0; }
.celebration-card h2 { color: #d8f584; font-size: clamp(42px, 11vw, 118px); line-height: 1.05; letter-spacing: -.04em; margin: 0 0 20px; text-shadow: 0 7px 0 #082b2090; }
.celebration-card > p { line-height: 1.6; }
#celebration-result { font-size: clamp(18px, 3vw, 24px); margin: 0; }
.celebration-number { display: block; font-size: clamp(84px, 19vw, 168px); font-weight: 900; line-height: 1.2; letter-spacing: -.05em; }
.celebration-email { display: inline-block; max-width: 100%; overflow-wrap: anywhere; margin: 10px 0; padding: 12px 24px; border-radius: 16px; background: #ffffff12; border: 1px solid #ffffff40; color: #fff; font-size: clamp(16px, 3vw, 24px); font-weight: 700; }
.celebration-note { color: #e1efdf; font-size: 16px; margin: 12px 0 24px; }
.celebration-close { min-height: 50px; padding: 14px 24px; border: 2px solid #d8f584; border-radius: 14px; background: #d8f584; color: #0b3928; font-size: 16px; font-weight: 800; }
.celebration-close:hover { background: #ecffc0; }
.celebration-close:focus-visible { outline-color: white; }
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -30px; left: var(--x); width: 10px; height: 18px; background: var(--color); border-radius: 2px; animation: confetti-fall var(--fall) var(--delay) ease-in forwards; }
.confetti i:nth-child(3n) { border-radius: 50%; width: 12px; height: 12px; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 115vh) rotate(var(--turn)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .confetti i { animation: none; }
}

.remaining-count { margin: 0; padding: 12px; border-radius: 12px; background: #e5f3dc; color: #245e37; font-size: 16px; font-weight: 750; text-align: center; }

.draw-blocked-reason { margin: 0; color: #7b382d; font-size: 14px; line-height: 1.6; padding: 12px; background: #fff1e8; border: 1px solid #dfc0ae; border-radius: 12px; }

.drawn-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; padding: 0; margin: 18px 0 0; }
.drawn-numbers li { padding: 10px 14px; border: 1px solid #b9d59c; border-radius: 10px; background: #eff8e2; color: #123c2c; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

.number-confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 28px; border: 1px solid #b9d2bc; border-radius: 22px; background: #fff; color: #123c2c; box-shadow: 0 20px 70px #082c2033; }
.number-confirm-dialog::backdrop { background: #082c2070; }
.number-confirm-dialog h2 { font-size: 26px; margin: 0 0 14px; }
.number-confirm-dialog p { font-size: 16px; line-height: 1.6; color: #496454; margin: 0 0 24px; }
.number-confirm-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.number-confirm-actions button { flex: 1 1 150px; min-height: 48px; }
