:root { --qd-bg: #f2f5fa; }
body {
  background: var(--qd-bg); min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
.hero { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.hero img { display: block; width: 100%; height: auto;  object-fit: cover; }i

.section-card { border: 0; border-radius: 1rem; box-shadow: 0 4px 18px rgba(20,40,80,.08); }
.section-title { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; margin-bottom: .5rem; }
.step-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem;
  margin-right: .6rem; border-radius: 50%; background: var(--bs-primary); color: #fff; font-size: .95rem;
}

/* Vote option cards (radio buttons) */
.option-card {
  position: relative; cursor: pointer; border: 3px solid transparent; border-radius: .9rem; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; user-select: none;
}
.option-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.option-card .card-img-top { width: 100%; height: auto; }
.option-card .check-mark {
  position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--bs-primary); color: #fff; font-weight: 700; display: none;
  align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.btn-check:checked + .option-card { border-color: var(--bs-primary); box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }
.btn-check:checked + .option-card .check-mark { display: flex; }
.btn-check:checked + .option-card .fw-semibold { color: var(--bs-primary); }
.btn-check:focus-visible + .option-card { outline: 3px solid rgba(13,110,253,.6); outline-offset: 2px; }

.sticky-actions { position: sticky; bottom: 0; z-index: 10; padding: 1rem 0 .5rem; background: linear-gradient(rgba(242,245,250,0), var(--qd-bg) 35%); }

.home-tile, .admin-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 1rem; transition: transform .15s ease;
}
.home-tile { min-height: 180px; font-size: 1.7rem; }
.home-tile span { font-size: 1.4rem; font-weight: 600; }
.admin-tile { min-height: 120px; font-size: 1.8rem; box-shadow: 0 4px 14px rgba(20,40,80,.08); }
.admin-tile span { font-size: 1rem; font-weight: 600; }
.home-tile:hover, .admin-tile:hover { transform: translateY(-3px); }
.msg-card { max-width: 560px; }

.loading-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }

.table-votes tr.vote-invalid td:not(.status-cell) { text-decoration: line-through; color: var(--bs-secondary-color); }
.result-card.is-top { border: 2px solid #ffc107; box-shadow: 0 0 0 .2rem rgba(255,193,7,.3); }

/* Lucky draw */
.winner-card {
  background: linear-gradient(180deg, #f4f3fe 0%, #ccefFC 100%); border: 2px solid #1565c0; border-radius: 1rem;
  padding: 1.5rem 1rem; text-align: center; min-height: 260px; display: flex; align-items: center; justify-content: center;
}
.winner-content { width: 100%; }
.winner-label { font-size: .9rem; letter-spacing: .15em; color: #345; }
.winner-org { font-size: 1.4rem; font-weight: 700; color: #8a1a22; margin-bottom: .6rem; word-break: break-word; }
.winner-name { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; color: #c4101c; line-height: 1.1; margin-bottom: .6rem; word-break: break-word; }
.winner-no { font-size: 1.3rem; font-family: ui-monospace, monospace; color: #5a0a10; }
.winner-card.is-empty .winner-org, .winner-card.is-empty .winner-name, .winner-card.is-empty .winner-no { color: #a9a3b6; }
.winner-card.is-drawing .winner-content { animation: qd-shake .15s infinite; opacity: .55; }
.winner-card.is-revealed .winner-content { animation: qd-reveal .7s ease-out; }
@keyframes qd-shake { 50% { transform: translateY(-4px); } }
@keyframes qd-reveal { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.btn-draw {
  font-weight: 800; letter-spacing: .3em; font-size: 1.6rem; border-radius: 3rem; color: #0d3c78;
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 60%, #90caf9 100%); border: 2px solid #64b5f6;
}
.btn-draw:hover { background: linear-gradient(180deg, #f4f3fe 0%, #ccefFC 60%, #a1dbfa 100%); color: #0d3c78; }
.winner-list-body { max-height: 320px; overflow-y: auto; }
.winner-list tr.new-row { animation: qd-flash 1.5s ease-out; }
@keyframes qd-flash { from { background: rgba(255,193,7,.6); } to { background: transparent; } }
