/* 射龙门 —— 黑金柠檬
 * 底板是概念图 output/goal-concept/screen-shot-moment.jpg:顶上一条记分牌(池是本屏唯一的黄)、中间夜场球门(两张门柱牌竖在网两侧)、
 * 底下一排座位圆盘。球场在 canvas 上(goal-stage.js),门柱牌 / 当球的牌是 CSS 画的真牌面,圆盘、面板、大厅列表全是 CSS。
 * 吉祥物(黑豹)还没出图,舞台先画几何剪影;图到位只动 goal-art.js。
 */
.goal {
  position: fixed; inset: 0; z-index: 10; overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--safe-t, 0px) 0 calc(var(--safe-b, 0px) + 6px);
  --bg: #0a0a0a; --surface: #151515; --surface-2: #1c1c1c; --line: #242424;
  --ink: #fff; --ink-2: #8a8a8a; --ink-3: #5c5c5c; --neon: #e5ff3d; --neon-ink: #0a0a0a; --bad: #ff5a5a;
  --sans: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.goal[hidden] { display: none; }
.goal :where(p, h2, h3, ul, ol) { margin: 0; }
/* 用 :where 把重置的权重压到 0:后面单个 class 的按钮样式才盖得过它(button 的 background:none 会吃掉底板) */
.goal :where(button) { appearance: none; border: 0; margin: 0; padding: 0; font: inherit; color: inherit; background: none; cursor: pointer; }
.goal button:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.goal img { -webkit-user-drag: none; pointer-events: none; }
/* 按钮里面的字、金额、金币一律点不到:按下、松手、click 都落在按钮本身。按钮里的金额会被 PA 金币那层换成新的 <span>+<img>,
   桌卡里的池、在座每次轮询都可能改,不能让手指落在会被换掉的东西上(10-16 冲天鹰「一直点不到收钱」同一个毛病) */
.goal button > *, .goal button * { pointer-events: none; }

/* ---------- 顶栏 ---------- */
.gl-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.gl-back, .gl-help { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gl-back svg, .gl-help svg { width: 20px; height: 20px; }
.gl-help { color: var(--ink-2); font-weight: 700; }
.gl-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 18px; font-weight: 700; line-height: 1.1; overflow: hidden; }
.gl-title small { font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-bal { flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 340px) { .gl-top { gap: 8px; padding-left: 12px; padding-right: 12px; } .gl-title { font-size: 15px; } .gl-bal { padding: 7px 10px; } }
/* 顶栏多了音符按钮(2026-10-23):间距收一点、余额框窄一点,标题才放得下 */
.gl-top.has-music { gap: 6px; }
.gl-top.has-music .gl-bal { padding-inline: 10px; flex-shrink: 1; min-width: 0; }
.gl-top.has-music .gl-title > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) { .gl-top.has-music .gl-title { font-size: 15px; } }

/* ---------- 记分牌:池(本屏唯一的黄)、局号、本局剩几张 ---------- */
.gl-board {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 12px 6px; padding: 8px 14px;
  border-radius: 14px; background: #0f0f0f; box-shadow: inset 0 0 0 1px var(--line), inset 0 0 18px rgba(0, 0, 0, .8);
  font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.gl-board b { display: inline-block; margin: 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: .02em; }
.gl-pot b { font-size: 22px; color: var(--neon); text-shadow: 0 0 10px rgba(229, 255, 61, .35); }
.gl-deal b, .gl-cards b { font-size: 15px; }

/* ---------- 舞台 ---------- */
/* 球场 / 操作卡怎么分高度(10-31 老板「下注的那个地方空间很窄」):以前球场固定占 40%(矮屏 36% / 31%),媒体查询看的是整个视窗高,
   Telegram 全屏顶上那约 100px(状态栏 + 返回键,--safe-t)没扣掉:iPhone Pro Max(430×932)不算矮屏,轮到我时操作卡只剩 182px,数字框和拉杆被裁掉。
   改成操作卡先拿够「轮到我」要的高度(--gl-need,见 .gl-panel),球场吃剩下的(最多 420、最少 150);
   没轮到我时底下多一条 50px 的聊天输入条,操作卡就少拿 50px —— 球场高度不跟着轮到谁跳。屏幕实在太矮才让操作卡里面那块自己滚 */
/* --gl-need = 操作卡 + 聊天输入条一共要多高,取「没轮到我(先选好下一枪)+ 输入条」和「轮到我」两种里高的那个(10-31 照 430×932 / 393×852 / 375×667 实测) */
.goal { --gl-need: 258px; }
.gl-stage { position: relative; flex: 100 1 0; min-height: 150px; max-height: 420px; overflow: hidden; background: #050506; transition: filter .25s ease-out; }
.gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* 撞柱:整个画面瞬间去色(揭晓期间),关了动态效果照样去色(这是结果,不是闪光) */
.gl-stage[data-phase="reveal"][data-result="post"], .gl-stage[data-phase="reveal"][data-result="trips"] { filter: grayscale(1) contrast(1.1); }

/* 一张牌:白底、左上角点数、中间花色;牌背是黑底 + 一圈柠檬细边 + 斜纹 */
.gl-card {
  position: absolute; display: grid; grid-template-rows: auto 1fr; box-sizing: border-box; padding: 4px 6px; /* 别用百分比:百分比按舞台宽算,牌缩小时会被撑成方的 */
  border-radius: 10%; background: #fff; color: #111; font-style: normal; font-weight: 800; line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .08);
  font-variant-numeric: tabular-nums;
}
.gl-card b { font-size: clamp(14px, 6cqi, 30px); font-size: 28px; }
.gl-card span { place-self: center; font-size: 34px; }
.gl-card.is-red { color: #d8262f; }
.gl-card.is-back { background: #0f0f0f repeating-linear-gradient(135deg, rgba(229, 255, 61, .12) 0 4px, transparent 4px 10px); box-shadow: 0 6px 18px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(229, 255, 61, .55); }
.gl-card.is-back b, .gl-card.is-back span { display: none; }
.gl-post { left: 0; top: 0; width: 60px; height: 86px; z-index: 2; transform-origin: 50% 100%; transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.gl-post b { font-size: 24px; } .gl-post span { font-size: 28px; }
@media (max-width: 380px) { .gl-post b { font-size: 20px; } .gl-post span { font-size: 24px; } }
/* 射门期间(data-focus):两张门柱牌缩小滑到舞台上方两角,豹子的助跑 / 滑跪 / 抱头不被牌压住;字幕也贴顶 */
.gl-stage[data-focus="1"] .gl-post b { font-size: 16px; } .gl-stage[data-focus="1"] .gl-post span { font-size: 19px; }
.gl-stage[data-focus="1"] .gl-cap { top: 3%; padding: 6px 14px; }
.gl-stage[data-focus="1"] .gl-cap b { font-size: 17px; } .gl-stage[data-focus="1"] .gl-cap em { font-size: 26px; }
.gl-stage[data-reduced="1"] .gl-post { transition: none; }
/* 撞柱:门柱牌剧烈抖动(关了动态效果不抖) */
.gl-stage[data-phase="reveal"][data-result="post"][data-side="l"][data-reduced="0"] [data-post="l"],
.gl-stage[data-phase="reveal"][data-result="post"][data-side="r"][data-reduced="0"] [data-post="r"],
.gl-stage[data-phase="reveal"][data-result="trips"][data-reduced="0"] .gl-post { animation: gl-shake .6s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes gl-shake { 10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-3deg); } 20%, 80% { transform: translate3d(4px, 0, 0) rotate(3deg); } 30%, 50%, 70% { transform: translate3d(-7px, 0, 0) rotate(-5deg); } 40%, 60% { transform: translate3d(7px, 0, 0) rotate(5deg); } }
/* 球 = 第三张牌:位置由 goal-stage.js 每帧摆(transform),这里只给大小和层级 */
.gl-ball { left: 0; top: 0; width: 42px; height: 60px; z-index: 3; opacity: 0; will-change: transform; transform-origin: 50% 50%; }
.gl-ball b { font-size: 18px; } .gl-ball span { font-size: 22px; }
/* 足球(老板选的「旋转压扁」):助跑时停在脚下,悬念前段飞向顶点、转着压成一条线,牌背从那条线展开;位置由 goal-stage.js 每帧摆 */
.gl-stage { perspective: 800px; }
.gl-football { position: absolute; left: 0; top: 0; width: 40px; height: 40px; z-index: 3; opacity: 0; will-change: transform; transform-origin: 50% 50%; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.gl-stage[data-phase="reveal"][data-result="goal"] .gl-ball { box-shadow: 0 0 0 2px var(--neon), 0 0 24px rgba(229, 255, 61, .7); }
/* 进球那一下的柠檬闪光(关了动态效果不闪) */
.gl-flash { position: absolute; inset: 0; z-index: 4; background: var(--neon); opacity: 0; pointer-events: none; }
.gl-flash.is-on { animation: gl-flash .5s ease-out both; }
@keyframes gl-flash { 0% { opacity: .55; } 100% { opacity: 0; } }
.gl-stage[data-reduced="1"] .gl-flash { animation: none; opacity: 0; }
/* 揭晓大字:进球 +RM X 弹跳(黄);撞柱红字;射偏灰字;没门 / 不射 白字 */
.gl-cap {
  position: absolute; left: 50%; top: 8%; z-index: 5; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px;
  padding: 8px 18px; border-radius: 16px; background: rgba(10, 10, 10, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  text-align: center; pointer-events: none; animation: gl-rise .28s ease-out both;
}
.gl-cap[hidden] { display: none; }
.gl-cap-card { display: inline-grid; place-items: center; min-width: 28px; padding: 2px 6px; border-radius: 6px; background: #fff; color: #111; font-style: normal; font-size: 14px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.gl-cap-card.is-red { color: #d8262f; }
.gl-cap b { font-size: 20px; font-weight: 800; }
.gl-cap em { font-style: normal; font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.gl-cap small { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gl-cap.is-goal b, .gl-cap.is-goal em { color: var(--neon); }
.gl-cap.is-goal em { animation: gl-bounce .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.gl-cap.is-post b, .gl-cap.is-post em, .gl-cap.is-trips b, .gl-cap.is-trips em { color: var(--bad); }
.gl-cap.is-miss b { color: var(--ink-2); }
/* 射偏输掉的钱「−RM x」跟撞柱、三条、别的游戏一样红字(老板 10-19:输了只写输多少,每个游戏都一样);大字「射偏」照旧灰 */
.gl-cap.is-miss em { color: var(--bad); }
@keyframes gl-rise { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes gl-bounce { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
/* 每局开始「底注飞进池」:固定定位盖在整页上,筹码从各座位飞到记分牌的池,池的数字弹一下;自己的那枚柠檬色 */
.gl-fly { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.gl-chip { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); padding: 3px 9px; border-radius: 999px; background: #151515; color: #fff; font-style: normal; font-size: 12px; font-weight: 800; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 2px 10px rgba(0, 0, 0, .6); will-change: transform, opacity; }
.gl-chip.is-me { background: var(--neon); color: var(--neon-ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.gl-pot b { display: inline-block; transform-origin: 50% 60%; }
.gl-pot b.is-bump { animation: gl-potbump .4s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes gl-potbump { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }
/* 场边灰掉的已出牌列 */
.gl-used { position: absolute; left: 10px; right: 10px; bottom: 6px; z-index: 2; display: flex; flex-wrap: wrap; gap: 3px; pointer-events: none; }
.gl-used i { display: inline-block; padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: var(--ink-3); font-style: normal; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gl-used i.is-red { color: #8a4a4a; }
/* 读屏用的那一句,画面上看不到 */
.gl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .gl-cap, .gl-cap.is-goal em, .gl-flash.is-on, .gl-post { animation: none; }
}

/* ---------- 舞台下面那一行:谁的回合 + 倒数 ---------- */
.gl-status { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 34px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
.gl-st-l.is-me { color: var(--neon); }
.gl-st-r { color: var(--ink-2); font-weight: 600; }
.gl-sec { min-width: 1.4em; padding: 2px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- 贴纸:状态栏右边一颗钮,面板往上开盖在球场上;座位上挂 3.2 秒(时长跟 goal-sticker-catalog.js 一致) ---------- */
/* 只把状态栏的字(谁的回合 + 倒数)抬到贴纸那层(12)上面:贴纸冒到这一行也盖不住倒数。
   整条状态栏不开层叠,贴纸钮(6)才会被右边座位的贴纸盖住而不是反过来;面板(15)照样在贴纸上面 */
.gl-statusbar { flex: none; position: relative; }
.gl-statusbar .gl-status { position: relative; z-index: 13; pointer-events: none; text-shadow: 0 1px 3px #000, 0 0 10px #000; } /* 这一行只有字;不挡下面的贴纸钮 */
.gl-statusbar.has-stk .gl-status { padding-inline: 52px; }
.gl-stk { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 6; }
.gl-stk-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); cursor: pointer; }
.gl-stk-btn svg { width: 22px; height: 22px; }
.gl-stk-btn.is-open { box-shadow: inset 0 0 0 1.5px var(--neon); color: var(--neon); }
.gl-stk-btn b { position: absolute; right: -4px; top: -4px; min-width: 22px; padding: 1px 4px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 10px; font-weight: 700; line-height: 14px; font-variant-numeric: tabular-nums; }
.gl-stk-btn:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.gl-stk-pick { position: absolute; right: 8px; bottom: calc(100% + 4px); z-index: 15; width: min(300px, calc(100vw - 16px)); padding: 6px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 8px 28px rgba(0, 0, 0, .7); }
.gl-stk-pick[hidden] { display: none; }
.gl-stk-pick header { display: flex; align-items: center; justify-content: space-between; height: 36px; padding-left: 8px; }
.gl-stk-pick header small { font-size: 11px; color: var(--ink-2); }
.gl-stk-x { width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 22px; cursor: pointer; }
.gl-stk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.gl-stk-grid button { display: grid; place-items: center; height: 66px; min-width: 44px; padding: 2px; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; }
.gl-stk-grid button:hover, .gl-stk-grid button:focus-visible { background: rgba(255, 255, 255, .05); border-color: var(--neon); outline: none; }
.gl-stk-grid button:disabled { opacity: .4; cursor: default; }
.gl-stk-grid img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 座位上那层:跟座位同一个格子,贴纸从圆盘上方冒出来,盖在状态栏 / 球场底边上 */
.gl-seatwrap { flex: none; position: relative; }
.gl-stk-layer { position: absolute; inset: 0; z-index: 12; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 4px; padding: 4px 10px 6px; pointer-events: none; }
.gl-stk-pop {
  position: relative; grid-column: var(--c8); grid-row: 1;
  animation: gl-stk-pop 3200ms linear both; animation-delay: var(--age, 0ms);
}
/* goal.js 量得到座位就照座位的实际位置摆(座位高矮不一、两种排法都对得上);格子那套只是量不到时的退路 */
.gl-stk-layer .gl-stk-pop.is-placed { position: absolute; grid-column: auto; grid-row: auto; }
.gl-stk-pop img { position: absolute; left: 50%; bottom: 22px; width: 72px; height: 72px; transform: translateX(-50%); object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .7)); }
/* 一排 8 个的时候格子窄,相邻两个人同时发会叠在一起:双号座位的贴纸抬高一截错开 */
.gl-stk-pop[data-even="1"] img { bottom: 52px; }
.gl-stk-pop.is-me img { filter: drop-shadow(0 0 6px rgba(229, 255, 61, .45)) drop-shadow(0 3px 6px rgba(0, 0, 0, .7)); }
/* 两头的座位贴着屏幕边:贴纸往里靠,别被切掉 */
.gl-stk-pop[data-e8="l"] img { left: 0; transform: none; }
.gl-stk-pop[data-e8="r"] img { left: auto; right: 0; transform: none; }
@keyframes gl-stk-pop {
  0% { opacity: 0; transform: translateY(10px) scale(.6); }
  6% { opacity: 1; transform: translateY(-4px) scale(1.06); }
  10% { transform: translateY(0) scale(1); }
  88% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(.96); }
}
@media (max-width: 420px) {
  .gl-stk-layer { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows4, 2), minmax(0, 1fr)); row-gap: 8px; } /* 行数跟座位一样(--rows4 由 goal.js 按座位数给) */
  .gl-stk-pop { grid-column: var(--c4); grid-row: var(--r4); }
  /* 一排 4 个格子够宽:贴纸放大、不用错开 */
  .gl-stk-pop img, .gl-stk-pop[data-even="1"] img { left: 50%; right: auto; bottom: 22px; width: 84px; height: 84px; transform: translateX(-50%); }
  .gl-stk-pop[data-e4="l"] img { left: 0; transform: none; }
  .gl-stk-pop[data-e4="r"] img { left: auto; right: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gl-stk-pop { animation-name: gl-stk-fade; }
  @keyframes gl-stk-fade { 0%, 92% { opacity: 1; } 100% { opacity: 0; } }
}

/* ---------- 座位圆盘:一排 8 个(窄屏两排 4 个),自己的放大 ---------- */
.gl-seats { flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 4px 10px 6px; }
@media (max-width: 420px) { .gl-seats { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 4px; padding-block: 2px 4px; } .gl-seat.is-spare { display: none; } .gl-seat { padding: 2px 0; } }
.gl-seat { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 4px 0; border-radius: 12px; text-align: center; }
.gl-disc {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #2a2a2a 0%, #141414 76%); box-shadow: inset 0 0 0 1.5px #2c2c2c, 0 2px 6px rgba(0, 0, 0, .6);
  font-style: normal; font-size: 15px; font-weight: 800;
}
.gl-seat.is-empty .gl-disc { background: #0f0f0f; box-shadow: inset 0 0 0 1px var(--line); }
.gl-seat.is-empty small { font-size: 10px; color: var(--ink-3); }
.gl-seat.is-me .gl-disc { width: 44px; height: 44px; font-size: 18px; box-shadow: inset 0 0 0 2px rgba(229, 255, 61, .6), 0 2px 8px rgba(0, 0, 0, .6); }
.gl-seat.is-away .gl-disc { opacity: .45; }
/* 轮到他:圆盘外一圈倒计时环(--p 0→1 走完),用 conic-gradient 画,不靠 JS 动画 */
.gl-seat.is-counting .gl-disc::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; z-index: -1;
  background: conic-gradient(var(--neon) calc((1 - var(--p, 0)) * 100%), transparent 0);
}
.gl-seat.is-turn .gl-disc { box-shadow: inset 0 0 0 1.5px var(--neon), 0 0 12px rgba(229, 255, 61, .35); }
/* 有头像:图铺满圆盘;内圈(自己的柠檬圈、轮到他的亮圈)改画在 ::after 上,才不会被图盖住 */
.gl-disc.has-avatar { background: #111; }
.gl-disc img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gl-disc.has-avatar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #2c2c2c; pointer-events: none; }
.gl-seat.is-me .gl-disc.has-avatar::after { box-shadow: inset 0 0 0 2px rgba(229, 255, 61, .75); }
.gl-seat.is-turn .gl-disc.has-avatar::after { box-shadow: inset 0 0 0 2px var(--neon); }
.gl-name { max-width: 100%; font-size: 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-away { font-style: normal; font-size: 9px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.gl-mini { display: flex; gap: 2px; }
.gl-mini i { display: inline-block; min-width: 14px; padding: 1px 2px; border-radius: 3px; background: #fff; color: #111; font-style: normal; font-size: 9px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gl-mini i.is-red { color: #d8262f; }
.gl-tag { font-size: 10px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gl-tag.is-win { color: var(--neon); }
.gl-tag.is-post { color: var(--bad); }
/* 座位上射偏的「−RM x」也是红字,跟撞柱、三条一样 */
.gl-tag.is-miss { color: var(--bad); }
.gl-tag.is-pass { color: var(--ink-3); font-weight: 600; }

/* ---------- 操作面板 ---------- */
.gl-panel { flex: 1 1 var(--gl-need); min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 6px 12px 0; }
.goal[data-glchat="b"]:not([data-turn="1"]) .gl-panel { flex-basis: calc(var(--gl-need) - 50px); }
/* 操作卡上面那块(goal.js 的 panelLayout):放不下就自己滚;底下那排按钮(.gl-panel > .gl-acts)不跟着滚、永远看得见、也不压住这块里的东西 */
.gl-pbody { flex: 0 1 auto; min-height: 0; margin-bottom: auto; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 8px; scrollbar-width: none; }
.gl-pbody::-webkit-scrollbar { display: none; }
/* 还有没露出来的(矮屏放不下,goal.js 量了写 data-more):底边淡出一截,看得出往下还能滑 */
.gl-pbody[data-more] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); }
.gl-hint { font-size: 13px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.gl-hint-2 { font-size: 12px; color: var(--ink-3); text-align: center; }
.gl-hint b { color: var(--ink); }
/* 下注区「这局你 −RM x」:输了的钱红字(射偏、撞柱、三条都是) */
.gl-hint b.is-miss, .gl-hint b.is-post { color: var(--bad); }
.gl-warn { font-style: normal; color: var(--bad); }
.gl-gate { font-size: 15px; font-weight: 700; text-align: center; }
.gl-quicks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gl-quick { display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 7px 2px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 11px; line-height: 1.15; color: var(--ink-2); }
.gl-quick small { font-size: 11px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.gl-quick.is-on { background: var(--neon); color: var(--neon-ink); box-shadow: none; }
.gl-quick.is-on small { color: var(--neon-ink); }
.gl-quick:disabled { opacity: .35; }
.gl-quick:active:not(:disabled) { transform: scale(.96); }
.gl-amt { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gl-amt:focus-within { box-shadow: inset 0 0 0 1px var(--neon); }
.gl-amt span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.gl-amt input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; outline: none; }
.gl-need { min-height: 16px; font-size: 12px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.gl-need.is-bad { color: var(--bad); }
/* 轮到自己射、这一枪带不够钱:不自动开充值(倒数会被盖住走完),在提示下面亮一颗「充值」由他自己按。柠檬底深色字 */
.gl-dep { display: block; margin: 2px auto 0; padding: 6px 18px; border-radius: 999px; background: var(--neon); color: var(--neon-ink); font-size: 13px; font-weight: 800; }
.gl-dep[hidden] { display: none; }
.gl-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gl-dir { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 700; }
.gl-dir small { font-size: 10px; font-weight: 500; color: var(--ink-3); }
.gl-dir.is-on { background: var(--neon); color: var(--neon-ink); box-shadow: none; }
.gl-dir:disabled { opacity: .4; }
/* 按钮排(射 / 不射、回座、坐下;弹层里的确认 / 取消)。弹层卡片会滚,按钮排 sticky 钉在卡片底边;
   操作卡里的按钮排不在会滚的那块里(见上面 .gl-pbody),本来就一直看得见:轮到你只有 12 秒,按钮必须一直看得见 */
.gl-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: sticky; bottom: 0; z-index: 2; padding: 6px 0 calc(8px + var(--safe-b, 0px)); background: linear-gradient(to top, #0a0a0a 75%, rgba(10, 10, 10, 0)); }
.gl-acts:has(> :only-child) { grid-template-columns: 1fr; }
.gl-panel > .gl-acts { flex: none; position: static; margin-top: 2px; background: none; }
/* 轮到我:「射 RM X 要带够 RM 2X」+「充值」一行,跟按钮排一起钉在会滚那块下面(goal.js 的 PANEL_PIN),矮屏也永远看得到 */
.gl-panel > .gl-needrow { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; padding-top: 4px; }
.gl-needrow .gl-need { min-width: 0; }
.gl-needrow .gl-dep { flex: none; margin: 0; }
.gl-btn { height: 48px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); font-size: 16px; font-weight: 700; }
.gl-btn.is-primary { background: var(--neon); color: var(--neon-ink); box-shadow: none; }
.gl-btn.is-primary b { font-weight: 800; font-variant-numeric: tabular-nums; }
.gl-btn:disabled { opacity: .35; }
.gl-btn:active:not(:disabled) { transform: scale(.97); }
/* 钱在路上:整个面板不接手指 */
.gl-panel.is-busy { pointer-events: none; }

/* ---------- 大厅:按档位列桌 ---------- */
.gl-lobby { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: grid; align-content: start; gap: 12px; padding: 4px 12px 16px; scrollbar-width: none; }
.gl-lobby::-webkit-scrollbar { display: none; }
.gl-lobby-hint, .gl-empty { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.gl-notice { padding: 8px 12px; border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; text-align: center; }
.gl-tier { display: grid; gap: 6px; }
.gl-tier h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 2px; font-size: 16px; font-weight: 800; }
.gl-tier h3 small { font-size: 11px; font-weight: 500; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.gl-room { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.gl-room.is-new { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.gl-room.is-dim { opacity: .5; pointer-events: none; }
.gl-room:active { transform: scale(.985); }
.gl-room-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gl-room-main b { font-size: 15px; font-weight: 700; }
.gl-room-main small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.gl-room-end { flex: none; display: flex; align-items: center; gap: 6px; }
.gl-room-end small { font-size: 11px; color: var(--neon); font-variant-numeric: tabular-nums; }
.gl-chev { font-style: normal; color: var(--ink-3); font-size: 18px; }

/* ---------- 弹层:规则卡、进桌确认 ---------- */
.gl-overlay { position: absolute; inset: 0; z-index: 20; display: grid; align-items: end; padding: 16px; background: rgba(0, 0, 0, .6); }
.gl-overlay[hidden] { display: none; }
.gl-ov-card { display: grid; gap: 12px; max-height: 80vh; overflow-y: auto; padding: 18px 16px calc(16px + var(--safe-b, 0px)); border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gl-ov-card h3 { font-size: 18px; font-weight: 800; }
.gl-ov-text { font-size: 15px; line-height: 1.4; }
.gl-rules { display: grid; gap: 8px; padding-left: 18px; font-size: 13px; line-height: 1.4; color: var(--ink); }

/* 窄又矮的手机(Telegram 里 390×750 左右):操作区行距收一点(10-15 老板:操作的界面太窄);球场高度不用再另外收,见 .gl-stage */
@media (max-height: 860px) and (max-width: 420px) {
  .goal { --gl-need: 242px; }
  .gl-panel { padding-top: 2px; }
  .gl-pbody { gap: 6px; }
  .gl-quick { padding-block: 5px; }
  .gl-amt { height: 40px; }
  .gl-acts { padding-top: 4px; }
}
/* 数字框和拉杆并排一行(数字框左、拉杆右),省下一整行;对子门多一排「射小 / 射大」时也放得下。没有拉杆时数字框照旧占满。
   以前只有窄屏这样排;底部多了聊天输入条以后宽一点的屏(Telegram 电脑版)也一样排,不然下注区要滚 */
.gl-pbody { grid-template-columns: 120px minmax(0, 1fr); column-gap: 10px; }
.gl-pbody > * { grid-column: 1 / -1; }
.gl-pbody > .gl-amt { grid-column: 1; padding: 0 10px; }
.gl-pbody > .gl-amt input { font-size: 18px; }
.gl-pbody > .gl-slide { grid-column: 2; align-self: center; padding: 0; }
.gl-pbody:not(:has(> .gl-slide)) > .gl-amt { grid-column: 1 / -1; }
/* 窄屏人多(5–8 人,座位两排):圆盘缩一号、两排靠近一点,矮屏再把球场收一点,让操作区还放得下 */
@media (max-width: 420px) {
  [data-seat-rows="2"] .gl-seats { row-gap: 0; padding-block: 0 2px; }
  [data-seat-rows="2"] .gl-disc { width: 30px; height: 30px; font-size: 13px; }
  [data-seat-rows="2"] .gl-seat.is-me .gl-disc { width: 36px; height: 36px; font-size: 15px; }
  [data-seat-rows="2"] .gl-seat { gap: 1px; padding: 1px 0; }
}

@media (max-height: 700px) {
  .goal { --gl-need: 220px; }
  .gl-disc { width: 32px; height: 32px; font-size: 13px; }
  .gl-seat.is-me .gl-disc { width: 38px; height: 38px; }
  .gl-btn { height: 44px; }
}
@media (max-height: 600px) {
  .gl-stage { min-height: 130px; }
  .gl-mini { display: none; }
}

/* ---------- 大厅横幅(app.js 画在首页):你在射龙门 RM5 桌还有座位 ---------- */
.bn-goal-seat { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 12px; padding: 12px 16px; border-radius: 20px; text-align: left; font: inherit; color: #fff; cursor: pointer; }
.bn-goal-seat span { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: #8a8a8a; font-variant-numeric: tabular-nums; }
.bn-goal-seat b { flex: none; padding: 8px 14px; border-radius: 999px; background: #e5ff3d; color: #0a0a0a; font-size: 13px; font-weight: 700; }
/* 大厅:一张桌一张卡(两列格子)。活着的桌拿底板当底图压暗;池是卡上唯一的黄;8 个座位点;右下角「观看」 */
.gl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gl-tcard { position: relative; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gl-tcard.is-dim { opacity: .5; pointer-events: none; }
.gl-tcard-main { display: grid; align-content: start; gap: 6px; width: 100%; min-height: 158px; padding: 12px 12px 40px; text-align: left; color: var(--ink); background-color: #0d0f0d; background-size: cover; background-position: center 42%; box-shadow: inset 0 0 0 100vmax rgba(8, 8, 8, .62); }
.gl-tcard-main:active { transform: scale(.985); }
.gl-tcard-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gl-tcard-top b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-tstatus { flex: none; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: var(--ink); font-style: normal; font-size: 10px; font-weight: 700; }
.gl-tstatus.is-playing { background: #fff; color: #111; }
.gl-tcard-pot { display: grid; gap: 1px; margin-top: 4px; }
.gl-tcard-pot small { font-size: 11px; color: var(--ink-2); }
.gl-tcard-pot b { font-size: 26px; font-weight: 800; line-height: 1.05; color: var(--neon); font-variant-numeric: tabular-nums; }
.gl-tcard-seats { display: flex; align-items: center; gap: 8px; }
.gl-tcard-seats small { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gl-dots { display: inline-flex; gap: 3px; }
.gl-dots b { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.gl-dots b.on { background: #fff; }
.gl-tcard-foot small { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gl-tcard-watch { position: absolute; right: 10px; bottom: 10px; height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.gl-tcard-watch:active { transform: scale(.96); }
.gl-tcard.is-new { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 158px; padding: 12px; background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); color: var(--ink); text-align: center; }
.gl-tcard.is-new:active { transform: scale(.985); }
.gl-tcard-plus { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); font-size: 22px; font-weight: 700; color: var(--ink-2); }
.gl-tcard.is-new b { font-size: 14px; font-weight: 800; }
.gl-tcard.is-new small { font-size: 11px; color: var(--ink-2); line-height: 1.3; font-variant-numeric: tabular-nums; }

/* 金额拉杆:一份底注拉到最多;轨道左边柠檬色是已拉的那段(--p 由 paintNeed 写) */
.gl-slide { padding: 2px 4px 0; }
.gl-slide input { --p: 0%; display: block; width: 100%; height: 36px; margin: 0; background: none; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.gl-slide input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--neon) var(--p), var(--line) var(--p)); }
.gl-slide input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--neon); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.gl-slide input::-moz-range-track { height: 8px; border-radius: 4px; background: var(--line); }
.gl-slide input::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--neon); }
.gl-slide input::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--neon); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.gl-slide-ends { display: flex; justify-content: space-between; margin-top: -2px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gl-slide-ends i { font-style: normal; }
.gl-slide-ends b { font-weight: 700; color: var(--ink-2); }

/* 门下面的 outs:剩下的牌里几张进球 / 射偏 / 撞柱,各占几成;对子门射大 / 射小各一行 */
.gl-odds { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gl-odds b { font-weight: 700; color: var(--ink); }
.gl-odds em { font-style: normal; font-weight: 700; color: var(--ink); }
.gl-odds .is-post { color: var(--bad); }
.gl-odds .is-post b { color: var(--bad); }

/* ---------- 桌上聊天(老板 10-22;10-25 第二次定样子 b —— c「太占位置了 整个就是聊天室」) ----------
   球场照原本大小、座位照原本排法;球场左下浮最新 3 句弹幕,有人射门球场中间亮一条结果;快捷语 + 输入框 + 发送一条排在操作卡下面;
   往回 200 句的记录收进状态栏聊天钮(贴纸钮旁边)拉开的抽屉,抽屉的底边贴在输入条上面(输入条只有一份,抽屉开着也不被盖住,照样能说)。
   根节点写死 data-glchat="b"(goal.js):样子相关的规则写成 .goal[data-glchat="b"] …,特异性压得住 [data-seat-rows="2"] 和媒体查询,别改成 .goal。
   class 一律 gl-chat-*(后台的 admin-workspace.css 也用 gl-*) */
.gl-chat-who { flex: none; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.gl-chat-text { min-width: 0; overflow-wrap: anywhere; }
.gl-chat-stk { width: 56px; height: 56px; }
.gl-chat-amt.is-win { color: var(--neon); }
.gl-chat-amt.is-post, .gl-chat-amt.is-miss { color: var(--bad); }

/* 状态栏右边、贴纸钮旁边的聊天钮(观看的人没有贴纸钮,聊天钮就靠最右)。红点 = 抽屉收着时别人说了几句。
   层级跟贴纸钮一样(6):右边座位冒出来的贴纸盖得住它,状态栏的字(13)照样在上面而且不吃点击 */
.gl-chat-open { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 6; }
.gl-chat-open:empty { display: none; }
.gl-statusbar.has-stk .gl-chat-open { right: 60px; }
.gl-statusbar.has-chat .gl-status { padding-inline: 52px; }
/* 右边两颗钮(10 + 44 + 6 + 44):字往左让,不两边对称留 108px(长名字、外文才不会挤成两行) */
.gl-statusbar.has-chat.has-stk .gl-status { padding-inline: 12px 110px; }
.gl-chat-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.gl-chat-btn svg { width: 22px; height: 22px; }
.gl-chat-btn.is-open { box-shadow: inset 0 0 0 1.5px var(--neon); color: var(--neon); }
.gl-chat-btn b { position: absolute; right: -3px; top: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.gl-chat-btn b[hidden] { display: none; }

/* 弹幕:球场左下最新 3 句(越旧越淡),不吃点击。只占门柱牌底边(草地线)以下那一截 ——
   goal.js 量了舞台(chatFloatFit),写进 --gl-fl-b(底边离舞台底多远:平常在已出牌列上面 10px;矮屏人多、上面一句都放不下时贴着草地线、盖到已出牌列上,保底 1 句)
   和 --gl-fl-max(放得下几句整句);放不下的旧句从上面裁掉,不盖门柱牌。层级 4 比已出牌列(2)高。
   一句 20px 高、句间 3px(goal.js 照这两个数算放几句) */
.gl-chat-float {
  position: absolute; left: 6px; bottom: var(--gl-fl-b, calc(var(--gl-used-h, 16px) + 10px)); z-index: 4; width: min(62%, 300px); max-height: var(--gl-fl-max, 66px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 3px; overflow: hidden; pointer-events: none;
}
.gl-chat-fl { flex: none; display: flex; align-items: center; gap: 2px; max-width: 100%; height: 20px; padding: 0 9px; border-radius: 999px; background: rgba(0, 0, 0, .58); font-size: 12px; line-height: 20px; white-space: nowrap; overflow: hidden; opacity: calc(1 - var(--i, 0) * .22); }
.gl-chat-fl .gl-chat-who { max-width: 6em; color: var(--neon); font-size: 12px; }
.gl-chat-fl.is-me .gl-chat-who { color: #fff; }
.gl-chat-fl .gl-chat-colon { flex: none; color: var(--ink-2); }
.gl-chat-fl .gl-chat-text { overflow: hidden; text-overflow: ellipsis; }
.gl-chat-fl .gl-chat-stk { flex: none; width: 18px; height: 18px; }

/* 射门结果的高光:有人射门的结果一放出来(服务器等到揭晓才放,不会剧透),球场中间亮一条 3.2 秒;进球柠檬底、撞柱 / 射偏 / 三条红底 */
.gl-chat-pillbox { position: absolute; left: 0; right: 0; top: 58%; z-index: 6; display: grid; place-items: center; padding: 0 12px; pointer-events: none; }
/* 射门揭晓时结果卡在球场上方(约 107px 高):球场矮(10-31 起 393 宽的 iPhone 约 166px)时 58% 会压住卡上「服务费 · 到账」那行,改成至少 116px、也不超出球场底边 */
.gl-stage[data-focus="1"] .gl-chat-pillbox { top: min(max(58%, 116px), calc(100% - 36px)); }
.gl-chat-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 6px 16px; border-radius: 999px; background: var(--neon); color: var(--neon-ink); font-size: 15px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .55); animation: gl-chat-pill 3.2s ease-out both; }
.gl-chat-pill .gl-chat-who { display: inline-block; vertical-align: bottom; max-width: 7em; color: inherit; font-size: 15px; font-weight: 800; }
.gl-chat-pill .gl-chat-amt { color: inherit; }
.gl-chat-pill.is-post, .gl-chat-pill.is-miss, .gl-chat-pill.is-trips { background: var(--bad); color: #fff; }
@keyframes gl-chat-pill { 0% { opacity: 0; transform: translateY(8px) scale(.94); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* 聊天抽屉:点聊天钮从下面拉出来(盖在球场下半、状态栏、座位、操作卡上),底边贴在输入条上面(--gl-bar-h 是 goal.js 量的输入条高度)。
   收着是 visibility: hidden(版面还在,记录区照样贴底;Tab、读屏跳过它)。轮到我射、点外面、Esc、返回键、换桌都会收起来;轮到我时也开不了。
   收着就不吃点击(pointer-events: none):visibility 要等收起动画 0.22 秒过完才变 hidden,这段时间点「射」会落在正在淡出的抽屉上 */
.goal[data-glchat="b"] .gl-chat {
  position: absolute; left: 0; right: 0; bottom: calc(var(--gl-bar-h, 50px) + var(--safe-b, 0px) + 6px); z-index: 16;
  display: flex; flex-direction: column; height: min(56%, 520px); padding: 0 12px 4px;
  border-radius: 20px 20px 0 0; background: var(--surface); box-shadow: inset 0 1px 0 #2c2c2c, 0 -10px 30px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(16px); visibility: hidden; pointer-events: none; transition: opacity .18s ease-out, transform .22s ease-out, visibility 0s linear .22s;
}
.goal[data-glchat="b"] .gl-chat.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .18s ease-out, transform .22s ease-out; }
.gl-chat-head { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; height: 46px; padding-left: 4px; font-size: 16px; }
.gl-chat-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #3a3a3a; }
.gl-chat-x { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--ink-2); }
/* 聊天记录(在抽屉里)。overflow-anchor: none:往上翻着看时位置由 goal.js 自己补(锚住可视区第一句),不跟浏览器原生的锚定叠在一起补两次(安卓有、iOS 没有) */
.gl-chat-log { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; padding: 4px 2px 8px; scrollbar-width: none; }
.goal[data-glchat="b"] .gl-chat-log { flex: 1 1 0; }
.gl-chat-log::-webkit-scrollbar { display: none; }
.gl-chat-log:focus { outline: none; }
.gl-chat-msg { display: grid; justify-items: start; gap: 2px; max-width: 84%; }
.gl-chat-msg .gl-chat-text { padding: 6px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.35; }
.gl-chat-msg.is-me { align-self: flex-end; justify-items: end; }
.gl-chat-msg.is-me .gl-chat-who { display: none; }
.gl-chat-msg.is-me .gl-chat-text { border-radius: 14px 4px 14px 14px; background: var(--neon); color: var(--neon-ink); box-shadow: none; font-weight: 600; }
.gl-chat-msg.is-sys { align-self: center; display: block; max-width: 100%; padding: 2px 10px; color: var(--ink-2); font-size: 12px; text-align: center; }
.gl-chat-msg.is-sys .gl-chat-who { display: inline; color: var(--ink); font-size: 12px; }
.gl-chat-empty { margin: auto; padding: 10px; color: var(--ink-3); font-size: 12px; }
/* 「↓ 新消息」(老板 10-25):抽屉开着、往上翻着看旧的、别人又说了话才冒出来,浮在抽屉底边正中(柠檬底黑字,跟发送钮一套);点了回到最底 */
.gl-chat-new {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3; width: max-content; margin-inline: auto; /* 居中不用 transform:全站 button:active 的 scale(.975) 会把 translateX 盖掉,按下就往右滑半个按钮,鼠标点左半边落空 */
  display: flex; align-items: center; gap: 4px; height: 32px; min-height: 0; padding: 0 14px 0 10px; border-radius: 999px; /* min-height: 0 压回全站 button 的 44px,热区靠下面的 ::before 补 */
  background: var(--neon); color: var(--neon-ink); font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .6);
}
.gl-chat-new::before { content: ''; position: absolute; inset: -6px -4px; } /* 手指的热区补到 44px 高(按钮按不到全站修那套) */
.gl-chat-new svg { flex: none; width: 16px; height: 16px; }
.gl-chat-new[hidden] { display: none; }

/* 底部输入条:快捷语一排(横滑)+ 输入框 + 发送,排在操作卡下面,一行 50px 高(两行要 102px:底部多两行,矮屏的下注区就放不下);
   点进输入框打字时快捷语先收起来,输入框拉满一整行。观看的人、被禁言的、后台关了聊天,只有一句提示。
   盖在抽屉上面一层(抽屉拉出来那一下从输入条后面冒出来) */
.gl-chat-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal[data-glchat="b"] .gl-chat-bar { flex: none; position: relative; z-index: 17; min-height: 50px; padding: 6px 12px 0; background: var(--bg); }
/* 轮到我(data-turn="1"):输入条收起来,还回约 50px 给操作卡(轮到我本来就不该打字;goal.js 轮到我时也收键盘、不开抽屉) */
.goal[data-glchat="b"][data-turn="1"] .gl-chat-bar { display: none; }
.gl-chat-quick { flex: 1 1 0; display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent); }
.gl-chat-quick::-webkit-scrollbar { display: none; }
/* 这一排横着滚(overflow-x: auto),overflow-y 也跟着变成会裁的:撑满输入条的高度(44px),胶囊上下 ::before 补的那截才落在框里、点得到;
   左右各留 3px 再用负的 margin 抵回去,两头那颗的热区也不被裁 */
.goal[data-glchat="b"] .gl-chat-quick { align-self: stretch; padding-inline: 3px; margin-inline: -3px; }
/* 看得到的是 36px 的胶囊,手指的热区用 ::before 补到 44px 高(全站 button 的 min-height 44 在这里压回去,不然一排胶囊又胖又高) */
.gl-chat-chip { position: relative; flex: none; height: 36px; min-height: 0; padding: 0 12px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(229, 255, 61, .42); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.gl-chat-chip::before { content: ''; position: absolute; inset: -4px -3px; }
.gl-chat-row { flex: 0 0 50%; display: flex; align-items: center; gap: 8px; min-width: 0; }
.gl-chat-bar:has(.gl-chat-in:focus) .gl-chat-quick { display: none; }
.gl-chat-bar:has(.gl-chat-in:focus) .gl-chat-row { flex: 1 1 auto; }
.gl-chat-in { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: inherit; font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.gl-chat-in::placeholder { color: var(--ink-3); }
.gl-chat-in:focus { box-shadow: inset 0 0 0 1.5px var(--neon); }
.gl-chat-send { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--neon); color: var(--neon-ink); }
.gl-chat-send svg { width: 20px; height: 20px; }
.gl-chat-send b { position: absolute; right: -4px; top: -4px; min-width: 20px; padding: 1px 4px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 10px; line-height: 16px; }
.gl-chat-chip:disabled, .gl-chat-send:disabled { opacity: .45; }
.gl-chat-hint { flex: 1; padding: 8px 0 4px; color: var(--ink-2); font-size: 13px; text-align: center; }
.gl-chat-quick[hidden], .gl-chat-row[hidden], .gl-chat-hint[hidden], .gl-chat-send b[hidden] { display: none; }

/* 操作卡里那排按钮不再是最底下的东西了(输入条才是),底部安全区 .goal 已经垫过一份,这里不重复垫(iPhone 全屏白丢约 34px) */
.goal[data-glchat="b"] .gl-panel > .gl-acts { margin-top: 0; padding: 4px 0 6px; }
/* 没轮到我(等着、先选好下一枪):提示和「离座」排同一行,离座缩成右边的小按钮,省一整排;快捷金额、数字框、拉杆照样在(先选好下一枪)。
   格子多开第三栏(auto = 离座钮多宽就留多宽):提示占第一行左边两栏、离座占第三栏。不能两样叠在同一格再给提示右边留固定宽度 ——
   外文的离座钮比中文宽一倍(马来文「Rehat sebentar」145px),提示会钻到按钮底下被盖住。拉杆跟着占到最右;离座中、观看中不是 is-pre,不受影响 */
.goal[data-glchat="b"] .gl-panel.is-pre .gl-pbody { grid-template-columns: 120px minmax(0, 1fr) auto; }
.goal[data-glchat="b"] .gl-panel.is-pre .gl-pbody > .gl-hint:first-child { grid-row: 1; grid-column: 1 / 3; align-self: center; text-align: left; }
.goal[data-glchat="b"] .gl-panel.is-pre .gl-pbody > .gl-acts { grid-row: 1; grid-column: 3; justify-self: end; align-self: center; position: static; display: block; padding: 0; background: none; }
.goal[data-glchat="b"] .gl-panel.is-pre .gl-pbody > .gl-slide { grid-column: 2 / -1; }
.goal[data-glchat="b"] .gl-panel.is-pre .gl-acts .gl-btn { height: 44px; padding: 0 20px; font-size: 14px; }
/* 矮屏(Telegram 里 iPhone SE 这种):「先选好下一枪」那句小字先收起来,快捷金额、数字框、拉杆多露一截 */
@media (max-height: 700px) { .goal[data-glchat="b"] .gl-panel.is-pre .gl-pbody > .gl-hint-2 { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .goal[data-glchat="b"] .gl-chat, .goal[data-glchat="b"] .gl-chat.is-open { transform: none; transition: none; }
  .gl-chat-pill { animation: none; }
}
