/* 現場票選（vote / screen / admin）— 沿用 styles.css 的色票與字體 */

.vpage [hidden] { display: none !important; }
.vpage { min-height: 100svh; background:
  radial-gradient(80% 50% at 50% 115%, rgba(255, 107, 26, .22), transparent 70%),
  radial-gradient(60% 40% at 50% -10%, rgba(29, 92, 255, .18), transparent 70%),
  var(--bg); }

.vnav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--gutter); border-bottom: 1px solid var(--line); }
.vnav__back { font-size: 13px; letter-spacing: .12em; color: var(--ink-2); text-decoration: none; }
.vnav__back:hover { color: var(--amber); }

/* ── status pill ── */
.vstatus { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 14px; font-weight: 500; letter-spacing: .08em; }
.vstatus i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.vstatus.is-open { border-color: rgba(52, 199, 89, .6); color: #8ff0a8; }
.vstatus.is-open i { background: #34c759; box-shadow: 0 0 0 0 rgba(52, 199, 89, .7); animation: pulse 1.6s infinite; }
.vstatus.is-closed { color: var(--ink-2); }
.vstatus.is-error { border-color: rgba(255, 107, 26, .6); color: var(--amber); }
.vstatus.is-error i { background: var(--orange); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }

/* ── vote page ── */
.vote { width: min(100% - var(--gutter) * 2, 960px); margin: 0 auto; padding: 32px 0 140px; }
.vote__title { margin: 14px 0 18px; font-size: clamp(32px, 6vw, 52px); font-weight: 700; letter-spacing: .08em; line-height: 1.2; }
.vrole { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.vrole__label { margin-right: 4px; font-size: 13px; letter-spacing: .14em; color: var(--ink-3); }
.vrole button { padding: 8px 14px; font: inherit; font-size: 14px; letter-spacing: .06em; color: var(--ink-2); background: transparent; border: 1px solid var(--line-2); border-radius: 99px; cursor: pointer; }
.vrole button:hover { color: var(--ink); border-color: var(--ink-3); }
.vrole button.is-active { color: #140700; font-weight: 700; background: linear-gradient(90deg, var(--orange), var(--amber)); border-color: transparent; }
@media (max-width: 420px) {
  .vrole { gap: 6px; }
  .vrole__label { display: none; }
  .vrole button { flex: 1; padding: 8px 6px; font-size: 13px; letter-spacing: .02em; }
}
.vdialog__label { display: block; margin: 14px 0 8px; font-size: 14px; color: var(--ink-2); }
.vdialog__input { width: 100%; padding: 13px 14px; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; }
.vdialog__input:focus { outline: none; border-color: var(--amber); }
.vdialog__err { margin-top: 10px; font-size: 14px; color: #ff8a7a; }
.vrole button:disabled { opacity: .35; cursor: not-allowed; }
.vlock { margin: -6px 0 14px; font-size: 13px; color: var(--ink-3); }
.vjudge { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: -4px 0 16px; padding: 10px 14px; font-size: 14px; color: var(--ink-2); border: 1px solid rgba(255, 165, 60, .5); background: rgba(255, 107, 26, .08); border-radius: 4px; }
.vjudge b { font-size: 17px; color: var(--ink); letter-spacing: .06em; }
.vtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.vtab { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-align: left; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font: inherit; transition: border-color .2s, color .2s, background .2s; }
.vtab__name { font-size: 18px; font-weight: 700; letter-spacing: .08em; }
.vtab__sub { font-family: var(--display); font-size: 11px; font-weight: 500; letter-spacing: .2em; color: var(--ink-3); }
.vtab.is-active { color: var(--ink); border-color: var(--orange); background: linear-gradient(180deg, rgba(255, 107, 26, .14), rgba(255, 107, 26, .02)), var(--panel); }
.vtab.is-voted .vtab__sub { color: #8ff0a8; font-family: var(--sans); letter-spacing: .1em; }
.vhint { margin: 18px 0 14px; color: var(--ink-2); font-size: 15px; }

.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .vgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .vgrid { grid-template-columns: repeat(5, 1fr); } }
.vcard { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 30px 12px 14px; text-align: left; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font: inherit; transition: border-color .2s, transform .2s, opacity .2s, box-shadow .2s; }
.vcard:not(:disabled):hover { border-color: rgba(255, 165, 60, .6); }
.vcard:not(:disabled):active { transform: scale(.98); }
.vcard__no { position: absolute; top: 8px; left: 12px; font-family: var(--display); font-size: 12px; font-weight: 500; letter-spacing: .14em; color: var(--ink-3); }
.vcard__name { margin-top: 4px; font-size: 16px; font-weight: 500; letter-spacing: .04em; line-height: 1.35; }
.vcard__en { font-family: var(--display); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); line-height: 1.3; }
.vcard.is-picked { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255, 107, 26, .55), 0 0 28px rgba(255, 107, 26, .25); }
.vcard.is-picked::after, .vcard.is-mine::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; color: #140700; background: linear-gradient(90deg, var(--orange), var(--amber)); }
.vcard.is-mine { border-color: rgba(52, 199, 89, .7); }
.vcard.is-mine::after { background: #34c759; color: #04210c; }
.vcard__badge { align-self: flex-start; margin-top: 4px; padding: 2px 8px; font-size: 11px; letter-spacing: .1em; color: #04210c; background: #8ff0a8; border-radius: 2px; }
.vgrid.is-disabled .vcard:disabled { cursor: default; }
.vgrid.is-locked .vcard:not(.is-mine) { opacity: .38; }
.vgrid.is-disabled:not(.is-locked) .vcard { opacity: .55; }

.vlogo { display: block; width: 100%; height: 56px; object-fit: contain; padding: 6px 8px; background: #fff; border-radius: 2px; }
.vlogo--dark { background: #1b1c22; box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 12px; }
.vlogo--text { display: grid; place-items: center; font-family: var(--display); font-size: 12px; color: #111; }

.vdone { margin-top: 24px; padding: 22px; text-align: center; border: 1px solid rgba(52, 199, 89, .5); background: rgba(52, 199, 89, .06); border-radius: 4px; color: var(--ink-2); }
.vdone__big { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: .08em; margin-bottom: 6px; }

.vbar { position: fixed; z-index: 120; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); background: rgba(9, 9, 12, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line-2); }
.vbar__pick { min-width: 0; font-size: 17px; font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbar__pick small { display: block; font-size: 12px; color: var(--amber); letter-spacing: .14em; }
.vbar .btn { flex: none; }

.vdialog { width: min(92vw, 420px); padding: 0; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; }
.vdialog::backdrop { background: rgba(0, 0, 0, .7); }
.vdialog form { padding: 26px 24px 22px; }
.vdialog__award { font-size: 13px; letter-spacing: .2em; color: var(--amber); }
.vdialog__team { margin: 8px 0 10px; font-size: 22px; font-weight: 700; line-height: 1.4; }
.vdialog__note { font-size: 14px; color: var(--ink-2); }
.vdialog__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.vbtn-ghost { display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: .1em; line-height: 1; color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 2px; cursor: pointer; }
.vbtn-ghost:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.vbtn-ghost:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.vbtn-danger { border-color: rgba(255, 90, 70, .6); color: #ff8a7a; }

.vtoast { position: fixed; z-index: 130; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; font-size: 15px; color: #111; background: var(--ink); border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* ── big screen ── */
.spage { overflow: hidden; }
.screen { height: 100svh; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 2.2vh 2.4vw; padding: 3.5vh 3vw 3vh; }
.screen__head { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.screen__title { margin-top: 1vh; font-size: clamp(28px, 3.4vw, 64px); font-weight: 700; letter-spacing: .1em; line-height: 1.15; }
.screen__legend { margin-top: .8vh; font-size: clamp(12px, .95vw, 18px); color: var(--ink-2); letter-spacing: .06em; }
.screen__meta { display: flex; align-items: center; gap: 28px; margin-right: calc(13vh + 2.4vw); }
.screen__voters { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); font-size: clamp(14px, 1.2vw, 22px); }
.screen__voters b { font-family: var(--display); font-weight: 300; font-size: clamp(36px, 3.6vw, 72px); color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.screen .vstatus { font-size: clamp(14px, 1.1vw, 20px); }
.screen__boards { display: contents; }
.board { min-height: 0; display: flex; flex-direction: column; padding: 2vh 1.6vw; border: 1px solid var(--line); background: rgba(14, 15, 19, .85); border-radius: 6px; }
.board__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 1.4vh; }
.board__head h2 { font-size: clamp(22px, 2.2vw, 42px); font-weight: 700; letter-spacing: .1em; }
.board__head span { font-family: var(--display); font-size: clamp(10px, .8vw, 15px); letter-spacing: .3em; color: var(--orange); }
.board__total { margin-left: auto; color: var(--ink-2); font-size: clamp(13px, 1vw, 18px); }
.board__total b { font-family: var(--display); font-weight: 400; font-size: 1.6em; color: var(--ink); font-variant-numeric: tabular-nums; }
.board__rows { flex: 1; display: grid; grid-template-rows: repeat(10, 1fr); gap: .9vh; min-height: 0; }
.brow { display: grid; grid-template-columns: 2.2em minmax(70px, 8vw) minmax(5em, 10vw) 1fr 2.6em; align-items: center; gap: .9vw; min-height: 0; font-size: clamp(12px, 1.05vw, 20px); }
.brow__no { font-family: var(--display); color: var(--ink-3); letter-spacing: .1em; }
.blogo { display: block; width: 100%; height: 100%; max-height: 4.4vh; object-fit: contain; padding: .3vh .4vw; background: #fff; border-radius: 2px; }
.blogo--dark { background: #1b1c22; }
.blogo--text { display: grid; place-items: center; font-size: .7em; color: #111; }
.brow__name { font-weight: 500; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow__track { height: 62%; background: rgba(255, 255, 255, .06); border-radius: 2px; overflow: hidden; }
.brow__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--violet) 40%, var(--orange) 85%, var(--amber)); border-radius: 2px; transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.brow__n { text-align: right; font-family: var(--display); font-weight: 500; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.brow.is-lead .brow__name, .brow.is-lead .brow__n { color: var(--amber); }
.brow.is-lead .brow__fill { box-shadow: 0 0 18px rgba(255, 140, 40, .7); }
.screen__qr { position: fixed; top: 3vh; right: 3vw; display: flex; align-items: center; gap: 1vw; }
.screen__qr > div:last-child { display: none; }
.screen__qrcode { width: 13vh; height: 13vh; padding: .8vh; background: #fff; border-radius: 6px; }
.screen__qrcode img, .screen__qrcode canvas { width: 100% !important; height: 100% !important; }
.screen__qrtitle { font-size: clamp(12px, 1vw, 18px); font-weight: 500; }
.screen__qrurl { font-family: var(--display); font-size: clamp(11px, .8vw, 15px); color: var(--ink-2); }
@media (max-width: 900px) { /* 小螢幕預覽時改成上下排 */
  .spage { overflow: auto; }
  .screen { height: auto; grid-template-columns: 1fr; }
  .screen__meta { margin-right: 0; }
  .screen__qr { position: static; grid-row: 2; }
  .screen__qr > div:last-child { display: block; }
  .board__rows { grid-template-rows: none; }
  .brow { grid-template-columns: 2em 72px 6em 1fr 2.4em; font-size: 13px; }
  .blogo { max-height: 30px; }
}

/* ── admin ── */
.admin { width: min(100% - var(--gutter) * 2, 880px); margin: 0 auto; padding: 40px 0 80px; }
.admin label { display: block; margin: 18px 0 8px; font-size: 14px; color: var(--ink-2); letter-spacing: .1em; }
.admin input { flex: 1; min-width: 0; padding: 13px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px; }
.admin input:focus { outline: none; border-color: var(--amber); }
.admin__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.admin__err { margin-top: 10px; color: #ff8a7a; font-size: 14px; }
.admin__switches { display: grid; gap: 14px; }
@media (min-width: 760px) { .admin__switches { grid-template-columns: 1fr 1fr; } }
.admin__switch { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; }
.admin__h { font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.admin__card { display: grid; gap: 12px; margin-top: 28px; padding: 22px; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; }
.admin__inline { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; color: var(--ink) !important; font-size: 15px !important; letter-spacing: .04em !important; }
.admin__inline input { width: 9em; flex: none; }
.admin__inline input[type=number] { width: 5.5em; text-align: center; }
.admin__counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.admin__counts b { margin: 0 14px 0 2px !important; }
.admin__counts span { font-size: 13px; color: var(--ink-3); }
.admin__switch .vstatus { justify-self: start; font-size: 16px; }
.admin__switch .btn, .admin__switch .vbtn-ghost { min-width: 140px; padding-block: 16px; font-size: 16px; }
.admin__note { font-size: 13px; color: var(--ink-3); }
.admin__links { display: flex; flex-wrap: wrap; gap: 20px; margin: 22px 0; }
.admin__stats > p { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.admin__stats > p b { font-family: var(--display); font-size: 28px; color: var(--ink); margin-left: 8px; }
.admin__tables { display: grid; gap: 16px; }
@media (min-width: 720px) { .admin__tables { grid-template-columns: 1fr 1fr; } }
.admin__table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--panel); border: 1px solid var(--line); }
.admin__table caption { padding: 10px 0; text-align: left; font-weight: 700; letter-spacing: .08em; }
.admin__table caption span { margin-left: 10px; font-weight: 400; color: var(--ink-3); font-size: 13px; }
.admin__table th { padding: 8px 10px; font-size: 12px; font-weight: 500; color: var(--ink-3); text-align: right; letter-spacing: .06em; }
.admin__table th:nth-child(2) { text-align: left; }
.admin__table td { padding: 9px 10px; border-top: 1px solid var(--line); }
.admin__table td:nth-child(n+3) { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.admin__table td:last-child { color: var(--ink); font-weight: 600; }
.admin__table td:first-child { width: 2.5em; color: var(--ink-3); font-family: var(--display); }
.admin__table td:last-child { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
.admin__table tbody tr:first-child td:nth-child(2), .admin__table tbody tr:first-child td:last-child { color: var(--amber); }
.admin__danger { margin-top: 36px; padding: 16px 18px; border: 1px solid rgba(255, 90, 70, .35); border-radius: 4px; }
.admin__danger summary { cursor: pointer; color: #ff8a7a; font-size: 14px; letter-spacing: .06em; }
.admin__danger p { margin: 12px 0; font-size: 14px; color: var(--ink-2); }

/* ── QR 投影頁（/qr）── */
.qpage { overflow: hidden; }
.qr { height: 100svh; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5vw; padding: 6vh 7vw; }
.qr__title { margin: 2.4vh 0 3vh; font-size: clamp(44px, 6.4vw, 128px); font-weight: 700; line-height: 1.15; letter-spacing: .08em; }
.qr__awards { font-size: clamp(20px, 2.2vw, 44px); font-weight: 500; letter-spacing: .12em; color: var(--amber); }
.qr__awards i { font-style: normal; color: var(--ink-3); padding: 0 .2em; }
.qr .vstatus { margin-top: 3.4vh; font-size: clamp(14px, 1.3vw, 24px); }
.qr__url { margin-top: 2.4vh; font-family: var(--display); font-size: clamp(14px, 1.3vw, 26px); color: var(--ink-2); letter-spacing: .04em; }
.qr__code { width: min(82vh, 52vw); aspect-ratio: 1; padding: 2.2vh; background: #fff; border-radius: 12px; box-shadow: 0 0 80px rgba(255, 140, 40, .28); }
.qr__code img, .qr__code canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
@media (max-width: 900px), (orientation: portrait) {
  .qpage { overflow: auto; }
  .qr { height: auto; min-height: 100svh; grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qr__code { width: min(86vw, 70vh); }
}
