/* Vixtention — app chrome: login, menu, stage, live chat, phone */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* night-street ambience (shared background) */
.ambience { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(255, 184, 28, .13), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(77, 107, 255, .12), transparent 60%),
    var(--bg); }
.ambience i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ffcf6b; box-shadow: 0 0 20px 6px rgba(255, 190, 70, .45); opacity: .0; animation: vx-lamp 14s linear infinite; }
@keyframes vx-lamp { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.6); } }
.ambience::after { content: ''; position: absolute; inset: -50%; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>"); opacity: .06; mix-blend-mode: overlay; }

.brand { font: 400 30px var(--f-head); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; }
.brand .dot-live { margin-right: 12px; }
.brand b { color: var(--gold); font-weight: 400; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(255, 66, 88, .7); animation: vx-pulse 1.6s infinite; display: inline-block; }
@keyframes vx-pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 66, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 66, 88, 0); } }

.btn { font: 600 17px var(--f-body); border: 0; border-radius: 999px; padding: 14px 26px; cursor: pointer; color: #140e00; background: var(--gold); transition: transform .2s var(--ease), box-shadow .2s, background .2s; display: inline-flex; align-items: center; gap: 10px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -10px rgba(255, 184, 28, .8); }
.btn.big { font-size: 22px; padding: 20px 40px; }
.btn.ghost { background: rgba(255, 255, 255, .06); color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: rgba(255, 184, 28, .6); box-shadow: none; }
.btn.danger:hover { border-color: var(--hot); color: #ffd0d6; }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* ---------------- login */
.login { position: relative; z-index: 1; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: rgba(18, 16, 28, .75); backdrop-filter: blur(18px); border: 1.5px solid var(--line); border-radius: 28px; padding: 40px 34px; box-shadow: 0 40px 120px -40px #000; }
.login-card h1 { font: 400 54px var(--f-head); text-transform: uppercase; margin: 22px 0 6px; line-height: 1; }
.login-card p { color: var(--mute); margin: 0 0 26px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font: 500 13px var(--f-mono); color: var(--mute); margin-bottom: 7px; letter-spacing: .06em; text-transform: uppercase; }
.field input, .phone textarea, .phone input { width: 100%; font: 500 17px var(--f-body); color: var(--ink); background: rgba(255, 255, 255, .05); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; outline: none; transition: border-color .2s, background .2s; }
.field input:focus, .phone textarea:focus, .phone input:focus { border-color: var(--gold); background: rgba(255, 184, 28, .06); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 10px; }
.err { color: #ff8f9c; font-size: 15px; min-height: 22px; margin-top: 12px; }
.hint { font-size: 13px; color: var(--mute); margin-top: 18px; text-align: center; }

/* ---------------- menu (before start) */
.screen { position: relative; z-index: 1; height: 100%; }
.menu { display: grid; grid-template-rows: auto 1fr auto; height: 100%; padding: 34px 48px 28px; }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-top .actions { display: flex; gap: 10px; }
.menu-mid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 60px; }
.menu-title .kick { font: 500 18px var(--f-mono); color: var(--gold); letter-spacing: .08em; }
.menu-title h1 { font: 400 clamp(80px, 11vw, 190px) var(--f-head); line-height: 1.02; text-transform: uppercase; margin: 16px 0 24px; }
.menu-title h1 span { display: block; color: transparent; -webkit-text-stroke: 2px var(--gold); }
.menu-title p { font-size: 22px; color: var(--mute); margin: 0 0 34px; max-width: 560px; }
.qr-card { background: #fff; color: #111; border-radius: 30px; padding: 26px; text-align: center; box-shadow: 0 0 140px -30px rgba(255, 184, 28, .7); }
.qr-card img { width: min(42vh, 420px); height: min(42vh, 420px); display: block; }
.qr-card b { display: block; font: 400 30px var(--f-head); text-transform: uppercase; margin-top: 10px; }
.qr-card span { font: 600 15px var(--f-mono); color: #444; }
.lobby { border-top: 1.5px solid var(--line); padding-top: 20px; min-height: 120px; }
.lobby-head { display: flex; align-items: center; gap: 12px; font: 500 15px var(--f-mono); color: var(--mute); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.lobby-head b { color: var(--ink); font: 400 30px var(--f-head); }
.lobby-names { display: flex; flex-wrap: wrap; gap: 10px; max-height: 18vh; overflow: hidden; }
.lobby-names span { font: 600 19px var(--f-body); padding: 10px 20px; border-radius: 999px; background: var(--c, #333); color: #0b0a10; animation: vx-pop .5s var(--ease) both; }
.lobby-names .empty { background: none; color: var(--mute); font-weight: 400; animation: none; padding-left: 0; }
@keyframes vx-pop { from { transform: scale(.3) translateY(20px); opacity: 0; } 60% { transform: scale(1.12); } to { transform: none; opacity: 1; } }

/* ---------------- show: stage + chat */
.show { display: grid; grid-template-columns: 1fr clamp(320px, 24vw, 420px); height: 100%; }
.stage-col { position: relative; display: flex; flex-direction: column; min-width: 0; }
#stage { position: relative; flex: 1; overflow: hidden; cursor: pointer; }
.hud { height: 46px; display: flex; align-items: center; gap: 16px; padding: 0 22px; font: 500 14px var(--f-mono); color: var(--mute); }
.hud .bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.hud .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .6s var(--ease); }
.hud button { background: none; border: 1px solid var(--line); color: var(--mute); border-radius: 8px; padding: 6px 12px; font: 500 13px var(--f-mono); cursor: pointer; }
.hud button:hover { color: var(--ink); border-color: var(--gold); }

.chat { position: relative; display: flex; flex-direction: column; min-height: 0; border-left: 1.5px solid var(--line); background: rgba(12, 11, 19, .82); backdrop-filter: blur(14px); }
.chat-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.chat-head .row { display: flex; align-items: center; justify-content: space-between; }
.chat-head h2 { margin: 0; font: 600 16px var(--f-body); display: flex; align-items: center; gap: 10px; letter-spacing: .02em; }
.chat-head .count { font: 500 13px var(--f-mono); color: var(--mute); }
.chat-join { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.chat-join img { width: 92px; height: 92px; background: #fff; border-radius: 10px; padding: 5px; flex: 0 0 92px; }
.chat-join b { display: block; font: 400 22px var(--f-head); text-transform: uppercase; }
.chat-join span { font: 500 12px var(--f-mono); color: var(--mute); word-break: break-all; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 10px 20px; scroll-behavior: smooth; }
.msgs::-webkit-scrollbar { width: 6px; } .msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }
.msgs .empty { color: var(--mute); text-align: center; margin-top: 30%; padding: 0 30px; font-size: 15px; line-height: 1.5; }
.msg { position: relative; display: flex; gap: 12px; padding: 9px 10px; border-radius: 12px; animation: vx-msg .45s var(--ease) both; }
.msg:hover { background: rgba(255, 255, 255, .04); }
@keyframes vx-msg { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.msg.gone { animation: vx-gone .3s ease both; }
@keyframes vx-gone { to { opacity: 0; transform: translateX(-20px); height: 0; padding: 0; } }
.av { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 14px var(--f-body); color: #0b0a10; background: var(--c, #888); }
.msg-body { min-width: 0; font-size: 18px; line-height: 1.4; }
.msg-name { font-weight: 600; color: var(--c, var(--mute)); cursor: pointer; margin-right: 8px; font-size: 15px; }
.msg-name:hover { text-decoration: underline; }
.msg-time { font: 500 11px var(--f-mono); color: #6d6879; }
.msg-text { display: block; word-wrap: break-word; color: #ece8df; margin-top: 2px; }
.msg-del { position: absolute; right: 8px; top: 8px; opacity: 0; background: rgba(255, 66, 88, .15); color: #ff9aa6; border: 1px solid rgba(255, 66, 88, .4); border-radius: 8px; font: 600 12px var(--f-body); padding: 4px 9px; cursor: pointer; transition: opacity .15s; }
.msg:hover .msg-del { opacity: 1; }
.pop { position: fixed; z-index: 50; background: #1b1926; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px -10px #000; min-width: 200px; }
.pop button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); font: 500 15px var(--f-body); padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.pop button:hover { background: rgba(255, 66, 88, .15); color: #ffb3bc; }
.pop small { display: block; padding: 6px 12px 4px; color: var(--mute); font: 500 12px var(--f-mono); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60; background: #1b1926; border: 1px solid var(--line); padding: 12px 20px; border-radius: 14px; font-size: 15px; transition: .3s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { border-color: rgba(255, 66, 88, .55); color: #ffc2ca; }
.toast.good { border-color: rgba(30, 215, 96, .5); color: #c7f7d7; }

/* ---------------- phone */
.phone { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.ph-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ph-top .brand { font-size: 22px; }
.ph-me { font: 500 13px var(--f-mono); color: var(--mute); }
.ph-center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ph-center h1 { font: 400 52px var(--f-head); text-transform: uppercase; line-height: .95; margin: 0 0 12px; }
.ph-center p { color: var(--mute); margin: 0 0 22px; line-height: 1.5; }
.ph-center .btn { width: 100%; justify-content: center; margin-top: 12px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; color: var(--mute); font: 600 15px var(--f-body); padding: 11px; border-radius: 12px; cursor: pointer; }
.tabs button.on { background: var(--gold); color: #140e00; }
.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ask-box textarea { min-height: 150px; resize: none; line-height: 1.45; }
.ask-meta { display: flex; justify-content: space-between; font: 500 12px var(--f-mono); color: var(--mute); margin: 8px 2px 14px; }
.ask-box .btn { width: 100%; justify-content: center; }
.ask-note { color: var(--mute); font-size: 14px; line-height: 1.5; margin-top: 18px; text-align: center; }
.sent-list { margin-top: 18px; }
.viewer { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); touch-action: pan-y; }
.viewer .slide { pointer-events: auto; }
.v-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }
.v-ctrl .pos { font: 500 14px var(--f-mono); color: var(--mute); }
.v-ctrl .btn { padding: 11px 18px; }
.live-btn { background: var(--hot) !important; color: #fff !important; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow-y: auto; padding-bottom: 8px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--bg2); border: 1.5px solid var(--line); cursor: pointer; }
.thumb.on { border-color: var(--gold); }
.thumb .slide { pointer-events: none; }
.thumb .tag { position: absolute; left: 5px; bottom: 4px; font: 600 10px var(--f-mono); background: rgba(0, 0, 0, .6); padding: 2px 5px; border-radius: 5px; z-index: 2; }
.thumb .tag.live { background: var(--hot); }
.wait { text-align: center; color: var(--mute); padding: 40px 10px; line-height: 1.6; }
