* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(1200px 700px at 70% -10%, #1b2b5c 0, #0a1330 45%, #050a18 100%); color: #f6ead0; font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: #f6cf72; }
button { font-family: inherit; }
.btn { font-size: 16px; font-weight: 800; padding: 10px 16px; border-radius: 12px; cursor: pointer; border: 2px solid #e9b44c; background: #13224b; color: #f6ead0; }
.btn:hover { background: #1b2e60; }
.btn.gold { background: linear-gradient(180deg, #f6cf72, #e9b44c); color: #1a1408; }
.btn.ghost { background: transparent; border-color: rgba(233,180,76,.5); }
.btn.danger { border-color: #ff8a7a; color: #ffb3a8; background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #3fd6c6; outline-offset: 2px; }
.muted { color: #a9b3cf; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 22px; letter-spacing: .5px; }
.brand b { color: #e9b44c; }
.brand svg { width: 46px; height: 34px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(420px, 100%); background: rgba(9,18,42,.92); border: 2px solid #e9b44c; border-radius: 20px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login h1 { margin: 14px 0 4px; font-size: 26px; }
.login label { display: block; margin-top: 18px; font-weight: 700; }
.login input { width: 100%; margin-top: 6px; padding: 12px; font-size: 18px; border-radius: 10px; border: 2px solid rgba(233,180,76,.5); background: #0a1430; color: #fff; }
.login .btn { width: 100%; margin-top: 18px; font-size: 18px; padding: 12px; }
.err { color: #ff8a7a; min-height: 1.3em; margin-top: 10px; font-weight: 700; }

/* host */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 2px solid rgba(233,180,76,.6); background: rgba(10,20,50,.9); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.topbar .sp { flex: 1; }
.view { display: none; padding: 18px; max-width: 1500px; margin: 0 auto; }
.view.on { display: block; }
.home h2 { font-size: 30px; margin: 10px 0 4px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.choice { text-align: left; padding: 22px; border-radius: 20px; border: 2px solid rgba(233,180,76,.6); background: linear-gradient(180deg, rgba(23,38,82,.95), rgba(10,20,50,.95)); color: #f6ead0; cursor: pointer; min-height: 190px; display: flex; flex-direction: column; gap: 8px; transition: transform .1s, box-shadow .2s; }
.choice:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(233,180,76,.2); }
.choice .t { font-size: 26px; font-weight: 900; }
.choice .d { color: #cfd6ea; line-height: 1.4; }
.choice .s { margin-top: auto; color: #3fd6c6; font-weight: 800; }
.choice.primary { border-color: #f6cf72; box-shadow: 0 0 0 3px rgba(246,207,114,.25); }
.choice.live .t { color: #ff8a8a; }
.panel { margin-top: 22px; padding: 18px; border-radius: 16px; border: 1px solid rgba(233,180,76,.35); background: rgba(9,18,42,.8); }
.panel h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: 1px; color: #f6cf72; }
.tok { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.tok .lbl { font-weight: 800; } .tok .meta { color: #a9b3cf; font-size: 14px; flex: 1; }
.newtok { word-break: break-all; background: #0a1430; border: 1px dashed #3fd6c6; padding: 10px; border-radius: 10px; margin-top: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row input { padding: 9px; border-radius: 10px; border: 2px solid rgba(233,180,76,.4); background: #0a1430; color: #fff; font-size: 15px; }

.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 12px; }
.rail .box { padding: 14px; border-radius: 14px; border: 1px solid rgba(233,180,76,.35); background: rgba(9,18,42,.85); }
.rail h4 { margin: 0 0 10px; font-size: 14px; letter-spacing: 2px; color: #f6cf72; text-transform: uppercase; }
.rail .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail .btn { width: 100%; }
.hint-text { margin-top: 10px; padding: 10px; background: #f6ead0; color: #1a1408; border-radius: 10px; font-size: 15px; line-height: 1.35; display: none; }
.hint-text.on { display: block; }
.stat { font-size: 14px; color: #cfd6ea; line-height: 1.5; }
.bars .b { display: grid; grid-template-columns: 1fr 44px; gap: 6px; font-size: 14px; margin-top: 6px; }
.bars .track { grid-column: 1 / -1; height: 10px; background: rgba(255,255,255,.12); border-radius: 5px; overflow: hidden; } .bars .track i { display: block; height: 100%; background: #3fd6c6; }
.timer { font-size: 30px; font-weight: 900; color: #3fd6c6; font-variant-numeric: tabular-nums; }
.copy { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; color: #f6cf72; }
.flash { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #f6ead0; color: #1a1408; padding: 10px 16px; border-radius: 10px; font-weight: 700; display: none; z-index: 30; max-width: 90vw; }
.flash.on { display: block; }
.conn { font-size: 13px; padding: 4px 10px; border-radius: 99px; border: 1px solid rgba(63,214,198,.6); color: #3fd6c6; }
.conn.off { color: #ff8a7a; border-color: #ff8a7a; }
.journal .entry { padding: 14px; border-radius: 14px; border: 1px solid rgba(233,180,76,.3); background: rgba(9,18,42,.85); margin-top: 12px; }
.journal .entry h4 { margin: 0 0 6px; color: #f6cf72; }
.journal .entry p { margin: 4px 0; white-space: pre-wrap; line-height: 1.4; }
.journal .entry .q { color: #3fd6c6; font-weight: 700; }

@media (max-width: 1050px) { .play { grid-template-columns: 1fr; } .cards { grid-template-columns: 1fr; } .rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

/* stream (OBS) */
body.stream-body { background: #000; overflow: hidden; }
.stream-root { position: fixed; inset: 0; display: grid; place-items: center; }
.stream-root .stage-wrap { width: min(100vw, calc(100vh * 16 / 9)); border-radius: 0; }
.standby-card { margin: auto; text-align: center; padding: 40px; }
.standby-card h1 { font-size: 72px; margin: 0; color: #f6ead0; } .standby-card h1 b { color: #e9b44c; }
.standby-card p { font-size: 30px; color: #a9b3cf; }

/* vote (phone) */
.vote { max-width: 520px; margin: 0 auto; padding: 18px; min-height: 100vh; display: flex; flex-direction: column; }
.vote header { display: flex; justify-content: center; padding: 6px 0 14px; border-bottom: 2px solid rgba(233,180,76,.5); }
.vote main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.vote h1 { font-size: 26px; text-align: center; margin: 6px 0; }
.vote .vtimer { text-align: center; font-size: 48px; font-weight: 900; color: #3fd6c6; font-variant-numeric: tabular-nums; }
.vote .vopt { width: 100%; display: flex; gap: 14px; align-items: center; padding: 20px; border-radius: 18px; border: 3px solid #e9b44c; background: #13224b; color: #fff; font-size: 22px; font-weight: 800; cursor: pointer; text-align: left; }
.vote .vopt .k { background: #f6ead0; color: #111; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.vote .vopt:disabled { opacity: .5; }
.vote .vopt.mine { border-color: #3fd6c6; opacity: 1; box-shadow: 0 0 0 4px rgba(63,214,198,.3); }
.vote .vmsg { text-align: center; font-size: 18px; min-height: 1.4em; font-weight: 700; color: #f6cf72; }
.vote .wait { text-align: center; color: #a9b3cf; font-size: 20px; line-height: 1.5; }
.vote footer { text-align: center; color: #6f7a98; font-size: 13px; padding-top: 10px; }
