/* アナリストゲーム（/apps/updown/）。画面は案C（配信風、/apps/updown/demo/）: 上に値段・チャート・ポジション・ゲージ、
   まんなかにコメントが1行で流れ、下に HIGH / LOW（予想前）と入力欄。ランキングは右上からポップアップ。 */
:root {
  --bg: #111214; --card: #1b1c20; --card2: #232428; --line: #2e3035; --text: #f2f3f5; --muted: #949ba4;
  --up: #23a55a; --down: #f23f42; --up-bg: rgba(35,165,90,.15); --down-bg: rgba(242,63,66,.15); --gold: #f0b232;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #0a0b0c; color: var(--text); font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; -webkit-tap-highlight-color: transparent; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
.app { position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 560px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* 上: 値段・チャート */
.hero { flex: none; position: relative; height: 262px; padding-top: env(safe-area-inset-top); background: linear-gradient(180deg, #16181b, var(--bg)); }
.top { position: absolute; left: 14px; right: 14px; top: calc(12px + env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: flex-start; z-index: 2; }
.ttl { font-weight: 800; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.menu { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px 0 0; }
.tag { font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 3px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.live { font-size: 9px; font-weight: 800; color: var(--up); }
.px { font-size: 30px; font-weight: 900; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.px .yen { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 1px; }
.chg { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero.up .chg { color: var(--up); } .hero.down .chg { color: var(--down); }
.rkbtn { border: 1px solid var(--line); background: rgba(27,28,32,.92); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chart { position: absolute; left: 0; right: 0; top: calc(78px + env(safe-area-inset-top)); bottom: 46px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.chart .entry { stroke-width: 1.4; } .chart .entry.up { stroke: var(--up); } .chart .entry.down { stroke: var(--down); }
.chart .dot { position: absolute; right: 0; width: 8px; height: 8px; margin: -4px -4px 0 0; border-radius: 50%; animation: pulse 1.6s infinite; }
.chart .dot.up { background: var(--up); } .chart .dot.down { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
.badge { position: absolute; right: 14px; top: calc(104px + env(safe-area-inset-top)); z-index: 2; }
.gwrap { position: absolute; left: 14px; right: 14px; bottom: 8px; }
.gauge { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--card2); }
.gauge i { display: block; transition: width .6s; } .gauge .gu { background: var(--up); } .gauge .gd { background: var(--down); }
.gl { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; margin-top: 3px; }
.gl .u { color: var(--up); } .gl .d { color: var(--down); } .gl.empty span { color: var(--muted); }

/* いまのポジション: 当たっている間はその色、外れている間は灰色 */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 13px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st small { font-weight: 700; opacity: .85; font-size: 11px; }
.st.win.up { color: #fff; background: var(--up); animation: glow 1.8s infinite; }
.st.win.down { color: #fff; background: var(--down); animation: glowd 1.8s infinite; }
.st.lose, .st.even { color: #c4c7cc; background: #4a4d55; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(35,165,90,.55); } 100% { box-shadow: 0 0 0 10px rgba(35,165,90,0); } }
@keyframes glowd { 0% { box-shadow: 0 0 0 0 rgba(242,63,66,.55); } 100% { box-shadow: 0 0 0 10px rgba(242,63,66,0); } }

/* まんなか: コメント（1行で流れる） */
.stream { flex: 1; min-height: 0; position: relative; }
.cm-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 4px 0;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 36px); mask-image: linear-gradient(180deg, transparent 0, #000 36px); }
.cm-list { list-style: none; margin: auto 0 0; padding: 0; }
.cm-line { padding: 3px 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cm-line .nm { color: var(--muted); font-weight: 700; font-size: 12px; margin-right: 6px; }
.cm-line .nm.admin { color: #8ea1ff; }
.cm-line.own .nm { color: var(--gold); }
.cm-line .side { margin-right: 6px; position: relative; top: -1px; }
.cm-line a { color: #00a8fc; }
.cm-line .rx { margin-left: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cm-line .im { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 4px; } .cm-line .im img { height: 48px; border-radius: 6px; display: block; }
.cm-line.new { animation: slide .35s ease; }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.cm-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; list-style: none; }
.side { font-size: 9px; font-weight: 900; letter-spacing: .04em; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.side.up { color: var(--up); background: var(--up-bg); } .side.down { color: var(--down); background: var(--down-bg); }

/* 下: HIGH / LOW と入力欄 */
.foot { flex: none; padding: 8px 10px 0; }
.when { margin: 0 0 6px; text-align: center; font-size: 12px; color: var(--muted); } .when b { color: var(--text); }
.hl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { border-radius: 12px; height: 56px; color: #fff; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .08s, filter .15s; }
.btn .b-main { font-size: 19px; letter-spacing: .04em; } .btn .b-sub { font-size: 10px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.btn.up { border: 1px solid #3ddc84; background: linear-gradient(160deg, #1f9d55, #0f6b37); box-shadow: 0 6px 20px -8px rgba(35,165,90,.7); }
.btn.down { border: 1px solid #ff6b6e; background: linear-gradient(160deg, #e0383b, #9c1d20); box-shadow: 0 6px 20px -8px rgba(242,63,66,.7); }
.btn:active, .btn.pressed { transform: scale(.97); filter: brightness(1.12); }
.busy .btn { opacity: .6; pointer-events: none; }
.inp { flex: none; display: flex; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.inp .cm-input { flex: 1; min-width: 0; font-size: 16px; padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.inp .cm-input:disabled { opacity: .55; }
.inp button { border: 0; border-radius: 999px; padding: 0 15px; background: var(--text); color: #111; font-weight: 800; font-size: 13px; }

/* ランキング（右上からポップアップ） */
.scrim { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: absolute; top: calc(50px + env(safe-area-inset-top)); right: 10px; left: 10px; z-index: 10; max-width: 380px; margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); transform-origin: top right; transform: scale(.92); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s;
  max-height: calc(100% - 70px - env(safe-area-inset-top)); display: flex; flex-direction: column; }
.app.open .sheet { transform: none; opacity: 1; pointer-events: auto; }
.app.open .scrim { opacity: 1; pointer-events: auto; }
.sh-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 14px; font-size: 13px; }
.sh-head small { color: var(--muted); }
.sh-head .x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 20px; width: 32px; height: 32px; }
.sh-body { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 10px; }
.locked { margin: 4px 12px 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.6; } .locked b { color: var(--text); }
.rk { list-style: none; margin: 0; padding: 0; }
.rk li { display: grid; grid-template-columns: 22px 26px 1fr auto 46px; gap: 8px; align-items: center; padding: 7px 14px; font-size: 13px; }
.rk .n { font-weight: 900; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk .top1 .n { color: var(--gold); } .rk .top2 .n { color: #c9ced6; } .rk .top3 .n { color: #d08b54; }
.ava { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); color: var(--muted); font-size: 11px; font-weight: 700; flex: none; object-fit: cover; }
.rk .nm { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.rk .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rk .nm small { color: var(--muted); font-size: 10px; }
.rk .rt { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.rk .rt small { display: block; font-size: 10px; color: var(--gold); font-weight: 700; }
.rk .none { color: var(--muted); font-size: 11px; text-align: center; }
.rk li.me { background: rgba(240,178,50,.08); }
.empty { color: var(--muted); font-size: 12px; margin: 6px 14px; }
.mine { margin: 12px 12px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.mine-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.rename { border: 1px solid var(--line); background: var(--card2); border-radius: 999px; padding: 3px 10px; font-size: 11px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ms { background: var(--card2); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.ms b { font-size: 17px; font-variant-numeric: tabular-nums; } .ms small { color: var(--muted); font-size: 10px; }
.hist { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; }
.h { display: grid; grid-template-columns: 72px 36px 1fr auto; gap: 6px; align-items: center; padding: 6px 2px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.h-side { font-size: 10px; font-weight: 900; } .h-side.up { color: var(--up); } .h-side.down { color: var(--down); }
.h-px { color: var(--muted); } .h-res { font-weight: 700; }
.h.win .h-res { color: var(--up); } .h.lose .h-res { color: var(--down); } .h.wait .h-res, .h.draw .h-res { color: var(--muted); }
.rules { margin: 12px 14px 0; color: var(--muted); font-size: 12px; }
.rules summary { cursor: pointer; font-weight: 700; } .rules ul { padding-left: 18px; margin: 6px 0 0; line-height: 1.6; }

/* 名前・トースト */
.namesheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.namesheet[hidden], .toast[hidden], .foot[hidden] { display: none; }
.ns-box { width: 100%; max-width: 520px; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.ns-title { margin: 0 0 10px; font-weight: 800; }
.ns-box input { width: 100%; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.ns-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.ghost, .primary { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; }
.ghost { background: var(--card2); } .primary { background: var(--text); color: #111; }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; background: #f2f3f5; color: #111;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }

/* v6: 2択の問い・自動エントリーのタイマー・ゲージの注記・ランキングの区切り・お知らせの行 */
.foot .q { margin: 2px 0 2px; text-align: center; font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.foot .when { margin-bottom: 8px; }
.btn.sel { outline: 3px solid #fff; outline-offset: 2px; }
.timer { height: 6px; margin: 10px 2px 0; border-radius: 99px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--up); border-radius: inherit; transform-origin: left; }
.timer.run i { animation: autodrain var(--auto, 3000ms) linear forwards; }
@keyframes autodrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.auto { margin: 5px 0 calc(10px + env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: var(--muted); }
.auto b { color: var(--up); font-variant-numeric: tabular-nums; }
.gl { align-items: baseline; }
.gl .gn { font-size: 9px; font-weight: 600; color: var(--muted); }
.inp[hidden] { display: none; }
.rk li.gap { display: block; text-align: center; color: var(--muted); padding: 0; font-size: 12px; }
.cm-line.notice { color: var(--muted); font-size: 12px; }
.cm-line.notice .nm { color: var(--text); }
.inp .cm-input { resize: none; height: 40px; line-height: 20px; overflow: hidden; white-space: nowrap; font-family: inherit; }
.cm-line.notice::before { content: "👀 "; }
.px .tag { font-size: 10px; vertical-align: middle; }

/* v9: 点数・ガチ予想 */
.rk .rt { font-size: 15px; } .rk .rt i { font-style: normal; font-size: 9px; color: var(--muted); margin-left: 1px; }
.rk .rt.plus { color: var(--up); } .rk .rt.minus { color: var(--down); }
.rk li { grid-template-columns: 22px 1fr auto 50px; }
.ms b { font-size: 15px; }
.pro { display: block; margin: -4px auto calc(8px + env(safe-area-inset-bottom)); border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; }
.auto { margin-bottom: 8px; }
.cm-pro { flex: none; width: 40px; padding: 0 !important; background: var(--card) !important; border: 1px solid var(--line) !important; font-size: 16px !important; }

.cs-when { margin: 0 0 8px; text-align: center; font-size: 12px; color: var(--muted); } .cs-when b { color: var(--text); }
.cs-price { display: flex; align-items: center; gap: 6px; justify-content: center; }
.cs-price input { width: 120px; text-align: center; font-size: 24px; font-weight: 900; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-variant-numeric: tabular-nums; }
.cs-price span { font-size: 13px; color: var(--muted); }
.cs-price button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 20px; font-weight: 900; }
.cs-chips { display: flex; gap: 5px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.cs-chips button { border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; }
.cs-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-side button { border-radius: 10px; height: 48px; font-weight: 900; font-size: 15px; color: #fff; opacity: .45; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.cs-side button small { font-size: 10px; font-weight: 700; opacity: .85; }
.cs-side .up { border: 1px solid #3ddc84; background: linear-gradient(160deg, #1f9d55, #0f6b37); }
.cs-side .down { border: 1px solid #ff6b6e; background: linear-gradient(160deg, #e0383b, #9c1d20); }
.cs-side button.on { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
.cs-odds { margin: 10px 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.cs-odds b { font-size: 22px; color: var(--text); } .cs-odds .w { color: var(--up); font-weight: 800; } .cs-odds .l { color: var(--down); font-weight: 800; }
.cs-odds.bad b { color: var(--down); } .cs-odds.done { color: var(--text); font-weight: 700; }
.cs-odds small { display: block; }
#callGo:disabled { opacity: .4; }
.chart line.strike { stroke-dasharray: 2 3; stroke-width: 1.5; } .chart line.strike.up { stroke: var(--up); } .chart line.strike.down { stroke: var(--down); }

/* v12 / v16: 左のサイドバー（ラウンジ /lounge/ のサイドバーと同じ見た目。900px 以上は常に出す、それより狭いと ☰ で引き出す） */
.sbar { --side: #2b2d31; --side-2: #1e1f22; --hover: #35373c; --active: #404249; --strong: #f2f3f5; --muted: #949ba4;
  width: 260px; flex: none; background: var(--side); display: flex; flex-direction: column; min-height: 0; font-size: 15px; line-height: 1.5; color: #dbdee1; }
.sbar a { text-decoration: none; }
.sbar .brand { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 700; color: var(--strong);
  border-bottom: 1px solid var(--side-2); flex: none; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.sbar .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.sbar .rooms { flex: 1; overflow-y: auto; padding: 8px; }
.sbar .section { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); padding: 16px 8px 4px; }
.sbar .rooms ul { list-style: none; margin: 0; padding: 0; }
.sbar .rooms li a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--muted); }
.sbar .rooms li a:hover { background: var(--hover); color: #dbdee1; }
.sbar .rooms li a.active { background: var(--active); color: var(--strong); }
.sbar .hash { width: 20px; text-align: center; font-size: 20px; line-height: 1; opacity: .7; }
.sbar .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .me { background: var(--side-2); padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); flex: none; min-height: 48px; }
.sbar .me-row { display: flex; align-items: center; gap: 8px; }
.sbar .me-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 0; border-radius: 6px; }
.sbar .me-open:hover { background: var(--hover); }
.sbar .me-names { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.sbar .me-names strong { color: var(--strong); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .me-names span { color: var(--muted); font-size: 12px; }
.sbar .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: #5865f2; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.sbar .login { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--strong); color: #000; font-weight: 700; border-radius: 8px; padding: 9px 12px; width: 100%; font-size: 14px; }
.sbar .login.small { flex: none; padding: 6px 10px; font-size: 12px; width: auto; }
.sbar .login .x { font-size: 16px; }
.sbar .event-banner { position: relative; display: flex; flex-direction: column; gap: 3px; margin: 16px 4px 8px; padding: 12px 12px 11px; border-radius: 12px;
  background: linear-gradient(135deg, #3b2a06 0%, #6b4a0a 55%, #b7791f 100%); border: 1px solid rgba(252,211,77,.35); color: #fff7e0; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sbar .event-banner::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(252,211,77,.35), transparent 70%); }
.sbar .event-banner:hover { filter: brightness(1.08); }
.sbar .eb-tag { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 1px 7px; border-radius: 999px; background: #fcd34d; color: #3b2a06; }
.sbar .eb-title { font-size: 14.5px; font-weight: 800; color: #fff; }
.sbar .eb-sub { font-size: 11.5px; line-height: 1.5; color: rgba(255,247,224,.82); }
.sbar .eb-go { align-self: flex-end; margin-top: 2px; font-size: 12px; font-weight: 700; color: #fcd34d; }
.shell { display: flex; justify-content: center; height: 100dvh; }
.shell .app { margin: 0; flex: 1 1 auto; width: 100%; }
.sbar-scrim { display: none; }
@media (max-width: 899px) {
  .sbar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 290px); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  .shell.drawer .sbar { transform: none; }
  .shell.drawer .sbar-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.55); }
}
@media (min-width: 900px) { .menu { display: none; } .shell .app { flex: 0 1 520px; } }

/* 上位1% vs みんな（案D）: 2色バー・50% の点線・多い方を大きな太字・ひとこと */
.vs { padding: 2px 2px 0; }
.vs-card { margin: 0 12px 10px; padding: 10px 12px; border-radius: 12px; background: var(--card2); }
.vs-row + .vs-row { margin-top: 10px; }
.vs-who { font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.vs-who small { color: var(--muted); font-weight: 600; font-size: 10px; }
.vs-row.elite .vs-who { color: var(--gold); }
.vs-lbl { display: flex; justify-content: space-between; align-items: flex-end; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.vs-side { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 11px; color: var(--muted); white-space: nowrap; }
.vs-side .pill { font-size: 10px; padding: 0 6px; border-radius: 999px; background: #4a4d53; color: #fff; line-height: 16px; }
.vs-side.win { font-size: 17px; } .vs-side.win .pill { font-size: 12px; line-height: 19px; }
.vs-side.win.u { color: var(--up); } .vs-side.win.u .pill { background: var(--up); }
.vs-side.win.d { color: var(--down); } .vs-side.win.d .pill { background: var(--down); }
.vs-bar { position: relative; display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card2); }
.vs-bar i { display: block; transition: width .6s; } .vs-bar .gu { background: var(--up); } .vs-bar .gd { background: var(--down); }
.vs-bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed rgba(255,255,255,.65); }
.vs-bar.empty i { opacity: .25; }
.vs-row.rest .vs-bar { opacity: .85; }
.vs-say { margin-top: 10px; padding: 7px 9px; border-radius: 8px; background: rgba(255,255,255,.05); font-size: 12px; font-weight: 700; line-height: 1.5; }
.vs-say b.u { color: var(--up); } .vs-say b.d { color: var(--down); }

/* ランキング: アイコンなし。名前の下に直近の結果、右にアナリスト偏差値 */
.rk-head { display: grid; grid-template-columns: 22px 1fr 50px; gap: 8px; padding: 0 14px 4px; font-size: 10px; color: var(--muted); font-weight: 700; }
.rk-head span:last-child { text-align: right; }
.rk .nm small em { font-style: normal; color: var(--gold); font-weight: 700; }
.rc { display: flex; gap: 2px; margin: 3px 0 2px; }
.rc i { width: 9px; height: 9px; border-radius: 2px; background: transparent; }
.rc .rc-w { background: var(--up); } .rc .rc-l { background: var(--down); } .rc .rc-d { background: var(--muted); } .rc .rc-x { background: #3a3c42; }
.rc .rc-n { border: 1px dashed #3a3c42; }
.dev { text-align: right; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dev.hi { color: var(--gold); } .dev.lo { color: var(--muted); }
.mine-recent { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mine-recent small { color: var(--muted); font-size: 10px; }
.mine-recent .rc i { width: 12px; height: 12px; }

/* v14: 予想の変更（15:00 まで） */
.st.tap { cursor: pointer; }
.st .chg { font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.28); }
.foot .keep { display: none; }
.foot.changing .keep { display: block; }
.foot.changing .timer, .foot.changing .auto, .foot.changing #proBtn { display: none; }
.cs-now { display: block; margin-top: 6px; color: var(--gold); font-weight: 700; }

/* v15: リアクション（行を押すと絵文字のバー。付いたものはチップで、押すと付ける / 外す） */
.cm-line { cursor: pointer; border-radius: 6px; }
.cm-line.notice { cursor: default; }
.cm-line.picking { background: rgba(255,255,255,.06); }
.cm-line .rx { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; margin-left: 6px; }
.rx-b { border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rx-b.mine { border-color: var(--gold); background: rgba(240,178,50,.15); color: var(--gold); }
.rx-pick { position: fixed; z-index: 50; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.rx-pick[hidden] { display: none; }
.rx-pick button { border: 0; background: none; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; }
.rx-pick button:hover, .rx-pick button:active { background: var(--card2); }

/* v17: サイドバーのキャッチコピーと通知（ラウンジと同じ見た目） */
.sbar .brand-names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sbar .brand-tag { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar .rooms .badge { margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.sbar .rooms li a.unread { color: var(--strong); font-weight: 700; }
.sbar .notice-head { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.sbar .notice-head .badge { margin-left: 0; }
.sbar .notice-read { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 0; }
.sbar .notice-read:hover { color: var(--strong); text-decoration: underline; }
.sbar .notice-list { list-style: none; margin: 0; padding: 0; }
.sbar .notice { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); text-align: left; font: inherit; cursor: pointer; }
.sbar .notice:hover { background: var(--hover); }
.sbar .notice.new { background: rgba(242,63,67,.12); color: #dbdee1; }
.sbar .notice.new strong { color: var(--strong); }
.sbar .notice-emoji { flex: none; font-size: 18px; line-height: 1; }
.sbar .notice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sbar .notice-text strong { font-size: 13px; font-weight: 600; }
.sbar .notice-text small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .notice time { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sbar .notice-empty { margin: 4px 8px; font-size: 12px; color: var(--muted); }
.menu.has-unread { position: relative; }
.menu.has-unread::after { content: ""; position: absolute; top: -2px; right: 0; width: 8px; height: 8px; border-radius: 50%; background: #f23f43; }
.cm-line.flash { animation: notice-flash 1.6s ease-out; }
@keyframes notice-flash { 0%, 40% { box-shadow: inset 0 0 0 2px #f23f43; } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.notice-peek { display: none; }
@media (max-width: 899px) {
  .notice-peek:not([hidden]) { display: flex; align-items: center; gap: 5px; position: fixed; left: 0; top: 46%; z-index: 15; padding: 8px 12px 8px 8px;
    border: 1px solid var(--line); border-left: 0; border-radius: 0 16px 16px 0; background: #2b2d31; color: #f2f3f5; font-size: 12.5px; box-shadow: 4px 4px 14px rgba(0,0,0,.4); }
  .notice-peek b { min-width: 20px; padding: 1px 6px; border-radius: 9px; background: #f23f43; color: #fff; font-size: 11.5px; text-align: center; }
  .shell.drawer .notice-peek { display: none; }
}

/* v17: また来た人へのバルーン（上に出るだけ。押すと消える） */
.balloon { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 41; max-width: min(92vw, 460px);
  padding: 11px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; text-align: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  background: #f2f3f5; color: #111; animation: balloon-in .35s cubic-bezier(.2,1.4,.4,1); }
.balloon[hidden] { display: none; }
.balloon.win { background: var(--up); color: #fff; }
.balloon.lose { background: #4a4d55; color: #f2f3f5; }
@keyframes balloon-in { from { transform: translate(-50%, -16px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* v18: 2日目からのログインのお願い・Google ログイン（小さな文字） */
.sbar .login-col { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.sbar .login-col.wide { width: 100%; }
.sbar .google-login { font-size: 10.5px; color: var(--muted); text-decoration: underline; }
.wall { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,6,8,.82); backdrop-filter: blur(6px); }
.wall[hidden] { display: none; }
.wall-box { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px 18px; text-align: center; }
.wall-box img { border-radius: 14px; }
.wall-t { font-size: 20px; font-weight: 900; margin: 12px 0 6px; }
.wall-s { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 16px; }
.wall-x { display: flex; align-items: center; justify-content: center; gap: 6px; background: #f2f3f5; color: #000; font-weight: 800; border-radius: 12px; padding: 13px; text-decoration: none; font-size: 15px; }
.wall-x span { font-size: 18px; }
.wall-g { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.wall-legal { font-size: 10.5px; color: var(--muted); margin: 14px 0 0; }
.wall-legal a { color: var(--muted); }
.wall-g[hidden] { display: none; }
