:root {
  color-scheme: dark;
  --bg: #070807;
  --panel: #101211;
  --panel-2: #171a18;
  --line: #2a2e2b;
  --ink: #f7f8f5;
  --muted: #9fa5a0;
  --green: #28d893;
  --green-deep: #0a5b3c;
  --cream: #f4efdf;
  --orange: #ffb55d;
  --danger: #ff6b6b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.public-page, .public-detail { --green: #ffd700; --green-deep: #806b00; }
.public-page .search input:focus { border-color: #ffd700; box-shadow: 0 0 0 4px rgba(255,215,0,.12); }
.public-page .status:not(.sold_out), .public-detail .status:not(.sold_out) { background: rgba(255,215,0,.1); }
.public-page .promotion-note, .public-detail .promotion-note { color: #ffd700; }
.public-detail .brand-mark { box-shadow: 0 0 32px rgba(255,215,0,.22); }
.public-status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.new-badge { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid #ffd700; border-radius: 999px; color: #ffd700; background: #292300; font-size: 13px; font-weight: 950; letter-spacing: .06em; }
.new-badge::after { content: ""; position: absolute; inset: -30% auto -30% -70%; width: 45%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent); transform: skewX(-20deg); animation: new-shine 2.8s ease-in-out infinite; }
.new-badge > span { animation: new-sparkle 1.4s ease-in-out infinite alternate; }
@keyframes new-shine { 0%, 30% { left: -70%; } 80%, 100% { left: 140%; } }
@keyframes new-sparkle { from { opacity: .45; } to { opacity: 1; text-shadow: 0 0 9px #ffd700; } }
@media (prefers-reduced-motion: reduce) { .new-badge::after, .new-badge > span { animation: none; } }

.shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  min-height: 84px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; border-bottom: 1px solid var(--line);
}
.public-page .topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 8, 7, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 900; letter-spacing: -.04em; font-size: 22px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
  color: #07120d; background: var(--green); box-shadow: 0 0 32px rgba(40,216,147,.22);
}
.brand-logo { width: 58px; height: 58px; object-fit: contain; flex: none; }
.brand-name { white-space: nowrap; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a { color: var(--muted); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.nav a:hover, .nav a.active { background: var(--panel-2); color: var(--ink); }
.nav-button { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 10px 16px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; }
.nav-button:hover { border-color: var(--green); color: var(--green); }
.private-badge { display: inline-flex; align-items: center; gap: 7px; color: #b4f8d8; border: 1px solid #174d37; background: #0a2218; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; }
.private-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.hero { padding: 80px 0 50px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: end; }
.eyebrow { color: var(--green); font-size: 13px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: 16px 0; max-width: 850px; font-size: clamp(44px, 7vw, 92px); line-height: .98; letter-spacing: -.075em; }
.hero p { color: var(--muted); font-size: clamp(16px, 2vw, 21px); line-height: 1.7; max-width: 680px; }
.hero-stat { justify-self: end; min-width: 280px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #151816, #0c0e0d); }
.hero-stat strong { display: block; font-size: 44px; letter-spacing: -.05em; margin-bottom: 4px; }
.hero-stat span { color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 26px; }
.search { flex: 1; max-width: 600px; position: relative; }
.search input {
  width: 100%; padding: 15px 18px 15px 46px; border: 1px solid var(--line); border-radius: 15px;
  background: var(--panel); color: var(--ink); outline: none;
}
.search input:focus { border-color: #49705e; box-shadow: 0 0 0 4px rgba(40,216,147,.08); }
.search::before { content: "⌕"; position: absolute; left: 17px; top: 8px; color: var(--muted); font-size: 27px; }
.filter-pills { display: flex; gap: 8px; }
.filter-pills button, .chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 10px 15px; cursor: pointer; }
.filter-pills button.active { color: #07120d; border-color: var(--green); background: var(--green); font-weight: 900; }

.lottery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding-bottom: 80px; }
.lottery-card { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.lottery-card:hover { transform: translateY(-3px); border-color: #4b514c; }
.lottery-card.is-completed { filter: grayscale(1); }
.lottery-card.is-completed .status { color: #eeeeec; background: #343634; border: 1px solid #656965; }
.cover {
  position: relative; width: 100%; min-width: 0; aspect-ratio: 1 / 1; align-self: start; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 25% 15%, color-mix(in srgb, var(--green) 40%, transparent), transparent 33%), linear-gradient(135deg, #242925, #0c0e0d);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lottery-card .cover { aspect-ratio: 1 / 1; }
.lottery-card .cover img { object-fit: contain; }
.cover-placeholder { font-size: clamp(56px, 10vw, 120px); filter: drop-shadow(0 18px 35px rgba(0,0,0,.45)); }
.cover::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, rgba(0,0,0,.35)); pointer-events: none; }
.card-body { padding: 18px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--green); background: rgba(40,216,147,.09); border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 900; }
.status::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status.sold_out, .status.paused, .status.archived { color: #a8ada9; background: #202320; }
.card-body h2 { margin: 14px 0 5px; font-size: 22px; letter-spacing: -.035em; }
.card-body .series { color: var(--muted); margin-bottom: 18px; }
.remaining-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 10px; }
.remaining-row strong { font-size: 18px; }
.remaining-row span { color: var(--muted); font-size: 13px; }
.progress { height: 8px; background: #292c2a; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 17px; font-size: 14px; }
.card-link { font-weight: 900; }
.card-link::after { content: "  →"; color: var(--green); }
.price { color: var(--muted); text-align: right; }
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 34px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.site-footer p { margin: 0; }

.page-head { padding: 46px 0 26px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-head h1 { font-size: clamp(34px, 5vw, 58px); margin: 0 0 8px; letter-spacing: -.055em; }
.page-head p { color: var(--muted); margin: 0; }
.btn { border: 1px solid var(--line); background: var(--panel-2); padding: 12px 17px; border-radius: 13px; font-weight: 850; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { border-color: #505750; }
.btn.primary { color: #07120d; border-color: var(--green); background: var(--green); }
.btn.danger { color: #ffdada; border-color: #633434; background: #291616; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.dashboard { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding-bottom: 70px; }
.side-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); padding: 12px; align-self: start; position: sticky; top: 16px; }
.side-panel button { width: 100%; border: 0; background: transparent; color: var(--muted); text-align: left; padding: 13px 14px; border-radius: 12px; cursor: pointer; font-weight: 800; }
.side-panel button.active, .side-panel button:hover { background: var(--panel-2); color: var(--ink); }
.content-panel { min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 20px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; font-size: 29px; margin-top: 8px; letter-spacing: -.04em; }
.table-wrap { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.row-title { font-weight: 900; }
.row-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.actions .btn { padding: 8px 11px; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(9px); display: grid; place-items: center; padding: 18px; z-index: 50; }
.lucky-page .modal-backdrop { background: rgba(0,0,0,.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid #414641; background: #111412; border-radius: 24px; padding: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.modal.wide { width: min(1000px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 22px; }
.modal h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #c9ceca; font-size: 13px; font-weight: 800; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.5; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #090b0a; color: var(--ink); padding: 12px 13px; outline: none;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); }
.promotion-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #111412; cursor: pointer; }
.promotion-toggle input { width: auto; margin-top: 3px; accent-color: var(--green); }
.promotion-toggle span { display: grid; gap: 4px; }
.promotion-toggle strong { color: var(--text); font-size: 14px; }
.promotion-toggle small { color: var(--muted); line-height: 1.5; }
.promotion-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 16px; border: 1px solid #24523d; border-radius: 14px; background: rgba(25, 195, 125, .05); }
.promotion-fields[hidden] { display: none; }
.promotion-note { margin-top: 12px; color: #9de7bf; font-size: 13px; font-weight: 800; line-height: 1.5; }
.session-price-preview { display: grid; gap: 5px; padding: 15px; border: 1px solid #24523d; border-radius: 14px; background: rgba(25, 195, 125, .08); }
.session-price-preview span, .session-price-preview small { color: var(--muted); }
.session-price-preview strong { color: var(--green); font-size: 24px; }
.session-total { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(25, 195, 125, .08); color: var(--muted); }
.session-total strong { color: var(--green); }
.prize-editor { margin-top: 22px; }
.prize-category-options { display: grid; gap: 14px; }
.category-major { --category-color: #ffb8f2; --category-border: linear-gradient(110deg, #ff788f, #ffd866, #85dfcc, #92acff, #e39aff); }
.category-secondary { --category-color: #ffd700; --category-border: linear-gradient(110deg, #ad8320, #ffe789, #c89b27); }
.category-general { --category-color: #c4c4c4; --category-border: linear-gradient(110deg, #666, #b7b7b7, #666); }
.prize-category-choice { min-height: 76px; border: 2px solid transparent; border-radius: 16px; background: linear-gradient(#151515, #151515) padding-box, var(--category-border) border-box; color: var(--category-color); font-size: 22px; font-weight: 900; cursor: pointer; }
.prize-category-choice:hover { filter: brightness(1.25); }
.prize-category-field { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; color: var(--category-color); font-size: 13px; font-weight: 850; }
.prize-category-field select { padding: 8px 12px; border: 1px solid currentColor; border-radius: 10px; background: #151515; color: var(--category-color); font: inherit; }
.prize-row[class*="category-"] { padding: 14px; border: 2px solid transparent; border-radius: 16px; background: linear-gradient(#101211, #101211) padding-box, var(--category-border) border-box; }
.prize-row { display: grid; grid-template-columns: 95px 1fr 90px 42px; gap: 8px; margin-bottom: 9px; }
.prize-row input { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #090b0a; color: var(--ink); padding: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.upload-preview { width: min(480px, 100%); min-height: 0; aspect-ratio: 1 / 1; justify-self: start; border: 1px dashed #3b423d; border-radius: 14px; display: grid; place-items: center; color: var(--muted); background: #090b0a; overflow: hidden; }
.upload-preview img { width: 100%; height: 100%; max-height: none; object-fit: contain; }

.draw-layout { display: grid; grid-template-columns: 330px 1fr; gap: 24px; padding-bottom: 60px; }
.draw-catalog, .draw-catalog-skeleton { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 4px 0 70px; }
.draw-lottery-card { padding: 0; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 24px; overflow: hidden; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.draw-lottery-card:hover { transform: translateY(-4px); border-color: #526059; box-shadow: 0 18px 45px rgba(0,0,0,.25); }
.draw-lottery-card:focus-visible { outline: 3px solid rgba(40,216,147,.5); outline-offset: 3px; }
.draw-card-cover { width: calc(100% - 24px); max-width: 280px; margin: 12px auto 0; border-radius: 14px; aspect-ratio: 1 / 1; }
.draw-card-body { padding: 16px; }
.draw-card-body h2 { margin: 0 0 22px; font-size: 24px; letter-spacing: -.035em; }
.draw-card-price { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 20px; }
.draw-card-price span { color: var(--muted); font-size: 13px; }
.draw-card-price strong { font-size: 19px; color: var(--green); }
.draw-detail-summary { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 22px; margin-bottom: 26px; }
.draw-detail-cover { max-width: 280px; border-radius: 18px; aspect-ratio: 1 / 1; }
.draw-detail-info { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 4px; }
.draw-detail-info > div:not(.progress) { display: grid; gap: 5px; }
.draw-detail-info span, .draw-prize-heading span { color: var(--muted); font-size: 13px; }
.draw-detail-info strong { font-size: 25px; }
.draw-prize-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.draw-prize-heading h3 { margin: 0; font-size: 20px; }
.draw-prize-list { display: grid; gap: 9px; }
.draw-prize-row { display: grid; grid-template-columns: 68px 1fr auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #0c0f0d; }
.draw-prize-rank { min-height: 48px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-2); color: var(--orange); font-weight: 950; }
.draw-prize-row > div:nth-child(2) { display: grid; gap: 4px; }
.draw-prize-row span { color: var(--muted); font-size: 12px; }
.draw-prize-row b { font-size: 18px; }
.draw-create-button { min-width: 180px; }
.session-entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; align-items: start; }
.session-fields { display: grid; gap: 14px; }
.tv-target-selector { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.tv-target-selector legend { margin-bottom: 9px; padding: 0; color: var(--ink); font-size: 17px; font-weight: 900; }
.tv-target-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tv-target-option { position: relative; cursor: pointer; }
.tv-target-option input { position: absolute; opacity: 0; pointer-events: none; }
.tv-target-option span { min-height: 82px; display: grid; align-content: center; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #0c0f0d; transition: border-color .16s, background .16s, box-shadow .16s; }
.tv-target-option strong { font-size: 17px; }
.tv-target-option small { color: var(--muted); line-height: 1.4; }
.tv-target-option input:checked + span { border-color: var(--green); background: rgba(255,225,53,.09); box-shadow: inset 0 0 0 1px var(--green); }
.tv-target-option input:focus-visible + span { outline: 3px solid rgba(255,225,53,.35); outline-offset: 2px; }
.entry-field { display: grid; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #0c0f0d; transition: border-color .16s, background .16s; }
.entry-field.active { border-color: var(--green); background: #0d1712; }
.entry-field > span { font-weight: 900; font-size: 17px; }
.entry-field small { color: var(--muted); }
.entry-field input { width: 100%; border: 0; border-bottom: 1px solid #343a36; background: transparent; color: var(--ink); padding: 14px 2px 9px; font-size: 24px; font-weight: 800; outline: none; }
.keypad-panel { padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #0b0d0c; }
.keypad-label { min-height: 20px; margin-bottom: 12px; color: var(--green); font-size: 13px; font-weight: 850; text-align: center; }
.number-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.number-pad button { min-height: 54px; border: 1px solid #343a36; border-radius: 12px; background: var(--panel-2); color: var(--ink); font-size: 20px; font-weight: 900; cursor: pointer; }
.number-pad button:hover { border-color: var(--green); background: #183025; }
.number-pad .number-pad-action { color: var(--muted); font-size: 13px; }
.draw-history-modal { width: min(1080px, 100%); }
.draw-history-filter { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #0c0f0d; }
.draw-history-filter label { display: grid; gap: 8px; }
.draw-history-filter label > span { color: var(--muted); font-size: 13px; font-weight: 850; }
.draw-history-filter input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #373a34; border-radius: 11px; background: var(--panel-2); color: var(--ink); color-scheme: dark; font: inherit; font-weight: 750; outline: none; }
.draw-history-filter input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(255,225,53,.15); }
.draw-history-filter-actions { display: flex; gap: 8px; }
.draw-history-filter-actions .btn { min-height: 48px; padding: 0 17px; white-space: nowrap; }
.draw-history-filter-status { min-height: 26px; padding: 3px 2px 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.draw-history-loading { padding: 70px 20px; color: var(--muted); text-align: center; }
.draw-history-list { max-height: min(72vh, 820px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; padding-right: 8px; scrollbar-color: var(--green) #24251e; }
.draw-history-card { display: grid; gap: 15px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #0c0f0d; }
.draw-history-card header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.draw-history-card time { color: var(--muted); font-size: 13px; font-weight: 750; }
.draw-history-card h3 { margin: 0; font-size: 23px; }
.draw-history-screen { display: inline-flex; padding: 7px 11px; border: 1px solid #766817; border-radius: 999px; background: rgba(255,225,53,.1); color: #ffe86b; font-size: 13px; font-weight: 900; }
.draw-history-screen.tv2 { border-color: #8b6a29; background: rgba(255,178,53,.11); color: #ffd180; }
.draw-history-meta { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(150px, .6fr); gap: 10px; }
.draw-history-meta > div { display: grid; gap: 5px; padding: 14px; border-radius: 13px; background: var(--panel-2); }
.draw-history-meta span, .draw-history-meta small { color: var(--muted); font-size: 12px; }
.draw-history-meta strong { font-size: 19px; overflow-wrap: anywhere; }
.draw-history-prizes { display: grid; gap: 8px; }
.draw-history-prize { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #34362f; border-radius: 12px; }
.draw-history-prize span { color: #ffe86b; font-size: 14px; font-weight: 900; }
.draw-history-prize strong { overflow-wrap: anywhere; }
.draw-history-prize b { min-width: 48px; text-align: right; font-size: 18px; }
.lucky-page { background: radial-gradient(circle at 50% -10%, rgba(40,216,147,.12), transparent 38%), var(--bg); }
.lucky-topbar { position: relative; }
.lucky-legend { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; font-weight: 750; }
.lucky-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-dot.covered { background: #176b4a; border: 1px solid #45d59a; }
.legend-dot.revealed { background: #865f1e; border: 1px solid #ffc66d; }
.lucky-main { padding-bottom: 70px; }
.lucky-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 42px 0 26px; }
.lucky-head h1 { margin: 7px 0 8px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.055em; }
.lucky-head p { margin: 0; color: var(--muted); }
.lucky-session-count { display: flex; align-items: baseline; gap: 8px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16,18,17,.82); white-space: nowrap; }
.lucky-session-count strong { color: var(--green); font-size: 30px; }
.lucky-session-count span { color: var(--muted); font-size: 13px; }
.lucky-ticket-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 11px; align-items: start; }
.lucky-ticket { position: relative; isolation: isolate; min-width: 0; aspect-ratio: .76; border-radius: 14px; padding: 12px 10px 10px; overflow: hidden; text-align: left; display: flex; flex-direction: column; align-items: stretch; cursor: pointer; transition: transform .16s ease, border-color .16s ease, filter .16s ease, box-shadow .16s ease; }
.lucky-ticket::after { content: ""; position: absolute; z-index: 0; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 23%, rgba(255,255,255,.13) 40%, rgba(255,255,255,.035) 49%, transparent 64%); }
.lucky-ticket > span { position: relative; z-index: 1; }
.lucky-ticket:disabled { cursor: default; opacity: 1; }
.lucky-ticket.is-covered { border: 1px solid #2d936b; background: linear-gradient(155deg, #1c5d43, #0b2d20 70%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.025), 0 8px 18px rgba(0,0,0,.24); }
.lucky-ticket.is-covered:not(:disabled):hover { transform: translateY(-4px); border-color: #7aefbd; filter: brightness(1.12); }
.lucky-ticket.is-covered:disabled { filter: saturate(.55); }
.lucky-ticket.is-revealed { border: 1px solid #E5E4E2; background: linear-gradient(125deg, rgba(255,255,255,.20), transparent 28%), radial-gradient(circle at 22% 10%, rgba(255,255,255,.16), transparent 34%), linear-gradient(155deg, #727272, #3D3D3D 48%, #181818); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -12px 24px rgba(0,0,0,.25), 0 10px 22px rgba(0,0,0,.38); }
.lucky-ticket-number { align-self: flex-start; color: #e8fff5; font-size: clamp(14px, 1.6vw, 21px); font-weight: 950; line-height: 1; letter-spacing: .04em; }
.is-revealed .lucky-ticket-number { color: #ffd996; }
.lucky-ticket-mark { margin: auto; align-self: center; color: rgba(213,255,236,.2); font-size: clamp(9px, .85vw, 12px); font-weight: 950; letter-spacing: .13em; text-align: center; }
.tv-game .lucky-ticket-art { position: absolute; inset: 22% 12% 10%; display: grid; place-items: center; pointer-events: none; }
.tv-game .lucky-ticket-art img { width: 85%; height: 85%; min-height: 0; object-fit: contain; opacity: .55; filter: brightness(.8) saturate(.8); }
.lucky-ticket-result { margin: auto 0; display: grid; gap: 6px; text-align: center; }
.lucky-ticket-result small { color: #eab65d; font-size: clamp(15px, 1.35vw, 20px); line-height: 1.1; font-weight: 950; }
.lucky-ticket-result small.prize-rank-major { color: transparent; background: linear-gradient(110deg, #ff788f, #ffd866, #85dfcc, #92acff, #e39aff); background-clip: text; -webkit-background-clip: text; }
.lucky-ticket-result small.prize-rank-secondary { color: #ffd700; }
.lucky-ticket-result small.prize-rank-general { color: #ffffff; }
.lucky-ticket-result strong { color: #fff5df; font-size: clamp(10px, 1vw, 14px); line-height: 1.25; overflow-wrap: anywhere; }
.lucky-loading { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.lucky-loading .skeleton { min-height: 145px; }
.lucky-bonus { color: var(--orange); font-weight: 850; }
.draw-confirmation { text-align: left; }
.draw-confirmation-detail { display: grid; gap: 7px; padding: 20px; border: 1px solid #28503d; border-radius: 18px; background: rgba(40,216,147,.06); }
.draw-confirmation-detail span { color: var(--muted); font-size: 12px; font-weight: 800; }
.draw-confirmation-detail strong { margin-bottom: 12px; font-size: 24px; line-height: 1.35; }
.draw-confirmation-detail b { color: var(--green); font-size: 42px; letter-spacing: -.04em; }
.draw-confirmation > p { margin: 20px 0 14px; color: var(--muted); text-align: center; }
.draw-confirm-button { width: 100%; min-height: 54px; font-size: 17px; }
.draw-confirm-button.is-loading { cursor: wait; opacity: .82; }
.draw-sidebar { border: 1px solid var(--line); background: var(--panel); border-radius: 22px; padding: 22px; align-self: start; position: sticky; top: 16px; }
.draw-sidebar h2 { margin: 7px 0 4px; font-size: 27px; }
.counter-ring { width: 122px; height: 122px; margin: 25px auto; border: 9px solid #26302b; border-top-color: var(--green); border-radius: 50%; display: grid; place-items: center; text-align: center; }
.counter-ring strong { display: block; font-size: 32px; line-height: 1; }
.counter-ring span { font-size: 11px; color: var(--muted); }
.draw-results { display: grid; gap: 8px; }
.result-mini { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; border-radius: 12px; background: var(--panel-2); }
.ticket-area { border: 1px solid var(--line); background: radial-gradient(circle at 50% 0, rgba(40,216,147,.07), transparent 40%), var(--panel); border-radius: 22px; padding: 24px; min-height: 520px; }
.ticket-area-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.ticket-area h2 { margin: 0; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 11px; }
.ticket {
  aspect-ratio: .78; border: 1px solid #385146; color: #c4f8df; border-radius: 13px;
  background: linear-gradient(145deg, #19382a, #0c1912); cursor: pointer; display: grid; place-items: center;
  font-size: 17px; font-weight: 950; box-shadow: inset 0 0 0 3px rgba(0,0,0,.18); transition: transform .16s, background .16s;
}
.ticket:hover { transform: translateY(-4px) rotate(-1deg); background: linear-gradient(145deg, #24563d, #102419); }
.ticket:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 23px; margin-bottom: 8px; }

.reveal-card { text-align: center; padding: 18px 0 6px; }
.reveal-burst { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; font-size: 62px; background: radial-gradient(circle, #fff8c8, #f4b943 55%, #7e4d05); color: #2b1900; box-shadow: 0 0 80px rgba(255,196,72,.35); animation: pop .42s cubic-bezier(.2,.9,.3,1.35); }
.reveal-card .rank { color: var(--orange); font-size: 18px; font-weight: 950; letter-spacing: .1em; }
.reveal-card h2 { font-size: 38px; margin: 8px 0; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }

.detail-hero { padding: 46px 0 36px; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 32px; }
.detail-cover { max-width: 400px; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); min-height: 0; aspect-ratio: 1 / 1; }
.prize-quantity-summary { display: grid; justify-items: end; gap: 8px; text-align: right; white-space: nowrap; }
.prize-quantity-summary > strong { color: #ffd700; font-size: clamp(18px, 3vw, 26px); }
.prize-quantity-summary > span { color: var(--muted); font-size: 13px; }
.prize-quantity-summary > .prize-exhausted { padding: 8px 12px; border-radius: 10px; background: #303030; color: #dcdcdc; font-size: 18px; }
.detail-summary { display: flex; flex-direction: column; justify-content: center; }
.detail-summary h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1; letter-spacing: -.06em; margin: 16px 0; }
.detail-summary p { color: var(--muted); line-height: 1.7; }
.big-remaining { margin-top: 24px; display: flex; align-items: end; gap: 9px; }
.big-remaining strong { font-size: 56px; line-height: 1; letter-spacing: -.06em; }
.big-remaining span { color: var(--muted); }
.prize-list { display: grid; gap: 12px; padding-bottom: 70px; }
.prize-card { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 15px; }
.rank-box { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 15px; background: #202421; font-weight: 950; color: var(--orange); }
.prize-card h3 { margin: 0 0 5px; }
.prize-card p { margin: 0; color: var(--muted); font-size: 13px; }
.probability { text-align: right; }
.probability strong { display: block; font-size: 23px; }
.probability span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #eefdf5; color: #07170f; border-radius: 13px; padding: 13px 17px; font-weight: 800; box-shadow: 0 15px 50px rgba(0,0,0,.4); z-index: 100; animation: toast-in .25s ease; }
.toast.error { color: #fff; background: #9d2c2c; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.skeleton { background: linear-gradient(90deg, #171a18 20%, #222622 45%, #171a18 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 16px; min-height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hidden { display: none !important; }

.private-theme {
  --green: #FFE135;
  --green-deep: #806c12;
}
.private-theme .brand-mark { box-shadow: 0 0 32px rgba(255,225,53,.22); }
.private-theme .private-badge { color: #fff0a0; border-color: #6b5d16; background: #241f08; }
.private-theme .status { background: rgba(255,225,53,.10); }
.private-theme .promotion-fields { border-color: #6b5d16; background: rgba(255,225,53,.05); }
.private-theme .promotion-note { color: #ffe97a; }
.private-theme .session-price-preview { border-color: #6b5d16; background: rgba(255,225,53,.08); }
.private-theme .session-total { background: rgba(255,225,53,.08); }
.private-theme .draw-lottery-card:focus-visible { outline-color: rgba(255,225,53,.55); }
.private-theme .entry-field.active { background: #181404; }
.private-theme .number-pad button:hover { background: #2b2508; }
.lucky-page.private-theme { background: radial-gradient(circle at 50% -10%, rgba(255,225,53,.12), transparent 38%), var(--bg); }
.private-theme .legend-dot.covered { background: #806f1c; border-color: #FFE135; }
.private-theme .lucky-ticket.is-covered { border: 1px solid #d8c39e; background: linear-gradient(to bottom right, #45405f, #242039 55%, #141020); box-shadow: 0 10px 22px rgba(0,0,0,.34); }
.private-theme .lucky-ticket.is-covered::after { content: none; }
.private-theme .lucky-ticket.is-covered .lucky-ticket-number { color: #ffffff; }
.private-theme .lucky-ticket.is-covered:not(:disabled):hover { border-color: #ead9bb; filter: none; box-shadow: 0 14px 28px rgba(0,0,0,.42); }
.private-theme .lucky-ticket.is-covered:disabled { filter: none; }
.private-theme .lucky-ticket-number { color: #212121; }
.private-theme .lucky-ticket.is-revealed .lucky-ticket-number { color: #fff4bd; }
.private-theme .lucky-ticket.is-revealed.revealed-major { border-color: #ffb5ff; background: linear-gradient(125deg, rgba(255,255,255,.25), transparent 30%), linear-gradient(155deg, #ff247f, #b835ff 25%, #00bfff 48%, #00e59b 72%, #ffe000); }
.private-theme .lucky-ticket.is-revealed.revealed-secondary { border-color: #ffe99b; background: linear-gradient(125deg, rgba(255,255,255,.38), transparent 30%), linear-gradient(155deg, #fff1a6, #ffd700 48%, #b8860b); }
.private-theme .lucky-ticket.is-revealed.revealed-general { border-color: #dcdcdc; background: linear-gradient(125deg, rgba(255,255,255,.25), transparent 30%), linear-gradient(155deg, #e7e7e7, #dcdcdc 48%, #bcbcbc); }
.private-theme .lucky-ticket.is-revealed:is(.revealed-major, .revealed-secondary, .revealed-general) .lucky-ticket-number,
.private-theme .lucky-ticket.is-revealed:is(.revealed-major, .revealed-secondary, .revealed-general) .lucky-ticket-result strong { color: #212121; }
.private-theme .lucky-ticket.is-revealed .lucky-ticket-result small { padding: 5px 9px; border-radius: 9px; background-color: #242424; justify-self: center; }
.private-theme .lucky-ticket.is-revealed .lucky-ticket-result small.prize-rank-major { background: #242424; -webkit-background-clip: border-box; background-clip: border-box; color: #ffffff; }
.private-theme .lucky-ticket.is-revealed .lucky-ticket-result small.prize-rank-major > span { color: transparent; background: linear-gradient(110deg, #ff788f, #ffd866, #85dfcc, #92acff, #e39aff); -webkit-background-clip: text; background-clip: text; }
.private-theme .lucky-ticket-mark { color: rgba(255,239,164,.42); text-shadow: 0 1px 0 rgba(255,255,255,.12), 0 2px 8px rgba(0,0,0,.55); }
.private-theme .draw-confirmation-detail { border-color: #6b5d16; background: rgba(255,225,53,.07); }
.private-theme .ticket-area { background: radial-gradient(circle at 50% 0, rgba(255,225,53,.08), transparent 40%), var(--panel); }
.private-theme .ticket { border-color: #806f1c; color: #fff0a8; background: linear-gradient(145deg, #443b0e, #1b1706); }
.private-theme .ticket:hover { background: linear-gradient(145deg, #625517, #282208); }

/* 直立式觸控電視專用開獎台 */
.tv-lucky-page { margin: 0; min-height: 100svh; overflow-x: hidden; background: #050605; touch-action: manipulation; }
.tv-lucky-page .modal-backdrop { background: rgba(0,0,0,.9); -webkit-backdrop-filter: none; backdrop-filter: none; }
.tv-lucky-page .modal { width: min(820px, calc(100% - 64px)); padding: 42px; border-radius: 34px; }
.tv-standby { min-height: 100svh; display: grid; place-items: center; background: #050605; }
.tv-standby-poster { width: min(100vw, 1080px); min-height: 100svh; aspect-ratio: 9 / 16; padding: clamp(42px, 4vh, 64px) clamp(40px, 5.5vw, 62px); display: flex; flex-direction: column; overflow: hidden; position: relative; background: radial-gradient(circle at 90% 8%, rgba(255,225,53,.26), transparent 27%), radial-gradient(circle at 8% 70%, rgba(255,225,53,.11), transparent 31%), linear-gradient(160deg, #151506, #060706 48%, #111005); }
.tv-standby-poster::before { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(255,225,53,.25); border-radius: 42px; pointer-events: none; }
.tv-poster-brand { display: flex; align-items: center; gap: 24px; position: relative; z-index: 1; }
.tv-poster-brand img { width: clamp(128px, 16vw, 176px); height: clamp(128px, 16vw, 176px); flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 16px 28px rgba(0,0,0,.36)); }
.tv-poster-brand div { display: grid; gap: 7px; }
.tv-poster-brand strong { font-size: clamp(28px, 4vw, 43px); letter-spacing: -.04em; }
.tv-poster-brand span { color: #FFE135; font-size: clamp(18px, 2.7vw, 28px); font-weight: 850; }
.tv-poster-copy { margin-top: clamp(68px, 6.2vh, 102px); position: relative; z-index: 1; }
.tv-poster-copy h1 { margin: 20px 0 34px; font-size: clamp(92px, 14vw, 152px); line-height: 1.04; letter-spacing: -.08em; }
.tv-poster-copy p { max-width: 860px; margin: 0; color: #c5c6c2; font-size: clamp(21px, 2.8vw, 30px); line-height: 1.5; font-weight: 700; }
.tv-play-steps { list-style: none; margin: clamp(72px, 6.2vh, 106px) 0 0; padding: 0; display: grid; gap: clamp(11px, 1.2vh, 17px); position: relative; z-index: 1; }
.tv-play-steps li { display: grid; grid-template-columns: clamp(68px, 8.5vw, 92px) 1fr; align-items: center; gap: 20px; padding: clamp(13px, 1.3vh, 18px) 22px; border: 1px solid rgba(255,225,53,.24); border-radius: 22px; background: rgba(255,255,255,.035); }
.tv-play-steps b { color: #FFE135; font-size: clamp(32px, 4vw, 44px); font-weight: 950; }
.tv-play-steps span { display: grid; gap: 3px; color: #aeb0aa; font-size: clamp(16px, 1.9vw, 21px); }
.tv-play-steps strong { color: #fff; font-size: clamp(23px, 2.8vw, 31px); }
.tv-poster-qr { margin-top: auto; padding-top: clamp(32px, 3.6vh, 52px); display: grid; grid-template-columns: clamp(184px, 23vw, 248px) 1fr; align-items: center; gap: 30px; position: relative; z-index: 1; }
.tv-poster-qr img { width: 100%; aspect-ratio: 1; border-radius: 22px; background: #fff; padding: 10px; }
.tv-poster-qr div { display: grid; gap: 12px; }
.tv-poster-qr strong { color: #FFE135; font-size: clamp(28px, 3.7vw, 40px); line-height: 1.2; }
.tv-poster-qr span { color: #b9bbb6; font-size: clamp(17px, 2.2vw, 24px); line-height: 1.5; }
.tv-game { height: 100svh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(circle at 50% -8%, rgba(255,225,53,.14), transparent 30%), #080906; }
.tv-game-topbar { flex-shrink: 0; width: min(calc(100% - 64px), 1040px); min-height: 112px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.tv-game-brand { display: flex; align-items: center; gap: 18px; font-size: 27px; font-weight: 950; }
.tv-game-header-tools { display: grid; justify-items: end; gap: 12px; padding: 12px 0; }
.tv-selection-timer { display: flex; align-items: baseline; gap: 8px; color: #ffe135; white-space: nowrap; }
.tv-selection-timer[hidden] { display: none; }
.tv-selection-timer strong { font-size: 36px; font-variant-numeric: tabular-nums; }
.tv-selection-timer span { font-size: 16px; font-weight: 850; }
.tv-selection-warning .tv-selection-timer { color: #ff6868; }
.tv-selection-warning::after { content: ""; position: fixed; inset: 0; z-index: 200; border: 6px solid #ff3030; box-shadow: inset 0 0 38px 10px rgba(255,25,25,.75); pointer-events: none; animation: tv-time-warning .8s ease-in-out infinite alternate; }
.tv-selection-critical::after { border-width: 12px; border-color: #ff1515; box-shadow: inset 0 0 90px 30px rgba(255,10,10,.9); animation-duration: .35s; }
@keyframes tv-time-warning { from { opacity: .25; } to { opacity: 1; } }
.tv-game-rules h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 28px; }
.tv-game-rules ol { padding-left: 1.4em; display: grid; gap: 22px; font-size: clamp(20px, 2.8vw, 28px); line-height: 1.65; }
.tv-game-rules p { font-size: clamp(20px, 2.8vw, 28px); line-height: 1.65; }
.tv-game-rules .btn { width: 100%; min-height: 72px; font-size: 26px; margin-top: 28px; }
.tv-game-main { flex: 1; min-height: 0; display: flex; flex-direction: column; width: min(calc(100% - 64px), 1040px); margin: 0 auto; padding: 38px 0 0; }
.tv-game-head { flex-shrink: 0; display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
#tvLuckyRoot { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 60px; scrollbar-color: #d8c39e #242039; }
.tv-game-head h1 { margin: 8px 0; font-size: clamp(42px, 6vw, 66px); line-height: 1; letter-spacing: -.055em; }
.tv-game-head p { margin: 0; color: var(--muted); font-size: 20px; }
.tv-game .lucky-ticket-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.tv-game .lucky-ticket { aspect-ratio: .82; padding: 13px 10px; border-radius: 15px; }
.tv-game .lucky-ticket-number { font-size: clamp(18px, 2.6vw, 28px); }
.tv-game .lucky-ticket-result small { font-size: clamp(16px, 2.3vw, 25px); }
.tv-game .lucky-ticket-result strong { font-size: clamp(11px, 1.65vw, 17px); }
.tv-confirmation h2 { font-size: 48px; }
.tv-confirmation .draw-confirmation-detail { padding: 30px; }
.tv-confirmation .draw-confirmation-detail strong { font-size: 32px; }
.tv-confirmation .draw-confirmation-detail b { font-size: 64px; }
.tv-confirmation .draw-confirm-button { min-height: 76px; font-size: 25px; }
.tv-reveal { padding: 32px 0 18px; }
.tv-reveal .reveal-burst { width: 220px; height: 220px; font-size: 86px; }
.tv-reveal .rank { font-size: 25px; }
.tv-reveal h2 { font-size: 56px; }
.tv-reveal .btn { min-width: 260px; min-height: 70px; margin-top: 28px; font-size: 24px; }
.tv-lucky-page .modal.tv-welcome-shell { width: min(850px, calc(100% - 64px)); }
.tv-session-welcome { display: grid; justify-items: center; gap: 23px; padding: 28px 6px 18px; text-align: center; }
.tv-welcome-mark { width: 124px; height: 124px; display: grid; place-items: center; border-radius: 32px; background: #FFE135; color: #111; font-size: 66px; font-weight: 950; box-shadow: 0 0 60px rgba(255,225,53,.25); }
.tv-welcome-mark:has(img) { background: transparent; box-shadow: none; }
.tv-welcome-mark img { width: 100%; height: 100%; object-fit: contain; }
.tv-welcome-guest { margin: 10px 0 0; color: #fff; font-size: 34px; font-weight: 850; }
.tv-welcome-guest strong { color: #FFE135; margin-left: 7px; font-size: 42px; }
.tv-session-welcome h2 { max-width: 680px; margin: 0; font-size: 54px; line-height: 1.15; }
.tv-welcome-countdown { display: flex; align-items: baseline; justify-content: center; gap: 11px; color: var(--muted); font-size: 24px; }
.tv-welcome-countdown strong { color: #FFE135; font-size: 72px; line-height: 1; }
.tv-session-welcome .btn { min-width: 330px; min-height: 76px; margin-top: 5px; font-size: 25px; }
.tv-return-notice { margin-top: 32px; display: flex; justify-content: center; align-items: baseline; gap: 12px; color: var(--muted); }
.tv-return-notice strong { color: #FFE135; font-size: 68px; line-height: 1; }
.tv-return-notice span { font-size: 22px; }
.tv-lucky-page .modal.tv-summary-shell { max-height: calc(100svh - 56px); overflow: hidden; }
.tv-final-summary { max-height: calc(100svh - 140px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 26px; text-align: left; }
.tv-summary-heading h2 { margin: 8px 0 7px; font-size: 52px; }
.tv-summary-heading p { margin: 0; color: var(--muted); font-size: 20px; }
.tv-summary-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 12px; padding: 3px 10px 3px 3px; scrollbar-color: #FFE135 #24251e; }
.tv-summary-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 20px; padding: 18px; border: 1px solid #494a42; border-radius: 19px; background: linear-gradient(135deg, rgba(255,225,53,.09), rgba(255,255,255,.025)); }
.tv-summary-rank { min-height: 76px; display: grid; place-items: center; padding: 10px; border-radius: 14px; background: #FFE135; color: #111; font-size: 27px; font-weight: 950; text-align: center; }
.tv-summary-prize { min-width: 0; display: grid; gap: 7px; }
.tv-summary-prize small { color: #d4c66c; font-size: 17px; font-weight: 850; }
.tv-summary-prize strong { font-size: 27px; line-height: 1.3; overflow-wrap: anywhere; }
.tv-summary-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 24px; padding-top: 2px; }
.tv-summary-footer [data-tv-print-state] { grid-column: 1 / -1; margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.tv-summary-footer .tv-return-notice[hidden] { display: none; }
.tv-summary-footer .tv-return-notice { grid-column: 1; grid-row: 2; }
.tv-summary-footer #tvFinishSession { grid-column: 2; grid-row: 2; }
.tv-summary-footer .tv-return-notice { margin-top: 0; justify-content: flex-start; }
.tv-summary-footer .btn { min-width: 280px; min-height: 72px; font-size: 22px; }

@media (max-width: 760px) {
  .tv-game-topbar, .tv-game-main { width: min(calc(100% - 28px), 1040px); }
  .tv-game-topbar { min-height: 82px; }
  .tv-game-brand { font-size: 18px; }
  .tv-game .lucky-legend { display: none; }
  .tv-game-head { align-items: stretch; flex-direction: column; }
  .tv-game .lucky-ticket-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .tv-lucky-page .modal { width: min(100% - 24px, 820px); padding: 24px; }
  .tv-session-welcome { gap: 17px; padding-top: 14px; }
  .tv-welcome-mark { width: 92px; height: 92px; border-radius: 25px; font-size: 50px; }
  .tv-welcome-guest { font-size: 26px; }
  .tv-welcome-guest strong { font-size: 32px; }
  .tv-session-welcome h2 { font-size: 40px; }
  .tv-session-welcome .btn { width: 100%; min-width: 0; }
  .tv-final-summary { max-height: calc(100svh - 72px); gap: 18px; }
  .tv-summary-heading h2 { font-size: 38px; }
  .tv-summary-item { grid-template-columns: 96px minmax(0, 1fr); padding: 13px; }
  .tv-summary-rank { min-height: 62px; font-size: 21px; }
  .tv-summary-prize strong { font-size: 21px; }
  .tv-summary-footer { align-items: stretch; grid-template-columns: minmax(0, 1fr); }
  .tv-summary-footer #tvFinishSession { grid-column: 1; grid-row: 3; }
  .tv-summary-footer .btn { width: 100%; min-width: 0; }
  .draw-history-filter { grid-template-columns: 1fr; }
  .draw-history-filter-actions .btn { flex: 1; }
  .draw-history-meta { grid-template-columns: 1fr; }
  .draw-history-prize { grid-template-columns: 90px minmax(0, 1fr) auto; }
}

@media (max-width: 1240px) {
  .lottery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 55px; }
  .hero-stat { justify-self: stretch; }
  .dashboard, .draw-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; display: flex; overflow-x: auto; }
  .side-panel button { white-space: nowrap; width: auto; }
  .draw-sidebar { position: static; }
  .lottery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .draw-catalog, .draw-catalog-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lucky-ticket-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1480px); }
  .topbar { min-height: 70px; }
  .brand { gap: 9px; }
  .brand-logo { width: 48px; height: 48px; }
  .brand-name { font-size: 14px; }
  .nav a:not(.always) { display: none; }
  .private-badge { padding: 7px 9px; font-size: 0; }
  .private-badge::after { content: "私網"; font-size: 11px; }
  .hero { padding-top: 42px; }
  .lottery-grid { grid-template-columns: 1fr; }
  .draw-catalog, .draw-catalog-skeleton, .draw-detail-summary, .session-entry-grid { grid-template-columns: 1fr; }
  .tv-target-options { grid-template-columns: 1fr 1fr; }
  .lucky-topbar { align-items: flex-start; padding: 14px 0; }
  .lucky-legend { gap: 9px; flex-direction: column; align-items: flex-start; }
  .lucky-head { align-items: stretch; flex-direction: column; padding-top: 30px; }
  .lucky-session-count { align-self: flex-start; }
  .lucky-ticket-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .lucky-ticket { padding: 10px 8px 8px; border-radius: 12px; }
  .toolbar, .page-head { align-items: stretch; flex-direction: column; }
  .filter-pills { overflow-x: auto; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 760px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .prize-row { grid-template-columns: 74px 1fr 70px 38px; }
  .ticket-area { padding: 15px; }
  .ticket-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .prize-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .prize-card h3 { overflow-wrap: anywhere; font-size: 16px; }
  .prize-quantity-summary > strong { font-size: 17px; }
  .prize-quantity-summary > .prize-exhausted { font-size: 16px; padding: 7px 9px; }
  .prize-card .rank-box { width: 48px; height: 48px; }
  .rank-box { width: 58px; height: 58px; }
  .probability { grid-column: 2; text-align: left; }
}
.receipt-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
.receipt-preview { width: 100%; background: #fff; color: #111; padding: 22px; font-size: 14px; overflow-wrap: anywhere; box-shadow: 0 5px 20px #0005; }
.receipt-preview h3 { font-size: 17px; color: #111; }
.receipt-preview p { margin: 12px 0; color: #111; }
.receipt-preview img { display: block; width: 200px; max-width: 100%; margin: 14px auto; image-rendering: pixelated; }
.receipt-preview small { display: block; text-align: center; color: #444; }
[data-pair-result] input { width: 100%; font-family: monospace; }
@media (max-width: 680px) { .receipt-layout { grid-template-columns: 1fr; } .receipt-preview { max-width: 320px; margin: auto; } }
.public-activity-section { margin-top: 20px; padding-bottom: 20px; }
.public-activity-notice { margin: 20px 0 64px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.public-activity-notice h3 { margin: 0 0 16px; font-size: 20px; line-height: 1.5; }
.public-activity-notice ol { margin: 0; padding-left: 24px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.public-activity-notice li + li { margin-top: 10px; }
.public-activity-section .page-head h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.public-history-scroll { --history-row-height: 80px; max-height: calc(58px + 20 * var(--history-row-height)); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 18px; scrollbar-color: #ffd700 #20221e; }
.public-history-scroll:focus-visible { outline: 2px solid #ffd700; outline-offset: 4px; }
.public-history-table { min-width: 0; }
.public-history-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.5fr); align-items: center; gap: 16px; height: var(--history-row-height); box-sizing: border-box; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.public-history-row:last-child { border-bottom: 0; }
.public-history-row > div { min-width: 0; display: grid; gap: 5px; }
.public-history-guest b { font-size: 18px; }
.public-history-guest time { color: var(--muted); font-size: 12px; line-height: 1.4; }
.public-history-prize strong { font-size: 17px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.public-history-prize > span { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.public-history-head small { font-size: 12px; font-weight: 500; }
.public-history-row strong { color: #ffd700; }
.public-history-head { position: sticky; z-index: 1; top: 0; height: 56px; background: #24251f; font-weight: 850; color: var(--muted); }
.public-ticket-legend { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 18px; color: var(--muted); }
.public-ticket-legend span { display: inline-flex; align-items: center; gap: 8px; }
.public-ticket-legend i { width: 15px; height: 15px; border-radius: 4px; border: 1px solid #d8c39e; background: #242039; }
.public-ticket-legend i.revealed { background: #666; border-color: #e5e4e2; }
.public-ticket-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.public-ticket { position: relative; min-width: 0; min-height: 150px; border-radius: 13px; padding: 12px; color: #fff; display: flex; flex-direction: column; }
.public-ticket.is-closed { border: 1px solid #d8c39e; background: linear-gradient(135deg, #45405f, #242039 55%, #141020); }
.public-ticket.is-open { border: 1px solid #e5e4e2; background: linear-gradient(135deg, #4a4a4a, #212121); }
.public-ticket > b { font-size: 21px; line-height: 1; }
.public-ticket > div { display: grid; gap: 7px; text-align: center; margin: auto 0; overflow-wrap: anywhere; }
.public-ticket > div strong { color: #ffd700; font-size: 17px; }
.public-ticket > div span { font-size: 12px; line-height: 1.4; }
.public-ticket-mystery { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 0; }
.public-ticket-mystery img { width: auto; height: 76px; max-width: 68%; object-fit: contain; opacity: .55; filter: brightness(.8) saturate(.8); }
@media (max-width: 1100px) { .public-ticket-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 760px) { .public-ticket-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 480px) { .public-ticket-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; } .public-ticket { min-height: 135px; padding: 10px 7px; } }
