/* 冲天鹰 —— 黑金柠檬
 * 图片只有角色:老鹰机长(canvas 里的飞行循环、跑道上挥手那张)。曲线、格线、倍数、倒数在 canvas 上现画(eagle-stage.js);
 * 面板、按钮、最近几局、名单全是 CSS。
 * 版面(竖屏):顶栏 / 最近几局一排 / 舞台(约 36% 高)/ 两个下注区(永远不卷走:「收钱」按钮不能被卷出画面)/ 下面一块可以卷:本局下注名单。
 * 按钮的字色都要看得清:柠檬底、橙底上一律深色字(白字、红字在这两个底上都不够对比)。
 */
.eagle {
  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;
  --cash-a: #ff8a00; --cash-b: #ffb300; --cancel-ink: #9e0f18;
  --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;
}
.eagle[hidden] { display: none; }
.eagle :where(p, h2, h3, ul, table) { margin: 0; }
/* 用 :where 把重置的权重压到 0:后面单个 class 的按钮样式才盖得过它(road.css 那种写法会把背景吃掉) */
.eagle :where(button) { appearance: none; border: 0; margin: 0; padding: 0; font: inherit; color: inherit; background: none; cursor: pointer; }
.eagle :where(input) { appearance: none; border: 0; margin: 0; font: inherit; color: inherit; background: none; -webkit-user-select: text; user-select: text; }
.eagle button:focus-visible, .eagle input:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.eagle img { -webkit-user-drag: none; pointer-events: none; }

/* ---------- 顶栏 ---------- */
.eg-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.eg-back, .eg-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); }
.eg-back svg, .eg-help svg { width: 20px; height: 20px; }
.eg-help { color: var(--ink-2); font-weight: 700; }
.eg-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eg-bal { flex: none; max-width: 46%; 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; }
/* 余额不够、另一注还在飞(不自动开充值,免得盖住「收钱」):余额旁边亮几秒,要不要去由他自己按。柠檬底深色字 */
.eg-dep { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--neon); color: var(--neon-ink); font-size: 13px; font-weight: 800; white-space: nowrap; }
.eg-dep[hidden] { display: none; }
.eg-top:has(.eg-dep:not([hidden])) .eg-bal { max-width: 34%; } /* 亮的那几秒让余额让一点位子,小屏不挤出画面 */
/* 顶栏多了音符按钮(2026-10-23):间距收一点、余额框窄一点 */
.eg-top.eg-has-music { gap: 6px; }
.eg-top.eg-has-music .eg-bal { padding-inline: 10px; flex-shrink: 1; min-width: 0; } /* 窄手机「充值」亮起来时余额让位(末尾变「…」),不把充值挤出画面 */

/* ---------- 最近几局:最新的在最左边,超出的往右淡出 ---------- */
.eg-recent {
  flex: none; display: flex; gap: 6px; padding: 0 16px 8px; overflow: hidden; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent);
}
.eg-chip {
  flex: none; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.eg-chip.is-mid { color: var(--neon); box-shadow: inset 0 0 0 1px rgba(229, 255, 61, .55); background: transparent; }
.eg-chip.is-hi { color: var(--neon-ink); background: var(--neon); box-shadow: none; }

/* ---------- 舞台 ---------- */
.eg-stage { position: relative; flex: 0 0 36%; min-height: 180px; max-height: 360px; margin: 0 12px; border-radius: 16px; overflow: hidden; background: #070708; box-shadow: inset 0 0 0 1px var(--line); }
.eg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.eg-players {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; pointer-events: none;
  background: rgba(10, 10, 10, .78); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
.eg-players[hidden] { display: none; }
/* 收钱确认:舞台上方冒一条柠檬色(深色字) */
.eg-pop {
  position: absolute; top: 42px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px);
  padding: 8px 16px; border-radius: 999px; pointer-events: none;
  background: var(--neon); color: var(--neon-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.eg-pop[hidden] { display: none; }
.eg-pop.is-in { animation: eg-pop .26s ease-out; }
@keyframes eg-pop { from { opacity: 0; transform: translate(-50%, -8px) scale(.94); } }
/* 关了动态效果:收钱那一条不弹(倍数和飞机照样动,那是游戏本身) */
@media (prefers-reduced-motion: reduce) {
  .eg-pop.is-in { animation: none; }
}
/* 读屏用的那一句,画面上看不到 */
.eg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 两个下注区(不卷) ---------- */
.eg-panels { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 12px 0; }
.eg-panels.is-one { grid-template-columns: minmax(0, 1fr) auto; }
/* 里面那一栏也要 minmax(0, 1fr):不然「自动」那一页的开关 + 倍数一行把整个下注区撑宽,360 / 390 宽的手机上 + 号和第二个下注区被挤出画面 */
.eg-panel { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); align-content: start; }
.eg-ptop { display: flex; align-items: center; gap: 6px; }
.eg-tabs { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 999px; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); }
/* regal.css 给所有 button 一个 min-height: 44px,这里写死 40px(手指够按):快捷金额排成两行之后,这一行和金额那一行各省 4px 给名单 */
.eg-tab { height: 40px; min-height: 40px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.eg-tab.is-on { background: var(--neon); color: var(--neon-ink); }
.eg-tab:disabled { opacity: .55; }
.eg-fold { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 16px; font-weight: 700; line-height: 1; }
.eg-fold:disabled { opacity: .35; }
.eg-amt { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 4px; padding: 2px; border-radius: 12px; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); }
.eg-step { height: 40px; min-height: 40px; border-radius: 10px; background: var(--surface-2); font-size: 18px; font-weight: 700; line-height: 1; }
.eg-step:disabled { opacity: .35; }
/* 16px:iOS 输入框字小于 16px 一点进去整页会放大 */
.eg-amt-in { width: 100%; min-width: 0; height: 32px; text-align: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.eg-amt-in:disabled { color: var(--ink-2); }
/* 快捷金额(默认 RM5 / 10 / 50 / 100 / 200 / 500):两个下注区并排时 2 行 × 3 个,一个 40px 高、360 宽的手机上 46px 宽;
 * 一行几个由 eagle.js 按筹码个数给(--cols / --cols-one)。只剩一个下注区(第二个收起来)时一行排完,省下一行给名单;
 * 340px 以下的小手机一行 6 个只剩 35px 宽,照样排两行。不做横向卷动:大额的那几个卷到看不见,等于没加 */
.eg-quick { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 4px; }
@media (min-width: 341px) {
  .eg-panels.is-one .eg-quick { grid-template-columns: repeat(var(--cols-one, 6), minmax(0, 1fr)); }
}
.eg-q { height: 40px; min-height: 40px; border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.eg-q.is-on { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(229, 255, 61, .55); }
.eg-q:disabled { opacity: .35; }
.eg-auto { display: flex; align-items: center; gap: 6px; }
.eg-auto[hidden] { display: none; }
.eg-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 30px; font-size: 12px; color: var(--ink-2); text-align: left; }
.eg-switch i { flex: none; position: relative; width: 30px; height: 18px; border-radius: 999px; background: #2a2a2a; transition: background .15s; }
.eg-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #8a8a8a; transition: transform .15s, background .15s; }
.eg-switch.is-on { color: var(--ink); }
.eg-switch.is-on i { background: var(--neon); }
.eg-switch.is-on i::after { transform: translateX(12px); background: var(--neon-ink); }
.eg-switch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eg-switch:disabled { opacity: .55; }
.eg-target { flex: none; display: flex; align-items: center; gap: 1px; height: 30px; padding: 0 8px; border-radius: 999px; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
.eg-target-in { width: 3.6em; height: 28px; text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.eg-target-in:disabled { color: var(--ink-3); }

/* 大按钮:上面一行字,下面一行金额(RM 12,345.67 在 320px 宽的手机上也放得下) */
.eg-go {
  display: grid; place-items: center; align-content: center; gap: 1px; min-height: 52px; padding: 6px 8px; border-radius: 14px;
  background: var(--neon); color: var(--neon-ink); text-align: center; contain: layout paint;
  transition: transform .08s ease-out, filter .15s;
}
.eg-go-l { font-size: 13px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; }
.eg-go-a { font-size: clamp(16px, 4.6vw, 20px); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eg-go-a[hidden] { display: none; }
.eg-go:active:not(.is-off) { transform: scale(.97); }
/* 按钮里面的字、金额、金币一律点不到:按下、松手、click 都落在按钮本身(里面的数字一秒改十次,不能让手指落在会变的东西上) */
.eg-go > *, .eg-go * { pointer-events: none; }
.eg-go { -webkit-touch-callout: none; }
.eg-go.is-cancel { background: var(--neon); color: var(--cancel-ink); }
.eg-go.is-cash { background: linear-gradient(180deg, var(--cash-b), var(--cash-a)); color: var(--neon-ink); }
.eg-go.is-busy { background: #2a2a2a; color: var(--ink); }
.eg-go.is-wait, .eg-go.is-auto { background: #1d1f10; color: var(--neon); box-shadow: inset 0 0 0 1px rgba(229, 255, 61, .45); }
.eg-go.is-lost { background: #2a1214; color: #ffb3b3; box-shadow: inset 0 0 0 1px rgba(255, 90, 90, .45); }
.eg-go.is-off { filter: saturate(.85); }
.eg-go.is-bet.is-off { opacity: .6; }
.eg-sub { min-height: 14px; font-size: 11px; line-height: 1.25; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
/* 飞走了那一行只有输掉的钱「−RM x」:红字、粗一点,跟别的游戏一样(字号不动,小屏下注区的高度量过) */
.eg-sub.is-loss { font-weight: 800; color: var(--bad); }
.eg-panel.is-busy .eg-go { cursor: progress; }
/* 第二个下注区收起来:只剩一个「+ 再加一注」 */
.eg-unfold { display: none; }
.eg-panel.is-fold { padding: 4px; align-content: stretch; }
.eg-panel.is-fold > :not(.eg-unfold) { display: none; }
.eg-panel.is-fold .eg-unfold { display: grid; place-items: center; width: 44px; height: 100%; min-height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--neon); font-size: 18px; font-weight: 800; }
.eg-unfold span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 本局下注名单(这一块可以卷) ---------- */
.eg-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 12px 0; scrollbar-width: none; }
.eg-body::-webkit-scrollbar { display: none; }
.eg-list { display: grid; gap: 6px; padding-bottom: 10px; }
.eg-list-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.eg-list-h span:first-child { font-weight: 700; color: var(--ink); }
.eg-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.eg-table th { padding: 0 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: left; }
.eg-table td { padding: 7px 8px; background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.eg-table td:first-child { border-radius: 10px 0 0 10px; color: var(--ink); }
.eg-table td:last-child { border-radius: 0 10px 10px 0; }
.eg-table th:not(:first-child), .eg-table td:not(:first-child) { text-align: right; }
.eg-table tr.is-cashed td { background: #1a1d08; color: var(--neon); box-shadow: inset 0 1px 0 rgba(229, 255, 61, .35), inset 0 -1px 0 rgba(229, 255, 61, .35); }
.eg-table tr.is-out td { opacity: .45; }
/* 看得懂的字(表头、没人下注)用 --ink-2:--ink-3 在黑底上只有 3:1,只留给点不动的东西 */
.eg-empty { padding: 6px 2px; font-size: 12px; color: var(--ink-2); }

/* 矮屏幕:舞台收一点(下注区不能被挤出画面) */
@media (max-height: 700px) {
  .eg-stage { flex-basis: 32%; }
  .eg-go { min-height: 48px; }
}
@media (max-height: 600px) {
  .eg-stage { flex-basis: 28%; min-height: 150px; }
  .eg-recent { padding-bottom: 6px; }
  .eg-sub { min-height: 0; }
  /* 快捷金额排成两行之后下注区高了 32px:320×512(小手机在 Telegram 里)最下面那行小字会被切掉。
   * 舞台不动,改从间距拿回来(按钮都还是 40px 以上) */
  .eg-top { padding-top: 6px; padding-bottom: 6px; }
  .eg-panels { padding-top: 6px; }
  .eg-panel { gap: 4px; }
  .eg-go { min-height: 44px; }
  .eg-body { padding-top: 6px; }
}
/* 「自动」那一页比「下注」那一页多一行开关 + 倍数:矮于 660px 的屏幕(360×640 以下)两个下注区都开着这一页,下注区底下会被切掉。
 * 矮屏幕上这一页不放快捷金额(金额照样用 − / + 或者直接打,自动收钱的设定回「下注」那一页也还在),要点快捷金额回「下注」那一页 */
@media (max-height: 660px) {
  .eg-panel.is-auto .eg-quick { display: none; }
}
@media (max-width: 340px) {
  .eg-top { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .eg-title { font-size: 15px; }
  .eg-bal { padding: 7px 10px; }
  .eg-panels { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .eg-panel { padding: 6px; }
  .eg-amt { grid-template-columns: 28px minmax(0, 1fr) 28px; }
}
