/* 你挑我玩 · 特效层样式（配 js/fx.js）
   这个文件只画「整屏播报」那一层和抖屏，别的都在 play.css / app.css / ogames.css 里。
   规矩：
     · **颜色和字体一个都不在这儿定义**，全部 var() 引用 css/theme.css（唯一定义处）。
     · 两套色只挂在最外面那一层：
         .fx-dm        该你喝   → 琥珀（--gold / --amber2）
         .fx-dm.them   该别人喝 → 绿（--cool / --green2）
       里面的杯子、数字、点阵一个都不用知道这单是谁的，以后加第三种形态也只是多一个类名。
     · 基础件（html/body、button 重置、.btn、.tok 这些）在 css/base.css 里，这儿不重复定义。
     · 只动 transform / opacity；大面积元素不做逐帧的 filter / box-shadow。
     · prefers-reduced-motion: reduce → 文件末尾把这里所有动画退化成「直接显示」
       （base.css 的全局规则是把时长压到 .01ms，而这几条动画的末帧是 opacity:0，
        压到 0 秒就等于整层看不见，所以这儿要单独按住）。 */

/* ---------- 特效层本体 ---------- */
#fxl {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  overflow: hidden; contain: layout size style;
}
/* 抖屏时夹掉横向溢出：用 clip（不建滚动容器、不动已经滚到的位置），比 overflow:hidden 稳 */
html.fx-shk, html.fx-shk body { overflow-x: clip; }

/* ====================================================================
   「该谁喝了」整屏播报（fx.js 的 drinkMe / drinkThem）
   #fxl 本身 pointer-events:none，这一层自己打开，好让人点一下提前收掉
   ==================================================================== */
.fx-dm {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: auto;
  padding: calc(14px + var(--safe-t)) 16px calc(14px + var(--safe-b));
}
/* 琥珀（自己喝）：霓虹紫底 + 一大片金光 */
.fx-dm-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(88% 56% at 50% 40%, rgba(255, 194, 71, .46) 0%, rgba(255, 194, 71, 0) 72%),
    linear-gradient(180deg, rgba(96, 54, 6, .96) 0%, rgba(48, 22, 34, .97) 48%, rgba(16, 8, 24, .98) 100%);
  animation: fx-dm-bg var(--ms, 1800ms) ease-out both;
}
@keyframes fx-dm-bg { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

.fx-dm-c {
  position: relative; display: grid; justify-items: center; gap: 4px;
  text-align: center; max-width: 420px;
  animation: fx-dm-in var(--ms, 1800ms) cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes fx-dm-in {
  0% { opacity: 0; transform: scale(.52); }
  12% { opacity: 1; transform: scale(1.12); }
  22% { transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.07); }
}

/* 标题里可能顶着一个最长 16 个字的昵称（「小明 该喝了」），窄屏上让它自己换行，别顶出去 */
.fx-dm-k {
  max-width: 100%;
  font-family: var(--title);
  font-size: 22px; font-weight: 900; letter-spacing: 4px; line-height: 1.3;
  color: var(--gold);
  text-shadow: 0 3px 0 rgba(96, 48, 0, .85), 0 8px 22px rgba(0, 0, 0, .6);
  overflow-wrap: anywhere;
}
@media (max-width: 360px) { .fx-dm-k { font-size: 19px; letter-spacing: 3px; } }

/* ---------- 大数字那一行 ---------- */
.fx-dm-row { display: flex; align-items: flex-end; gap: 5px; }
.fx-dm .fx-cup {
  width: 62px; height: 80px; margin-right: 8px; align-self: center;
  transform-origin: 50% 78%;
  animation: fx-dm-tilt 1.05s .2s ease-in-out 2 both;
}
.fx-dm .fx-cup .fx-gl { fill: none; stroke: var(--amber2); stroke-width: 2.6; stroke-linecap: round; }
.fx-dm .fx-cup .fx-liq { fill: var(--gold); }
.fx-dm .fx-cup .fx-bub { fill: rgba(255, 255, 255, .7); }
@keyframes fx-dm-tilt { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-24deg); } 72% { transform: rotate(-15deg); } }
.fx-dm-n {
  font-size: 92px; font-weight: 900; line-height: .9; color: #fff;
  text-shadow: 0 6px 0 rgba(150, 82, 0, .9), 0 16px 36px rgba(0, 0, 0, .66);
}
.fx-dm-row i {
  font-style: normal; font-size: 26px; font-weight: 800; margin-bottom: 14px;
  color: var(--amber2);
}
/* 口数的点阵：扫一眼就知道几口，不用去读数字 */
.fx-dm-pips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 262px; margin-top: 10px; }
.fx-dm-pips i {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 10px rgba(255, 194, 71, .8);
  animation: fx-dm-pip .42s calc(.2s + var(--k) * .055s) cubic-bezier(.2, .9, .3, 1.6) both;
}
@keyframes fx-dm-pip { from { opacity: 0; transform: scale(0) translateY(10px); } }
.fx-dm-tap { margin-top: 14px; font-size: 12.5px; color: rgba(255, 238, 208, .62); }

/* ---------- 两个人以上一起喝：一行一个人 ---------- */
.fx-dm-ls { list-style: none; margin: 12px 0 2px; padding: 0; width: min(312px, 86vw); display: grid; gap: 7px; }
.fx-dm-ls li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-radius: 14px;
  background: rgba(255, 214, 140, .14); border: 1px solid rgba(255, 206, 120, .3);
  animation: fx-dm-ln .36s calc(.1s + var(--k, 0) * .07s) cubic-bezier(.2, .9, .3, 1.4) both;
}
.fx-dm-ls li b { font-size: 19px; font-weight: 800; color: #fff6e4; min-width: 0; overflow-wrap: anywhere; }
.fx-dm-ls li span { font-size: 23px; font-weight: 900; color: var(--amber2); white-space: nowrap; }
.fx-dm-ls li.rest {
  justify-content: center; padding: 2px 0 0; border: 0; background: none;
  font-size: 13.5px; font-weight: 700; color: rgba(255, 238, 208, .66);
}
@keyframes fx-dm-ln { from { opacity: 0; transform: translateY(9px); } }

/* ====================================================================
   该别人喝 → 整层换成绿（.them）。和上面那套琥珀一眼分得清，这是站长明确要求的。
   ==================================================================== */
.fx-dm.them .fx-dm-bg {
  background:
    radial-gradient(88% 56% at 50% 40%, rgba(61, 220, 151, .4) 0%, rgba(61, 220, 151, 0) 72%),
    linear-gradient(180deg, rgba(6, 74, 48, .96) 0%, rgba(10, 40, 48, .97) 48%, rgba(8, 14, 26, .98) 100%);
}
.fx-dm.them .fx-dm-k { color: var(--green2); text-shadow: 0 3px 0 rgba(6, 70, 42, .9), 0 8px 20px rgba(0, 0, 0, .6); }
.fx-dm.them .fx-cup .fx-gl { stroke: var(--green2); }
.fx-dm.them .fx-cup .fx-liq { fill: var(--cool); }
.fx-dm.them .fx-dm-n { text-shadow: 0 6px 0 rgba(20, 110, 70, .9), 0 16px 36px rgba(0, 0, 0, .66); }
.fx-dm.them .fx-dm-row i { color: var(--green2); }
.fx-dm.them .fx-dm-pips i { background: var(--cool); box-shadow: 0 0 10px rgba(61, 220, 151, .8); }
.fx-dm.them .fx-dm-tap { color: rgba(222, 255, 236, .6); }
.fx-dm.them .fx-dm-ls li { background: rgba(140, 244, 196, .12); border-color: rgba(120, 232, 176, .28); }
.fx-dm.them .fx-dm-ls li b { color: #eafff1; }
.fx-dm.them .fx-dm-ls li span { color: var(--green2); }

/* ====================================================================
   动画退化：reduce 时不位移、不缩放、不抖，但该说的话一样说清楚
   （.fx-dm 自己不淡出 —— 留在那儿等 fx.js 到点把它摘掉）
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
  .fx-dm-bg, .fx-dm-c, .fx-dm .fx-cup, .fx-dm-pips i, .fx-dm-ls li { animation: none !important; }
  .fx-dm-bg { opacity: 1; }
  .fx-dm-c { opacity: 1; transform: none; }
}
