:root {
  --bg: #080d17;
  --bg-deep: #050912;
  --surface: rgba(13, 23, 38, .9);
  --surface-strong: #101d30;
  --surface-soft: #13243a;
  --line: rgba(105, 222, 230, .24);
  --line-soft: rgba(143, 166, 194, .16);
  --ink: #eef8fb;
  --muted: #8fa4bc;
  --cyan: #60e6e6;
  --cyan-deep: #1c97ab;
  --magenta: #f16ac6;
  --lime: #baf34f;
  --orange: #ff9d4d;
  --violet: #ad8af0;
  --gold: #ffd166;
  --shadow: 0 22px 55px rgba(0, 0, 0, .3);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html { background: var(--bg-deep); }
body { min-width: 320px; margin: 0; overflow-x: hidden; background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.app-shell { position: relative; min-height: 100vh; isolation: isolate; background-color: var(--bg); background-image: linear-gradient(rgba(96, 230, 230, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(96, 230, 230, .035) 1px, transparent 1px); background-size: 48px 48px; }
.app-shell::after { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; background: linear-gradient(180deg, rgba(8, 13, 23, 0) 0, rgba(8, 13, 23, .76) 82%, var(--bg-deep) 100%); }
.ambient-fx { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.ambient-fx::before { position: absolute; top: 17%; left: -8%; width: 42vw; height: 1px; content: ""; background: var(--magenta); box-shadow: 0 0 16px rgba(241, 106, 198, .75); opacity: .42; transform: rotate(-22deg); animation: horizon-drift 12s ease-in-out infinite alternate; }
.ambient-fx::after { position: absolute; right: -12%; bottom: 24%; width: 48vw; height: 1px; content: ""; background: var(--cyan); box-shadow: 0 0 16px rgba(96, 230, 230, .8); opacity: .28; transform: rotate(16deg); animation: horizon-drift 16s ease-in-out infinite alternate-reverse; }
.scanline { position: absolute; inset: 0; opacity: .07; background: repeating-linear-gradient(0deg, transparent 0, transparent 5px, rgba(255,255,255,.18) 6px); animation: scan 11s linear infinite; }
.neon-ball { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 18px; font-weight: 850; color: var(--ink); background: #17283a; border: 1px solid currentColor; box-shadow: 0 0 10px currentColor, inset 7px -7px 16px rgba(0,0,0,.5), inset -6px 7px 14px rgba(255,255,255,.12); animation: ball-float 8s ease-in-out infinite; }
.neon-ball::before { position: absolute; top: 12px; left: 12px; width: 12px; height: 5px; border-radius: 50%; content: ""; background: rgba(255,255,255,.65); filter: blur(2px); transform: rotate(-28deg); }
.ball-cyan { top: 17%; right: 8%; color: var(--cyan); animation-delay: -2s; }
.ball-magenta { top: 66%; left: 4%; color: var(--magenta); animation-duration: 11s; animation-delay: -5s; transform: scale(.73); }
.ball-lime { right: 22%; bottom: 9%; color: var(--lime); animation-duration: 9s; animation-delay: -7s; transform: scale(.52); }
.topbar, main { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; height: 78px; margin: 0 auto; padding: 0 34px; border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; color: #071019; background: var(--cyan); border: 1px solid #c4ffff; border-radius: 50%; box-shadow: 0 0 9px var(--cyan), 0 0 26px rgba(96, 230, 230, .45); font-size: 20px; font-weight: 900; }
.brand strong { display: block; color: var(--ink); font-size: 18px; letter-spacing: 2px; text-shadow: 0 0 12px rgba(96,230,230,.34); }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: 1.5px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.device-chip { display: flex; align-items: center; gap: 7px; padding: 8px 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
.status-dot, .live-label i, .signal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(186,243,79,.1), 0 0 10px var(--lime); }
.avatar { width: 35px; height: 35px; border: 1px solid rgba(241,106,198,.8); border-radius: 50%; color: #210f25; background: var(--magenta); box-shadow: 0 0 16px rgba(241,106,198,.4); font-weight: 900; }
main { max-width: 1400px; margin: 0 auto; padding: 64px 34px 90px; }
.home-intro { display: flex; align-items: end; justify-content: space-between; margin-bottom: 45px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--cyan); font-size: 10px; letter-spacing: 2.5px; font-weight: 800; }
.signal-dot { width: 5px; height: 5px; animation: blink 1.4s ease-in-out infinite; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; color: var(--ink); font-size: clamp(39px, 5vw, 72px); line-height: .96; letter-spacing: -3px; font-weight: 900; text-shadow: 0 0 24px rgba(96,230,230,.18); }
h1 em { color: var(--magenta); font-style: normal; text-shadow: 0 0 19px rgba(241,106,198,.45); }
h2 { margin-bottom: 0; color: var(--ink); font-size: 22px; letter-spacing: -.3px; }
.intro-copy { margin: 0; color: var(--muted); font-size: 15px; }
.intro-stat { display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 9px; border: 1px solid rgba(186,243,79,.35); color: var(--muted); font-size: 12px; line-height: 1.4; background: rgba(13,23,38,.72); box-shadow: 0 0 21px rgba(186,243,79,.08); }
.stat-ring { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); background: #14232b; box-shadow: inset 0 0 17px rgba(186,243,79,.15), 0 0 18px rgba(186,243,79,.3); font-size: 26px; font-weight: 900; animation: ring-pulse 2.8s ease-in-out infinite; }
.workspace-grid { display: grid; grid-template-columns: 1.18fr 1fr; gap: 22px; }
.panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow), 0 0 28px rgba(96,230,230,.035); backdrop-filter: blur(8px); }
.panel::before { position: absolute; top: 0; left: 10%; width: 80%; height: 1px; content: ""; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); opacity: .75; }
.create-panel, .join-panel { min-height: 430px; padding: 30px 34px 33px; }
.join-panel { border-color: rgba(241,106,198,.45); background: rgba(23, 17, 39, .88); }
.join-panel::before { background: var(--magenta); box-shadow: 0 0 15px var(--magenta); }
.panel-heading, .score-heading, .section-head { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-heading { margin-bottom: 28px; }
.panel-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--cyan); border-radius: 50%; color: #071019; background: var(--cyan); box-shadow: 0 0 14px rgba(96,230,230,.55); font-size: 22px; font-weight: 300; }
.join-icon { border-color: var(--magenta); color: #210f25; background: var(--magenta); box-shadow: 0 0 14px rgba(241,106,198,.5); font-size: 18px; }
.field-label { display: flex; gap: 8px; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.field-label span { color: #63758e; }
input, select { width: 100%; min-height: 43px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 3px; color: var(--ink); background: #0a1422; transition: border-color .18s, box-shadow .18s; }
input:hover, select:hover, input:focus, select:focus { border-color: var(--cyan-deep); box-shadow: 0 0 14px rgba(96,230,230,.12); }
input::placeholder { color: #61738b; }
.create-panel input, .join-panel input { margin-bottom: 19px; }
.room-code-input { color: var(--cyan); letter-spacing: 5px; font-size: 19px; font-weight: 900; text-transform: uppercase; }
.section-caption { margin: 4px 0 10px; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 23px; }
.settings-grid label { color: var(--muted); font-size: 11px; }
.settings-grid input { min-height: 37px; margin-top: 6px; padding: 8px 7px; color: var(--cyan); text-align: center; }
.primary-button, .secondary-button, .outline-button { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 0 16px; border-radius: 3px; font-weight: 800; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { width: 100%; border: 1px solid var(--cyan); color: #071019; background: var(--cyan); box-shadow: 0 0 14px rgba(96,230,230,.22); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); box-shadow: 0 0 24px rgba(96,230,230,.45); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .38; transform: none; box-shadow: none; }
.primary-button b, .secondary-button b { font-size: 19px; font-weight: 400; }
.secondary-button { width: 100%; margin-top: 23px; border: 1px solid var(--magenta); color: #210f25; background: var(--magenta); box-shadow: 0 0 14px rgba(241,106,198,.2); }
.secondary-button:hover { background: #ff82d5; box-shadow: 0 0 24px rgba(241,106,198,.45); }
.join-note { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.scan-entry-button { width: 100%; margin-top: 12px; color: var(--cyan); }
.scan-entry-button b, .qr-scan-button b { color: var(--lime); font-size: 18px; }
.note-icon { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid var(--magenta); border-radius: 50%; color: var(--magenta); font-size: 11px; }
.recent-section, .history-section { margin-top: 50px; }
.section-head { align-items: end; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
.recent-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recent-item { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border: 1px solid var(--line-soft); border-radius: 5px; background: rgba(13,23,38,.78); cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.recent-item:hover { border-color: var(--cyan); box-shadow: 0 0 19px rgba(96,230,230,.15); transform: translateY(-2px); }
.recent-item strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 14px; }
.recent-item small { color: var(--muted); font-size: 11px; }
.recent-code { color: var(--lime); font-size: 15px; letter-spacing: 2px; font-weight: 900; text-shadow: 0 0 8px rgba(186,243,79,.4); }
.room-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.room-head-main { display: flex; align-items: center; gap: 16px; }
.back-button, .more-button { padding: 3px 7px; border: 0; color: var(--cyan); background: transparent; font-size: 25px; }
.back-button:hover { text-shadow: 0 0 12px var(--cyan); }
.room-head h1 { margin: 0; color: var(--ink); font-size: 28px; letter-spacing: -.7px; }
.room-head .eyebrow { margin-bottom: 5px; }
.room-actions { display: flex; align-items: center; gap: 9px; }
.outline-button { min-height: 38px; border: 1px solid var(--line); color: var(--muted); background: rgba(13,23,38,.7); font-size: 12px; }
.outline-button:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 16px rgba(96,230,230,.16); }
.outline-button b { color: var(--lime); letter-spacing: 2px; }
.finish-button { border-color: rgba(241,106,198,.62); color: var(--magenta); }
.finish-button:hover { border-color: var(--magenta); color: #ffd8f2; box-shadow: 0 0 16px rgba(241,106,198,.24); }
.rule-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.rule-pill { padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 3px; color: var(--muted); background: var(--surface); font-size: 11px; }
.rule-pill b { margin-left: 4px; color: var(--cyan); font-size: 13px; }
.room-layout { display: grid; grid-template-columns: 1.42fr 1fr; gap: 22px; }
.score-panel { padding: 27px 29px; }
.score-heading { align-items: center; margin-bottom: 22px; }
.score-heading h2 { font-size: 19px; }
.live-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.bolt { color: var(--lime); font-size: 22px; text-shadow: 0 0 12px var(--lime); animation: blink 2.1s ease-in-out infinite; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 730px; border-collapse: collapse; }
th { padding: 0 12px 12px; color: #677f99; font-size: 10px; letter-spacing: 1.5px; font-weight: 700; text-align: left; }
td { padding: 15px 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
td:first-child, th:first-child { width: 38px; padding-left: 0; }
td:nth-child(3) { color: var(--cyan); font-size: 21px; font-weight: 900; text-shadow: 0 0 13px rgba(96,230,230,.27); }
.stat-win, .stat-small, .stat-big, .stat-nine, .stat-foul { width: 54px; color: var(--ink); font-size: 16px; font-weight: 850; text-align: center; }
.stat-win { color: var(--cyan); }
.stat-small { color: var(--orange); }
.stat-big { color: var(--violet); }
.stat-nine { color: var(--gold); }
.stat-foul { color: var(--magenta); }
.rank-one { color: var(--lime) !important; font-weight: 900; text-shadow: 0 0 10px rgba(186,243,79,.35); }
.score-pop { animation: score-pop .7s ease both; }
.player-cell { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 750; }
.player-dot { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--cyan-deep); border-radius: 50%; color: #061019; background: var(--cyan); box-shadow: 0 0 9px rgba(96,230,230,.3); font-size: 10px; font-weight: 900; }
.host-tag { margin-left: 5px; color: var(--magenta); font-size: 10px; font-weight: 500; }
.online-tag { color: var(--lime); font-size: 11px; text-shadow: 0 0 8px rgba(186,243,79,.28); }
.offline-tag { color: #63758e; font-size: 11px; }
.action-panel { border-color: rgba(96,230,230,.48); background: rgba(7, 18, 31, .96); }
.action-panel::before { background: var(--lime); box-shadow: 0 0 15px var(--lime); }
.action-panel .eyebrow { color: var(--magenta); }
.action-panel h2 { color: var(--ink); }
.action-panel .section-caption { color: var(--muted); }
.finished-banner { margin: -6px 0 17px; padding: 9px 10px; border: 1px solid rgba(241,106,198,.38); color: var(--magenta); background: rgba(69,27,61,.35); font-size: 11px; }
.score-select-row { display: grid; grid-template-columns: 1fr 20px 1fr; gap: 7px; align-items: end; margin-bottom: 23px; }
.self-player { min-width: 0; color: var(--muted); font-size: 11px; }
.self-player span { display: block; margin-bottom: 7px; }
.self-player strong { display: block; overflow: hidden; min-height: 37px; padding: 10px 8px; border: 1px solid rgba(96,230,230,.32); color: var(--cyan); background: var(--surface-soft); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.score-select-row label { color: var(--muted); font-size: 11px; }
.score-select-row select { margin-top: 7px; padding: 8px; border-color: rgba(96,230,230,.32); color: var(--ink); background: var(--surface-soft); }
.score-select-row select:disabled { cursor: not-allowed; color: #63758e; opacity: .7; }
.bonus-events { margin: -9px 0 17px; }
.bonus-event { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid rgba(255,157,77,.45); border-radius: 3px; color: var(--orange); background: rgba(74,35,22,.44); box-shadow: inset 0 0 12px rgba(255,157,77,.06); }
.bonus-event-nine { border-color: rgba(255,209,102,.52); color: var(--gold); background: rgba(78,58,24,.42); }
.event-flame { color: var(--magenta); font-size: 15px; text-shadow: 0 0 10px var(--magenta); animation: spark-pop 1.1s ease-in-out infinite; }
.bonus-event span:nth-child(2) { min-width: 0; flex: 1; }
.bonus-event strong, .bonus-event small { display: block; }
.bonus-event strong { color: var(--orange); font-size: 11px; }
.bonus-event-nine strong { color: var(--gold); }
.bonus-event small { margin-top: 3px; overflow: hidden; color: #c29170; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bonus-event b { color: var(--lime); font-size: 10px; white-space: nowrap; }
.flow-arrow { padding-bottom: 11px; color: var(--magenta); text-align: center; font-size: 18px; text-shadow: 0 0 9px var(--magenta); }
.kind-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.kind-button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 65px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: #101e31; transition: transform .16s, border-color .16s, box-shadow .16s; }
.kind-button:hover { transform: translateY(-2px); border-color: var(--cyan); }
.kind-button span { font-size: 12px; }
.kind-button b { margin-top: 7px; color: var(--ink); font-size: 15px; }
.kind-button.active { border-color: var(--cyan); color: #061019; background: var(--cyan); box-shadow: 0 0 17px rgba(96,230,230,.45); }
.kind-button.active b { color: #061019; }
.kind-button.kind-foul.active { border-color: var(--lime); background: var(--lime); box-shadow: 0 0 17px rgba(186,243,79,.4); }
.kind-button.kind-small.active { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 17px rgba(255,157,77,.42); }
.kind-button.kind-big.active { border-color: var(--violet); background: var(--violet); box-shadow: 0 0 17px rgba(173,138,240,.42); }
.kind-button.kind-small, .kind-button.kind-big { position: relative; overflow: visible; }
.kind-button.kind-small::before, .kind-button.kind-big::before { position: absolute; z-index: 0; inset: -5px; border: 1px solid var(--orange); border-radius: 8px; content: ""; opacity: .76; pointer-events: none; transform: rotate(-1deg); animation: flame-ring 1.25s ease-in-out infinite; }
.kind-button.kind-small span, .kind-button.kind-small b, .kind-button.kind-big span, .kind-button.kind-big b { position: relative; z-index: 1; }
.kind-button.kind-small::after, .kind-button.kind-big::after { position: absolute; top: -11px; right: -6px; content: "✦"; color: var(--orange); font-size: 11px; pointer-events: none; animation: spark-pop 1.35s ease-in-out infinite; }
.kind-button.kind-big::before { inset: -7px; border-color: var(--magenta); box-shadow: 0 0 7px rgba(255,157,77,.62), 0 0 14px rgba(241,106,198,.3); animation-duration: .95s; transform: rotate(1deg); }
.kind-button.kind-big::after { color: var(--magenta); animation-delay: -.45s; }
.kind-button.kind-small.active::before, .kind-button.kind-big.active::before { opacity: 1; box-shadow: 0 0 8px currentColor, 0 0 21px rgba(255,157,77,.45); }
.kind-button.kind-nine { position: relative; overflow: visible; color: var(--gold); }
.kind-button.kind-nine::before { position: absolute; z-index: 0; inset: -6px; border: 1px solid var(--gold); border-radius: 8px; content: ""; opacity: .78; pointer-events: none; transform: rotate(-2deg); animation: flame-ring 1.05s ease-in-out infinite reverse; box-shadow: 0 0 8px rgba(255,209,102,.35); }
.kind-button.kind-nine::after { position: absolute; top: -11px; right: -6px; content: "✦"; color: var(--gold); font-size: 11px; pointer-events: none; animation: spark-pop 1.15s ease-in-out infinite -.2s; }
.kind-button.kind-nine span, .kind-button.kind-nine b { position: relative; z-index: 1; }
.kind-button.kind-nine.active { border-color: var(--gold); color: #211a08; background: var(--gold); box-shadow: 0 0 19px rgba(255,209,102,.5); }
.kind-button.kind-nine.active b { color: #211a08; }
.kind-button.kind-nine.active::before { opacity: 1; box-shadow: 0 0 9px var(--gold), 0 0 23px rgba(255,209,102,.52); }
.score-submit { margin-top: 20px; color: #061019; background: var(--lime); border-color: var(--lime); box-shadow: 0 0 17px rgba(186,243,79,.24); }
.score-submit:hover { background: #d0ff71; box-shadow: 0 0 25px rgba(186,243,79,.5); }
.history-section .section-head { margin-bottom: 13px; }
.log-count { color: var(--muted); font-size: 12px; }
.history-list { min-height: 80px; padding: 0 22px; }
.history-item { display: grid; grid-template-columns: 58px 1fr auto auto; gap: 15px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.history-item:last-child { border-bottom: 0; }
.history-item.self-give { padding-left: 10px; border-left: 2px solid #ff6476; background: linear-gradient(90deg, rgba(177, 39, 59, .28), rgba(78, 20, 34, .08)); }
.history-item.self-receive { padding-left: 10px; border-left: 2px solid #59e69a; background: linear-gradient(90deg, rgba(37, 155, 94, .25), rgba(20, 86, 61, .08)); }
.history-item.self-give .history-points { color: #ff8694; text-shadow: 0 0 8px rgba(255, 100, 118, .38); }
.history-item.self-receive .history-points { color: #72f0aa; text-shadow: 0 0 8px rgba(89, 230, 154, .38); }
.history-time { color: #687f98; font-size: 11px; }
.history-copy { color: var(--muted); font-size: 13px; }
.history-copy strong { color: var(--ink); }
.history-points { color: var(--lime); font-size: 16px; font-weight: 900; text-shadow: 0 0 8px rgba(186,243,79,.35); }
.history-kind { display: inline-block; margin-right: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--cyan); background: #102739; font-size: 10px; }
.history-kind.big_gold { color: var(--violet); background: #241e3e; }
.history-kind.golden_nine { color: var(--gold); background: #3b321b; }
.history-kind.small_gold { color: var(--orange); background: #32251b; }
.history-kind.foul { color: var(--lime); background: #202d1b; }
.undo-button { padding: 5px; border: 0; color: var(--magenta); background: transparent; font-size: 11px; }
.undo-button:hover { text-shadow: 0 0 10px var(--magenta); }
.undone { opacity: .5; }
.undone .history-points { color: #687f98; text-decoration: line-through; text-shadow: none; }
.empty-history, .empty-players { padding: 28px 0; color: #687f98; font-size: 13px; text-align: center; }
.toast { position: fixed; z-index: 5; bottom: 26px; left: 50%; padding: 12px 18px; border: 1px solid var(--cyan); border-radius: 3px; color: #061019; background: var(--cyan); box-shadow: 0 0 24px rgba(96,230,230,.36); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 80px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.profile-dialog { max-width: calc(100% - 32px); padding: 0; border: 0; background: transparent; }
.profile-dialog::backdrop { background: rgba(1, 5, 12, .76); backdrop-filter: blur(3px); }
.dialog-card { position: relative; width: min(390px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--cyan); border-radius: 6px; background: var(--surface-strong); box-shadow: 0 0 30px rgba(96,230,230,.23), var(--shadow); }
.dialog-card h2 { margin-bottom: 10px; font-size: 24px; }
.dialog-copy { margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-card input { margin-bottom: 16px; }
.dialog-close { position: absolute; top: 10px; right: 13px; border: 0; color: var(--muted); background: transparent; font-size: 23px; }
.qr-dialog { max-width: calc(100% - 32px); padding: 0; border: 0; background: transparent; }
.qr-dialog::backdrop { background: rgba(1, 5, 12, .78); backdrop-filter: blur(4px); }
.qr-card { position: relative; width: min(390px, calc(100vw - 32px)); padding: 30px 28px 25px; border: 1px solid var(--cyan); border-radius: 6px; color: var(--ink); background: var(--surface-strong); box-shadow: 0 0 30px rgba(96,230,230,.25), var(--shadow); text-align: center; }
.qr-card h2 { margin-bottom: 18px; }
.qr-code { display: grid; place-items: center; min-height: 224px; padding: 10px; border-radius: 4px; background: #fff; }
.qr-code canvas { display: block; max-width: 100%; height: auto; }
.qr-room-code { display: block; margin: 13px 0 7px; color: var(--lime); font-size: 22px; letter-spacing: 4px; }
.qr-card .dialog-copy { margin-bottom: 16px; }
.qr-scan-button { width: 100%; justify-content: space-between; }
.scanner { position: relative; overflow: hidden; margin-top: 16px; border: 1px solid var(--cyan); border-radius: 4px; background: #000; }
.scanner video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.scanner-frame { position: absolute; inset: 17% 14%; border: 2px solid var(--lime); box-shadow: 0 0 0 999px rgba(0,0,0,.25), 0 0 18px var(--lime); }
.scan-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
@keyframes blink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes ring-pulse { 0%, 100% { box-shadow: inset 0 0 17px rgba(186,243,79,.15), 0 0 13px rgba(186,243,79,.18); } 50% { box-shadow: inset 0 0 17px rgba(186,243,79,.25), 0 0 28px rgba(186,243,79,.42); } }
@keyframes ball-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -16px; } }
@keyframes horizon-drift { from { margin-left: -3vw; } to { margin-left: 8vw; } }
@keyframes scan { from { transform: translateY(-12%); } to { transform: translateY(12%); } }
@keyframes score-pop { 0% { color: var(--ink); transform: scale(1); } 35% { color: var(--lime); transform: scale(1.22); text-shadow: 0 0 20px var(--lime); } 100% { color: var(--cyan); transform: scale(1); } }
@keyframes flame-ring { 0%, 100% { opacity: .45; transform: rotate(-1deg) scale(.98); } 42% { opacity: 1; transform: rotate(2deg) scale(1.035); } 72% { opacity: .68; transform: rotate(-3deg) scale(1.01); } }
@keyframes spark-pop { 0%, 100% { opacity: .25; transform: translate(0, 2px) scale(.7) rotate(0); } 45% { opacity: 1; transform: translate(3px, -4px) scale(1.1) rotate(22deg); } }
@media (max-width: 900px) {
  .topbar { padding: 0 22px; }
  main { padding: 48px 22px 76px; }
  .workspace-grid, .room-layout { grid-template-columns: 1fr; }
  .create-panel, .join-panel { min-height: 0; }
  .recent-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { height: 66px; padding: 0 15px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .topbar-actions { gap: 9px; }
  .device-chip { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 34px 14px 60px; }
  .ambient-fx .ball-cyan { top: 11%; right: -22px; transform: scale(.63); }
  .ambient-fx .ball-magenta { left: -28px; transform: scale(.52); }
  .ambient-fx .ball-lime { right: 8%; bottom: 7%; transform: scale(.4); }
  .home-intro { align-items: start; gap: 15px; margin-bottom: 31px; }
  h1 { margin-bottom: 14px; font-size: 36px; letter-spacing: -1px; }
  .intro-copy { max-width: 235px; font-size: 13px; line-height: 1.55; }
  .intro-stat { display: none; }
  .create-panel, .join-panel { padding: 24px 19px 25px; }
  .settings-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .settings-grid input { padding: 8px 3px; font-size: 12px; }
  .recent-list { grid-template-columns: 1fr; }
  .room-head { align-items: flex-start; gap: 12px; }
  .room-head-main { gap: 9px; }
  .room-head h1 { max-width: 155px; font-size: 22px; line-height: 1.12; }
  .room-actions { flex-direction: column; align-items: flex-end; gap: 5px; }
  .outline-button { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .room-layout { gap: 15px; }
  .score-panel { padding: 22px 16px; }
  .table-wrap { margin-right: -16px; padding-right: 16px; }
  table { min-width: 730px; }
  .score-select-row { grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 5px; }
  .score-select-row select { padding: 8px 5px; font-size: 12px; }
  .kind-grid { gap: 5px; }
  .kind-button { min-height: 62px; }
  .kind-button span { font-size: 11px; }
  .history-list { padding: 0 16px; }
  .history-item { grid-template-columns: 44px 1fr auto; gap: 8px; }
  .history-kind { margin-right: 2px; }
  .history-item .history-points { grid-column: 2; grid-row: 2; }
  .history-item .undo-button { grid-column: 3; grid-row: 1 / span 2; }
  .history-copy { line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
