/* 吹牛骰子 · 对赌一局
   左边是她，右边是你俩的对话，底下一条喊价。
   状态只用橙(她/开/输) 与 蓝(你/喊价) —— 作者红绿色盲，禁用红绿对比。 */

:root {
  --ink: #120e11; --ink-2: #1a1416;
  --fg: #f4ece4; --dim: #cbbdb3; --faint: #a4958b;
  --line: rgba(255,228,200,.15); --line-2: rgba(255,228,200,.08);
  --pane: rgba(26,20,22,.8);
  --amber: #E69F00; --amber-lo: #c78a09;
  --blue: #2a93d4; --blue-lo: #0072B2;
  --r: 12px; --r-lg: 18px;
  --ease: cubic-bezier(.16,1,.3,1);
  --serif: "Noto Serif SC","Source Han Serif SC","STSong",serif;
  --sans: "Microsoft YaHei UI","Noto Sans SC",system-ui,sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--fg);
  font: 15px/1.6 var(--sans); overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0,1fr) auto;
}
::selection { background: rgba(230,159,0,.3); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sprites { position: absolute; width: 0; height: 0; }
.ic { width: 15px; height: 15px; flex: none; }
button, a.chip { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.hud {
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(14px,2.5vw,24px); font-size: 13.5px;
  border-bottom: 1px solid var(--line-2);
}
.brand { font: 400 18px/1 var(--serif); letter-spacing: .1em; }
.sp { flex: 1; }
.score { display: flex; align-items: center; gap: 11px; color: var(--dim); }
.score b { color: var(--fg); font-size: 16px; font-variant-numeric: tabular-nums; }
.score i { font-style: normal; color: var(--faint); margin-left: -5px; }
.score em { font-style: normal; }
.score .you b { color: var(--blue); }
.score .her b { color: var(--amber); }
.nm { cursor: pointer; border-bottom: 1px dashed var(--line); }
.nm:hover { color: var(--fg); border-color: var(--blue); }
.drinks { display: inline-flex; gap: 2px; }
.drinks .ic { color: var(--amber); width: 14px; height: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--pane); color: var(--dim);
  transition: color .18s, border-color .18s;
}
.chip:hover { color: var(--fg); border-color: rgba(230,159,0,.5); }
.chip .box {
  width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--line);
  display: grid; place-items: center; transition: background .16s, border-color .16s;
}
.chip[aria-pressed="true"] { color: var(--fg); border-color: rgba(42,147,212,.55); }
.chip[aria-pressed="true"] .box { background: var(--blue); border-color: var(--blue); }
.chip[aria-pressed="true"] .box::after {
  content: ""; width: 6px; height: 3px;
  border-left: 1.8px solid #0d1b24; border-bottom: 1.8px solid #0d1b24;
  transform: rotate(-45deg) translate(1px,-1px);
}
body:not(.odds) .opt small, body:not(.odds) .challenge span { display: none; }

/* ---------- 房间：她 + 对话 ---------- */
.room {
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(290px,.95fr);
  min-height: 0; overflow: hidden;
}
.her { position: relative; overflow: hidden; background: var(--ink-2); }
.her img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  display: block; transition: opacity .42s var(--ease);
}
.her.swap img { opacity: 0; }
.fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 72%, rgba(18,14,17,.8) 100%),
              linear-gradient(0deg, rgba(18,14,17,.72) 0, transparent 30%);
}

/* ---------- 对话窗 ---------- */
.side {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  border-left: 1px solid var(--line-2); background: var(--ink-2);
}
.chat {
  flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth;
  padding: 18px clamp(14px,1.6vw,20px); display: flex; flex-direction: column; gap: 11px;
}
.chat::-webkit-scrollbar { width: 7px; }
.chat::-webkit-scrollbar-thumb { background: rgba(255,228,200,.16); border-radius: 99px; }
.msg { max-width: 88%; flex: none; animation: in .32s var(--ease) backwards; }
@keyframes in { from { opacity: 0; transform: translate3d(0,8px,0); } }
.msg .who { font-size: 11.5px; color: var(--faint); margin: 0 0 3px 2px; }
.msg .txt {
  padding: 10px 14px; border-radius: var(--r-lg); font-size: 15px; line-height: 1.6;
  border: 1px solid var(--line-2); overflow-wrap: anywhere;
}
.msg.her { align-self: flex-start; }
.msg.her .txt {
  background: rgba(230,159,0,.1); border-color: rgba(230,159,0,.25);
  border-bottom-left-radius: 5px; font-family: var(--serif); color: #fbf3e9;
}
.msg.me { align-self: flex-end; }
.msg.me .who { text-align: right; margin: 0 2px 3px 0; }
.msg.me .txt {
  background: rgba(42,147,212,.14); border-color: rgba(42,147,212,.3);
  border-bottom-right-radius: 5px; font-weight: 600;
}
.msg.sys { align-self: stretch; max-width: 100%; }
.msg.sys .txt {
  background: transparent; border: 0; color: var(--faint); font-size: 13px;
  text-align: center; padding: 2px 0;
}
.msg.sys.big .txt {
  background: rgba(255,255,255,.035); border: 1px solid var(--line-2);
  color: var(--dim); padding: 11px 14px; text-align: left; font-size: 14px;
}
.msg.sys b { color: var(--fg); }
.msg.sys .win { color: var(--blue); font-weight: 700; }
.msg.sys .lose { color: var(--amber); font-weight: 700; }
.mini { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: -7px; margin-left: 5px; }
.mini .die { --s: 22px; border-radius: 5px; animation: none; box-shadow: 0 2px 5px rgba(0,0,0,.5); }

.botstate {
  padding: 10px clamp(14px,1.6vw,20px); border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--faint);
}
.botstate .row { display: flex; align-items: center; gap: 8px; }
.botstate .tag { padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); }
.botstate .tag.gto { color: var(--blue); border-color: rgba(42,147,212,.45); }
.botstate .tag.ex { color: var(--amber); border-color: rgba(230,159,0,.5); background: rgba(230,159,0,.12); }
.botstate .bar { flex: 1; height: 2px; border-radius: 99px; background: var(--line); overflow: hidden; }
.botstate .bar i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: 0 50%; transition: transform .6s var(--ease); }
.botstate ul { margin: 5px 0 0; padding-left: 15px; }
.botstate li { color: var(--dim); }
.botstate li::marker { color: var(--amber-lo); }

/* ---------- 她那边的小道具 ---------- */
.glass {
  position: absolute; right: 9%; bottom: 13%; width: 38px; z-index: 2;
  display: grid; justify-items: center;
  animation: raise .64s var(--ease) backwards;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.7));
}
@keyframes raise { from { transform: translate3d(0,36px,0) rotate(-10deg); opacity: 0; } }
.glass-body {
  width: 38px; height: 42px; border: 1.6px solid rgba(255,236,206,.6); border-top: 0;
  border-radius: 3px 3px 20px 20px; background: rgba(255,255,255,.06);
  overflow: hidden; display: flex; align-items: flex-end;
}
.liquid {
  width: 100%; height: 100%; transform-origin: 50% 100%; transform: scaleY(.76);
  background: linear-gradient(180deg, rgba(230,159,0,.95), rgba(168,92,8,.96));
  transition: transform .9s var(--ease);
}
.liquid.drained { transform: scaleY(.05); }
.glass-stem { width: 2px; height: 14px; background: rgba(255,236,206,.45); }
.glass-foot { width: 22px; height: 2.5px; border-radius: 99px; background: rgba(255,236,206,.55); }

.cupzone {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 7%; z-index: 2;
  display: grid; justify-items: center; gap: 9px;
}
.cup-cap { margin: 0; font-size: 12px; letter-spacing: .16em; color: var(--dim); text-shadow: 0 2px 8px #000; }
.cup {
  --w: clamp(68px,7vw,88px);
  width: var(--w); height: calc(var(--w)*.92); border-radius: 7px 7px 13px 13px;
  background: linear-gradient(177deg,#8a6a46 0 3%,#6b4f33 3% 9%,#4e3722 9% 11.5%,#5c4229 11.5% 100%);
  border: 1px solid #2b1d12;
  box-shadow: inset 0 -11px 18px rgba(0,0,0,.52), 0 10px 26px -8px rgba(0,0,0,.8);
  display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding-bottom: 11px;
  transform-origin: 50% 100%;
}
.cup span { width: 5px; height: 5px; border-radius: 99px; background: rgba(0,0,0,.34); }
.cup.shaking { animation: shake .42s var(--ease) infinite; }
@keyframes shake {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  22% { transform: translate3d(-4px,-8px,0) rotate(-5deg); }
  48% { transform: translate3d(3px,-11px,0) rotate(4deg); }
  74% { transform: translate3d(-2px,-5px,0) rotate(-2deg); }
}
.cup.lifted { animation: lift .6s var(--ease) forwards; }
@keyframes lift { to { transform: translate3d(0,-130px,0) rotate(-18deg); opacity: 0; filter: blur(4px); } }

/* ---------- 底部：骰子 + 喊价 ---------- */
.deck {
  display: grid; gap: 13px; justify-items: center;
  padding: 14px clamp(14px,2.5vw,24px) calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2); background: var(--ink);
  max-height: 52vh; overflow-y: auto;
}
.boot { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13.5px; }
.spin {
  width: 15px; height: 15px; border-radius: 99px;
  border: 2px solid var(--line); border-top-color: var(--amber);
  animation: spin .82s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mine { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.dice { display: flex; gap: 9px; }
.die {
  --s: clamp(48px,5.6vw,62px);
  width: var(--s); height: var(--s); border-radius: 11px;
  background: linear-gradient(157deg,#fff,#f3f0e9 58%,#e3ded3);
  box-shadow: 0 8px 18px -5px rgba(0,0,0,.7), inset 0 -3px 6px rgba(90,80,66,.22), inset 0 2px 3px #fff;
  display: grid; place-items: center; animation: drop .5s var(--ease) backwards;
}
.die svg { width: 74%; height: 74%; fill: #24211f; }
.die[data-v="1"] svg, .die[data-v="4"] svg { fill: #cc2b29; }
@keyframes drop { from { transform: translate3d(0,-40px,0) rotate(-22deg) scale(.84); opacity: 0; filter: blur(4px); } }
.support { display: flex; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.support i {
  font-style: normal; padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--pane);
}
.support i b { color: var(--dim); font-weight: 600; }
.support i.hot { border-color: rgba(230,159,0,.45); color: var(--amber); }
.support i.hot b { color: var(--amber); }

.picker { display: grid; gap: 9px; justify-items: center; }
.prow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center; }
.plab { color: var(--faint); font-size: 15px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.opt {
  min-width: 56px; padding: 11px 15px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--pane);
  color: var(--fg); font: 600 18px/1.15 var(--sans);
  display: grid; gap: 2px; justify-items: center;
  transition: border-color .16s, background .16s, transform .16s var(--ease);
}
.opt small { font-weight: 500; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.opt:hover { border-color: rgba(42,147,212,.7); background: rgba(42,147,212,.14); transform: translateY(-1px); }
.opt.on { border-color: var(--blue); background: rgba(42,147,212,.22); color: #fff; }
.opt.on small { color: #cfe8f8; }
.opt.zhai { font-family: var(--serif); border-color: rgba(230,159,0,.45); color: var(--amber); }
.opt.zhai:hover { border-color: var(--amber); background: rgba(230,159,0,.16); }
.challenge {
  padding: 13px 30px; border-radius: 99px; cursor: pointer;
  border: 1px solid rgba(230,159,0,.55); background: rgba(230,159,0,.14);
  color: var(--amber); font: 600 16px/1 var(--sans); letter-spacing: .05em;
  transition: background .18s, transform .18s var(--ease);
}
.challenge:hover { background: rgba(230,159,0,.26); transform: translateY(-1px); }
.challenge span { font-weight: 500; color: var(--dim); margin-left: 8px; font-size: 14px; }

.dock { display: flex; gap: 11px; }
.btn {
  border: 0; border-radius: 99px; cursor: pointer; padding: 14px 44px;
  font: 600 16px/1 var(--sans); letter-spacing: .08em;
  transition: transform .18s var(--ease), background .2s;
}
.btn.primary {
  color: #231703; background: linear-gradient(177deg,#f2b53b,var(--amber));
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.8);
}
.btn.primary:hover { transform: translateY(-2px); }
.btn.primary:disabled { background: rgba(58,47,38,.8); color: var(--faint); box-shadow: none; transform: none; cursor: default; }
.btn.ghost { background: var(--pane); border: 1px solid var(--line); color: var(--dim); }
.btn.ghost:hover { border-color: var(--amber-lo); color: var(--fg); }

/* ---------- 规则 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px;
  background: rgba(10,7,9,.78); backdrop-filter: blur(10px); animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; max-width: 560px; width: 100%; max-height: 82vh; overflow-y: auto;
  padding: 26px 28px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: #1b1518;
  box-shadow: 0 30px 70px -22px rgba(0,0,0,.9);
}
.sheet h2 { margin: 0 0 14px; font: 400 22px/1.2 var(--serif); letter-spacing: .06em; }
.sheet ol { margin: 0; padding-left: 20px; display: grid; gap: 9px; }
.sheet li { color: var(--dim); font-size: 14.5px; }
.sheet li::marker { color: var(--amber-lo); }
.sheet b { color: var(--fg); font-weight: 600; }
.hint { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.sclose {
  position: absolute; right: 14px; top: 14px; width: 32px; height: 32px;
  border-radius: 99px; border: 1px solid var(--line); background: transparent;
  color: var(--dim); cursor: pointer; display: grid; place-items: center;
}
.sclose:hover { color: var(--fg); border-color: var(--amber-lo); }

@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; grid-template-rows: 32vh 1fr; }
  .side { border-left: 0; border-top: 1px solid var(--line-2); }
  .fade { background: linear-gradient(0deg, rgba(18,14,17,.8) 0, transparent 34%); }
  .brand { display: none; }
  .die { --s: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
