/* 对局页。上到下：顶栏、玩家条、一圈 44 格（中间区）、底栏按钮。格子尺寸 --tw/--th 由 game-ui.js 按屏幕算。 */
#game { background: var(--sky); display: flex; flex-direction: column; --city: #E8382F; }
.ui { font-family: var(--ui-font); }
.outline-w { text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff; }

/* ---------- 顶栏 ---------- */
.g-top { flex: none; display: flex; align-items: center; gap: 8px; height: calc(env(safe-area-inset-top) + 56px); padding: env(safe-area-inset-top) 6px 0 6px; }
.g-city { flex: none; display: flex; align-items: center; gap: 2px; }
.g-city img { width: 44px; height: 44px; }
.g-city b { font: 20px/1 var(--ui-font); font-weight: normal; letter-spacing: .04em;
  text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff; }
.g-goal { flex: 1; min-width: 0; position: relative; height: 28px; border-radius: 14px; background: #FFF7EC; box-shadow: inset 0 0 0 2px var(--ink); overflow: hidden; }
.g-goal i { position: absolute; left: 0; top: 0; bottom: 0; width: 4%; background: linear-gradient(#FFDF6B, #F5B321); box-shadow: inset 0 0 0 2px var(--ink); border-radius: 14px; transition: width .5s; }
.g-goal span { position: relative; display: block; text-align: center; font-size: 14px; font-weight: 700; line-height: 28px; white-space: nowrap; }
.g-round { flex: none; text-align: center; line-height: 1; min-width: 38px; }
.g-round b { display: block; font: 21px/1 var(--ui-font); font-weight: normal; }
.g-round small { font-size: 14px; }
.g-round span { font-size: 13px; font-weight: 600; }
.chip.menu { width: 48px; padding: 0; }
.chip.menu img { width: 46px; height: 46px; }

/* ---------- 玩家条 ---------- */
.g-players { flex: none; height: 50px; display: flex; gap: 6px; padding: 0 6px 4px; }
.pl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 14px; transition: background .2s; }
.pl { cursor: pointer; }
.pl.on { background: rgba(255, 255, 255, .7); }
.pl.out { opacity: .45; filter: grayscale(1); }
.pt { min-width: 0; line-height: 1.15; }
.pt .nm { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt .nm small { font-size: 13px; font-weight: 600; color: #6A3B2C; }
.pt .cash { font-size: 18px; font-weight: 800; white-space: nowrap; }
/* 3–4 人：头像在上、钱在下，名字省掉（头像上已有姓） */
.g-players:is([data-n="3"], [data-n="4"]) .pl { flex-direction: column; justify-content: center; gap: 1px; padding: 1px 2px; }
.g-players:is([data-n="3"], [data-n="4"]) .pt { text-align: center; }
.g-players:is([data-n="3"], [data-n="4"]) .pt .nm { display: none; }
.g-players:is([data-n="3"], [data-n="4"]) .pt .cash { font-size: 15px; line-height: 17px; }
.g-players:is([data-n="3"], [data-n="4"]) .pl > .av { width: 27px; height: 27px; margin-top: 2px; }
/* 3–4 人时条上没有名字，在你的头像右边贴个"你" */
.g-players:is([data-n="3"], [data-n="4"]) .av .me { display: block; position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%);
  padding: 0 5px; border-radius: 8px; background: var(--red); color: #fff; font: 800 13px/18px var(--text-font); font-style: normal; white-space: nowrap; }
.av { flex: none; position: relative; display: inline-block; width: 36px; height: 36px; border-radius: 50%; background: var(--pc);
  box-shadow: 0 0 0 3px var(--pc), 0 0 0 4.5px var(--ink); }
.av > img { display: block; width: 100%; height: 100%; }
.av.big { width: 56px; height: 56px; }
.av .gb { position: absolute; right: -12px; top: -12px; width: 70%; height: 70%; filter: drop-shadow(0 1px 1px rgba(42, 10, 30, .5)); }
.av .me { display: none; }
.pl.on .av { box-shadow: 0 0 0 3px var(--pc), 0 0 0 6px #FFD54A, 0 0 14px 6px rgba(255, 200, 60, .8); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--pc), 0 0 0 6px #FFD54A, 0 0 4px 1px rgba(255, 200, 60, .5); } }

/* ---------- 棋盘：一圈彩色的路，外沿和格子之间是深紫细线 ---------- */
.g-board { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.g-ring {
  position: relative; display: grid; gap: 2px; padding: 3px; border-radius: 14px; background: var(--ink);
  grid-template-columns: repeat(11, var(--tw, 32px)); grid-template-rows: repeat(13, var(--th, 40px));
  box-shadow: 0 8px 22px rgba(42, 10, 30, .18);
}
.tile { position: relative; display: grid; place-items: center; background: #FFF6EA; overflow: hidden; }
.tile.c-tl { border-top-left-radius: 11px; } .tile.c-tr { border-top-right-radius: 11px; }
.tile.c-bl { border-bottom-left-radius: 11px; } .tile.c-br { border-bottom-right-radius: 11px; }
.tile .ic { width: calc(min(var(--tw), var(--th)) * .76); height: calc(min(var(--tw), var(--th)) * .76); position: relative; z-index: 1; }
.tile.has-band::after { content: ""; position: absolute; background: var(--band); }
.tile.s-b.has-band::after { left: 0; right: 0; top: 0; height: 5px; }
.tile.s-t.has-band::after { left: 0; right: 0; bottom: 0; height: 5px; }
.tile.s-l.has-band::after { top: 0; bottom: 0; right: 0; width: 5px; }
.tile.s-r.has-band::after { top: 0; bottom: 0; left: 0; width: 5px; }
.tile .own { position: absolute; z-index: 2; min-width: 16px; height: 18px; padding: 0 3px; border-radius: 4px; background: var(--pc); border: 1.5px solid var(--ink); box-shadow: 0 0 0 1.5px #fff;
  color: #fff; font: 800 13px/15px var(--text-font); font-style: normal; text-align: center; }
.tile.s-b .own { right: 0; bottom: 0; } .tile.s-t .own { right: 0; top: 0; }
.tile.s-l .own { left: 0; bottom: 0; } .tile.s-r .own { right: 0; bottom: 0; }
.tile .godmk { position: absolute; z-index: 2; left: 0; top: 0; width: 55%; height: 45%; background: url(../img/icons/card-god.webp) center / contain no-repeat; }
.tile.mort .ic { filter: grayscale(1); opacity: .45; }
.tile.pass { animation: pass .3s; }
.tile.landed { animation: landed 1.4s; }
@keyframes pass { 40% { background-color: #FFF0B0; } }
@keyframes landed { 0%, 60% { box-shadow: inset 0 0 0 3px var(--pc), inset 0 0 10px 2px var(--pc); } 100% { box-shadow: none; } }
.g-ring.fx-cheer { animation: cheer .7s; }
.g-ring.fx-sad { animation: sad .4s; }
@keyframes cheer { 40% { box-shadow: 0 0 0 4px #FFD54A, 0 0 26px 8px rgba(255, 200, 60, .7); } }
@keyframes sad { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* 棋子 */
.pawn { position: absolute; left: 0; top: 0; z-index: 4; border-radius: 50%; background: var(--pc);
  box-shadow: 0 0 0 2px var(--pc), 0 0 0 3px var(--ink), 0 2px 4px rgba(42, 10, 30, .4); transition: transform .11s linear; pointer-events: none; }
.pawn > img { display: block; width: 100%; height: 100%; }
.pawn.me { z-index: 5; }
.pawn.turn { box-shadow: 0 0 0 2px var(--pc), 0 0 0 4px #FFD54A, 0 2px 6px rgba(42, 10, 30, .4); }
.pawn.hop { animation: hop .12s ease-out; }
@keyframes hop { 50% { margin-top: -6px; } }

/* ---------- 中间区 ---------- */
.g-center {
  grid-area: 2 / 2 / 13 / 11; position: relative; z-index: 3; border-radius: 4px; background: #FFF8EE;
  overflow: hidden auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 8px; text-align: center;
}
.g-center > * { flex: none; }
.idle { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.idle .sticker { width: 34%; max-width: 116px; }
.g-center.tiny .idle .sticker, .g-center.short .legend { display: none; }
.dice { display: flex; gap: 12px; }
.die { width: 64px; height: 64px; border-radius: 15px; background: #fff; border: 3px solid var(--ink); box-shadow: inset 0 -6px 0 #E6DAF6;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px 7px 10px; }
.die i { width: 12px; height: 12px; border-radius: 50%; place-self: center; }
.die i.on { background: #6A3FB5; }
.dice.rolling .die { animation: tumble .16s linear infinite; }
@keyframes tumble { 50% { transform: rotate(20deg) scale(.9); } }
.turn { font-size: 21px; font-weight: 800; }
.turn.ui { font: 28px/1.1 var(--ui-font); color: var(--red);
  text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff; }
.recent { width: 100%; padding: 8px 10px; border-radius: 12px; background: #fff; text-align: left; font-size: 15px; line-height: 1.45; }
.recent p + p { margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(42, 10, 30, .15); }
.legend { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; gap: 2px 28px; width: 100%; font-size: 14px; text-align: left; }   /* 两列按内容宽，整块居中；列内图标仍对齐 */
.legend span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend img { width: 24px; height: 24px; }

/* 卡片：地块、卡牌、神明、商城、结算都用这一种 */
.deed { width: 100%; overflow: hidden; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 0 0 2px var(--ink), 0 6px 16px rgba(42, 10, 30, .14); animation: pop .3s cubic-bezier(.3, 1.5, .5, 1); }
.deed .dh { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 700; }
.deed .dh img { width: 30px; height: 30px; }
.deed .dn { padding: 10px 10px 2px; font-size: 22px; font-weight: 800; line-height: 1.25; }
.deed .dl { font-size: 15px; color: #6A3B2C; }
.deed .dt { padding: 6px 14px; font-size: 15px; line-height: 1.55; text-align: left; }
.deed .dt b { color: #6A3B2C; white-space: nowrap; }
.dnum { display: flex; justify-content: space-around; gap: 4px; padding: 8px 4px 12px; }
.dnum b { display: block; font-size: 19px; }
.dnum span { font-size: 14px; color: #6A3B2C; }
.note { width: 100%; margin-top: 8px; font-size: 15px; line-height: 1.5; }
.bad { color: #D2302A; }
.deed.intro .dn { font-size: 24px; }
.deed .gimg { display: block; flex: none; width: 104px; height: 104px; }
.deed .gs { margin-top: 2px; font-size: 15px; line-height: 1.4; color: #6A3B2C; font-weight: 700; text-align: left; }
.deed .id-row { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 14px 4px; }
.deed .id-row .dn { padding: 0; text-align: left; }
.deed .id-av { flex: none; width: 88px; height: 88px; }
.g-center.short .deed .id-av, .g-center.short .deed .gimg { width: 80px; height: 80px; }
.g-center.tiny .deed .id-av, .g-center.tiny .deed .gimg { width: 64px; height: 64px; }
.g-center.tiny .deed .id-row { padding-top: 8px; }
.g-center.tiny .deed .rl { padding-top: 5px; padding-bottom: 5px; }
.g-center.tiny .deed.intro .dt { padding-top: 4px; padding-bottom: 4px; }
.pi-god { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 16px; font-weight: 700; }
.pi-god img { width: 40px; height: 40px; }
.deed.intro .dt:last-child { padding-bottom: 12px; }
.deed .rw { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; font-size: 17px; }
.deed .rl { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px; border-top: 1px dashed rgba(42, 10, 30, .15); font-size: 15px; text-align: left; }
.deed .rl > b { white-space: nowrap; flex-shrink: 0; }
.nw { white-space: nowrap; }
.deed .rl em { font-style: normal; color: #8A7358; font-weight: 400; }
.deed .gp { padding: 8px 14px 12px; font-size: 14px; color: #6A3B2C; text-align: left; line-height: 1.5; }
.deed.shop .sh-cash { padding: 8px; font-size: 15px; font-weight: 700; }
.sh-list { text-align: left; }
.sh-it { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px dashed rgba(42, 10, 30, .15); }
.sh-it > div { flex: 1; min-width: 0; }
.sh-it b { display: block; font-size: 16px; }
.sh-it span { display: block; font-size: 14px; color: #6A3B2C; line-height: 1.4; }
.sh-it button { flex: none; min-width: 68px; height: 44px; border-radius: 12px; background: #FFE9B8; box-shadow: inset 0 0 0 2px var(--ink); font-size: 16px; font-weight: 800; }
.sh-it button:disabled { opacity: .4; }
.sh-it .auto { flex: none; min-width: 68px; text-align: center; font-size: 14px; font-style: normal; font-weight: 700; color: #2E9E6B; }
.sh-it > .av { width: 30px; height: 30px; }
.sh-it > img.ii { flex: none; width: 42px; height: 42px; }
.deed .dh img.ii { width: 38px; height: 38px; margin: -4px 0; }
.num-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 6px 14px 14px; }
.num-pick button { height: 52px; border-radius: 14px; background: #FFE9B8; box-shadow: inset 0 0 0 2px var(--ink); font-size: 24px; font-weight: 800; }
/* 传送卡选格子：格子一闪一闪，表示可以点 */
#g-ring.picking .tile { cursor: pointer; animation: pickable 1.4s ease-in-out infinite; }
@keyframes pickable { 50% { box-shadow: inset 0 0 0 2px #FFC93C; } }
.deed .rk { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px dashed rgba(42, 10, 30, .15); font-size: 16px; }
.deed .rk i { font-style: normal; font-weight: 800; width: 18px; }
.deed .rk span:not(.av) { flex: 1; text-align: left; font-weight: 700; }
.deed .rk span small { font-size: 13px; font-weight: 600; color: #6A3B2C; }
/* 玩家信息卡 */
.pi-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pi-head b { display: block; font-size: 20px; }
.pi-head span:not(.av) { font-size: 16px; font-weight: 700; color: #6A3B2C; }
.pi-perk { font-size: 17px; line-height: 1.5; background: #FFF5DA; border-radius: 12px; padding: 10px 12px; }
.pi-cash { font-size: 15px; color: #6A3B2C; margin: 10px 2px 16px; }
#g-pinfo .slab { width: 100%; }
.deed .rk.first { background: #FFF6D6; }
.land { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pop .3s cubic-bezier(.3, 1.5, .5, 1); }
.land .lw { font-size: 17px; font-weight: 700; }
.land .li { width: 72px; height: 72px; }
.land .ln { font-size: 22px; font-weight: 800; line-height: 1.25; }
.land .le { font-size: 16px; color: #6A3B2C; }

/* 横幅：中间区顶上冒一下 */
.g-banner { position: absolute; left: 50%; top: calc(var(--th, 40px) + 14px); z-index: 6; max-width: 86%; padding: 6px 14px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translate(-50%, -6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.g-banner.on { opacity: 1; transform: translate(-50%, 0); }
.g-banner.ok { background: #2E9E6B; } .g-banner.warn { background: #E0861F; } .g-banner.bad { background: #D2302A; }

/* ---------- 底栏 ---------- */
.g-bottom { flex: none; padding: 0 10px calc(env(safe-area-inset-bottom) + 8px); }
.g-hint { height: 24px; line-height: 24px; text-align: center; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-acts { display: flex; align-items: center; gap: 8px; height: 70px; }
.g-acts .slab { flex: 1; }
.g-acts .slab.cream { flex: .62; }
.g-acts .slab:only-child { flex: 1; }   /* 只有一个按钮时占满整行，不管什么颜色 */
.g-acts[data-n="2"] .slab { font-size: 21px; }
.chip.bag { flex: none; width: 60px; }
.chip.bag img { width: 50px; height: 50px; }

/* 按钮：AI 画的按钮底，左右两头不动、中间拉长（九宫格）。字放在正面（不含底部厚边）正中 */
.slab {
  --h: 62px; height: var(--h); min-width: 0; display: flex; align-items: center; justify-content: center;
  border-style: solid; border-width: 0 calc(var(--h) * .5); padding: 0 0 calc(var(--h) * .14);
  border-image: url(../img/btn-red.webp) 0 120 0 120 fill / 0 calc(var(--h) * .5) / 0 stretch;
  font: 24px/1 var(--ui-font); color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 1.5px 0 var(--ink), 0 -1.5px 0 var(--ink), 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
}
.slab span { margin: 0 calc(var(--h) * -.3); overflow: hidden; text-overflow: ellipsis; }
.slab.cream { border-image-source: url(../img/btn-cream.webp); color: var(--ink); text-shadow: none; }
.slab:active { transform: translateY(2px); filter: brightness(.95); }
.slab:disabled { filter: grayscale(.7); opacity: .55; }

/* ---------- 答题面板：盖住玩家条、棋盘和底栏，顶栏留着（D16） ---------- */
.g-quiz { position: absolute; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top) + 56px); z-index: 8; display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0; background: #FFF8EE; box-shadow: 0 -6px 24px rgba(42, 10, 30, .22); animation: rise .25s cubic-bezier(.2, .9, .3, 1); }
.qs-in { flex: 1; min-height: 0; overflow: auto; padding: 14px 14px 6px; }
.qs-tag { font-size: 14px; color: #6A3B2C; }
.qs-tag b { color: var(--red); }
.qs-q { margin: 8px 0 12px; font-size: 18px; font-weight: 700; line-height: 1.55; }
.qs-o { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 56px; margin-bottom: 8px; padding: 12px; border-radius: 14px; background: #fff;
  box-shadow: inset 0 0 0 2px rgba(42, 10, 30, .14); text-align: left; font-size: 16px; line-height: 1.5; }
.qs-o i { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #F3E6D6; font-style: normal; font-weight: 800; }
.qs-o.sel { background: #FFF0EC; box-shadow: inset 0 0 0 3px var(--red); }
.qs-o.sel i { background: var(--red); color: #fff; }
.qs-o.done { opacity: .55; }
.qs-o.right { opacity: 1; background: #EAF6EF; box-shadow: inset 0 0 0 3px #2E9E6B; }
.qs-o.right i { background: #2E9E6B; color: #fff; }
.qs-o.wrong { opacity: 1; background: #FBECEB; box-shadow: inset 0 0 0 3px #D2302A; }
.qs-o.wrong i { background: #D2302A; color: #fff; }
.qs-res { margin: 4px 0 8px; padding: 12px; border-radius: 14px; font-size: 15px; line-height: 1.6; }
.qs-res.ok { background: #EAF6EF; } .qs-res.bad { background: #FBECEB; color: var(--ink); }
.qs-res p + p { margin-top: 6px; }
.qr-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 20px; }
.qs-res.ok .qr-h { color: #1F7A50; } .qs-res.bad .qr-h { color: #C02A24; }
.qr-h .up { color: #1F7A50; } .qr-h .down { color: #C02A24; }
.qs-foot { flex: none; padding: 6px 12px calc(env(safe-area-inset-bottom) + 10px); }
.qs-foot .slab { width: 100%; }
.qs-foot:empty { padding-top: 0; }
/* 完整版的性格测试（用答题面板） */
.id-lean { margin: -4px 0 4px; text-align: center; font-size: 15px; color: #6A3B2C; }
.ts-bar { height: 8px; margin: 8px 0 0; border-radius: 4px; background: #F0DFCB; overflow: hidden; }
.ts-bar i { display: block; height: 100%; border-radius: 4px; background: var(--red); transition: width .25s; }
.ts-intro { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFF0DA; font-size: 15px; line-height: 1.55; color: #6A3B2C; }

/* 菜单 */
.gm-list { display: grid; gap: 10px; }
.gm-list .slab { width: 100%; }
