/* 斗地主 —— 设计尺寸 1280×720，#ui 和 Pixi 的根容器用同一个缩放（main.js 里的 layout）。
   配色跟 NodeLoc：品牌绿 #009966、橙 #ff9933；桌布是深绿；恩娜美术包的恩娜绿 #1f8a4c、奶油、金 #d4a84a。
   右上角 ~220×90 留给宿主的胶囊按钮，不放东西。 */
:root {
  --green: #009966; --green-hi: #2ed39a; --green-deep: #06553b; --orange: #ff9933; --gold: #ffd36b;
  --ink: #13211b; --paper: #fffaf0; --red: #d0452f; --felt: #0d4433;
  --enna: #1f8a4c; --enna-deep: #136234; --brass: #d4a84a; --cream: #fff6e2;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #fff; background: radial-gradient(ellipse at 50% 42%, #1a8460 0%, #0e5a40 55%, #062e21 100%);
}
#bg { position: fixed; inset: 0; background: #0b3a26 url(../img/lobby.webp) center 28% / cover no-repeat; }
#bg::after { content: ""; position: absolute; inset: 0; transition: background .4s;
  background: linear-gradient(180deg, rgba(6,32,20,.72) 0%, rgba(6,32,20,.12) 24%, rgba(6,32,20,0) 46%, rgba(6,32,20,.55) 70%, rgba(4,24,15,.92) 100%); }
body[data-screen="waiting"] #bg::after, body[data-screen="signin"] #bg::after { background: linear-gradient(90deg, rgba(4,24,15,.2), rgba(4,24,15,.86) 46%, rgba(4,24,15,.9)); }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }
#ui { position: fixed; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
[hidden] { display: none !important; }
svg { display: block; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
h1 { margin: 0; font-size: 46px; letter-spacing: 6px; font-weight: 900; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.25); }
h2 { margin: 0; font-size: 30px; }
.sub { margin: 4px 0 0; opacity: .78; font-size: 17px; }
.fine { position: absolute; bottom: 20px; margin: 0; font-size: 13px; opacity: .5; }
.status { min-height: 22px; margin: 0; font-size: 16px; color: var(--gold); }

/* ===== 按钮：圆角矩形 + 底边厚度，按下沉下去 ===== */
.btn { position: relative; border: 0; border-radius: 16px; min-width: 124px; height: 56px; padding: 0 26px;
  font-family: inherit; font-size: 21px; font-weight: 800; letter-spacing: 2px; cursor: pointer; white-space: nowrap;
  color: #4a2300; background: linear-gradient(180deg, #ffd48a 0%, #ffaa3c 45%, #ff8f1f 100%);
  box-shadow: 0 5px 0 #c46510, 0 10px 20px rgba(0,0,0,.28), inset 0 1.5px 0 rgba(255,255,255,.65);
  transition: transform .08s, box-shadow .08s, filter .15s; }
.btn::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 42%; border-radius: 12px 12px 18px 18px;
  background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,0)); pointer-events: none; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #c46510, 0 4px 10px rgba(0,0,0,.25), inset 0 1.5px 0 rgba(255,255,255,.5); }
.btn.blue { color: #fff; text-shadow: 0 1px 1px rgba(0,60,40,.5); background: linear-gradient(180deg, #4fe3ad 0%, #17b47c 50%, #0a9566 100%);
  box-shadow: 0 5px 0 #066b48, 0 10px 20px rgba(0,0,0,.28), inset 0 1.5px 0 rgba(255,255,255,.5); }
.btn.blue:active:not(:disabled) { box-shadow: 0 1px 0 #066b48, 0 4px 10px rgba(0,0,0,.25); }
.btn.ghost, .btn.glass { color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.08));
  box-shadow: 0 5px 0 rgba(0,0,0,.28), 0 10px 20px rgba(0,0,0,.2), inset 0 0 0 1.5px rgba(255,255,255,.28); }
.btn.ghost::after, .btn.glass::after { opacity: .35; }
.btn.ghost:active:not(:disabled), .btn.glass:active:not(:disabled) { box-shadow: 0 1px 0 rgba(0,0,0,.28), inset 0 0 0 1.5px rgba(255,255,255,.28); }
.btn:disabled { filter: grayscale(.85); opacity: .45; cursor: default; }
.btn.small { height: 42px; min-width: 0; font-size: 16px; border-radius: 12px; padding: 0 16px; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.06); } }
.row { display: flex; gap: 16px; justify-content: center; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18); }
.round svg { width: 24px; height: 24px; }
.round:active { transform: scale(.94); }
.chip { border: 0; border-radius: 999px; padding: 7px 14px; font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  color: #4a2300; background: linear-gradient(#ffd48a, #ffa53a); box-shadow: 0 2px 0 #c46510; }
.chip:active { transform: translateY(2px); box-shadow: none; }
.chip.ghost { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }

/* ===== 大厅：恩娜主视觉铺底，品牌在左上，场次卡片排在底部，不挡恩娜 ===== */
.lobby { justify-content: flex-end; padding-bottom: 40px; gap: 0; }
.lobby-top { position: absolute; left: 60px; right: 60px; top: 30px; padding-right: 210px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand h1 { font-size: 42px; text-shadow: 0 3px 0 rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.45); }
.brand .sub { text-shadow: 0 1px 6px rgba(0,0,0,.6); opacity: .9; }
.logo { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #34c97a, var(--enna-deep) 70%); box-shadow: 0 10px 24px rgba(0,0,0,.4), inset 0 0 0 2px rgba(243,214,138,.55); }
.logo svg { width: 76px; height: 76px; }
.wallet { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 999px; font-size: 16px;
  background: rgba(6,28,18,.62); box-shadow: inset 0 0 0 1px rgba(243,214,138,.3), 0 6px 18px rgba(0,0,0,.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.wallet b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--gold); margin-right: 4px; }
.w-label { opacity: .85; }
.bolt { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ffc06a, #ff8a1a); box-shadow: 0 2px 6px rgba(255,140,30,.5); }
.bolt svg { width: 20px; height: 20px; }
.tables { display: flex; gap: 16px; align-items: stretch; }
.table-card { position: relative; overflow: hidden; width: 276px; height: 136px; border: 0; border-radius: 22px; padding: 18px 20px; cursor: pointer;
  color: #fff; text-align: left; font-family: inherit; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
  box-shadow: 0 6px 0 rgba(0,0,0,.28), 0 16px 30px rgba(0,0,0,.35), inset 0 0 0 1.5px rgba(243,214,138,.45), inset 0 1.5px 0 rgba(255,255,255,.4);
  transition: transform .14s, box-shadow .14s; }
.table-card::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.28), transparent 45%), repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px); }
.table-card.practice { background: linear-gradient(160deg, #35b86c, var(--enna) 55%, var(--enna-deep)); }
.table-card.stake { background: linear-gradient(160deg, #ffbb57, #f07f1e 60%, #c85d0c); }
.table-card.friend { background: linear-gradient(160deg, #a58ae8, #7a5cc9 60%, #5a3fa6); }
.table-card.join { width: 176px; background: linear-gradient(170deg, rgba(255,250,236,.22), rgba(255,250,236,.08)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.table-card.join .t-art { width: 40px; height: 40px; right: auto; left: 20px; top: 20px; color: var(--gold-hi, #f3d68a); }
.table-card.join .t-name { font-size: 24px; letter-spacing: 2px; }
.table-card:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.25), inset 0 0 0 1.5px rgba(243,214,138,.45); }
@media (hover: hover) { .table-card:hover:not(:disabled) { transform: translateY(-4px); } }
.table-card:disabled { opacity: .45; }
.t-art { position: absolute; right: 6px; top: 4px; width: 92px; height: 92px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
.t-tag { position: absolute; left: 16px; top: 14px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.t-name { position: relative; font-size: 28px; font-weight: 900; letter-spacing: 3px; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.t-desc { position: relative; font-size: 14px; opacity: .92; white-space: nowrap; }
.lobby .status { position: absolute; left: 0; right: 0; bottom: 196px; text-align: center; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.lobby .fine { bottom: 12px; font-size: 12px; opacity: .6; }

/* 匹配页：恩娜在左边陪你等 */
.waiting { padding-left: 380px; }
.waiting .host { position: absolute; left: 40px; bottom: -40px; height: 640px; pointer-events: none; filter: drop-shadow(0 16px 30px rgba(0,0,0,.45));
  animation: hostin .5s cubic-bezier(.3, 1.3, .5, 1) both, bob 3.2s ease-in-out .5s infinite alternate; }
@keyframes hostin { from { opacity: 0; transform: translateX(-60px); } }
@keyframes bob { to { transform: translateY(-8px); } }

/* ===== 匹配中：三张牌轮流跳 ===== */
.spinner { display: flex; gap: 10px; height: 64px; align-items: flex-end; }
.spinner i { width: 36px; height: 50px; border-radius: 6px; border: 2.5px solid var(--paper);
  background: #1f8a4c url(../img/card-back.webp) center / cover;
  box-shadow: 0 6px 12px rgba(0,0,0,.3); animation: hop 1.1s ease-in-out infinite; }
.spinner i:nth-child(2) { animation-delay: .15s; }
.spinner i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-14px) rotate(-6deg); } }

/* ===== 牌桌 HUD ===== */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#table-info { position: absolute; left: 24px; top: 16px; font-size: 15px; line-height: 1.4; background: rgba(0,0,0,.3);
  padding: 7px 14px; border-radius: 999px; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
#table-info b { color: var(--gold); }
#actions { position: absolute; left: 0; right: 0; top: 436px; display: flex; gap: 18px; justify-content: center; }
#actions .btn { animation: rise .18s ease-out both; }
#actions .btn:nth-child(2) { animation-delay: .03s; }
#actions .btn:nth-child(3) { animation-delay: .06s; }
#actions .btn:nth-child(4) { animation-delay: .09s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
#hint-text { position: absolute; left: 0; right: 0; top: 402px; text-align: center; font-size: 17px; font-weight: 700; color: var(--gold);
  pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#chat { position: absolute; left: 24px; top: 60px; }
#chat-menu { position: absolute; top: 56px; left: 0; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
#chat-menu button { white-space: nowrap; border: 0; border-radius: 12px; padding: 9px 14px; font-family: inherit; font-size: 15px; font-weight: 600;
  background: rgba(10,30,22,.82); color: #fff; text-align: left; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); cursor: pointer; }
#chat-menu button:active { background: var(--green); }
#auto-cancel { position: absolute; right: 24px; bottom: 210px; }
#net-status { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: rgba(160,40,30,.88); padding: 6px 14px; border-radius: 999px; font-size: 14px; }

/* ===== 座位牌（table.js 生成）===== */
#seats { position: absolute; inset: 0; pointer-events: none; }
.seat { position: absolute; transform: translate(-50%, -38px); display: flex; flex-direction: column; align-items: center; }
.av-wrap { position: relative; width: 76px; height: 76px; }
.av { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 6px #7fcfae, 0 8px 16px rgba(0,0,0,.4); transition: box-shadow .3s; }
.seat.landlord .av { box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 0 6px #f2b93b, 0 0 18px rgba(255,200,80,.55), 0 8px 16px rgba(0,0,0,.4); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.enna-face { position: absolute; width: 132%; height: 132%; left: -16%; top: -6%; pointer-events: none;
  background: url(../img/enna-faces.webp) no-repeat; background-size: 300% 200%; background-position: 50% 100%; transition: opacity .2s; }
.enna-face[data-mood="bid"] { background-position: 0 0; }
.enna-face[data-mood="thinking"] { background-position: 50% 0; }
.enna-face[data-mood="win"] { background-position: 100% 0; }
.enna-face[data-mood="lose"] { background-position: 0 100%; }
.av.is-enna { background: radial-gradient(circle at 50% 35%, #fffaf0, #d9efd9 70%) !important; }
/* 第二个机器人换一个底色和外圈，一桌两个恩娜也分得清 */
.av.is-enna[data-tint="1"] { background: radial-gradient(circle at 50% 35%, #fff6fb, #f3d3e4 70%) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 6px #e58fb6, 0 8px 16px rgba(0,0,0,.4); }
.ava.enna[data-tint="1"] { background: radial-gradient(circle at 50% 35%, #fff6fb, #f3d3e4 70%); }
.av.is-enna .mono, .av.is-enna img { display: none; }
.mono { font-size: 34px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.mono svg { width: 50px; height: 50px; }
.seat.empty .av { opacity: .45; box-shadow: 0 0 0 3px rgba(255,255,255,.4); }
.seat.offline .av { filter: grayscale(1) brightness(.8); }
.timer-ring { position: absolute; inset: -11px; border-radius: 50%; opacity: 0; transition: opacity .2s; --rc: #3fe0a0;
  background: conic-gradient(var(--rc) calc(var(--p, 1) * 1turn), rgba(255,255,255,.14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px)); }
.seat.ticking .timer-ring { opacity: 1; }
.seat.urgent .timer-ring { --rc: #ff5a4a; }
.role { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; white-space: nowrap;
  padding: 3px 10px 3px 7px; border-radius: 999px; font-size: 13px; font-weight: 900; box-shadow: 0 3px 8px rgba(0,0,0,.3); z-index: 1; }
.role svg { width: 15px; height: 15px; }
.role.landlord { color: #5a3500; background: linear-gradient(#ffe39a, #f2b93b); }
.role.farmer { color: #0b6b4a; background: linear-gradient(#f2fff8, #c7efdc); }
.botb { position: absolute; right: -8px; bottom: -2px; padding: 2px 6px; border-radius: 8px; font-size: 11px; font-weight: 900; letter-spacing: .5px;
  color: #fff; background: var(--orange); box-shadow: 0 0 0 2px var(--felt); z-index: 1; }
.secs { position: absolute; left: -14px; bottom: -6px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; display: grid; place-items: center;
  font-size: 16px; font-weight: 900; color: var(--ink); background: #fff8e6; box-shadow: 0 3px 8px rgba(0,0,0,.35); z-index: 1; font-variant-numeric: tabular-nums; }
.secs:empty { display: none; }
.seat.urgent .secs { color: #fff; background: #ff5a4a; animation: beat .5s ease-in-out infinite alternate; }
@keyframes beat { to { transform: scale(1.15); } }
.plate { margin-top: 12px; min-width: 100px; max-width: 150px; padding: 5px 12px 6px; border-radius: 12px; text-align: center;
  background: rgba(4,26,18,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.seat.turn .plate { box-shadow: inset 0 0 0 1.5px rgba(63,224,160,.8), 0 0 14px rgba(63,224,160,.35); }
.nm { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flags:empty { display: none; }
.flags { display: flex; justify-content: center; gap: 4px; margin-top: 3px; }
.flags i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--gold); padding: 1px 6px; border-radius: 6px; background: rgba(255,211,107,.14); }
.count { position: absolute; transform: translate(-50%, -50%); width: 56px; height: 78px; border-radius: 8px; display: grid; place-items: center;
  border: 2px solid #f3e6c4; box-shadow: 0 6px 14px rgba(0,0,0,.4);
  background: linear-gradient(rgba(10,40,24,.38), rgba(10,40,24,.38)), #1f8a4c url(../img/card-back.webp) center / cover; }
.count i { display: none; }
.count b { font-size: 28px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 8px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.count.low { border-color: #ff7a5a; animation: low .9s ease-in-out infinite alternate; }
@keyframes low { to { box-shadow: 0 0 0 5px rgba(255,90,74,.35), 0 6px 14px rgba(0,0,0,.4); } }
.bubble { position: absolute; transform: translate(-50%, -50%); padding: 9px 22px; border-radius: 18px; white-space: nowrap;
  font-size: 22px; font-weight: 900; letter-spacing: 2px; color: #2a3a33; background: var(--paper); box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.bubble::after { content: ""; position: absolute; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.bubble-0::after { left: calc(50% - 7px); bottom: -6px; }
.bubble-1::after { right: -6px; top: calc(50% - 7px); }
.bubble-2::after { left: -6px; top: calc(50% - 7px); }
.bubble.hot { color: #4a2300; background: linear-gradient(#ffd48a, #ffa53a); }
.bubble.pop { animation: pop .28s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } }
.mult { position: absolute; left: 640px; top: 102px; transform: translateX(-50%); display: flex; gap: 6px; padding: 4px; border-radius: 999px;
  font-size: 15px; font-weight: 600; background: rgba(0,0,0,.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); white-space: nowrap; }
.mult span { padding: 3px 11px; border-radius: 999px; background: rgba(255,255,255,.07); }
.mult b { color: var(--gold); font-weight: 900; font-variant-numeric: tabular-nums; }
.mult .bomb b { color: #ff9a5a; }
.mult.bump { animation: bump .5s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes bump { 40% { transform: translateX(-50%) scale(1.15); } }
.mult-pop { position: absolute; left: 640px; top: 150px; transform: translate(-50%, 0); font-size: 58px; font-weight: 900; color: var(--gold);
  -webkit-text-stroke: 3px #5a2a00; paint-order: stroke fill; text-shadow: 0 6px 12px rgba(0,0,0,.4); pointer-events: none; animation: multpop 1.3s ease-out forwards; }
@keyframes multpop { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.4); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  30% { transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
.chat-bubble { position: absolute; transform: translate(0, -50%); max-width: 360px; padding: 9px 15px; border-radius: 14px;
  font-size: 17px; font-weight: 700; color: #17231e; background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.3); animation: chatin .25s ease-out;
  transition: opacity .3s; white-space: nowrap; }
.chat-bubble.chat-1 { transform: translate(-100%, -50%); }
.chat-bubble.out { opacity: 0; }
@keyframes chatin { from { opacity: 0; margin-top: 8px; } }

/* ===== 叫完地主：立绘亮相 ===== */
.reveal { position: absolute; inset: 0; pointer-events: none !important; z-index: 4; }
/* 遮罩往外多铺一圈，宽屏 / 高屏上设计区外面的桌布也压暗 */
.reveal::before { content: ""; position: absolute; inset: -400px -800px; animation: rvbg 2.4s ease both;
  background: linear-gradient(90deg, rgba(4,20,12,.85) 30%, rgba(4,20,12,.5) 60%, rgba(4,20,12,.15)); }
.reveal img { position: absolute; left: 120px; bottom: -70px; height: 700px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5));
  animation: rvart 2.4s cubic-bezier(.25, 1.2, .5, 1) both; }
.rv-text { position: absolute; left: 650px; top: 270px; display: flex; flex-direction: column; gap: 8px; animation: rvtext 2.4s ease both; }
.rv-text b { font-size: 84px; font-weight: 900; letter-spacing: 10px; color: var(--gold); -webkit-text-stroke: 4px #5a2a00; paint-order: stroke fill;
  text-shadow: 0 8px 18px rgba(0,0,0,.5); }
.reveal.farmer .rv-text b { color: #c9f5d6; -webkit-text-stroke-color: #0d4a28; }
.rv-text span { font-size: 22px; font-weight: 700; padding-left: 8px; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
@keyframes rvbg { 0% { opacity: 0; } 12%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rvart { 0% { opacity: 0; transform: translateX(-120px); } 18% { opacity: 1; transform: translateX(0); } 82% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(-40px); } }
@keyframes rvtext { 0%, 12% { opacity: 0; transform: scale(1.6); } 24% { opacity: 1; transform: scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

/* ===== 弹窗、结算 ===== */
.dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 560px; padding: 28px 30px; border-radius: 26px;
  background: linear-gradient(175deg, #fffdf6, #f4ead0); color: var(--ink); text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), inset 0 0 0 1.5px rgba(255,255,255,.7); }
.dialog .sub { color: #4a4a40; opacity: 1; }
.dialog .row { margin-top: 20px; }
.dialog .btn.ghost { color: var(--ink); background: linear-gradient(#fff, #efe6cf); box-shadow: 0 5px 0 #c9b98f, 0 10px 18px rgba(0,0,0,.15), inset 0 0 0 1px rgba(0,0,0,.06); }
.dialog .btn.ghost:active { box-shadow: 0 1px 0 #c9b98f; }
.result { width: 620px; padding: 58px 30px 26px; animation: dlg .35s cubic-bezier(.3, 1.5, .5, 1); margin-left: 120px;
  box-shadow: 0 0 0 3000px rgba(4,20,12,.5), 0 24px 60px rgba(0,0,0,.5), inset 0 0 0 1.5px rgba(255,255,255,.7); }
/* 结算页左边站着恩娜：赢了是这局的身份立绘（地主 / 农民），输了是默认立绘 */
.res-art { position: absolute; right: 100%; margin-right: -40px; bottom: -110px; height: 560px; pointer-events: none;
  filter: drop-shadow(0 16px 30px rgba(0,0,0,.45)); animation: hostin .45s cubic-bezier(.3, 1.3, .5, 1) .1s both; }
.res-art:not([src]) { display: none; }
.result.lose .res-art { height: 400px; bottom: 40px; margin-right: -20px; }
.ava.enna { background: radial-gradient(circle at 50% 35%, #fffaf0, #d9efd9 70%); }
.ava.enna .enna-face { width: 140%; height: 140%; left: -20%; top: -8%; }
@keyframes dlg { from { opacity: 0; transform: translate(-50%, -46%) scale(.92); } }
.ribbon { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); width: 330px; height: 78px; display: grid; place-items: center; z-index: 1;
  clip-path: polygon(0 0, 100% 0, 93% 50%, 100% 100%, 0 100%, 7% 50%); background: linear-gradient(180deg, #ffbf5a, #f07f1e); }
.result.lose .ribbon { background: linear-gradient(180deg, #7f97a8, #4f6575); }
.result.aborted .ribbon { background: linear-gradient(180deg, #a5b0a9, #6c7a73); }
.ribbon h2 { color: #fff; font-size: 40px; font-weight: 900; letter-spacing: 12px; text-indent: 12px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.tags i, .tags b { font-style: normal; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(16,34,27,.07); color: #3d4a43; }
.tags b.spring { color: #fff; background: linear-gradient(#ff8fb0, #e0507c); }
.rows { margin: 16px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.rows .r { display: grid; grid-template-columns: 44px 1fr 62px 70px 96px; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 14px; text-align: left; }
.rows .r.me { background: rgba(0,153,102,.09); box-shadow: inset 0 0 0 1.5px rgba(0,153,102,.35); }
.ava { position: relative; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font-size: 19px; font-weight: 900; color: #fff; background: linear-gradient(150deg, #2fbf8f, #0b7a55); }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.who { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who em { font-style: normal; font-size: 12px; margin-left: 6px; padding: 1px 6px; border-radius: 6px; color: #fff; background: var(--green); vertical-align: 2px; }
.rl { justify-self: start; font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.rl.landlord { color: #5a3500; background: linear-gradient(#ffe39a, #f2b93b); }
.rl.farmer { color: #0b6b4a; background: #d6f3e5; }
.sc { font-size: 26px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; color: #6b746f; }
.sc.pos, .en.pos { color: var(--red); }
.sc.neg, .en.neg { color: #2f7a5a; }
.en { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: #6b746f; }
.bolt-i { width: 15px; height: 15px; color: var(--orange); }
.note { margin: 10px 0 0; font-size: 14px; color: #6a6a5e; }
#toast { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); background: rgba(8,24,18,.85); padding: 11px 20px;
  border-radius: 999px; font-size: 17px; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.12); }

/* 钱包面板 */
.wallet { cursor: pointer; }
.wallet-panel { width: 600px; max-height: 660px; display: flex; flex-direction: column; z-index: 6; text-align: left; padding: 24px 28px 18px;
  box-shadow: 0 0 0 3000px rgba(4,20,12,.5), 0 24px 60px rgba(0,0,0,.5), inset 0 0 0 1.5px rgba(255,255,255,.7); }
.wallet-panel h3 { margin: 0; font-size: 26px; letter-spacing: 2px; }
.wallet-panel h4 { margin: 16px 0 6px; font-size: 16px; color: #6a6a5e; }
.wp-close { position: absolute; right: 16px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; font-size: 26px; line-height: 1;
  background: rgba(0,0,0,.06); color: var(--ink); cursor: pointer; }
.wp-sum { display: flex; gap: 12px; margin-top: 14px; }
.wp-sum div { flex: 1; padding: 10px 14px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px rgba(16,34,27,.08); }
.wp-sum span { display: block; font-size: 14px; color: #6a6a5e; }
.wp-sum b { font-size: 30px; font-variant-numeric: tabular-nums; color: var(--green-deep); }
.wp-limits { margin: 10px 0 0; font-size: 14px; color: #4a4a40; }
.wp-actions { display: flex; gap: 10px; margin-top: 12px; }
.chip.ghost-dark { background: #fff; color: var(--green-deep); box-shadow: inset 0 0 0 1.5px rgba(0,153,102,.45); }
.chip:disabled { opacity: .4; cursor: default; }
.wp-history { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 120px; flex: 1; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.wp-history li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 9px 2px; border-bottom: 1px solid rgba(16,34,27,.08); }
.wp-history .k { font-size: 16px; font-weight: 700; }
.wp-history .t { font-size: 12px; color: #8a8a7e; }
.wp-history .a { grid-row: 1 / 3; grid-column: 2; align-self: center; text-align: right; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wp-history .a small { display: block; font-size: 12px; font-weight: 500; color: #8a8a7e; }
.wp-history .a.pos { color: var(--red); }
.wp-history .a.neg { color: #2f7a5a; }
.wp-more { margin: 6px 0 0; min-height: 18px; font-size: 13px; color: #8a8a7e; text-align: center; }

/* 好友房：加入入口、输入房间号、房间号展示 */
.join-dialog { width: 520px; z-index: 5; }
.join-dialog h3 { margin: 0; font-size: 30px; letter-spacing: 2px; }
.code-input { display: block; width: 320px; margin: 18px auto 0; padding: 10px 0; border: 0; border-radius: 16px; outline: none;
  background: #fff; color: var(--ink); text-align: center; font-size: 44px; font-weight: 800; letter-spacing: 14px; text-indent: 14px;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 2px rgba(16,34,27,.2); user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.code-input:focus { box-shadow: inset 0 0 0 3px var(--green); }
.join-error { min-height: 22px; margin: 10px 0 0; color: #c0392b; font-size: 17px; font-weight: 700; }
.room-code-box { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 22px; border-radius: 18px; background: rgba(0,0,0,.3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.rc-label { font-size: 18px; opacity: .8; }
.rc-code { font-size: 44px; letter-spacing: 8px; color: var(--gold); font-variant-numeric: tabular-nums; user-select: text; -webkit-user-select: text; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
