:root {
  --red: #c62828; --red2: #8e0000; --red3: #ff5f52; --gold: #ffd54f; --gold2: #ffb300;
  --ink: #2b1a12; --paper: #fff8e7; --felt: #0f5132; --felt2: #0b3d26;
  --bg: #7f0d0d; --card: #fffdf7; --muted: #8d6e63; --ok: #2e7d32; --bad: #c62828;
  --r: 14px;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 50% -10%, #d32f2f 0%, #8e0000 55%, #4a0000 100%) fixed;
  color: var(--paper); overflow-x: hidden; user-select: none; -webkit-user-select: none;
}
button { font: inherit; cursor: pointer; border: 0; }
input { font: inherit; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---- 共用元件 ---- */
.btn {
  background: linear-gradient(#ffe082, #ffb300); color: #5d1a00; font-weight: 800; padding: 10px 18px;
  border-radius: 999px; box-shadow: 0 3px 0 #b26a00, 0 6px 12px rgba(0,0,0,.25); transition: transform .08s;
  white-space: nowrap;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b26a00; }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
.btn.red { background: linear-gradient(#ef5350, #c62828); color: #fff; box-shadow: 0 3px 0 #7f0000, 0 6px 12px rgba(0,0,0,.25); }
.btn.green { background: linear-gradient(#66bb6a, #2e7d32); color: #fff; box-shadow: 0 3px 0 #1b5e20, 0 6px 12px rgba(0,0,0,.25); }
.btn.ghost { background: rgba(255,255,255,.12); color: var(--paper); box-shadow: none; border: 1px solid rgba(255,255,255,.25); }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn.lg { padding: 14px 28px; font-size: 20px; }
.panel { background: rgba(0,0,0,.25); border: 1px solid rgba(255,213,79,.35); border-radius: var(--r); padding: 14px; }
.paper { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.center { display: flex; justify-content: center; align-items: center; }
.grow { flex: 1; }
.muted { color: #ffcdd2; opacity: .8; font-size: 13px; }
.gold { color: var(--gold); }
h1, h2, h3 { margin: 0; }
.title-font { font-weight: 900; letter-spacing: 2px; text-shadow: 0 2px 0 #5d0000, 0 0 12px rgba(255,213,79,.5); }
.chip-pill { background: rgba(0,0,0,.35); border: 1px solid var(--gold2); border-radius: 999px; padding: 4px 12px; font-weight: 700; white-space: nowrap; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: #212121; color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 999; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: pop .2s; max-width: 90vw; text-align: center; }
@keyframes pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 16px; }
.modal { max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.modal pre { white-space: pre-wrap; font-family: inherit; line-height: 1.7; }

/* ---- 首頁 ---- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(0,0,0,.28); border-bottom: 2px solid rgba(255,213,79,.4); position: sticky; top: 0; z-index: 50; }
.topbar .name { font-weight: 800; }
.home { padding: 16px; max-width: 980px; margin: 0 auto; width: 100%; }
.hero { text-align: center; padding: 18px 0 10px; }
.hero h1 { font-size: clamp(30px, 7vw, 54px); }
.lanterns { font-size: 34px; letter-spacing: 18px; animation: sway 3s ease-in-out infinite; display: inline-block; }
@keyframes sway { 50% { transform: rotate(3deg); } }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.menu-tile { background: linear-gradient(160deg, #ffecb3, #ffca28); color: #5d1a00; border-radius: 18px; padding: 16px 10px; text-align: center; font-weight: 900; font-size: 18px; box-shadow: 0 4px 0 #b26a00, 0 8px 18px rgba(0,0,0,.3); }
.menu-tile .ic { font-size: 40px; display: block; margin-bottom: 4px; }
.menu-tile small { display: block; font-weight: 500; font-size: 12px; opacity: .75; margin-top: 2px; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-tabs button { background: rgba(255,255,255,.12); color: #fff; padding: 8px 14px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
.cat-tabs button.on { background: var(--gold); color: #5d1a00; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.game-card { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 12px; text-align: left; box-shadow: 0 4px 12px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 4px; min-height: 130px; border: 2px solid transparent; }
.game-card:hover { border-color: var(--gold2); }
.game-card .ic { font-size: 34px; }
.game-card b { font-size: 17px; }
.game-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.game-card .tag { font-size: 11px; background: #ffe0b2; color: #6d4c41; border-radius: 6px; padding: 1px 6px; align-self: flex-start; }

/* ---- 頭像 ---- */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #fff3e0; font-size: 30px; flex-shrink: 0; border: 3px solid #ffcc80; }
.av .hat { position: absolute; top: -16px; font-size: 22px; transform: rotate(-12deg); }
.av.frame-gold { border-color: #ffd54f; box-shadow: 0 0 0 2px #ff8f00, 0 0 12px #ffd54f; }
.av.frame-jade { border-color: #69f0ae; box-shadow: 0 0 0 2px #00897b, 0 0 12px #69f0ae; }
.av.frame-fire { border-color: #ff7043; box-shadow: 0 0 0 2px #d84315, 0 0 14px #ff5722; animation: fire 1s infinite alternate; }
.av.frame-rainbow { border-color: transparent; background-image: linear-gradient(#fff3e0, #fff3e0), conic-gradient(red, orange, yellow, lime, cyan, blue, violet, red); background-origin: border-box; background-clip: padding-box, border-box; }
.av.frame-dragon { border-color: #ffd54f; box-shadow: 0 0 0 3px #c62828, 0 0 18px #ffd54f; }
@keyframes fire { to { box-shadow: 0 0 0 2px #d84315, 0 0 22px #ffab40; } }
.av.sm { width: 38px; height: 38px; font-size: 22px; border-width: 2px; }
.av.sm .hat { font-size: 16px; top: -12px; }
.av.lg { width: 84px; height: 84px; font-size: 50px; }
.av.lg .hat { font-size: 34px; top: -26px; }
.ptitle { font-size: 11px; background: linear-gradient(90deg, #ff6f00, #ffca28); color: #3e1500; padding: 0 6px; border-radius: 6px; font-weight: 800; }

/* ---- 商店 / 兌換 ---- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.shop-item { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.shop-item .big { font-size: 38px; min-height: 52px; display: flex; align-items: center; }
.shop-item.owned { outline: 2px solid #66bb6a; }
.shop-item.equipped { outline: 3px solid var(--gold2); }
.exch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pkg { background: linear-gradient(160deg, #fff8e1, #ffe082); color: #5d1a00; border-radius: 16px; padding: 14px; text-align: center; }
.pkg .amt { font-size: 26px; font-weight: 900; }
.chipstack { font-size: 36px; }

/* ---- 房間 ---- */
.room-code { font-size: clamp(48px, 14vw, 92px); font-weight: 900; letter-spacing: 10px; color: var(--gold); text-shadow: 0 4px 0 #5d0000; text-align: center; }
.member { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.22); padding: 8px 12px; border-radius: 12px; }

/* ---- 遊戲畫面 ---- */
.play { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.stage { flex: 1; display: flex; flex-direction: column; padding: 10px; gap: 10px; position: relative; max-width: 1100px; margin: 0 auto; width: 100%; }
.felt { background: radial-gradient(ellipse at center, #1b7a4b 0%, var(--felt) 60%, var(--felt2) 100%); border: 6px solid #5d3a1a; border-radius: 26px; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.4); padding: 12px; }
.seats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seat { background: rgba(0,0,0,.3); border-radius: 14px; padding: 6px 10px; display: flex; gap: 8px; align-items: center; min-width: 120px; border: 2px solid transparent; position: relative; }
.seat.active { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,213,79,.7); }
.seat.me { background: rgba(255,213,79,.18); }
.seat .nm { font-weight: 700; font-size: 14px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .sub { font-size: 12px; opacity: .85; }
.badge { position: absolute; top: -8px; right: -6px; background: var(--gold); color: #5d1a00; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 8px; }
.delta { font-weight: 900; }
.delta.pos { color: #b9f6ca; } .delta.neg { color: #ff8a80; }

/* 撲克牌 */
.cards { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.cards.overlap .card:not(:first-child) { margin-left: -22px; }
.card { width: 52px; height: 74px; background: var(--card); color: #212121; border-radius: 7px; box-shadow: 0 2px 4px rgba(0,0,0,.4); display: inline-flex; flex-direction: column; justify-content: space-between; padding: 3px 5px; font-weight: 800; position: relative; transition: transform .12s; flex-shrink: 0; border: 1px solid #ccc; }
.card .r { font-size: 18px; line-height: 1; }
.card .s { font-size: 22px; align-self: flex-end; line-height: 1; }
.card.red { color: #d32f2f; }
.card.back { background: repeating-linear-gradient(45deg, var(--cb1, #b71c1c) 0 6px, var(--cb2, #d32f2f) 6px 12px); border: 3px solid #fff; }
.card.sel { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--gold2), 0 6px 10px rgba(0,0,0,.4); }
.card.dim { opacity: .45; }
.card.sm { width: 36px; height: 52px; padding: 2px 3px; }
.card.sm .r { font-size: 13px; } .card.sm .s { font-size: 15px; }
.card.lg { width: 70px; height: 100px; } .card.lg .r { font-size: 24px; } .card.lg .s { font-size: 30px; }
.card.click { cursor: pointer; }
.card.glow { box-shadow: 0 0 0 3px #69f0ae, 0 0 12px #69f0ae; }

/* 骰子 */
.die { width: 46px; height: 46px; background: #fff; border-radius: 10px; display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 6px; box-shadow: inset 0 -3px 0 #ddd, 0 3px 6px rgba(0,0,0,.4); }
.die i { width: 8px; height: 8px; border-radius: 50%; background: #212121; align-self: center; justify-self: center; }
.die.red i { background: #d32f2f; }
.die.sm { width: 30px; height: 30px; padding: 3px; border-radius: 6px; } .die.sm i { width: 5px; height: 5px; }
.die.roll { animation: roll .5s; }
@keyframes roll { 0% { transform: rotate(0) scale(.6); } 60% { transform: rotate(300deg) scale(1.15); } 100% { transform: rotate(360deg) scale(1); } }
.die.hidden-die { background: #5d4037; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.banner { text-align: center; font-size: 20px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 #3e0000; }
.status { text-align: center; font-weight: 700; min-height: 24px; }
.cd { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--gold); }
.log { font-size: 12px; opacity: .8; max-height: 80px; overflow: auto; background: rgba(0,0,0,.2); border-radius: 8px; padding: 6px 10px; }
.result-over { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .3s; }
@keyframes fadein { from { opacity: 0; } }
.result-box { background: linear-gradient(160deg, #fff8e1, #ffe082); color: #4e1a00; border-radius: 22px; padding: 22px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.6); border: 4px solid #ff8f00; }
.result-box h2 { font-size: 30px; }
.confetti { position: fixed; top: -20px; font-size: 24px; z-index: 450; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* 麻將 */
.tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; height: 46px; background: linear-gradient(#fffef5, #f1ead2); border-radius: 5px; box-shadow: 0 3px 0 #2e7d32, 0 4px 5px rgba(0,0,0,.4); color: #1a1a1a; font-weight: 900; font-size: 13px; line-height: 1.05; flex-shrink: 0; position: relative; }
.tile .n { font-size: 16px; }
.tile.m .n { color: #c62828; } .tile.p .n { color: #1565c0; } .tile.s .n { color: #2e7d32; }
.tile.h { font-size: 22px; }
.tile.h.d0 { color: #c62828; } .tile.h.d1 { color: #2e7d32; } .tile.h.d2 { color: #1565c0; }
.tile.f { color: #ad1457; font-size: 18px; }
.tile.sm { width: 24px; height: 32px; font-size: 10px; } .tile.sm .n { font-size: 12px; } .tile.sm.h { font-size: 15px; }
.tile.back { background: linear-gradient(#43a047, #1b5e20); }
.tile.click { cursor: pointer; }
.tile.click:hover { transform: translateY(-6px); }
.tile.new { margin-left: 10px; box-shadow: 0 3px 0 #2e7d32, 0 0 0 2px var(--gold); }
.tile.hl { box-shadow: 0 3px 0 #2e7d32, 0 0 0 3px #ff5252; }
.tiles { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.mj-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-rows: auto 1fr auto; gap: 8px; }

/* 棋盤 */
canvas.board { width: 100%; max-width: 640px; touch-action: none; display: block; margin: 0 auto; border-radius: 12px; }
.chat-box { background: rgba(0,0,0,.25); border-radius: 10px; padding: 6px; height: 140px; overflow-y: auto; font-size: 14px; }
.chat-box .sys { color: var(--gold); font-weight: 700; }
.chat-box .close { color: #ffab91; }
.opt-btn { background: #fff8e1; color: #4e1a00; border-radius: 14px; padding: 14px; font-size: 18px; font-weight: 800; text-align: left; box-shadow: 0 3px 0 #b26a00; min-height: 56px; }
.opt-btn.right { background: #b9f6ca; box-shadow: 0 3px 0 #1b5e20; }
.opt-btn.wrong { background: #ff8a80; }
.opt-btn.picked { outline: 3px solid #ff6f00; }
.opt-btn.gone { visibility: hidden; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .opts { grid-template-columns: 1fr; } .card { width: 44px; height: 64px; } .card .r { font-size: 15px; } .card .s { font-size: 18px; } .seat { min-width: 0; } .tile { width: 26px; height: 36px; font-size: 10px; } .tile .n { font-size: 12px; } .tile.h { font-size: 16px; } }
.progress { height: 8px; background: rgba(0,0,0,.3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #69f0ae, #ffd54f); transition: width .25s linear; }
.hpbar { height: 12px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; position: relative; }
.hpbar > i { display: block; height: 100%; background: linear-gradient(90deg, #ff5252, #ffeb3b, #69f0ae); transition: width .4s; }
.hpbar > s { position: absolute; top: 0; left: 0; height: 100%; background: rgba(100,181,246,.7); text-decoration: none; }
.emoji-bar button { font-size: 22px; background: transparent; padding: 2px 4px; }
.float-emoji { position: fixed; font-size: 46px; z-index: 600; pointer-events: none; animation: floatup 2s forwards; }
@keyframes floatup { to { transform: translateY(-160px) scale(1.4); opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.topbar > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 8px 10px; }
  .topbar .chip-pill { padding: 3px 8px; font-size: 13px; }
  .topbar .btn.sm { padding: 5px 9px; }
  .topbar > b { font-size: 15px !important; }
  .stage { padding: 6px; }
  .felt { padding: 8px; border-width: 4px; }
}

/* ================= 質感升級 v2 ================= */
:root { --serif: "Noto Serif TC", "Songti TC", serif; --gold-grad: linear-gradient(180deg, #fff6c8 0%, #ffd54f 40%, #ff9f1a 100%); }
body {
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(255, 120, 80, .45), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffcc66' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M0 40 Q20 20 40 40 T80 40'/%3E%3Cpath d='M0 80 Q20 60 40 80 T80 80'/%3E%3Cpath d='M0 0 Q20 -20 40 0 T80 0'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 30%, #b71c1c 0%, #7a0b0b 60%, #3d0303 100%) fixed;
}
.title-font { font-family: var(--serif); }
.screen-in { animation: screenIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } }
.topbar { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: linear-gradient(180deg, rgba(60,0,0,.75), rgba(60,0,0,.45)); border-bottom: 1px solid rgba(255,213,79,.35); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.chip-pill { background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.25)); border: 1px solid rgba(255,193,7,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.btn { position: relative; overflow: hidden; letter-spacing: .5px; }
.btn::after { content: ''; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)); border-radius: inherit; pointer-events: none; }
.btn.ghost::after { display: none; }
.panel { background: linear-gradient(180deg, rgba(40,0,0,.45), rgba(20,0,0,.35)); border: 1px solid rgba(255,213,79,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.2); }
.panel.fancy { position: relative; border: 1.5px solid rgba(255,213,79,.55); }
.panel.fancy::before, .panel.fancy::after { content: '❖'; position: absolute; top: -10px; color: #ffd54f; font-size: 16px; text-shadow: 0 0 6px rgba(255,180,0,.8); }
.panel.fancy::before { left: 12px; } .panel.fancy::after { right: 12px; }
.text-input, .code-input { padding: 11px 14px; border-radius: 12px; border: 2px solid rgba(255,193,7,.6); background: #fffaf0; font-size: 17px; color: #3e1500; outline: none; min-width: 0; }
.text-input:focus, .code-input:focus { border-color: #ffb300; box-shadow: 0 0 0 3px rgba(255,179,0,.3); }
.code-input { width: 110px; text-align: center; letter-spacing: 6px; font-size: 20px; font-weight: 800; }
.link-btn { background: none; color: var(--gold); font-weight: 700; padding: 2px 4px; }

/* 首頁 */
.hero { position: relative; padding: 26px 0 16px; overflow: hidden; }
.fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lanterns { display: flex; justify-content: center; gap: 22px; font-size: 38px; letter-spacing: 0; animation: none; position: relative; }
.lanterns span { display: inline-block; animation: sway 3.2s ease-in-out infinite; transform-origin: top center; filter: drop-shadow(0 6px 10px rgba(255,120,0,.45)); }
.lanterns span:nth-child(2) { animation-delay: -1.2s; } .lanterns span:nth-child(3) { animation-delay: -2.1s; }
.lanterns .big { font-size: 46px; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.hero-title { position: relative; font-size: clamp(44px, 12vw, 76px); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #6d0000) drop-shadow(0 0 18px rgba(255,190,60,.45)); letter-spacing: 8px; margin: 4px 0; }
.hero-sub { position: relative; color: #ffe0b2; font-size: 15px; letter-spacing: 2px; }
.play-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.join-box { flex-wrap: nowrap; gap: 6px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 8px; font-weight: 900; font-size: 18px; }
.hot-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.hot-strip > * { scroll-snap-align: start; }
.menu-tile { position: relative; overflow: hidden; background: linear-gradient(160deg, #fff8e1, #ffd54f 70%, #ffb300); border: 1px solid rgba(255,255,255,.6); transition: transform .15s; }
.menu-tile:active { transform: scale(.97); }
.menu-tile.glow { animation: tileGlow 1.6s ease-in-out infinite; }
.menu-tile.dim { filter: grayscale(.6) brightness(.9); }
@keyframes tileGlow { 50% { box-shadow: 0 4px 0 #b26a00, 0 0 26px rgba(255,214,79,.9); } }
.mission { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px dashed rgba(255,213,79,.25); }
.mission .m-ic { font-size: 26px; width: 34px; text-align: center; }
.mission.claimed { opacity: .5; }
.foot-note { margin-top: 12px; line-height: 1.8; }
.settings { gap: 18px; } .settings label { display: flex; gap: 6px; align-items: center; color: #fff; }

/* 遊戲卡 */
.game-card { padding: 0; overflow: hidden; border: 0; transition: transform .15s, box-shadow .15s; min-height: 0; background: #fffaf0; }
.game-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.35); }
.game-card:active { transform: scale(.97); }
.gc-art { position: relative; display: flex; align-items: center; justify-content: center; height: 78px; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 50%), linear-gradient(135deg, var(--c1), var(--c2)); }
.gc-art .ic { font-size: 44px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.gc-art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 18px; background: linear-gradient(transparent, rgba(0,0,0,.15)); }
.gc-new { position: absolute; top: 6px; right: 6px; background: #ffeb3b; color: #b71c1c; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.gc-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; text-align: left; }
.gc-body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-tabs button small { opacity: .7; font-weight: 600; }

/* 撲克牌 v2 */
.card { width: 56px; height: 80px; padding: 0; display: inline-block; position: relative; border-radius: 8px; border: 1px solid #d7ccc8; background: linear-gradient(160deg, #ffffff 0%, #fdf8ef 100%); box-shadow: 0 1px 0 #fff inset, 0 3px 6px rgba(0,0,0,.35); font-family: Georgia, "Times New Roman", serif; }
.card .ci { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .95; font-weight: 700; }
.card .ci b { font-size: 16px; } .card .ci i { font-style: normal; font-size: 13px; }
.card .ci.tl { top: 4px; left: 4px; } .card .ci.br { bottom: 4px; right: 4px; transform: rotate(180deg); }
.card .cc { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.card .pip { font-size: 26px; } .card .pip.ace { font-size: 34px; }
.card .face { font-size: 28px; filter: saturate(1.1); }
.card.red { color: #d32f2f; } .card.black { color: #1a1a1a; }
.card.joker { background: linear-gradient(160deg, #fff, #fff3e0); color: #6a1b9a; }
.card.joker .cc { font-size: 32px; }
.card.back { background: repeating-linear-gradient(45deg, var(--cb1, #b71c1c) 0 5px, var(--cb2, #d32f2f) 5px 10px); border: 3px solid #fff; display: inline-flex; align-items: center; justify-content: center; }
.card.back .cb-inner { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.card.sm { width: 38px; height: 54px; border-radius: 6px; }
.card.sm .ci b { font-size: 12px; } .card.sm .ci i { font-size: 10px; } .card.sm .ci.tl { top: 2px; left: 3px; } .card.sm .ci.br { bottom: 2px; right: 3px; }
.card.sm .pip { font-size: 18px; } .card.sm .pip.ace { font-size: 22px; } .card.sm .face { font-size: 19px; } .card.sm.back .cb-inner { font-size: 13px; }
.card.lg { width: 78px; height: 112px; } .card.lg .ci b { font-size: 21px; } .card.lg .ci i { font-size: 17px; } .card.lg .pip { font-size: 40px; } .card.lg .pip.ace { font-size: 52px; } .card.lg .face { font-size: 44px; }
.card.deal { animation: deal .38s cubic-bezier(.2,.9,.3,1.2) backwards; }
@keyframes deal { from { opacity: 0; transform: translateY(-40px) rotate(-12deg) scale(.6); } }
.card.sel { transform: translateY(-16px); }
@media (max-width: 520px) { .card { width: 46px; height: 66px; } .card .ci b { font-size: 13px; } .card .ci i { font-size: 11px; } .card .pip { font-size: 20px; } .card .pip.ace { font-size: 26px; } .card .face { font-size: 22px; } }

/* 牌桌 */
.felt { background: radial-gradient(ellipse at 50% 35%, #2a8f5c 0%, #136b40 45%, #0a3f25 100%); border: 0; box-shadow: 0 0 0 5px #6b3f1d, 0 0 0 8px #3e2310, inset 0 0 50px rgba(0,0,0,.55), 0 10px 24px rgba(0,0,0,.45); }
.seat { background: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,.25)); border: 1.5px solid rgba(255,255,255,.08); transition: box-shadow .3s, border-color .3s; }
.seat.active { border-color: #ffd54f; animation: seatPulse 1.4s ease-in-out infinite; }
@keyframes seatPulse { 50% { box-shadow: 0 0 22px rgba(255,213,79,.85); } }
.seat.out { opacity: .45; filter: grayscale(.8); }
.seat.safe { border-color: #69f0ae; }
.banner.pulse { animation: pulseTxt .5s ease-in-out infinite alternate; }
@keyframes pulseTxt { to { transform: scale(1.12); color: #ff5252; } }

/* 結算畫面 */
.result-box { position: relative; overflow: hidden; }
.result-box::before { content: ''; position: absolute; left: 50%; top: 60px; width: 600px; height: 600px; margin: -300px 0 0 -300px; background: repeating-conic-gradient(rgba(255,193,7,.25) 0 10deg, transparent 10deg 20deg); animation: rays 12s linear infinite; z-index: 0; }
.result-box > * { position: relative; z-index: 1; }
@keyframes rays { to { transform: rotate(360deg); } }

/* 誰是臥底 */
.word-card { width: 220px; min-height: 130px; border-radius: 18px; background: linear-gradient(160deg, #4a148c, #7b1fa2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 6px 0 #2a0a50, 0 10px 20px rgba(0,0,0,.4); transition: transform .3s; }
.word-card.open { background: linear-gradient(160deg, #fff8e1, #ffe082); color: #4e1a00; transform: rotateY(360deg); }
.word-card b { font-size: 30px; font-family: var(--serif); }
.word-card .muted { color: inherit; opacity: .7; }
.desc-list { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 12px; max-height: 240px; overflow-y: auto; }
.desc-round { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.15); }
.desc { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 10px; }
.desc.mine { background: rgba(255,213,79,.18); }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 14px; background: #fff8e1; color: #4e1a00; font-weight: 800; box-shadow: 0 3px 0 #b26a00; }
.vote-btn.skip { background: #eee; box-shadow: 0 3px 0 #999; font-size: 24px; }
.vote-btn.skip span { font-size: 14px; }

/* 心臟病 */
.heart-table { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; transition: background .2s; }
.heart-table.alarm { animation: alarm .35s ease-in-out infinite alternate; }
@keyframes alarm { to { box-shadow: 0 0 0 5px #6b3f1d, 0 0 0 8px #3e2310, inset 0 0 80px rgba(255,0,0,.75), 0 0 30px rgba(255,0,0,.6); } }
.count-call { display: flex; align-items: baseline; gap: 8px; }
.count-call b { font-size: 54px; font-family: var(--serif); color: #fff; text-shadow: 0 3px 0 #000; }
.pile { position: relative; min-height: 116px; display: flex; align-items: center; justify-content: center; }
.pile-n { position: absolute; bottom: -18px; font-size: 12px; opacity: .8; white-space: nowrap; }
.slap-btn { display: block; margin: 6px auto; width: min(320px, 90%); height: 96px; border-radius: 50px; font-size: 38px; font-weight: 900; color: #fff; background: radial-gradient(circle at 50% 30%, #ff8a80, #c62828 70%); box-shadow: 0 8px 0 #7f0000, 0 12px 24px rgba(0,0,0,.4); user-select: none; touch-action: manipulation; }
.slap-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #7f0000; }
.slap-btn.hot { animation: slapHot .3s ease-in-out infinite alternate; }
.slap-btn:disabled { filter: grayscale(.7); opacity: .6; }
@keyframes slapHot { to { transform: scale(1.06); box-shadow: 0 8px 0 #7f0000, 0 0 40px rgba(255,82,82,.9); } }

/* 排七 */
.sevens-board { display: flex; flex-direction: column; gap: 6px; padding: 10px; overflow-x: auto; }
.sv-row { display: flex; align-items: center; gap: 6px; }
.sv-suit { font-size: 22px; width: 24px; color: #fff; text-align: center; } .sv-suit.red { color: #ff8a80; }
.sv-cards { display: flex; gap: 2px; }
.sv-slot { width: 38px; height: 54px; border-radius: 6px; border: 1.5px dashed rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.4); font-weight: 800; flex-shrink: 0; }
.sv-slot.seven { border-color: rgba(255,213,79,.6); color: #ffd54f; }
@media (max-width: 520px) { .sv-slot, .sevens-board .card.sm { width: 24px; height: 36px; } .sevens-board .card.sm .ci.br, .sevens-board .card.sm .cc { display: none; } .sevens-board .card.sm .ci b { font-size: 10px; } }

/* 抽鬼牌扇形 */
.fan { display: flex; justify-content: center; padding: 20px 10px 6px; }
.fan-card { margin-left: -26px; background: none; padding: 0; transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg)) translateY(calc(var(--i) * 0px)); transition: transform .15s; }
.fan-card:first-child { margin-left: 0; }
button.fan-card:hover, button.fan-card:active { transform: translateY(-18px) scale(1.08); z-index: 2; }
.fan.small .fan-card { margin-left: -24px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.chip-pill.bump { animation: bump .5s; } @keyframes bump { 40% { transform: scale(1.25); background: rgba(255,213,79,.4); } }
.pile { margin-bottom: 16px; }

/* 射龍門 */
.dg-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0; min-height: 120px; }
.dg-gap { width: 78px; display: flex; justify-content: center; }
.dg-shot { animation: dgShoot .55s cubic-bezier(.2,.9,.3,1.3) both; }
.dg-shot.in .card { box-shadow: 0 0 0 4px #69f0ae, 0 0 24px #69f0ae; }
.dg-shot.out .card { box-shadow: 0 0 0 4px #ff5252, 0 0 24px #ff5252; }
@keyframes dgShoot { from { transform: translateY(160px) scale(.4) rotate(25deg); opacity: 0; } }
.dg-verdict { font-size: 32px; font-weight: 900; font-family: var(--serif); text-shadow: 0 3px 0 #000; animation: popIn .4s .25s both; }
.dg-verdict.win { color: #b9f6ca; } .dg-verdict.lose { color: #ff8a80; }
.dg-sub { font-size: 16px; animation: popIn .4s .35s both; }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }
.flash-win { animation: flashWin .8s; } .flash-lose { animation: flashLose .8s; }
@keyframes flashWin { 30% { box-shadow: 0 0 0 5px #6b3f1d, 0 0 0 8px #3e2310, inset 0 0 80px rgba(105,240,174,.6); } }
@keyframes flashLose { 30% { box-shadow: 0 0 0 5px #6b3f1d, 0 0 0 8px #3e2310, inset 0 0 80px rgba(255,82,82,.6); } }

/* 聊天 / 送禮 */
.social.hidden { display: none; }
.social-fab { position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 300; width: 56px; height: 56px; border-radius: 50%; font-size: 26px; background: linear-gradient(160deg, #ffe082, #ffb300); box-shadow: 0 4px 0 #b26a00, 0 8px 18px rgba(0,0,0,.4); }
.social-fab:active { transform: translateY(3px); }
.social-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #ff1744; border: 2px solid #fff; }
.social-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 310; width: min(560px, 100%); max-height: 62vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #4a0a0a, #2a0505); border: 1.5px solid rgba(255,213,79,.6); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.5); animation: sheetUp .25s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.social-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.social-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.social-tabs button { white-space: nowrap; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-weight: 700; font-size: 14px; }
.social-tabs button.on { background: #ffd54f; color: #5d1a00; }
.social-x { background: none; color: #fff; font-size: 20px; padding: 4px 8px; }
.social-body { overflow-y: auto; padding: 4px 12px 14px; }
.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.phrase-grid button { text-align: left; padding: 9px 10px; border-radius: 12px; background: #fff8e1; color: #4e1a00; font-weight: 700; display: flex; gap: 6px; align-items: center; box-shadow: 0 2px 0 #b26a00; }
.phrase-grid button span { font-size: 18px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.emoji-grid button { font-size: 30px; padding: 6px; background: rgba(255,255,255,.08); border-radius: 12px; }
.gift-people { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; }
.gift-people button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; min-width: 72px; font-size: 13px; border: 2px solid transparent; }
.gift-people button.on { border-color: #ffd54f; background: rgba(255,213,79,.18); }
.gp-av { font-size: 28px; }
.chat-log { max-height: 40vh; overflow-y: auto; line-height: 1.8; }
.bubble-layer { position: fixed; inset: 0; pointer-events: none; z-index: 320; }
.chat-bubble { position: fixed; max-width: min(260px, 80vw); background: #fff; color: #2b1a12; padding: 8px 12px; border-radius: 16px; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.35); animation: bubbleIn .3s cubic-bezier(.2,.9,.3,1.4); transition: opacity .5s, transform .5s; line-height: 1.35; }
.chat-bubble b { display: block; font-size: 11px; color: #c62828; }
.chat-bubble::after { content: ''; position: absolute; bottom: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
.chat-bubble .cb-e { font-size: 20px; margin-right: 4px; }
.chat-bubble.bye { opacity: 0; transform: translateY(-14px); }
@keyframes bubbleIn { from { transform: scale(.3) translateY(10px); opacity: 0; } }
.emoji-pop { position: fixed; font-size: 64px; animation: emojiPop 2.2s ease-out forwards; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
@keyframes emojiPop { 0% { transform: scale(.2); } 15% { transform: scale(1.3); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-80px) scale(1.1); opacity: 0; } }
.gift-banner { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, #c62828, #ff7043); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 17px; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.4), 0 0 0 2px #ffd54f; animation: bubbleIn .35s; }
.gift-fly { position: fixed; font-size: 30px; margin: -15px 0 0 -15px; transition: transform .9s cubic-bezier(.3,.1,.3,1), opacity .9s; }

/* 遊戲小劇場（吉祥物） */
.mascot { position: fixed; left: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 290; width: 96px; cursor: pointer; transition: transform .25s; }
.mascot.mini { transform: translateY(70px) scale(.7); transform-origin: bottom left; opacity: .85; }
.ms-stage { position: relative; height: 104px; border-radius: 18px; overflow: hidden; border: 2px solid #ffd54f; box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 -18px 0 rgba(0,0,0,.08); }
.ms-stage::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: 10px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.18); }
.ms-char { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 50px; line-height: 1; z-index: 2; }
.ms-char img { width: 76px; height: 76px; object-fit: contain; }
.ms-face { position: absolute; right: 8px; top: -6px; font-size: 24px; animation: popIn .3s; }
.ms-line { position: absolute; left: 4px; right: 4px; top: 4px; text-align: center; font-size: 12px; font-weight: 900; color: #4e1a00; background: rgba(255,255,255,.85); border-radius: 8px; padding: 1px 2px; opacity: 0; transform: translateY(-6px); transition: .25s; z-index: 3; }
.ms-line.show { opacity: 1; transform: none; }
.ms-min { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: #5d1a00; color: #ffd54f; font-weight: 900; line-height: 1; padding: 0; z-index: 4; border: 1.5px solid #ffd54f; }
.ms-fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ms-fx i { position: absolute; font-style: normal; }
.fx-coins i { top: -20px; left: calc(var(--i) * 18px + 4px); font-size: 16px; animation: coinRain 1.1s calc(var(--i) * .12s) ease-in infinite; }
@keyframes coinRain { to { transform: translateY(120px) rotate(360deg); } }
.fx-rain i { top: 18px; left: 50%; margin-left: -16px; font-size: 30px; animation: bob 1s ease-in-out infinite; }
.fx-fireworks i { font-size: 26px; animation: burst 1s ease-out infinite; }
.fx-fireworks i:nth-child(1) { left: 4px; top: 6px; } .fx-fireworks i:nth-child(2) { right: 4px; top: 10px; animation-delay: .3s; } .fx-fireworks i:nth-child(3) { left: 40px; top: 28px; animation-delay: .6s; }
@keyframes burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.fx-zzz i, .fx-dots i, .fx-bang i { right: 6px; top: 20px; font-size: 22px; animation: floatZ 1.6s ease-in-out infinite; }
@keyframes floatZ { 50% { transform: translate(-4px, -8px); } }
.a-bob { animation: bob 2.2s ease-in-out infinite; }
.a-hop { animation: hop .5s ease-in-out infinite; }
.a-jump { animation: jumpHi .6s ease-in-out infinite; }
.a-spin { animation: spinJump 1s ease-in-out infinite; }
.a-shake { animation: shake .5s infinite; }
.a-pop { animation: popIn .35s; }
.a-wiggle { animation: wiggle .3s ease-in-out infinite alternate; }
.a-tilt { animation: tilt 1.4s ease-in-out infinite; }
.a-breathe { animation: breathe 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes hop { 50% { transform: translateY(-12px); } }
@keyframes jumpHi { 50% { transform: translateY(-22px) scale(1.08); } }
@keyframes spinJump { 50% { transform: translateY(-20px) rotate(180deg) scale(1.15); } 100% { transform: rotate(360deg); } }
@keyframes wiggle { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes tilt { 50% { transform: rotate(-12deg); } }
@keyframes breathe { 50% { transform: scale(.94); } }
@media (max-width: 520px) { .mascot { width: 78px; } .ms-stage { height: 86px; } .ms-char { font-size: 40px; } }

/* ===== 個人化 ===== */
/* 頭像框 */
.av.frame-sakura { border-color: #f8bbd0; box-shadow: 0 0 0 2px #ec407a, 0 0 12px #f48fb1; }
.av.frame-sakura::after { content: '🌸'; position: absolute; bottom: -6px; right: -6px; font-size: 40%; }
.av.frame-ice { border-color: #b3e5fc; box-shadow: 0 0 0 2px #29b6f6, 0 0 14px #81d4fa; }
.av.frame-ice::after { content: '❄️'; position: absolute; top: -6px; left: -6px; font-size: 38%; }
.av.frame-neon { border-color: #f0f; box-shadow: 0 0 0 2px #0ff, 0 0 14px #f0f, 0 0 24px #0ff; animation: neonFlick 2s infinite; }
@keyframes neonFlick { 45%, 55% { box-shadow: 0 0 0 2px #0ff, 0 0 4px #f0f; } }
.av.frame-lantern { border-color: #ffca28; box-shadow: 0 0 0 3px #d32f2f, 0 0 16px #ff7043; }
.av.frame-lantern::after { content: '🏮'; position: absolute; bottom: -8px; left: -8px; font-size: 40%; animation: sway 2.5s ease-in-out infinite; }
.av.frame-galaxy { border-color: transparent; background-image: linear-gradient(#fff3e0, #fff3e0), conic-gradient(#7c4dff, #00e5ff, #e040fb, #7c4dff); background-origin: border-box; background-clip: padding-box, border-box; box-shadow: 0 0 16px #7c4dff; }
.av.frame-galaxy::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px dashed rgba(179,136,255,.8); animation: rays 6s linear infinite; }
.av.frame-emperor { border-color: #ffd54f; box-shadow: 0 0 0 3px #b71c1c, 0 0 0 5px #ffd54f, 0 0 22px #ffb300; }
.av.frame-emperor::before { content: '👑'; position: absolute; top: -40%; font-size: 48%; z-index: 2; }
.av.frame-emperor::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(255,213,79,.7), transparent 30%); animation: rays 3s linear infinite; z-index: -1; }
.av { isolation: isolate; }
/* 稱號稀有度 */
.ptitle.r-N { background: linear-gradient(90deg, #8d6e63, #bcaaa4); color: #fff; }
.ptitle.r-R { background: linear-gradient(90deg, #1e88e5, #4fc3f7); color: #fff; }
.ptitle.r-SR { background: linear-gradient(90deg, #8e24aa, #ea80fc); color: #fff; }
.ptitle.r-SSR { background: linear-gradient(90deg, #ff6f00, #ffd54f, #ff6f00); background-size: 200% 100%; color: #3e1500; animation: shine 2.5s linear infinite; box-shadow: 0 0 8px rgba(255,193,7,.8); }
@keyframes shine { to { background-position: 200% 0; } }
.ptitle.tl-big { font-size: 14px; padding: 2px 10px; white-space: nowrap; }
.rare-tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 6px; color: #fff; }
.shop-item { position: relative; }
.rare-tag.r-N { background: #8d6e63; } .rare-tag.r-R { background: #1e88e5; } .rare-tag.r-SR { background: #8e24aa; } .rare-tag.r-SSR { background: linear-gradient(90deg, #ff6f00, #ffb300); }
/* 聊天氣泡 */
.chat-bubble.demo { position: static; animation: none; font-size: 13px; }
.chat-bubble.bb-gold { background: linear-gradient(160deg, #fff8e1, #ffd54f); border: 2px solid #ff8f00; } .chat-bubble.bb-gold::after { border-top-color: #ffd54f; }
.chat-bubble.bb-pink { background: linear-gradient(160deg, #fff0f6, #f8bbd0); color: #880e4f; } .chat-bubble.bb-pink::after { border-top-color: #f8bbd0; }
.chat-bubble.bb-night { background: linear-gradient(160deg, #1a237e, #4a148c); color: #fff; } .chat-bubble.bb-night b { color: #ffd54f; } .chat-bubble.bb-night::after { border-top-color: #4a148c; }
.chat-bubble.bb-ink { background: #fdfaf2; color: #111; font-family: var(--serif); border: 2px solid #111; } .chat-bubble.bb-ink::after { border-top-color: #111; }
.chat-bubble.bb-neon { background: #111; color: #0ff; border: 2px solid #f0f; box-shadow: 0 0 12px #f0f, 0 0 20px #0ff; } .chat-bubble.bb-neon b { color: #f0f; } .chat-bubble.bb-neon::after { border-top-color: #f0f; }
.chat-bubble.bb-lucky { background: linear-gradient(160deg, #c62828, #ff7043); color: #fff8e1; border: 2px solid #ffd54f; } .chat-bubble.bb-lucky b { color: #ffd54f; } .chat-bubble.bb-lucky::after { border-top-color: #ff7043; }
.chat-bubble.bb-lucky::before { content: '🧧'; position: absolute; top: -12px; right: -8px; font-size: 18px; }
/* 座位名牌 */
.seat.demo { display: inline-flex; min-width: 0; padding: 4px 8px; color: #fff; }
.seat.st-gold { background: linear-gradient(180deg, rgba(255,213,79,.35), rgba(120,70,0,.5)); border-color: #ffd54f; }
.seat.st-jade { background: linear-gradient(180deg, rgba(105,240,174,.3), rgba(0,77,64,.55)); border-color: #69f0ae; }
.seat.st-lantern { background: linear-gradient(180deg, rgba(229,57,53,.7), rgba(120,0,0,.7)); border-color: #ffca28; }
.seat.st-lantern::before { content: '🏮'; position: absolute; left: -8px; top: -10px; font-size: 16px; }
.seat.st-dragon { background: linear-gradient(135deg, rgba(183,28,28,.85), rgba(60,0,0,.85)); border-color: #ffd54f; box-shadow: 0 0 12px rgba(255,213,79,.5); }
.seat.st-dragon::before { content: '🐉'; position: absolute; right: -8px; bottom: -8px; font-size: 18px; }
/* 桌布 */
.play .felt { background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--felt, #136b40) 70%, white 18%) 0%, var(--felt, #136b40) 45%, color-mix(in srgb, var(--felt, #136b40) 60%, black) 100%); }
.table-swatch { display: inline-block; width: 70px; height: 46px; border-radius: 10px; background: radial-gradient(ellipse, color-mix(in srgb, var(--felt) 70%, white 18%), var(--felt) 55%, color-mix(in srgb, var(--felt) 60%, black)); box-shadow: 0 0 0 3px #6b3f1d; }
/* 名片 */
.name-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,213,79,.18), rgba(0,0,0,.3)); border: 1.5px solid rgba(255,213,79,.5); margin-bottom: 4px; position: relative; overflow: hidden; }
.name-card.st-gold { background: linear-gradient(135deg, rgba(255,213,79,.4), rgba(120,70,0,.5)); }
.name-card.st-jade { background: linear-gradient(135deg, rgba(105,240,174,.3), rgba(0,77,64,.6)); }
.name-card.st-lantern { background: linear-gradient(135deg, rgba(229,57,53,.75), rgba(120,0,0,.75)); }
.name-card.st-dragon { background: linear-gradient(135deg, rgba(183,28,28,.9), rgba(40,0,0,.9)); box-shadow: inset 0 0 30px rgba(255,213,79,.35); }
.modal .name-card { color: #fff; background-color: #5d1010; }
.nc-sign { font-style: italic; opacity: .9; }
/* 進房特效 */
.dragon-fly { position: fixed; top: 35%; left: -120px; font-size: 110px; z-index: 600; pointer-events: none; animation: dragonFly 2.5s ease-in-out forwards; filter: drop-shadow(0 0 20px #ffd54f); }
@keyframes dragonFly { 50% { transform: translateY(-40px) rotate(-8deg); } to { left: 110vw; transform: translateY(20px); } }

/* ===== 賭場 ===== */
.chip-pick { gap: 8px; }
.pchip { width: 52px; height: 52px; border-radius: 50%; font-weight: 900; color: #fff; font-size: 14px; background: radial-gradient(circle, #e53935 45%, #fff 46%, #fff 52%, #b71c1c 53%); box-shadow: 0 3px 0 #7f0000, 0 4px 8px rgba(0,0,0,.4); transition: transform .12s; }
.pchip:nth-child(2) { background: radial-gradient(circle, #1e88e5 45%, #fff 46%, #fff 52%, #0d47a1 53%); box-shadow: 0 3px 0 #0d2b5e; }
.pchip:nth-child(3) { background: radial-gradient(circle, #43a047 45%, #fff 46%, #fff 52%, #1b5e20 53%); box-shadow: 0 3px 0 #0b3d0b; }
.pchip:nth-child(4) { background: radial-gradient(circle, #212121 45%, #ffd54f 46%, #ffd54f 52%, #000 53%); box-shadow: 0 3px 0 #000; }
.pchip:nth-child(5) { background: radial-gradient(circle, #8e24aa 45%, #fff 46%, #fff 52%, #4a148c 53%); box-shadow: 0 3px 0 #2a0a50; }
.pchip.on { transform: translateY(-6px) scale(1.1); box-shadow: 0 0 0 3px #ffd54f, 0 8px 14px rgba(0,0,0,.5); }
.bc-chip { position: absolute; top: 4px; right: 4px; min-width: 30px; padding: 2px 6px; border-radius: 999px; background: #ffd54f; color: #5d1a00; font-weight: 900; font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.bc-others { position: absolute; bottom: 4px; left: 0; right: 0; font-size: 11px; opacity: .8; }
/* 百家樂 */
.bc-table { gap: 12px; }
.bc-hands { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; flex-wrap: wrap; }
.bc-hand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 14px; border: 2px solid transparent; }
.bc-hand span { font-size: 18px; } .bc-hand b { font-size: 28px; color: #ffd54f; }
.bc-hand.win { border-color: #ffd54f; box-shadow: 0 0 20px rgba(255,213,79,.6); }
.bc-vs { font-size: 22px; font-weight: 900; color: #ffd54f; }
.bc-spots { display: grid; grid-template-columns: 1fr 2fr 1.2fr 2fr 1fr; gap: 6px; }
.bc-spot { position: relative; min-height: 78px; border-radius: 14px; border: 2px solid rgba(255,255,255,.5); background: rgba(0,0,0,.2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bc-spot b { font-size: 24px; font-family: var(--serif); } .bc-spot small { opacity: .75; font-size: 11px; }
.bc-spot.player { border-color: #64b5f6; } .bc-spot.player b { color: #90caf9; }
.bc-spot.banker { border-color: #ef5350; } .bc-spot.banker b { color: #ff8a80; }
.bc-spot.tie { border-color: #81c784; } .bc-spot.tie b { color: #a5d6a7; }
.bc-spot.pair b { font-size: 16px; }
.bc-spot:not(:disabled):active { transform: scale(.96); }
.bc-spot.win { background: rgba(255,213,79,.3); border-color: #ffd54f; animation: seatPulse 1s infinite; }
.road { display: flex; flex-wrap: wrap; gap: 3px; background: #fff; border-radius: 8px; padding: 6px; max-height: 70px; overflow: hidden; }
.road i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.rd-p { background: #1e88e5; } .rd-b { background: #e53935; } .rd-t { background: #43a047; }
@media (max-width: 520px) { .bc-spots { grid-template-columns: 1fr 1fr; } .bc-spot.tie { grid-column: span 2; order: -1; } .bc-spot.player { order: 0; } }
/* 輪盤 */
.rl-top { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
#rlWheel { width: min(260px, 62vw); height: auto; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
.rl-info { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rl-num { width: 84px; height: 84px; border-radius: 50%; font-size: 42px; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 4px solid #ffd54f; animation: popIn .4s; }
.c-red { background: #c62828; color: #fff; } .c-black { background: #212121; color: #fff; } .c-green { background: #2e7d32; color: #fff; }
.rl-hist { display: flex; gap: 3px; flex-wrap: wrap; max-width: 200px; justify-content: center; }
.rl-hist i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.rl-board { display: grid; grid-template-columns: 40px 1fr; gap: 4px; background: #0b4d2c; padding: 8px; border-radius: 12px; border: 3px solid #6b3f1d; }
.rl-zero { grid-row: span 1; display: flex; } .rl-zero .rl-cell { height: 100%; width: 100%; }
.rl-nums { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.rl-out { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 3px; }
.rl-cell { position: relative; min-height: 34px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 13px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); padding: 2px; }
.rl-cell.won { box-shadow: 0 0 0 3px #ffd54f, 0 0 14px #ffd54f; z-index: 1; }
.rl-cell .bc-chip { top: -6px; right: -4px; font-size: 10px; min-width: 22px; padding: 1px 4px; }
@media (max-width: 520px) { .rl-nums { grid-template-columns: repeat(6, 1fr); } .rl-cell { min-height: 30px; font-size: 12px; } }
/* 德州撲克 */
.tx-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tx-seat { position: relative; background: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,.25)); border: 1.5px solid rgba(255,255,255,.1); border-radius: 14px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.tx-seat.active { border-color: #ffd54f; animation: seatPulse 1.4s infinite; }
.tx-seat.out { opacity: .45; }
.tx-seat .nm { font-weight: 700; font-size: 13px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-seat .sub { font-size: 12px; }
.tx-btn { width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #000; font-weight: 900; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-tag { font-size: 10px; background: rgba(255,213,79,.25); border-radius: 6px; padding: 0 4px; white-space: nowrap; }
.tx-act { font-size: 12px; min-height: 16px; }
.tx-hand { font-size: 12px; color: #ffd54f; font-weight: 800; }
.tx-table { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 16px 8px; }
.tx-board { display: flex; gap: 6px; justify-content: center; }
.tx-empty { width: 78px; height: 112px; border-radius: 8px; border: 2px dashed rgba(255,255,255,.25); }
.tx-me { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.tx-me .tx-seat { min-width: 150px; }
@media (max-width: 520px) { .tx-board .card.lg, .tx-empty { width: 52px; height: 74px; } .tx-board .card.lg .pip { font-size: 24px; } .tx-board .card.lg .face { font-size: 26px; } .tx-board .card.lg .ci b { font-size: 14px; } .tx-seats { grid-template-columns: repeat(2, 1fr); } }
/* 老虎機 */
.sm-ticker { overflow: hidden; white-space: nowrap; background: rgba(0,0,0,.35); border-radius: 999px; padding: 6px 12px; font-weight: 700; color: #ffd54f; }
.sm-ticker span { display: inline-block; margin-right: 30px; animation: ticker 12s linear infinite; }
@keyframes ticker { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.sm-machine { margin: 0 auto; width: min(360px, 100%); padding: 16px; border-radius: 26px; background: linear-gradient(160deg, #ffd54f, #ff8f00 60%, #c62828); box-shadow: 0 10px 0 #7f0000, 0 16px 30px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.6); display: flex; flex-direction: column; gap: 10px; }
.sm-title { text-align: center; font-family: var(--serif); font-size: 22px; font-weight: 900; color: #7f0000; text-shadow: 0 1px 0 #fff; }
.sm-window { position: relative; background: #fff; border-radius: 14px; border: 6px solid #5d1a00; box-shadow: inset 0 6px 14px rgba(0,0,0,.35); aspect-ratio: 1; }
.sm-grid { display: grid; grid-template-columns: repeat(3, 1fr); height: 100%; }
.sm-grid span { display: flex; align-items: center; justify-content: center; font-size: clamp(38px, 12vw, 56px); border: 1px solid #eee; }
.sm-grid.spin span { filter: blur(1.5px); transform: translateY(4px); }
.sm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sm-lines polyline { fill: none; stroke: #ff1744; stroke-width: 6; stroke-linecap: round; opacity: .85; animation: popIn .4s; }
.sm-win { text-align: center; font-size: 18px; font-weight: 800; color: #3e1500; min-height: 26px; }
.sm-lever { height: 64px; border-radius: 32px; font-size: 28px; font-weight: 900; color: #fff; background: radial-gradient(circle at 50% 30%, #ff8a80, #c62828 70%); box-shadow: 0 6px 0 #7f0000; }
.sm-lever:active, .sm-lever:disabled { transform: translateY(4px); box-shadow: 0 2px 0 #7f0000; }
.sm-pay { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 12px; }
.sm-pay span { display: inline-block; margin: 4px 10px 0 0; }

/* ===== 熱門新遊戲 ===== */
/* 終極密碼 */
.nb-bomb { font-size: calc(70px + var(--d) * 50px); animation: nbShake calc(1.2s - var(--d) * 1s) ease-in-out infinite; filter: drop-shadow(0 0 calc(var(--d) * 30px) #ff1744); }
.nb-bomb.boom { animation: popIn .4s; }
@keyframes nbShake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.nb-range { font-size: 30px; font-weight: 900; } .nb-range b { font-size: 46px; color: #ffd54f; font-family: var(--serif); }
/* 真心話大冒險 */
.td-wheel-wrap { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 10px auto; }
.td-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 30px; color: #ffd54f; text-shadow: 0 2px 0 #000; }
.td-wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid #ffd54f; box-shadow: 0 8px 20px rgba(0,0,0,.5); position: relative; }
.td-slot { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.td-slot > span { position: absolute; transform-origin: center; display: flex; flex-direction: column; align-items: center; font-size: 28px; margin: -24px 0 0 -30px; width: 60px; }
.td-slot small { font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.td-card { margin: 10px auto; max-width: 420px; padding: 22px; border-radius: 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; animation: popIn .4s; }
.td-card.t { background: linear-gradient(160deg, #e3f2fd, #90caf9); color: #0d2b5e; } .td-card.d { background: linear-gradient(160deg, #ffebee, #ff8a80); color: #5d0000; }
.td-card b { font-size: 24px; line-height: 1.4; font-family: var(--serif); }
/* 暗棋 */
.bq-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: #d7b98a; padding: 8px; border-radius: 14px; border: 5px solid #6b3f1d; max-width: 640px; margin: 0 auto; width: 100%; }
.bq-cell { aspect-ratio: 1; background: #e8d2a6; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 2px; }
.bq-cell.sel { background: #ffe082; } .bq-cell.tgt { background: #a5d6a7; } .bq-cell.last { box-shadow: inset 0 0 0 3px #1e88e5; }
.bq-pc { width: 92%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 900; font-size: clamp(16px, 4.6vw, 30px); background: #fff3d6; border: 3px solid; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.bq-pc.r { color: #c62828; border-color: #c62828; } .bq-pc.b { color: #212121; border-color: #212121; }
.bq-pc.down { background: repeating-linear-gradient(45deg, #8d6e63 0 4px, #6d4c41 4px 8px); border-color: #4e342e; }
/* 黑白棋 */
.ot-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: #1b5e20; padding: 6px; border-radius: 12px; border: 5px solid #3e2723; max-width: 520px; margin: 0 auto; width: 100%; }
.ot-cell { aspect-ratio: 1; background: #2e7d32; border-radius: 3px; display: flex; align-items: center; justify-content: center; padding: 0; }
.ot-disc { width: 84%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 3px 4px rgba(0,0,0,.5); }
.ot-disc.d1 { background: radial-gradient(circle at 35% 30%, #666, #000); } .ot-disc.d2 { background: radial-gradient(circle at 35% 30%, #fff, #bbb); }
.ot-disc.flip { animation: otFlip .45s; } .ot-disc.last { box-shadow: 0 0 0 3px #ff5252, 0 3px 4px rgba(0,0,0,.5); }
@keyframes otFlip { 50% { transform: scaleX(0); } }
.ot-hint { width: 26%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.35); }
/* 四連棋 */
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #1565c0; padding: 8px; border-radius: 16px; max-width: 480px; margin: 0 auto; width: 100%; box-shadow: 0 8px 0 #0d47a1, 0 12px 20px rgba(0,0,0,.4); }
.c4-col { display: flex; flex-direction: column; gap: 4px; background: none; padding: 0; border-radius: 10px; }
.c4-col:hover { background: rgba(255,255,255,.12); }
.c4-slot { aspect-ratio: 1; border-radius: 50%; background: #0d2b5e; box-shadow: inset 0 3px 6px rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.c4-disc { width: 88%; aspect-ratio: 1; border-radius: 50%; display: block; }
.c4-disc.p1 { background: radial-gradient(circle at 35% 30%, #ff8a80, #c62828); } .c4-disc.p2 { background: radial-gradient(circle at 35% 30%, #fff59d, #f9a825); }
.c4-disc.drop { animation: c4Drop .4s cubic-bezier(.5,0,.6,1.4); } .c4-disc.win { box-shadow: 0 0 0 4px #fff, 0 0 16px #fff; }
@keyframes c4Drop { from { transform: translateY(calc(var(--r) * -110% - 110%)); } }
/* 瘋狂接龍 */
.c8-table { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; }
.c8-suit { font-weight: 900; font-size: 18px; color: #fff; } .c8-suit.red { color: #ff8a80; }
.c8-dir { text-align: center; font-weight: 700; }
.c8-pick { font-size: 44px; width: 70px; height: 70px; border-radius: 16px; background: #fff; color: #111; box-shadow: 0 3px 0 #999; } .c8-pick.red { color: #d32f2f; }
/* 狼人殺 */
.ww-role { width: 200px; min-height: 90px; border-radius: 16px; background: linear-gradient(160deg, #37474f, #102027); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 5px 0 #000; }
.ww-role.open { background: linear-gradient(160deg, #fff8e1, #ffe082); color: #4e1a00; }
.ww-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ww-p { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(0,0,0,.3); font-size: 13px; text-align: center; }
.ww-p.me { background: rgba(255,213,79,.2); } .ww-p.dead { opacity: .4; filter: grayscale(1); }
.ww-tag { font-size: 11px; min-height: 14px; }
.ww-night { background: radial-gradient(ellipse at 50% 30%, #1a237e, #0d0d2b) !important; text-align: center; padding: 24px; }
.ww-day { background: radial-gradient(ellipse at 50% 30%, #fff59d, #ff8f00) !important; color: #3e1500; text-align: center; padding: 20px; }
.ww-day .banner { color: #7f0000; text-shadow: none; }
/* 環島大富翁 */
.mp-board { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 3px; max-width: 640px; margin: 0 auto; width: 100%; aspect-ratio: 1; background: #a5d6a7; padding: 4px; border-radius: 14px; border: 5px solid #6b3f1d; }
.mp-cell { position: relative; background: #fffaf0; color: #3e1500; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; overflow: hidden; padding: 1px; }
.mp-cell.t-start, .mp-cell.t-rest, .mp-cell.t-market, .mp-cell.t-jam { background: #ffe082; } .mp-cell.t-chance, .mp-cell.t-fate { background: #e1bee7; } .mp-cell.t-tax { background: #ffcdd2; }
.mp-ic { font-size: clamp(12px, 3.4vw, 22px); line-height: 1; } .mp-nm { font-weight: 800; white-space: nowrap; } .mp-pr { font-size: 10px; color: #6d4c41; }
.mp-tokens { position: absolute; bottom: 1px; left: 1px; right: 1px; display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; }
.mp-tokens i { font-style: normal; font-size: clamp(10px, 2.6vw, 16px); border-radius: 50%; width: 1.3em; height: 1.3em; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.5); animation: popIn .3s; }
.mp-center { grid-row: 2 / 7; grid-column: 2 / 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 8px; color: #1b3a1b; }
.mp-title { font-family: var(--serif); font-weight: 900; font-size: clamp(18px, 5vw, 30px); color: #7f0000; }
.mp-msg { font-weight: 700; font-size: clamp(12px, 3.2vw, 15px); min-height: 36px; }
.mp-center .muted { color: #33691e; }
@media (max-width: 520px) { .mp-nm { font-size: 9px; } .mp-pr { display: none; } }

/* 小劇場縮小 50%（避免擋到畫面），台詞改成上方泡泡 */
.mascot { width: 50px; left: 6px; bottom: calc(8px + env(safe-area-inset-bottom)); }
.mascot.mini { transform: translateY(36px) scale(.75); }
.ms-stage { height: 54px; border-radius: 12px; border-width: 1.5px; overflow: hidden; }
.ms-stage::after { bottom: 5px; height: 4px; }
.ms-char { font-size: 28px; bottom: 7px; }
.ms-char img { width: 42px; height: 42px; }
.ms-face { font-size: 14px; right: 2px; top: -4px; }
.ms-line { position: fixed; left: 6px; bottom: calc(68px + env(safe-area-inset-bottom)); top: auto; right: auto; width: max-content; max-width: 120px; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.ms-min { width: 16px; height: 16px; top: -6px; right: -6px; font-size: 11px; }
.fx-coins i { font-size: 10px; left: calc(var(--i) * 9px + 2px); }
.fx-rain i, .fx-fireworks i, .fx-zzz i, .fx-dots i, .fx-bang i { font-size: 14px; }
.fx-rain i { top: 6px; margin-left: -9px; } .fx-fireworks i:nth-child(3) { left: 18px; top: 16px; }
.fx-zzz i, .fx-dots i, .fx-bang i { right: 2px; top: 8px; }
@media (max-width: 520px) { .mascot { width: 46px; } .ms-stage { height: 50px; } .ms-char { font-size: 26px; } }
.save-box { gap: 10px; }
.save-step { display: flex; gap: 10px; align-items: flex-start; line-height: 1.7; }
.ss-n { flex-shrink: 0; background: #ffd54f; color: #5d1a00; font-weight: 900; border-radius: 8px; padding: 0 8px; font-size: 13px; margin-top: 3px; }
.save-way { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px dashed rgba(255,213,79,.4); line-height: 1.6; }
/* 房間同步 */
.m-status { font-size: 12px; color: #ffe082; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-live { font-size: 18px; animation: pulseLive 2s ease-in-out infinite; }
@keyframes pulseLive { 50% { opacity: .65; } }
.bd-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.bd-line { background: rgba(255,255,255,.07); border-radius: 10px; padding: 4px 10px; line-height: 1.5; }
.quick-chips { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.quick-chips button { white-space: nowrap; padding: 5px 10px; border-radius: 999px; background: #fff8e1; color: #4e1a00; font-weight: 700; font-size: 13px; }
.gc-want { position: absolute; top: 6px; left: 6px; background: #ffeb3b; color: #b71c1c; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 6px; }

/* ===== 麻將 v2 ===== */
.mt { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 52px; flex-shrink: 0; position: relative; border-radius: 6px; background: linear-gradient(180deg, #fffef7 0%, #f3ecd6 85%); box-shadow: 0 4px 0 #2e7d32, 0 5px 6px rgba(0,0,0,.45), inset 0 -2px 0 rgba(0,0,0,.05); color: #1a1a1a; transition: transform .12s; padding: 3px; }
.mt.back { background: linear-gradient(160deg, #43a047, #1b5e20); box-shadow: 0 4px 0 #0b3d0b, 0 5px 6px rgba(0,0,0,.45); }
.mt.click { cursor: pointer; }
.mt.sel { transform: translateY(-14px); box-shadow: 0 4px 0 #2e7d32, 0 0 0 3px #ffd54f, 0 10px 14px rgba(0,0,0,.5); }
.mt.hint { box-shadow: 0 4px 0 #2e7d32, 0 0 0 3px #69f0ae, 0 0 14px #69f0ae; }
.mt.hint::after { content: '💡'; position: absolute; top: -16px; font-size: 13px; }
.mt.drawn { margin-left: 12px; }
.mt.gap { margin-left: 7px; }
.mt.hl { box-shadow: 0 4px 0 #2e7d32, 0 0 0 3px #ff5252, 0 0 14px #ff5252; animation: seatPulse 1s infinite; }
.mt.s { width: 26px; height: 36px; padding: 2px; box-shadow: 0 3px 0 #2e7d32, 0 3px 4px rgba(0,0,0,.4); border-radius: 4px; }
.mt.xs { width: 20px; height: 27px; padding: 1px; box-shadow: 0 2px 0 #2e7d32; border-radius: 3px; }
.mt.m { width: 32px; height: 44px; }
.mt.l { width: 48px; height: 66px; padding: 4px; }
.mt-wan { display: flex; flex-direction: column; align-items: center; line-height: 1; color: #c62828; }
.mt-wan b { font-size: 1.05em; font-family: var(--serif); } .mt-wan i { font-style: normal; font-size: .9em; font-family: var(--serif); color: #8e0000; }
.mt { font-size: 18px; } .mt.s { font-size: 12px; } .mt.xs { font-size: 9px; } .mt.m { font-size: 15px; } .mt.l { font-size: 24px; }
.mt-pips { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 100%; height: 100%; gap: 1px; }
.mt-pips i { display: flex; align-items: center; justify-content: center; }
.mt-pips i.dot::before { content: ''; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid currentColor; box-shadow: inset 0 0 0 2px #fffef7, inset 0 0 0 6px currentColor; }
.mt-pips i.c0 { color: #1565c0; } .mt-pips i.c1 { color: #c62828; } .mt-pips i.c2 { color: #2e7d32; }
.mt-pips.p1 i.dot::before { width: 92%; box-shadow: inset 0 0 0 2px #fffef7, inset 0 0 0 4px #c62828, inset 0 0 0 7px #fffef7, inset 0 0 0 20px #1565c0; }
.mt-pips.bam i.bar::before { content: ''; width: 32%; height: 90%; border-radius: 3px; background: linear-gradient(90deg, #1b5e20, #43a047 50%, #1b5e20); box-shadow: inset 0 -30% 0 rgba(0,0,0,.15); }
.mt-pips.bam i.bar.red::before { background: linear-gradient(90deg, #8e0000, #e53935 50%, #8e0000); }
.mt-bird { font-size: 1.4em; }
.mt-wind { font-family: var(--serif); font-weight: 900; font-size: 1.35em; color: #111; }
.mt-dragon { font-family: var(--serif); font-weight: 900; font-size: 1.45em; } .mt-dragon.red { color: #c62828; } .mt-dragon.green { color: #2e7d32; }
.mt-white { width: 70%; height: 72%; border: 2.5px solid #1565c0; border-radius: 3px; }
.mt-flower { display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-size: .9em; } .mt-flower b { color: #ad1457; font-family: var(--serif); }
.mj-table { display: flex; flex-direction: column; gap: 6px; }
.mj-mid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; align-items: stretch; }
.mj-opp, .mj-me { background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.22)); border: 1.5px solid rgba(255,255,255,.08); border-radius: 14px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mj-opp.turn, .mj-me.turn { border-color: #ffd54f; animation: seatPulse 1.4s infinite; }
.mj-oh { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mj-oh b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mj-oh .sub { font-size: 11px; opacity: .85; }
.mj-dealer { background: #ffd54f; color: #5d1a00; border-radius: 6px; padding: 0 5px; font-size: 11px; }
.mj-row { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-end; }
.mj-row.center { justify-content: center; }
.mj-meld { display: inline-flex; gap: 1px; margin-right: 4px; padding: 2px; border-radius: 6px; background: rgba(255,213,79,.15); }
.mj-river { display: flex; flex-wrap: wrap; gap: 2px; align-content: flex-start; min-height: 30px; }
.mj-center { background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--felt, #136b40) 70%, white 18%), var(--felt, #136b40) 60%, color-mix(in srgb, var(--felt, #136b40) 60%, black)); border-radius: 16px; box-shadow: 0 0 0 4px #6b3f1d, inset 0 0 30px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; }
.mj-info { display: flex; gap: 8px; font-size: 12px; opacity: .9; }
.mj-last { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; }
.mj-turn { font-size: 13px; } .mj-turn b { color: #ffd54f; }
.mj-hand { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; padding-top: 16px; }
.mj-wait { text-align: center; font-size: 14px; display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mj-wait b { color: #69f0ae; }
.mj-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 6px 0; }
.mj-claim { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 280; width: min(520px, calc(100% - 20px)); background: linear-gradient(180deg, #4a0a0a, #2a0505); border: 2px solid #ffd54f; border-radius: 20px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: sheetUp .25s; display: flex; flex-direction: column; gap: 10px; }
.mj-claim-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pulse-btn { animation: slapHot .5s ease-in-out infinite alternate; }
.mj-result { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.35); border: 1.5px solid #ffd54f; }
.mj-tai { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mj-tai span { background: rgba(255,213,79,.18); border-radius: 8px; padding: 2px 8px; font-size: 13px; }
.mj-tai .total { background: #ffd54f; color: #5d1a00; font-weight: 900; }
@media (max-width: 520px) {
  .mt { width: 30px; height: 42px; font-size: 14px; padding: 2px; }
  .mt.drawn { margin-left: 8px; } .mt.gap { margin-left: 4px; }
  .mt.s { width: 20px; height: 28px; font-size: 10px; } .mt.xs { width: 16px; height: 22px; font-size: 8px; } .mt.l { width: 40px; height: 56px; font-size: 20px; }
  .mj-mid { grid-template-columns: 1fr 1fr 1fr; }
  .mj-opp .mj-oh .av { display: none; }
}

/* ===== 商店 v2 ===== */
.cat-tabs button.special { background: linear-gradient(90deg, rgba(255,111,0,.5), rgba(255,213,79,.35)); }
.cat-tabs button.special.on { background: #ffd54f; }
.shop-item { cursor: pointer; transition: transform .15s; }
.shop-item:hover { transform: translateY(-3px); }
.shop-item .big .av { pointer-events: none; }
.off-tag { position: absolute; top: 6px; right: 6px; background: #ff1744; color: #fff; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 6px; }
.shop-item s { opacity: .6; font-size: 11px; }
.lucky-box { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding: 22px; border-radius: 20px; background: radial-gradient(circle at 50% 20%, rgba(255,213,79,.35), rgba(0,0,0,.25)); border: 2px solid #ffd54f; line-height: 1.7; }
.lucky-env { font-size: 90px; animation: sway 2s ease-in-out infinite; filter: drop-shadow(0 8px 20px rgba(255,180,0,.6)); }
.lucky-env.big { font-size: 150px; }
.shake-env { animation: envShake .5s ease-in-out infinite; cursor: pointer; }
@keyframes envShake { 25% { transform: rotate(-12deg) scale(1.05); } 75% { transform: rotate(12deg) scale(1.05); } }
.lucky-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; width: 100%; max-height: 92vh; overflow: auto; padding: 10px; }
.lucky-stage.r-SSR { background: radial-gradient(circle, rgba(255,213,79,.45), transparent 70%); }
.lucky-stage.r-SR { background: radial-gradient(circle, rgba(171,71,188,.4), transparent 70%); }
.lucky-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; width: 100%; }
.lucky-grid.one { grid-template-columns: 180px; justify-content: center; }
.lucky-card { position: relative; background: #fffaf0; color: #3e1500; border-radius: 14px; padding: 22px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: cardFlip .5s both; }
.lucky-card .big { font-size: 38px; min-height: 52px; display: flex; align-items: center; }
.lucky-card small { font-size: 11px; color: #8d6e63; }
.lucky-card.r-R { box-shadow: 0 0 0 3px #1e88e5, 0 0 14px #42a5f5; }
.lucky-card.r-SR { box-shadow: 0 0 0 3px #8e24aa, 0 0 20px #ce93d8; }
.lucky-card.r-SSR { box-shadow: 0 0 0 3px #ffb300, 0 0 30px #ffd54f; background: linear-gradient(160deg, #fff8e1, #ffe082); }
@keyframes cardFlip { from { transform: rotateY(90deg) scale(.6); opacity: 0; } }
.bundle-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(255,213,79,.2), rgba(0,0,0,.3)); border: 1.5px solid rgba(255,213,79,.5); }
.bundle-items { gap: 8px; }
.bi { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 28px; min-width: 64px; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.08); }
.bi small { font-size: 11px; } .bi.have { opacity: .5; }
.col-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.25); }
.col-row b { min-width: 86px; }

/* 美術圖（有圖才會套用） */
img.art { display: inline-block; vertical-align: middle; }
.game-ic { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.topbar .game-ic { width: 26px; height: 26px; }
.hero-logo { position: relative; width: min(420px, 86vw); height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
html.has-bg-home body { background: url(../img/bg/home.jpg) center top / cover fixed, #7a0b0b; }



/* 商店排版 v3 */
.shop-me { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,213,79,.3); }
.shop-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 10px; }
.shop-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; background: rgba(255,255,255,.1); color: #fff; font-weight: 800; font-size: 13px; border: 1.5px solid transparent; }
.shop-nav button span { font-size: 24px; }
.shop-nav button.on { background: linear-gradient(160deg, #fff3c4, #ffc94a); color: #5d1a00; border-color: #fff; box-shadow: 0 3px 0 #b26a00; }
.shop-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; padding: 8px; border-radius: 14px; background: rgba(0,0,0,.22); }
.shop-cats button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; background: rgba(255,255,255,.06); color: #fff; }
.shop-cats button.on { background: rgba(255,213,79,.28); box-shadow: inset 0 0 0 1.5px #ffd54f; }
.sc-ic { font-size: 22px; } .shop-cats b { font-size: 12px; white-space: nowrap; } .shop-cats small { font-size: 10px; opacity: .7; }
@media (min-width: 640px) { .shop-cats { grid-template-columns: repeat(6, 1fr); } }
.av.frame-ichiban { border-color: #fff; box-shadow: 0 0 0 3px #e91e63, 0 0 0 6px #ffd54f, 0 0 20px #ff80ab; }
.av.frame-ichiban::after { content: '🎟️'; position: absolute; bottom: -8px; right: -8px; font-size: 40%; animation: sway 2s ease-in-out infinite; }

/* ===== 夜市遊戲區 ===== */
.menu-tile.night { background: linear-gradient(160deg, #ffe0b2, #ff8a65 70%, #e64a19); }
.menu-tile.lucky { background: linear-gradient(160deg, #f0f4c3, #aed581 70%, #558b2f); }
.night-bg { background: radial-gradient(ellipse at 50% 0%, rgba(255,160,0,.18), transparent 60%); }
.booth-list { display: flex; flex-direction: column; gap: 10px; }
.booth { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 18px; background: #fffaf0; color: #3e2723; border-top: 5px solid #26a69a; box-shadow: 0 4px 0 rgba(0,0,0,.2), 0 8px 16px rgba(0,0,0,.25); transition: transform .12s; }
.booth:active { transform: scale(.98); }
.booth-ic { flex-shrink: 0; width: 76px; height: 76px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 42px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.booth-ic .game-ic { width: 64px; height: 64px; }
.booth-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.booth-body b { font-size: 19px; font-family: var(--serif); }
.booth-body small { color: #6d4c41; line-height: 1.4; }
.booth-tag { background: #ec407a; color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 8px; }
.booth-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 700; color: #5d4037; flex-wrap: wrap; }
.booth-foot b { color: #c62828; } .booth-foot b.ok { color: #2e7d32; }
.mini-stage { align-items: center; }
.mg-canvas { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.45); touch-action: none; user-select: none; }
.mg-hud { text-align: center; font-weight: 800; font-size: 15px; padding: 6px 10px; background: rgba(0,0,0,.35); border-radius: 12px; width: 100%; max-width: 420px; }
.mg-count { font-size: 120px; font-weight: 900; color: #ffd54f; text-align: center; margin-top: 15vh; animation: popIn .4s; text-shadow: 0 6px 0 #6d0000; }
.mg-how { text-align: center; color: #ffe0b2; font-size: 14px; }
.stars { font-size: 40px; letter-spacing: 6px; } .stars span { filter: grayscale(1) opacity(.3); } .stars span.on { filter: none; animation: popIn .5s; }
/* 打地鼠 */
.wk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 380px; padding: 16px; border-radius: 18px; background: #66bb6a; box-shadow: inset 0 -8px 0 #43a047; }
.wk-hole { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #3e2723 55%, #5d4037 56%); position: relative; overflow: hidden; touch-action: manipulation; }
.wk-mole { position: absolute; left: 0; right: 0; bottom: -70%; font-size: 52px; transition: bottom .12s; }
.wk-hole.up .wk-mole { bottom: 8%; } .wk-hole.hit { background: radial-gradient(ellipse at 50% 70%, #ffeb3b 30%, #5d4037 56%); }
/* 三消 */
.m3-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; max-width: 420px; padding: 6px; border-radius: 14px; background: #4a148c; }
.m3-cell { aspect-ratio: 1; font-size: clamp(22px, 7vw, 34px); background: #7b1fa2; border-radius: 8px; padding: 0; transition: transform .12s; }
.m3-cell.sel { background: #ffd54f; transform: scale(1.08); } .m3-cell.pop { animation: m3pop .26s forwards; }
@keyframes m3pop { to { transform: scale(1.6); opacity: 0; } }
/* 翻牌 */
.mm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 400px; }
.mm-card { aspect-ratio: 3/4; border-radius: 12px; position: relative; padding: 0; background: none; perspective: 600px; }
.mm-card span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 36px; backface-visibility: hidden; transition: transform .3s; }
.mm-f { background: #fffaf0; transform: rotateY(180deg); } .mm-b { background: linear-gradient(160deg, #e53935, #8e0000); border: 3px solid #ffd54f; }
.mm-card.open .mm-f { transform: rotateY(0); } .mm-card.open .mm-b { transform: rotateY(-180deg); }
.mm-card.done .mm-f { box-shadow: 0 0 0 3px #69f0ae; }
/* 眼力 */
.sd-wrap { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px; }
.sd-grid { display: grid; gap: 2px; padding: 6px; border-radius: 12px; background: #fff8e1; }
.sd-grid span, .sd-grid button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(18px, 6vw, 28px); background: none; padding: 0; border-radius: 6px; }
.sd-grid.bot { background: #fff3e0; box-shadow: 0 0 0 3px #ffb300; }
.sd-grid button.ok { box-shadow: inset 0 0 0 3px #43a047; background: #c8e6c9; } .sd-grid button.no { background: #ffcdd2; }
/* ===== 幸運廣場 ===== */
.lt-pool { display: flex; flex-direction: column; align-items: center; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, #ffd54f, #ff8f00); color: #4e1a00; box-shadow: 0 6px 0 #b26a00; margin-bottom: 10px; width: 100%; }
.lt-pool b { font-size: clamp(30px, 9vw, 44px); font-family: var(--serif); }
.lt-nums { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.lt-nums button { aspect-ratio: 1; border-radius: 50%; background: #fff8e1; color: #4e1a00; font-weight: 800; padding: 0; font-size: 14px; }
.lt-nums button.on { background: #e53935; color: #fff; box-shadow: 0 0 0 2px #ffd54f; }
.lt-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lt-row i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: #fff8e1; color: #4e1a00; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.lt-row i.hit { background: #e53935; color: #fff; }
.mini-stage .panel { width: 100%; max-width: 560px; }
.sc-shop { display: grid; gap: 10px; width: 100%; max-width: 420px; }
.sc-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, black)); box-shadow: 0 5px 0 rgba(0,0,0,.3); text-align: left; }
.sc-card b { font-size: 22px; font-family: var(--serif); } .sc-card em { font-style: normal; font-weight: 800; }
.sc-ticket { width: 100%; max-width: 360px; padding: 14px; border-radius: 18px; background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 55%, black)); box-shadow: 0 8px 20px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; }
.sc-title { text-align: center; font-size: 22px; font-weight: 900; color: #ffd54f; font-family: var(--serif); }
.sc-area { position: relative; border-radius: 12px; overflow: hidden; background: #fff8e1; }
.sc-cells { display: grid; grid-template-columns: repeat(3, 1fr); }
.sc-cells span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 44px; border: 1px solid #f0e0c0; }
.sc-cells span.win { background: #fff59d; animation: seatPulse 1s infinite; }
.sc-cover { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sc-prize { text-align: center; font-size: 22px; font-weight: 900; color: #fff; opacity: 0; } .sc-prize.show { opacity: 1; animation: popIn .4s; }
.ib-head { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 520px; }
.ib-tiers { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 520px; }
.ib-tier { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.08); border-left: 5px solid var(--c); }
.ib-tier.out { opacity: .35; } .ib-tier.last { background: rgba(255,213,79,.2); }
.ib-k { width: 34px; height: 34px; border-radius: 8px; background: var(--c); color: #fff; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.ib-k.big { width: 64px; height: 64px; font-size: 36px; }
.ib-reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; width: 100%; }
.ib-slip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; background: #fffaf0; color: #3e2723; box-shadow: 0 0 0 3px var(--c); animation: cardFlip .5s both; }
.cl-machine { width: 100%; max-width: 360px; padding: 10px; border-radius: 22px; background: linear-gradient(160deg, #ec407a, #ad1457); box-shadow: 0 8px 0 #6a0f37; }
.cl-cv { width: 100%; display: block; border-radius: 14px; }
.cl-btn { touch-action: none; user-select: none; }
.cl-shelf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cl-shelf span { display: flex; flex-direction: column; align-items: center; font-size: 30px; } .cl-shelf span.none { filter: grayscale(1) opacity(.3); } .cl-shelf small { font-size: 11px; }
.pk-head { display: flex; justify-content: space-between; width: 100%; max-width: 440px; }
.pk-left { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; } .pk-left span { background: rgba(255,255,255,.1); padding: 2px 8px; border-radius: 8px; font-size: 13px; } .pk-left span.out { opacity: .3; text-decoration: line-through; }
.pk-board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; width: 100%; max-width: 440px; padding: 10px; border-radius: 16px; background: #ffd54f; box-shadow: 0 6px 0 #b26a00; }
.pk-cell { aspect-ratio: 1; border-radius: 8px; background: #fff8e1; font-size: 20px; padding: 0; color: #4e1a00; font-weight: 900; }
.pk-cell.open { background: #8d6e63; color: #fff; font-size: 14px; } .pk-cell.big { background: #e53935; animation: seatPulse 1s infinite; }

/* 賽馬 */
.hr-track { position: relative; border-radius: 16px; padding: 8px 8px 8px 8px; background: repeating-linear-gradient(0deg, #6d9f42 0 34px, #7cb24c 34px 68px); box-shadow: 0 0 0 5px #fff, 0 8px 18px rgba(0,0,0,.4); }
.hr-finish { position: absolute; right: 10px; top: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(0deg, #000 0 8px, #fff 8px 16px); font-size: 0; }
.hr-lane { position: relative; height: 34px; display: flex; align-items: center; }
.hr-no { width: 22px; height: 22px; border-radius: 50%; font-weight: 900; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.hr-horse { position: absolute; left: 0; margin-left: 26px; font-size: 28px; transition: left .2s linear; transform: scaleX(-1); }
.hr-place { position: absolute; top: -10px; left: -6px; font-size: 16px; transform: scaleX(-1); }
.hr-odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hr-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: #fffaf0; color: #3e2723; box-shadow: 0 3px 0 #b26a00; }
.hr-pick b { font-size: 14px; } .hr-o { font-weight: 900; color: #c62828; } .hr-pick small { font-size: 10px; color: #8d6e63; }
/* 賓果 */
.bg-caller { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; }
.bg-ball { width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffd54f 60%, #ff8f00); color: #4e1a00; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; box-shadow: 0 6px 14px rgba(0,0,0,.45); animation: popIn .4s; line-height: 1; }
.bg-ball small { font-size: 16px; }
.bg-recent { display: flex; gap: 4px; } .bg-recent i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.bg-card { width: 100%; max-width: 380px; margin: 0 auto; padding: 8px; border-radius: 16px; background: #fffaf0; box-shadow: 0 6px 0 #b26a00; }
.bg-head, .bg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.bg-head b { text-align: center; color: #c62828; font-size: 22px; font-family: var(--serif); }
.bg-cell { aspect-ratio: 1; border-radius: 10px; background: #fff3e0; color: #4e1a00; font-weight: 900; font-size: 20px; padding: 0; }
.bg-cell.can { background: #fff59d; box-shadow: 0 0 0 3px #ffb300; animation: seatPulse 1s infinite; }
.bg-cell.on { background: radial-gradient(circle, #e53935 55%, #fff3e0 57%); color: #fff; }
.bg-btn { font-size: 26px; }

/* 美術圖示：圖片取代 emoji 時的尺寸 */
img.ic-img, img.em-img { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.25em; }
.menu-tile .ic img.ic-img, .sc-ic img.ic-img, .m-ic img.ic-img { width: 1.6em; height: 1.6em; }
.av img.av-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av .hat img.hat-img { width: 1.2em; height: 1.2em; object-fit: contain; }
.die.img img { width: 100%; height: 100%; object-fit: contain; }
.mj.img img, .tile.img img, span.img > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.has-chip-art .pchip { background: url(../img/chips/chip.png) center/contain no-repeat !important; border: none !important; color: #fff; text-shadow: 0 1px 2px #000; }

/* 每款牌背、桌布、頭像框的圖片 */
.card.back.img { background-size: cover; background-position: center; background-repeat: no-repeat; border: none; }
.play.felt-img .felt, .play.felt-img .mj-center { background: var(--felt-img) center / cover; }
.av .av-frame { position: absolute; inset: -24%; width: 148%; height: 148%; max-width: none; pointer-events: none; z-index: 3; }
.av.fimg { border-color: transparent !important; box-shadow: none !important; animation: none !important; }
.av.fimg::before, .av.fimg::after { display: none !important; }
.av .hat { z-index: 4; }
.shop-item img.shop-art, .center img.shop-art { width: 64px; height: 64px; object-fit: contain; }
.lucky-env img { width: 120px; height: 120px; object-fit: contain; }

/* 商店上方區塊：背景加深，文字看得清楚 */
.shop-me { background: rgba(48, 10, 6, .88); border-color: rgba(255,213,79,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.shop-nav { padding: 6px; border-radius: 16px; background: rgba(48, 10, 6, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.shop-nav button { background: rgba(255,255,255,.08); }
.shop-nav button img.ic-img { width: 34px; height: 34px; }
.shop-cats { background: rgba(48, 10, 6, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.35); border: 1px solid rgba(255,213,79,.35); }
.shop-cats button { background: rgba(255,255,255,.07); }
.shop-cats small { opacity: .85; }

/* ===== 夜市小遊戲：攤位外框、開場卡、資訊列、特效、結算 ===== */
.mg-awning { position: relative; height: 34px; margin: 0 -12px 4px; background: repeating-linear-gradient(90deg, #d32f2f 0 34px, #fff4e0 34px 68px); box-shadow: 0 6px 10px rgba(0,0,0,.35); border-bottom: 3px solid #8e0000; }
.mg-awning::after { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; background: radial-gradient(circle at 17px 0, #d32f2f 16px, transparent 17px) 0 0 / 68px 14px repeat-x, radial-gradient(circle at 51px 0, #fff4e0 16px, transparent 17px) 0 0 / 68px 14px repeat-x; }
.mg-awning i { position: absolute; left: 0; right: 0; top: 40px; height: 22px; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 60%, #ffeb3b 0 4px, rgba(255,235,59,.45) 5px, transparent 10px) 0 0 / 44px 22px repeat-x; filter: drop-shadow(0 0 6px #ffca28); animation: bulbs 1.2s steps(2) infinite; }
@keyframes bulbs { 50% { background-position: 22px 0; } }
.booth-stage { gap: 10px; padding-top: 22px; }
.mg-canvas { border-radius: 18px; border: 5px solid #6d3b17; box-shadow: 0 0 0 3px #ffca28, 0 10px 28px rgba(0,0,0,.55); background: #222; }

/* 開場卡 */
.mg-intro { width: 100%; max-width: 400px; margin: 4px auto; padding: 18px 18px 20px; border-radius: 22px; text-align: center; color: #4e1b00;
  background: linear-gradient(180deg, #fffaf0, #ffe9c2); border: 4px solid #ffca28; box-shadow: 0 0 0 4px #b71c1c, 0 14px 30px rgba(0,0,0,.5); position: relative; animation: popIn .35s; }
.mg-intro-art { width: 150px; height: 150px; margin: -70px auto 0; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.mg-intro-art img, .mg-res-art img { width: 100%; height: 100%; object-fit: contain; }
.mg-emo { font-size: 90px; line-height: 150px; }
.mg-intro h2 { margin: 2px 0 4px; font-size: 26px; color: #b71c1c; }
.mg-intro-desc { margin: 8px 0; font-size: 15px; font-weight: 700; }
.mg-steps { text-align: left; margin: 6px auto 10px; padding: 8px 12px 8px 30px; background: rgba(183,28,28,.07); border-radius: 12px; font-size: 14px; line-height: 1.7; }
.mg-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.mg-goals div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: #fff; box-shadow: 0 2px 0 #f0c070; }
.mg-goals span { color: #ffb300; font-size: 15px; letter-spacing: -2px; text-shadow: 0 1px 0 #b26a00; }
.mg-goals b { font-size: 15px; } .mg-goals small { font-size: 12px; color: #8d6e63; }
.mg-intro-best { font-weight: 800; color: #8d6e63; margin-bottom: 8px; }
.mg-go { width: 80%; font-size: 22px !important; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* 倒數 */
.mg-count { display: flex; align-items: center; justify-content: center; min-height: 50vh; }
.mg-count b { display: flex; align-items: center; justify-content: center; width: 170px; height: 170px; border-radius: 50%; font-size: 100px; font-weight: 900; color: #ffd54f;
  background: radial-gradient(circle, #c62828 55%, #7f0000); border: 6px solid #ffd54f; box-shadow: 0 0 0 6px rgba(255,213,79,.3), 0 0 40px #ff8f00; text-shadow: 0 5px 0 #6d0000; animation: countIn .6s cubic-bezier(.2,1.6,.4,1); }
.mg-count b.go { font-size: 44px; width: 220px; border-radius: 40px; height: 110px; }
@keyframes countIn { from { transform: scale(2.2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* 資訊列 */
.mg-bar { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; }
.mg-chip { display: flex; align-items: center; gap: 5px; padding: 5px 12px 5px 6px; border-radius: 999px; font-weight: 900; font-size: 18px; color: #fff;
  background: linear-gradient(180deg, #8e1b1b, #4a0a0a); border: 2px solid #ffca28; box-shadow: 0 3px 0 #2a0505; white-space: nowrap; }
.mg-chip i { font-style: normal; font-size: 20px; display: flex; } .mg-chip i img { width: 24px; height: 24px; }
.mg-chip b.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.35); color: #ffeb3b; } }
.mg-left { font-size: 15px; }
.mg-mid { flex: 1; display: flex; align-items: center; gap: 6px; justify-content: center; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; min-width: 0; }
.mg-tbar { flex: 1; height: 14px; border-radius: 99px; background: rgba(0,0,0,.45); border: 2px solid #ffca28; overflow: hidden; }
.mg-tbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffeb3b, #ff9800); border-radius: 99px; transition: width .25s linear; }
.mg-tbar.low i { background: linear-gradient(90deg, #ff5252, #d50000); animation: blink .5s infinite; }
.mg-tnum { font-size: 18px; font-weight: 900; min-width: 26px; } .mg-tnum.low { color: #ff5252; }
@keyframes blink { 50% { opacity: .55; } }
.mg-msg { position: absolute; left: 0; right: 0; top: 38%; z-index: 25; text-align: center; font-weight: 900; font-size: 20px; color: #ffeb3b; text-shadow: 0 2px 0 #6d0000, 0 0 8px #000; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.mg-msg.show { opacity: 1; transform: translateY(-4px); } .mg-msg.bad { color: #ff8a80; } .mg-msg.great { color: #69f0ae; font-size: 24px; }

/* DOM 特效 */
.booth-stage { position: relative; }
.mg-float { position: absolute; z-index: 20; transform: translate(-50%, -50%); font-weight: 900; font-size: 26px; color: #ffeb3b; text-shadow: 0 3px 0 #6d0000, 0 0 6px #000; pointer-events: none; animation: floatUp .9s forwards; }
.mg-float.bad { color: #ff5252; } .mg-float.big { font-size: 34px; color: #69f0ae; }
@keyframes floatUp { 0% { transform: translate(-50%, -50%) scale(.5); } 20% { transform: translate(-50%, -70%) scale(1.25); } 100% { transform: translate(-50%, -160%) scale(1); opacity: 0; } }
.mg-spark { position: absolute; z-index: 19; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; animation: spark .6s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* 結算 */
.mg-result { text-align: center; position: relative; padding-top: 50px; }
.mg-res-art { width: 130px; height: 130px; position: absolute; left: 50%; top: -80px; transform: translateX(-50%); filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.mg-res-head { font-size: 28px; font-weight: 900; color: #b71c1c; }
.mg-res-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; }
.mg-res-stars span { font-size: 52px; color: #d7ccc8; text-shadow: 0 3px 0 #a1887f; }
.mg-res-stars span:nth-child(2) { font-size: 64px; margin-top: -12px; }
.mg-res-stars span.on { color: #ffc107; text-shadow: 0 3px 0 #e65100, 0 0 18px #ffeb3b; animation: starIn .5s cubic-bezier(.2,1.8,.4,1) backwards; }
@keyframes starIn { from { transform: scale(3) rotate(-90deg); opacity: 0; } }
.mg-res-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap; }
.mg-res-score b { font-size: 46px; color: #4e1b00; } .mg-res-score small { color: #8d6e63; font-weight: 700; }
.mg-best { background: #e91e63; color: #fff; border-radius: 99px; padding: 2px 10px; font-weight: 900; font-size: 13px; animation: pulse 1s infinite; }
.mg-res-coin { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 10px; padding: 6px 16px; border-radius: 99px; background: linear-gradient(180deg, #fff3c4, #ffc94a); font-size: 20px; font-weight: 900; color: #6d3b00; box-shadow: 0 3px 0 #b26a00; }
.mg-res-bar { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.mg-res-bar span { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 10px; background: #efebe9; color: #bcaaa4; font-size: 12px; }
.mg-res-bar span.ok { background: #fff8e1; color: #ff8f00; box-shadow: inset 0 0 0 2px #ffca28; }
.mg-res-bar b { color: #5d4037; font-size: 13px; }

/* 打地鼠 */
.wk-field { position: relative; width: 100%; max-width: 400px; padding: 18px 14px 22px; border-radius: 22px;
  background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.25) 0 2px, transparent 3px) 0 0 / 34px 34px, radial-gradient(circle at 70% 60%, #fff59d 0 3px, transparent 4px) 0 0 / 90px 70px, linear-gradient(180deg, #8bc34a, #558b2f);
  border: 5px solid #6d3b17; box-shadow: 0 0 0 3px #ffca28, 0 10px 28px rgba(0,0,0,.5); }
.wk-field.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(-8px, 3px); } 40% { transform: translate(7px, -3px); } 60% { transform: translate(-5px, 2px); } 80% { transform: translate(3px, 0); } }
.wk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; background: none; box-shadow: none; padding: 0; max-width: none; }
.wk-hole { position: relative; aspect-ratio: 1; background: none; border-radius: 0; overflow: visible; padding: 0; touch-action: manipulation; }
.wk-back { position: absolute; left: 6%; right: 6%; bottom: 8%; height: 34%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #1b0f08 45%, #3e2414 70%); }
.wk-hole .wk-mole { position: absolute; left: 12%; right: 12%; bottom: 14%; height: 72%; display: flex; align-items: flex-end; justify-content: center; font-size: 54px; transform: translateY(70%); clip-path: inset(-40% -20% 30% -20%); transition: transform .14s cubic-bezier(.3,1.6,.5,1); }
.wk-hole .wk-mole img { width: 100%; height: 100%; object-fit: contain; }
.wk-hole.up .wk-mole { bottom: 14%; transform: translateY(0); clip-path: inset(-40% -20% 0 -20%); }
.wk-front { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; border-radius: 50%; background: radial-gradient(ellipse at 50% 20%, #a1662f, #6d3b17 70%); box-shadow: inset 0 3px 0 #c58b4f; }
.wk-hole.up[data-k="gold"] .wk-mole { filter: drop-shadow(0 0 10px #ffeb3b); }
.wk-hole.hit .wk-mole { transform: translateY(20%) scale(1.1, .8); }
.wk-hammer { position: absolute; right: -6%; top: -18%; font-size: 40px; opacity: 0; pointer-events: none; transform-origin: 80% 80%; }
.wk-hole.swing .wk-hammer { animation: hammer .28s; }
@keyframes hammer { 0% { opacity: 1; transform: rotate(40deg); } 50% { opacity: 1; transform: rotate(-35deg); } 100% { opacity: 0; transform: rotate(-35deg); } }

/* 三消 */
.m3-frame { position: relative; width: 100%; max-width: 420px; padding: 8px; border-radius: 20px; background: linear-gradient(180deg, #8d5a2b, #4e2a12); border: 3px solid #ffca28; box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.m3-grid { background: radial-gradient(ellipse at 50% 0, #6a1b9a, #2a0a3a); padding: 5px; gap: 4px; border-radius: 14px; max-width: none; }
.m3-cell { position: relative; background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.04)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.25); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.m3-cell img.em-img { width: 82%; height: 82%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.m3-cell.sel { background: linear-gradient(160deg, #fff59d, #ffb300); transform: scale(1.1); z-index: 2; box-shadow: 0 0 14px #ffeb3b; animation: wobble .6s infinite; }
@keyframes wobble { 50% { transform: scale(1.1) rotate(5deg); } }
.m3-cell.pop { animation: m3pop .28s forwards; }
@keyframes m3pop { 40% { transform: scale(1.35); filter: brightness(2); } 100% { transform: scale(0); opacity: 0; } }
.m3-cell.fall { animation: m3fall .26s cubic-bezier(.4,1.4,.6,1) backwards; }
@keyframes m3fall { from { transform: translateY(calc(var(--d) * -110%)); } }
.m3-cell.nope { animation: shake .3s; }
.mg-chain { color: #ffeb3b; font-size: 17px; animation: bump .4s; }

/* 翻牌 */
.mm-table { position: relative; width: 100%; max-width: 400px; padding: 12px; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #1b7a4b, #0b3d26); border: 5px solid #6d3b17; box-shadow: 0 0 0 3px #ffca28, 0 10px 28px rgba(0,0,0,.5), inset 0 0 30px rgba(0,0,0,.5); }
.mm-grid { gap: 9px; max-width: none; }
.mm-card { animation: dealIn .4s backwards; }
@keyframes dealIn { from { transform: translateY(-40px) scale(.6) rotate(-10deg); opacity: 0; } }
.mm-card span { transition: transform .35s cubic-bezier(.4,1.4,.6,1); box-shadow: 0 3px 6px rgba(0,0,0,.4); }
.mm-f { background: linear-gradient(160deg, #fffdf5, #ffe9c2); border: 3px solid #ffca28; }
.mm-f img.em-img { width: 72%; height: 72%; }
.mm-b { background: repeating-linear-gradient(45deg, #c62828 0 6px, #b71c1c 6px 12px) !important; border: 3px solid #ffd54f; }
.mm-b i { display: flex; width: 70%; height: 70%; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.18); font-style: normal; }
.mm-b i img { width: 80%; height: 80%; }
.mm-card.done .mm-f { box-shadow: 0 0 0 3px #69f0ae, 0 0 16px #69f0ae; animation: matched .5s; }
@keyframes matched { 50% { transform: rotateY(0) scale(1.15); } }
.mm-card.nope .mm-f { animation: shake .3s; box-shadow: 0 0 0 3px #ff5252; }

/* 眼力 */
.sd-wrap { position: relative; gap: 12px; }
.sd-wrap.next .sd-photo { animation: popIn .35s; }
.sd-photo { position: relative; padding: 10px 10px 10px; background: #fffdf5; border-radius: 6px; box-shadow: 0 8px 18px rgba(0,0,0,.45); transform: rotate(-.8deg); }
.sd-photo.find { transform: rotate(.8deg); box-shadow: 0 0 0 3px #ffb300, 0 8px 18px rgba(0,0,0,.45); }
.sd-tag { position: absolute; top: -12px; left: 12px; z-index: 2; padding: 2px 10px; border-radius: 99px; background: #b71c1c; color: #fff; font-size: 13px; font-weight: 900; box-shadow: 0 2px 0 #6d0000; }
.find .sd-tag { background: #ff8f00; box-shadow: 0 2px 0 #b26a00; }
.sd-grid { border-radius: 4px; padding: 6px; gap: 2px; }
.sd-grid[data-theme="0"] { background: linear-gradient(160deg, #ffebee, #ffcdd2); }
.sd-grid[data-theme="1"] { background: linear-gradient(160deg, #f1f8e9, #c5e1a5); }
.sd-grid[data-theme="2"] { background: linear-gradient(160deg, #fff8e1, #ffe082); }
.sd-grid[data-theme="3"] { background: linear-gradient(160deg, #e3f2fd, #90caf9); }
.sd-grid.bot { box-shadow: none; }
.sd-grid span img.em-img, .sd-grid button img.em-img { width: 86%; height: 86%; }
.sd-grid button.ok { background: none; box-shadow: none; position: relative; }
.sd-grid button.ok::after { content: ''; position: absolute; inset: -3px; border: 3px solid #e53935; border-radius: 50%; animation: circleIn .3s; }
@keyframes circleIn { from { transform: scale(2); opacity: 0; } }
.sd-grid button.no { background: rgba(255,82,82,.35); animation: shake .3s; }

/* 打彈珠剩餘球 */
.mg-balls { color: #eceff1; letter-spacing: 1px; font-size: 13px; } .mg-balls s { text-decoration: none; opacity: .25; }
.mg-left s { text-decoration: none; opacity: .3; }
.booth-stage .sd-wrap { width: min(100%, calc((100dvh - 250px) / 2 * 0.92)); min-width: 250px; }

/* ===== 幸運廣場 ===== */
.lucky-stage .panel, .lt-panel { width: 100%; max-width: 520px; padding: 12px 14px; border-radius: 16px; background: rgba(40, 8, 6, .9); border: 1px solid rgba(255,213,79,.4); box-shadow: 0 6px 16px rgba(0,0,0,.4); color: #fff; gap: 8px; }
.lt-panel small, .lt-panel .muted { color: #ffe0b2; }
/* 立體號碼球 */
.lt-ball { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-weight: 900; font-size: 13px; color: #3e2723; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, #f5f5f5 19% 36%, var(--bc, #e0e0e0) 37%); box-shadow: inset -2px -3px 5px rgba(0,0,0,.3), 0 2px 3px rgba(0,0,0,.35); text-shadow: 0 1px 0 #fff; }
.lt-ball.b1 { --bc: #ef5350; } .lt-ball.b2 { --bc: #42a5f5; } .lt-ball.b3 { --bc: #66bb6a; }
.lt-ball.off { --bc: #9e9e9e; opacity: .55; }
.lt-ball.hit { box-shadow: 0 0 0 2px #ffeb3b, 0 0 10px #ffeb3b, inset -2px -3px 5px rgba(0,0,0,.3); }
/* 看板 */
.lt-board { position: relative; width: 100%; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 20px;
  background: linear-gradient(160deg, #2a0a0a, #120303); border: 3px solid #ffca28; box-shadow: 0 0 0 4px #b71c1c, 0 10px 24px rgba(0,0,0,.5), inset 0 0 30px rgba(255,140,0,.2); }
.lt-board::before { content: ''; position: absolute; inset: 4px; border-radius: 16px; pointer-events: none;
  background: radial-gradient(circle, #ffeb3b 0 2.5px, transparent 3.5px) 0 0 / 16px 16px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 4px; animation: bulbs 1s steps(2) infinite; opacity: .8; }
.lt-dome { position: relative; flex: 0 0 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), rgba(255,255,255,.08) 45%, rgba(255,255,255,.02)); border: 3px solid rgba(255,255,255,.6); overflow: hidden; box-shadow: inset 0 -10px 20px rgba(0,0,0,.4); }
.lt-dome .lt-ball { position: absolute; width: 24px; height: 24px; font-size: 10px; left: calc(10% + var(--i) * 10%); top: 55%; animation: tumble calc(1s + var(--i) * .13s) ease-in-out infinite alternate; }
@keyframes tumble { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(calc(var(--i) * -6px + 18px), -40px) rotate(180deg); } 100% { transform: translate(calc(var(--i) * 4px - 12px), -8px) rotate(360deg); } }
.lt-pool { flex: 1; background: none; padding: 0; box-shadow: none; color: #fff; text-align: center; }
.lt-pool small { color: #ffcc80; font-weight: 700; }
.lt-pool b { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: clamp(26px, 8vw, 40px); color: #ffd54f; text-shadow: 0 0 12px #ff8f00, 0 2px 0 #8a4b00; font-variant-numeric: tabular-nums; }
.lt-pool b img { width: 30px; height: 30px; }
.lt-clock { font-size: 13px; color: #ffe0b2; font-weight: 700; }
.lt-clock em { display: inline-block; font-style: normal; min-width: 30px; padding: 2px 4px; margin: 0 2px; border-radius: 6px; background: #000; color: #ff5252; font-family: ui-monospace, monospace; font-size: 18px; box-shadow: inset 0 0 6px rgba(255,82,82,.4); }
.lt-last .lt-row .lt-ball { width: 36px; height: 36px; font-size: 15px; animation: popIn .4s backwards; }
.lt-tray { display: flex; gap: 8px; justify-content: center; padding: 8px; border-radius: 99px; background: rgba(0,0,0,.35); }
.lt-tray .lt-ball { width: 38px; height: 38px; font-size: 16px; animation: popIn .3s; }
.lt-slot { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; border: 2px dashed rgba(255,255,255,.35); color: rgba(255,255,255,.4); font-style: normal; font-weight: 900; }
.lt-nums { gap: 6px; }
.lt-nums .lt-ball { width: 100%; height: auto; aspect-ratio: 1; font-size: 14px; filter: saturate(.35) brightness(1.05); transition: transform .12s; }
.lt-nums .lt-ball.on { filter: none; transform: scale(1.12); box-shadow: 0 0 0 2px #ffeb3b, 0 0 12px #ffeb3b, inset -2px -3px 5px rgba(0,0,0,.3); }
.lt-prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lt-prizes span { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 12px; color: #ffe0b2; }
.lt-prizes b { color: #fff; } .lt-prizes .jp { background: linear-gradient(180deg, #ffca28, #ff8f00); color: #4e1b00; } .lt-prizes .jp b { color: #b71c1c; }
.lt-ticket { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 6px; background: #fffaf0; color: #4e1b00; position: relative; border-left: 6px dashed #e53935; }
.lt-ticket > span { font-size: 11px; color: #8d6e63; margin-right: 4px; }
.lt-ticket.won { background: #fff8e1; box-shadow: 0 0 0 2px #ffca28; }
.lt-ticket .muted { color: #8d6e63 !important; }
.lt-row.sm .lt-ball { width: 24px; height: 24px; font-size: 10px; }

/* 刮刮樂 */
.sc-shop { gap: 12px; }
.sc-card { position: relative; flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; overflow: hidden; border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 80%, white), var(--c) 50%, color-mix(in srgb, var(--c) 60%, black)); border: 3px solid #ffd54f; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 50%, black), 0 10px 20px rgba(0,0,0,.4);
  -webkit-mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; }
.sc-card::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); animation: sheen 3s infinite; }
@keyframes sheen { 60%, 100% { left: 130%; } }
.sc-card-art { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 46px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.sc-card-art img { width: 100%; height: 100%; }
.sc-card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.sc-card-body small { font-size: 12px; opacity: .85; }
.sc-jp { font-size: 13px; } .sc-jp strong { font-size: 22px; color: #ffeb3b; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.sc-card em { padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.35); display: flex; align-items: center; gap: 4px; }
.sc-tip { text-align: center; color: #ffe0b2; font-weight: 700; }
.sc-ticket { position: relative; border-radius: 10px; border: 4px solid #ffd54f; box-shadow: 0 10px 24px rgba(0,0,0,.5);
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.25), transparent 40%), linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 55%, black)); }
.sc-title { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.sc-title span { width: 30px; height: 30px; display: inline-flex; } .sc-title img { width: 100%; height: 100%; }
.sc-rule { text-align: center; color: #fff; font-size: 12px; font-weight: 700; margin: 2px 0 8px; opacity: .9; }
.sc-area { border: 3px solid #ffd54f; box-shadow: inset 0 2px 8px rgba(0,0,0,.25); }
.sc-cells span { background: linear-gradient(160deg, #fffdf5, #ffecc7); }
.sc-cells span img { width: 72%; height: 72%; }
.sc-cells span.win { background: radial-gradient(circle, #fff59d, #ffca28); animation: winGlow .8s infinite alternate; }
@keyframes winGlow { to { box-shadow: inset 0 0 0 3px #e53935, inset 0 0 20px #fff; } }
.sc-dust { position: absolute; width: 4px; height: 4px; border-radius: 1px; background: #b0bec5; pointer-events: none; animation: dust .6s forwards; }
@keyframes dust { to { transform: translate(var(--dx), 40px) rotate(180deg); opacity: 0; } }
.sc-stamp { position: absolute; left: 50%; top: 50%; padding: 6px 18px; border: 4px double #9e9e9e; border-radius: 10px; color: #9e9e9e; font-size: 26px; font-weight: 900; transform: translate(-50%, -50%) rotate(-14deg) scale(3); opacity: 0; pointer-events: none; background: rgba(255,255,255,.75); }
.sc-stamp.win { color: #d50000; border-color: #d50000; font-size: 40px; }
.sc-stamp.show { opacity: 1; transform: translate(-50%, -50%) rotate(-14deg) scale(1); transition: transform .3s cubic-bezier(.2,1.6,.4,1), opacity .2s; }
.sc-prize { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.sc-no { text-align: right; font-size: 10px; color: rgba(255,255,255,.6); font-family: ui-monospace, monospace; }

/* 一番賞 */
.ib-box { position: relative; width: 100%; max-width: 520px; padding: 14px 16px 12px; border-radius: 16px; text-align: center; color: #fff;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px), linear-gradient(160deg, #d81b60, #6a0036); border: 3px solid #ffd54f; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.ib-sign { font-size: 30px; font-weight: 900; color: #ffeb3b; text-shadow: 0 3px 0 #6a0036, 0 0 14px rgba(255,235,59,.6); letter-spacing: 4px; }
.ib-sign small { display: block; font-size: 12px; letter-spacing: 1px; color: #ffe0f0; text-shadow: none; }
.ib-meter { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-weight: 700; }
.ib-meter b { font-size: 36px; color: #fff; }
.ib-bar { height: 10px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; margin-top: 4px; }
.ib-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffeb3b, #ff9800); }
.ib-tiers { gap: 8px; }
.ib-tier { position: relative; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #fffaf0; color: #3e2723; border-left: none; box-shadow: 0 3px 0 rgba(0,0,0,.25); overflow: hidden; }
.ib-tier::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.ib-tier.rare { background: linear-gradient(90deg, #fff8e1, #fffaf0); box-shadow: 0 3px 0 rgba(0,0,0,.25), inset 0 0 0 2px var(--c); }
.ib-tier small { color: #8d6e63; font-size: 11px; }
.ib-k { width: 42px; height: 42px; border-radius: 10px; flex-direction: column; line-height: 1; font-size: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, white), var(--c)); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 50%, black); }
.ib-k small { font-size: 9px; font-weight: 700; }
.ib-show { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 28px; } .ib-show img { width: 100%; height: 100%; }
.ib-cnt { font-size: 12px; color: #8d6e63; } .ib-cnt b { font-size: 18px; color: #3e2723; }
.ib-sold { position: absolute; right: 50px; top: 50%; transform: translateY(-50%) rotate(-12deg); color: #d50000; border: 2px solid #d50000; border-radius: 6px; padding: 0 6px; font-weight: 900; font-size: 14px; }
.ib-tier.out { opacity: .55; }
.ib-tier.last { background: linear-gradient(90deg, #fff3c4, #ffe082); }
.ib-log { font-size: 13px; color: #ffe0b2; padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.12); }
.ib-reveal-t { color: #fff; font-weight: 900; font-size: 18px; text-align: center; }
.ib-slips { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; width: 100%; }
.ib-paper { position: relative; height: 150px; padding: 0; border-radius: 10px; background: none; perspective: 600px; animation: popIn .35s backwards; }
.ib-fold, .ib-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; backface-visibility: hidden; transition: transform .45s cubic-bezier(.4,1.4,.6,1); }
.ib-fold { background: repeating-linear-gradient(0deg, #fffdf5 0 14px, #f5ecd8 14px 15px); border: 2px solid #d7ccc8; box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.ib-fold i { font-style: normal; font-weight: 900; color: #c2185b; font-size: 20px; writing-mode: vertical-rl; letter-spacing: 4px; }
.ib-fold small { color: #8d6e63; font-size: 11px; }
.ib-in { transform: rotateY(180deg); background: #fffaf0; border: 3px solid var(--c); color: #3e2723; padding: 6px; text-align: center; }
.ib-in small { font-size: 11px; }
.ib-paper.open .ib-fold { transform: rotateY(-180deg); } .ib-paper.open .ib-in { transform: rotateY(0); }
.ib-paper.open .ib-in { box-shadow: 0 0 18px var(--c); }

/* 夾娃娃機 */
.cl-machine { padding: 10px 12px 12px; border-radius: 26px 26px 18px 18px; background: linear-gradient(160deg, #f06292, #ad1457); box-shadow: 0 10px 0 #6a0036, 0 16px 30px rgba(0,0,0,.45); border: 3px solid #ffd54f; }
.cl-top { position: relative; text-align: center; margin: -4px 0 8px; padding: 6px; border-radius: 16px; background: #4a0e2a; color: #ffeb3b; font-weight: 900; font-size: 18px; letter-spacing: 2px; text-shadow: 0 0 10px #ff4081; overflow: hidden; }
.cl-top::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, #ffeb3b 0 2px, transparent 3px) 0 0 / 14px 100%; opacity: .5; animation: bulbs .8s steps(2) infinite; pointer-events: none; }
.cl-glass { border-radius: 14px; overflow: hidden; border: 4px solid #4a0e2a; box-shadow: inset 0 0 20px rgba(0,0,0,.3); }
.cl-panel { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #4a0e2a, #2a0718); }
.cl-coin { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 10px; background: #000; color: #ffeb3b; font-weight: 900; font-family: ui-monospace, monospace; }
.cl-coin small { color: #ffcc80; font-size: 10px; }
.cl-btn { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 99px; color: #fff; background: radial-gradient(circle at 50% 30%, #ff5252, #b71c1c); border: 3px solid #ffcdd2; box-shadow: 0 6px 0 #6d0000; transition: transform .08s, box-shadow .08s; }
.cl-btn b { font-size: 20px; } .cl-btn small { font-size: 11px; opacity: .9; }
.cl-btn.on { transform: translateY(5px); box-shadow: 0 1px 0 #6d0000; background: radial-gradient(circle at 50% 30%, #ff8a80, #d50000); }
.cl-cabinet { width: 100%; max-width: 360px; padding: 12px; border-radius: 16px; background: linear-gradient(180deg, #6d3b17, #3e2010); border: 3px solid #ffca28; box-shadow: 0 6px 16px rgba(0,0,0,.4); color: #fff; }
.cl-cab-t { font-weight: 900; margin-bottom: 8px; display: flex; justify-content: space-between; } .cl-cab-t small { color: #ffd54f; }
.cl-shelf { grid-template-columns: repeat(6, 1fr); gap: 6px 4px; padding: 8px 4px; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.3); }
.cl-shelf span { width: 100%; } .cl-shelf span img { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.cl-shelf small { font-size: 11px; color: #ffe0b2; }
.cl-cabinet .muted { color: #ffcc80; font-size: 12px; margin-top: 6px; }

/* 戳戳樂 */
.pk-sign { width: 100%; max-width: 440px; text-align: center; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #d32f2f, #8e0000); border: 3px solid #ffd54f; color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.4); }
.pk-sign b { display: block; font-size: 28px; color: #ffeb3b; letter-spacing: 6px; text-shadow: 0 3px 0 #5d0000; }
.pk-sign span { font-size: 13px; display: inline-flex; align-items: center; gap: 3px; }
.pk-left { max-width: 440px; }
.pk-left span { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 99px; background: rgba(40,8,6,.85); border: 1px solid rgba(255,213,79,.4); color: #fff; font-size: 13px; }
.pk-left span.top { background: linear-gradient(180deg, #ffca28, #ff8f00); color: #4e1b00; border-color: #fff; }
.pk-left span b { color: #ffd54f; margin-left: 2px; } .pk-left span.top b { color: #b71c1c; }
.pk-left span.out { opacity: .35; text-decoration: line-through; }
.pk-board { gap: 6px; padding: 12px; border-radius: 18px; background: linear-gradient(160deg, #8d5a2b, #4e2a12); border: 4px solid #ffca28; box-shadow: 0 10px 24px rgba(0,0,0,.5), inset 0 0 20px rgba(0,0,0,.4); }
.pk-cell { position: relative; padding: 0; border-radius: 50%; background: #2b1a10; box-shadow: inset 0 3px 6px rgba(0,0,0,.6); overflow: hidden; }
.pk-paper { position: absolute; inset: 3px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #ffd54f; font-weight: 900; font-size: 16px;
  background: radial-gradient(circle at 35% 30%, #ef5350, #b71c1c 70%); box-shadow: inset 0 -3px 4px rgba(0,0,0,.3), inset 0 2px 3px rgba(255,255,255,.3); }
.pk-cell:active .pk-paper { transform: scale(.9); }
.pk-cap { position: absolute; inset: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fffdf5, #ffe0b2); color: #4e1b00; font-weight: 900; font-size: 11px; line-height: 1; }
.pk-cap i { font-style: normal; font-size: 14px; }
.pk-cell.open { background: #2b1a10; } .pk-cell.open.mid .pk-cap { background: radial-gradient(circle at 35% 30%, #fff, #b3e5fc); }
.pk-cell.open.big .pk-cap { background: radial-gradient(circle at 35% 30%, #fff59d, #ffb300); animation: winGlow .8s infinite alternate; }
.pk-cell.just .pk-cap { animation: capPop .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes capPop { from { transform: scale(0) rotate(-180deg); } }
.pk-cell.just::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, #e53935 0 10%, transparent 10% 30%, #c62828 30% 42%, transparent 42% 62%, #e53935 62% 70%, transparent 70%); animation: tear .5s forwards; pointer-events: none; }
@keyframes tear { to { transform: scale(1.6) rotate(40deg); opacity: 0; } }
.ib-k small { color: rgba(255,255,255,.9); }
.modal-back:has(.ib-reveal) { background: rgba(20, 0, 8, .88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ib-reveal { padding: 16px; border-radius: 20px; background: linear-gradient(160deg, #880e4f, #3a0020); border: 3px solid #ffd54f; box-shadow: 0 14px 30px rgba(0,0,0,.6); }
.mg-result { padding-top: 0; }
.mg-res-art { position: static; transform: none; width: 110px; height: 110px; margin: 0 auto -4px; }
.mg-result .muted { color: #8d6e63 !important; }

/* 撲克牌圖片牌面 */
.card.face-img { padding: 0; overflow: hidden; background: #fff; border: 1px solid #d7ccc8; }
.card.face-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* 頭像框圖片：洞約佔 62% */
.av .av-frame { inset: -31%; width: 162%; height: 162%; }
/* 序列特效 */
.fx-flip { position: fixed; z-index: 9000; pointer-events: none; transition: opacity .3s; }
.fx-flip img { width: 100%; height: 100%; object-fit: contain; }
.fx-flip.out { opacity: 0; }
.shop-item img.fx-prev { width: 64px; height: 64px; object-fit: contain; }

/* 單機遊戲：夜市／幸運廣場分頁 */
.menu-tile.wide { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.menu-tile.wide small { margin-left: 4px; }
.single-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; padding: 6px; border-radius: 18px; background: rgba(48, 10, 6, .88); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.single-tabs button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.07); color: #fff; border: 1.5px solid transparent; }
.single-tabs button span { grid-row: 1 / 3; font-size: 30px; display: flex; } .single-tabs button span img { width: 44px; height: 44px; }
.single-tabs button b { font-size: 17px; } .single-tabs button small { font-size: 11px; opacity: .8; }
.single-tabs button.on { background: linear-gradient(160deg, #fff3c4, #ffc94a); color: #5d1a00; border-color: #fff; box-shadow: 0 3px 0 #b26a00; }
.single-tabs ~ .muted { padding: 7px 12px; border-radius: 12px; background: rgba(40, 8, 6, .85); color: #ffe0b2 !important; }

/* ===== 語音訊息（按住說話） ===== */
.voice-fab { position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 300; width: 56px; height: 56px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: radial-gradient(circle at 50% 30%, #ff6e6e, #c62828); color: #fff; border: 3px solid #ffcdd2; box-shadow: 0 4px 0 #7f0000, 0 8px 18px rgba(0,0,0,.4); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.voice-fab span { font-size: 22px; } .voice-fab small { font-size: 9px; font-weight: 800; margin-top: 2px; }
.voice-fab.hidden { display: none; }
.voice-fab.on { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(255,82,82,.35), 0 0 0 16px rgba(255,82,82,.15); animation: micPulse 1s infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 12px rgba(255,82,82,.25), 0 0 0 24px rgba(255,82,82,.08); } }
.voice-rec { position: fixed; left: 50%; top: 42%; z-index: 9500; transform: translate(-50%, -50%); width: 200px; padding: 18px 16px 14px; border-radius: 24px; text-align: center; color: #fff;
  background: rgba(30, 6, 6, .92); border: 2px solid #ff5252; box-shadow: 0 12px 30px rgba(0,0,0,.5); pointer-events: none; animation: popIn .2s; }
.voice-rec.hidden { display: none; }
.vr-mic { font-size: 54px; animation: pulse .8s infinite; }
.vr-time { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
.vr-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; } .vr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #69f0ae, #ffeb3b, #ff5252); transition: width .1s linear; }
.vr-tip { margin-top: 8px; font-size: 13px; color: #ffcdd2; }
.voice-rec.cancel { border-color: #9e9e9e; background: rgba(40, 40, 40, .95); } .voice-rec.cancel .vr-mic { animation: none; filter: grayscale(1); } .voice-rec.cancel .vr-tip { color: #fff; font-weight: 900; }
.voice-bubble { pointer-events: auto; }
.voice-bubble button { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 12px; border-radius: 99px; background: linear-gradient(180deg, #ffebee, #ffcdd2); color: #b71c1c; font-weight: 900; }
.vb-ic { font-size: 18px; }
.vb-wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.vb-wave i { width: 3px; height: 6px; border-radius: 2px; background: #e53935; }
.voice-bubble.playing .vb-wave i { animation: wave .5s ease-in-out infinite alternate; }
.voice-bubble.playing .vb-wave i:nth-child(2) { animation-delay: .1s; } .voice-bubble.playing .vb-wave i:nth-child(3) { animation-delay: .2s; } .voice-bubble.playing .vb-wave i:nth-child(4) { animation-delay: .3s; } .voice-bubble.playing .vb-wave i:nth-child(5) { animation-delay: .15s; }
@keyframes wave { to { height: 18px; } }
.voice-bubble.playing { box-shadow: 0 0 0 3px #ff5252, 0 6px 16px rgba(0,0,0,.35); }
.vb-tap { display: none; font-size: 11px; color: #fff; background: #e53935; border-radius: 99px; padding: 1px 6px; }
.voice-bubble.tap .vb-tap { display: inline; }
.chat-log .vlog { padding: 2px 10px; border-radius: 99px; background: #ffebee; color: #b71c1c; font-weight: 800; font-size: 13px; }

/* 背景音樂／音效開關 */
.snd-ctl { display: inline-flex; gap: 4px; margin-left: 4px; }
.snd-ctl .btn { min-width: 38px; padding: 4px 8px; font-size: 18px; position: relative; }
.snd-ctl .btn.off { opacity: .55; }
.snd-ctl .btn.off[data-snd="music"]::after { content: ''; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.5px; background: #ff5252; transform: rotate(-40deg); border-radius: 2px; }

/* 一番賞撕籤：不用 3D 翻牌（iPhone 會整張不見），改成籤紙往上撕開、底下的獎品一直都在 */
.modal-back:has(.ib-reveal) { backdrop-filter: none; -webkit-backdrop-filter: none; overflow-y: auto; align-items: flex-start; }
.modal-back:has(.ib-reveal) .ib-reveal { margin: auto; }
.ib-paper { perspective: none; overflow: hidden; }
.ib-fold, .ib-in { backface-visibility: visible; -webkit-backface-visibility: visible; }
.ib-in { transform: none; z-index: 0; }
.ib-fold { z-index: 1; transition: transform .45s cubic-bezier(.4,1.2,.6,1), opacity .4s; }
.ib-paper.open .ib-fold { transform: translateY(-115%) rotate(-10deg); opacity: 0; pointer-events: none; }
.ib-paper.open .ib-in { transform: none; }
.ib-got { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,213,79,.5); border-radius: 12px; padding: 8px 10px; color: #fff; font-size: 13px; line-height: 1.6; }
.ib-got b { color: #ffd54f; }
@media (max-width: 420px) { .ib-slips { grid-template-columns: repeat(3, 1fr); gap: 8px; } .ib-paper { height: 128px; } .ib-in .ib-show { transform: scale(.85); } }

/* iPhone 瀏海／狀態列：最上排往下讓出空間（加到主畫面時尤其需要） */
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (max-width: 480px) { .topbar { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); } }
.toast { top: calc(14px + env(safe-area-inset-top)); }
.modal-back { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.gift-banner { top: calc(70px + env(safe-area-inset-top)); }

/* 右上角金幣：有借款亮小紅點 */
.chip-pill { position: relative; }
.debt-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ffb300; box-shadow: 0 0 0 2px #5a0000; }
.chip-pill.debt .debt-dot { background: #ff1744; animation: pulse 1.2s infinite; }

/* 我的收藏 */
.col-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.col-tabs button { flex: none; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: inherit; font-size: 14px; border: 1px solid rgba(255,213,79,.3); white-space: nowrap; }
.col-tabs button.on { background: linear-gradient(160deg, #ffe082, #ffb300); color: #4e2600; font-weight: 800; }
.col-tabs small { margin-left: 4px; background: #c62828; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.col-grid { margin-top: 4px; }

/* 銀行 */
.bank-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px; }
.bank-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px; background: linear-gradient(160deg, #fff8e1, #ffe082); color: #4e2600; border: 2px solid #ffb300; box-shadow: 0 3px 0 #b26a00; }
.bank-opt b { font-size: 20px; display: inline-flex; align-items: center; gap: 4px; }
.bank-opt small { font-size: 12px; color: #6d4c41; }
.bank-loan { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,213,79,.5); }
.bank-loan.over { border-color: #ff5252; background: rgba(255,23,68,.12); }
.bk-owed { font-size: 22px; display: flex; align-items: center; gap: 6px; } .bk-owed b { color: #ffd54f; font-size: 28px; }
.bk-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.15); }
.bk-tag.red { background: #d50000; color: #fff; font-weight: 800; }
.bk-warn { font-size: 13px; line-height: 1.6; color: #ffcdd2; }
.bank-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bank-plans button { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.1); color: inherit; border: 1.5px solid rgba(255,213,79,.3); }
.bank-plans button.on { background: linear-gradient(160deg, #c8e6c9, #66bb6a); color: #1b3d1f; border-color: #2e7d32; }
.bank-plans small { font-size: 12px; }
.bank-dep { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.08); }
.bank-dep.ready { background: rgba(102,187,106,.2); border: 1px solid #66bb6a; }
.bank-dep small { font-size: 12px; opacity: .85; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.col-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; }
.col-grid .shop-item { padding: 8px 4px; } .col-grid .shop-item b { font-size: 13px; }

/* ================= 我的家 ================= */
.hm-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #ff1744; color: #fff; font-size: 11px; font-style: normal; line-height: 18px; text-align: center; }
.hm-off { background: rgba(0,0,0,.35); border: 1px dashed rgba(255,213,79,.5); border-radius: 12px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.hm-hero { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,213,79,.25), rgba(198,40,40,.35)); border: 1.5px solid rgba(255,213,79,.6); }
.hm-name { font-size: 20px; }
.hm-wealth { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.hm-wealth small { font-size: 12px; opacity: .85; }
.hm-wealth b { font-size: 24px; color: #ffd54f; display: inline-flex; align-items: center; gap: 4px; text-shadow: 0 2px 0 #7a3a00; }
.hm-rank { font-size: 13px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #ffd54f; color: #5d2b00; }
.hm-prog { position: relative; height: 18px; margin: 8px 0; border-radius: 999px; background: rgba(0,0,0,.35); overflow: hidden; }
.hm-prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffb300, #ffeb3b); border-radius: 999px; }
.hm-prog span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 18px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.hm-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; margin-bottom: 8px; }
.hm-stats b { color: #ffd54f; }
.hm-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px; background: rgba(0,0,0,.3); padding: 4px; border-radius: 14px; margin-bottom: 10px; }
.hm-tabs button { padding: 8px 2px; border-radius: 10px; background: none; color: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; }
.hm-tabs button.on { background: linear-gradient(160deg, #ffe082, #ffb300); color: #4e2600; }
.hm-hint { text-align: center; font-size: 12px; margin-top: 6px; }
.hm-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hm-emo { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* 全身照 */
.hm-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 360px; border-radius: 20px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 92%, rgba(0,0,0,.35) 0 18%, transparent 19%), radial-gradient(circle at 50% 30%, #fff8e1, #ffcc80 55%, #e65100); box-shadow: inset 0 0 40px rgba(120,40,0,.4); }
.hm-stage::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 35%, rgba(255,255,255,.18) 0 8deg, transparent 8deg 20deg); animation: hmSpin 40s linear infinite; }
@keyframes hmSpin { to { transform: rotate(360deg); } }
.hm-fig { --w: 200px; position: relative; width: var(--w); height: calc(var(--w) * 1.62); flex: none; }
.hm-fig.lg { --w: 210px; margin-bottom: 8px; }
.hm-fig.sm { --w: 70px; }
.hm-fig.xs { --w: 60px; }
.hm-body { position: absolute; left: 0; bottom: 0; width: 100%; height: 82%; object-fit: contain; }
.hm-head { position: absolute; left: 50%; top: 0; transform: translateX(-50%) scale(calc(var(--w) / 170px)); transform-origin: 50% 0; }
.hm-fig.sm .hm-head, .hm-fig.xs .hm-head { transform: translateX(-50%) scale(.42); }
.hm-fig.lg .hm-head { transform: translateX(-50%) scale(1.15); }
.hm-head .av { box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.hm-acc { position: absolute; left: 50%; transform: translateX(-50%); font-size: calc(var(--w) * .2); line-height: 1; z-index: 3; }
.hm-acc.pos-face { top: calc(var(--w) * .2); } .hm-acc.pos-neck { top: calc(var(--w) * .5); } .hm-acc.pos-back { top: calc(var(--w) * .45); font-size: calc(var(--w) * .5); z-index: 0; opacity: .95; }
.hm-acc.pos-wrist { top: calc(var(--w) * 1.08); left: 18%; font-size: calc(var(--w) * .13); }
.hm-acc-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 3; }
.hm-hand { position: absolute; right: -6%; top: 58%; width: calc(var(--w) * .3); height: calc(var(--w) * .3); font-size: calc(var(--w) * .24); z-index: 4; transform: rotate(-8deg); }
.hm-pet { position: absolute; left: -34%; bottom: -2%; width: calc(var(--w) * .42); height: calc(var(--w) * .42); font-size: calc(var(--w) * .34); z-index: 4; animation: hmHop 1.6s ease-in-out infinite; }
@keyframes hmHop { 50% { transform: translateY(-8%); } }
.hm-hand .hm-emo, .hm-pet .hm-emo { width: 100%; height: 100%; }
.hm-wear { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hm-wrow { display: flex; align-items: center; gap: 8px; }
.hm-wrow > b { flex: none; width: 64px; font-size: 13px; }
.hm-wlist { display: flex; gap: 6px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
.hm-wlist button { flex: none; width: 50px; height: 50px; border-radius: 12px; background: rgba(255,255,255,.9); font-size: 28px; padding: 4px; border: 2px solid transparent; }
.hm-wlist button.on { border-color: #ffb300; box-shadow: 0 0 0 2px #ffd54f, 0 0 12px #ffb300; }
.hm-wlist button.more { width: auto; padding: 0 10px; font-size: 13px; font-weight: 800; color: #6d3b00; background: #ffe082; }

/* 家裡 */
.hm-room { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; border: 3px solid #5d4037; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.hm-wall { position: absolute; inset: 0 0 34% 0; background: linear-gradient(180deg, var(--wall), color-mix(in srgb, var(--wall) 80%, #000)); }
.hm-wall::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 14px, transparent 14px 28px); }
.hm-floor { position: absolute; inset: 66% 0 0 0; background: repeating-linear-gradient(90deg, var(--floor) 0 36px, color-mix(in srgb, var(--floor) 85%, #000) 36px 38px); box-shadow: inset 0 10px 18px rgba(0,0,0,.3); }
.hm-window { position: absolute; left: 62%; top: 10%; width: 22%; height: 24%; border: 5px solid #fff; border-radius: 6px; background: linear-gradient(180deg, #81d4fa, #e1f5fe); box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.hm-furn, .hm-slot { position: absolute; transform: translate(-50%, -50%); width: calc(var(--s) * 1%); aspect-ratio: 1; z-index: 2; }
.hm-furn .hm-emo { width: 100%; height: 100%; font-size: calc(var(--s) * .22rem); filter: drop-shadow(0 4px 3px rgba(0,0,0,.3)); }
.hm-furn.flat { aspect-ratio: 3 / 1; z-index: 1; } .hm-furn.flat .hm-emo { transform: scaleY(.35); font-size: calc(var(--s) * .16rem); }
.hm-slot { border: 2px dashed rgba(255,255,255,.85); border-radius: 12px; background: rgba(0,0,0,.18); color: #fff; font-size: 18px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; animation: hmPulse 2s ease-in-out infinite; }
.hm-slot small { font-size: 10px; font-weight: 700; }
@keyframes hmPulse { 50% { background: rgba(255,213,79,.35); } }
.hm-roomfig { position: absolute; left: 40%; bottom: 3%; z-index: 3; }

/* 門口 */
.hm-door { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; border: 3px solid #4e342e; box-shadow: 0 8px 20px rgba(0,0,0,.4); background: linear-gradient(180deg, #1a237e, #5c6bc0 55%, #ffb74d); }
.hm-sky i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }
.hm-sky i:nth-child(1) { left: 12%; top: 10%; } .hm-sky i:nth-child(2) { left: 80%; top: 16%; } .hm-sky i:nth-child(3) { left: 50%; top: 6%; }
.hm-facade { position: absolute; left: 22%; right: 22%; bottom: 18%; height: 48%; background: var(--wallc); border-radius: 4px; box-shadow: inset -12px 0 0 rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.35); }
.hm-facade.lv-1 { height: 62%; left: 26%; right: 26%; } .hm-facade.lv-2 { height: 56%; left: 18%; right: 18%; } .hm-facade.lv-3 { height: 54%; left: 12%; right: 12%; } .hm-facade.lv-4 { height: 60%; left: 8%; right: 8%; } .hm-facade.lv-5 { height: 62%; left: 6%; right: 6%; box-shadow: 0 0 30px #ffd54f; }
.hm-roof { position: absolute; left: -8%; right: -8%; bottom: 100%; height: 42%; background: var(--roof); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.hm-facade.lv-1 .hm-roof { clip-path: none; height: 10%; left: -3%; right: -3%; }
.hm-win { position: absolute; top: 16%; width: 20%; height: 28%; background: linear-gradient(180deg, #fff59d, #ffca28); border: 4px solid #6d4c41; box-shadow: 0 0 14px #ffeb3b; }
.hm-win.l { left: 10%; } .hm-win.r { right: 10%; }
.hm-gate { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 26%; height: 56%; background: linear-gradient(90deg, #b71c1c, #e53935 50%, #b71c1c); border: 4px solid #ffd54f; border-bottom: 0; border-radius: 6px 6px 0 0; }
.hm-knob { position: absolute; right: 14%; top: 52%; width: 9px; height: 9px; border-radius: 50%; background: #ffd54f; }
.hm-ground { position: absolute; inset: 82% 0 0 0; background: linear-gradient(180deg, #8d6e63, #5d4037); }
.hm-plate { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); padding: 3px 14px; border-radius: 8px; background: linear-gradient(180deg, #ffe082, #ffb300); color: #5d2b00; font-weight: 900; font-size: 14px; border: 2px solid #8d5200; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.35); z-index: 3; }
.hm-deco { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); width: 46%; height: 36%; z-index: 2; pointer-events: none; display: flex; justify-content: space-between; align-items: center; font-size: 34px; }
.hm-deco .hm-emo { font-size: 34px; }
.hm-deco:has(> img) { justify-content: center; }
.hm-deco.d-lions, .hm-deco.d-flowers { bottom: 16%; align-items: flex-end; }
.hm-car { position: absolute; left: 3%; bottom: 4%; width: 36%; height: 26%; font-size: 64px; z-index: 3; filter: drop-shadow(0 6px 4px rgba(0,0,0,.4)); }
.hm-car .hm-emo { width: 100%; height: 100%; transform: scaleX(-1); }
.hm-carslot { position: absolute; left: 4%; bottom: 5%; padding: 6px 10px; border: 2px dashed rgba(255,255,255,.8); border-radius: 10px; background: rgba(0,0,0,.25); color: #fff; font-weight: 800; font-size: 13px; display: flex; flex-direction: column; z-index: 3; }
.hm-carslot small { font-size: 10px; font-weight: 600; }
.hm-mailbox { position: absolute; right: 5%; bottom: 6%; z-index: 3; font-size: 40px; background: none; line-height: 1; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
.hm-mailbox b { position: absolute; top: -6px; right: -8px; min-width: 22px; padding: 0 5px; font-size: 12px; line-height: 22px; border-radius: 999px; background: #ff1744; color: #fff; }

/* 留言板 */
.hm-book { display: flex; flex-direction: column; gap: 8px; }
.hm-write { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: #fff8e1; color: #3e2723; }
.hm-stk { display: flex; gap: 4px; overflow-x: auto; }
.hm-stk button { flex: none; width: 38px; height: 38px; font-size: 22px; border-radius: 10px; background: #fff; border: 2px solid #ffe082; }
.hm-stk button.on { border-color: #ff6f00; background: #ffe0b2; transform: scale(1.08); }
.hm-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 14px; background: #fffdf6; color: #3e2723; box-shadow: 0 3px 0 #e0c9a6; position: relative; }
.hm-note::before { content: ''; position: absolute; left: 50%; top: -5px; width: 34px; height: 10px; background: rgba(255,213,79,.7); transform: translateX(-50%) rotate(-3deg); border-radius: 2px; }
.hm-note.me { background: #fff3e0; } .hm-note.pending { opacity: .7; }
.hm-ntext { word-break: break-word; line-height: 1.5; }
.hm-nstk { font-size: 30px; margin-right: 6px; vertical-align: middle; }
.hm-ndel { background: none; color: #a1887f; font-size: 16px; padding: 2px 6px; }
.hm-visitors { display: flex; gap: 10px; overflow-x: auto; } .hm-visitors span { display: flex; flex-direction: column; align-items: center; font-size: 11px; flex: none; }

/* 商店 */
.col-tabs.sub { margin-top: 4px; } .col-tabs.sub button { font-size: 12px; padding: 4px 9px; } .col-tabs button.lock { opacity: .6; }
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.hm-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border-radius: 14px; background: linear-gradient(180deg, #fffdf6, #ffecb3); color: #3e2723; border: 2px solid #ffe082; text-align: center; }
.hm-card.own { border-color: #81c784; } .hm-card.eq { border-color: #ffb300; box-shadow: 0 0 0 2px #ffd54f; }
.hm-card b { font-size: 13px; } .hm-card small { font-size: 11px; }
.hm-prev { width: 70px; height: 74px; display: flex; align-items: flex-end; justify-content: center; font-size: 48px; }
.hm-prev .hm-emo { width: 100%; height: 100%; }
.hm-prev .hm-fig.xs { transform: scale(.72); transform-origin: 50% 100%; }

/* 好友 */
.hm-code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 900; letter-spacing: 2px; color: #ffd54f; padding: 6px 12px; background: rgba(0,0,0,.3); border-radius: 10px; align-self: flex-start; user-select: all; }
.hm-frow { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
.hm-frow.me { background: rgba(255,213,79,.15); border-radius: 10px; }
.hm-rk { width: 28px; text-align: center; font-weight: 900; font-size: 18px; flex: none; }
.hm-on { color: #69f0ae; font-weight: 800; }
.hm-more { background: none; color: inherit; font-size: 20px; padding: 0 6px; }
.menu-tile.home-tile { background: linear-gradient(160deg, #fff59d, #ffb300); }
/* 頭接在脖子上：頭的底部對齊脖子（約 0.72 倍寬） */
.hm-head { top: calc(var(--w) * .74); transform: translate(-50%, -100%) scale(var(--hk, 1.2)); transform-origin: 50% 100%; z-index: 2; }
.hm-fig.lg .hm-head { --hk: 1.26; transform: translate(-50%, -100%) scale(var(--hk)); }
.hm-fig.sm .hm-head { --hk: .42; transform: translate(-50%, -100%) scale(var(--hk)); }
.hm-fig.xs .hm-head { --hk: .36; transform: translate(-50%, -100%) scale(var(--hk)); }
.hm-acc.pos-face { top: calc(var(--w) * .34); z-index: 5; }
.hm-acc.pos-neck { top: calc(var(--w) * .68); z-index: 5; }
.hm-acc.pos-back { top: calc(var(--w) * .62); }
.hm-acc.pos-wrist { top: calc(var(--w) * 1.18); }
.hm-fig.lg { margin-bottom: 14px; }
.hm-acc img { width: 1.3em; height: 1.3em; object-fit: contain; display: block; }
.hm-card small.muted { color: #8d6e63; opacity: 1; }
.hm-head { top: calc(var(--w) * .79); }

/* 全身照的頭（程式畫的 Q 版頭） */
.hm-head2 { position: absolute; left: 50%; top: calc(var(--w) * .2); width: calc(var(--w) * .66); aspect-ratio: 1; transform: translateX(-50%); z-index: 2; }
.hm-headsvg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.18)); }
.hm-hat { position: absolute; left: 50%; top: -14%; transform: translateX(-50%); width: 58%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: calc(var(--w) * .26); line-height: 1; z-index: 3; }
.hm-hat .hat-img { width: 100%; height: 100%; object-fit: contain; }
.hm-acc.pos-face { top: calc(var(--w) * .48); font-size: calc(var(--w) * .2); }
.hm-acc.pos-neck { top: calc(var(--w) * .74); }
.hm-wlist button.hair { padding: 2px; background: #fff3e0; }
.hm-wlist button.hair svg, .hm-wlist button.hair img { width: 100%; height: 100%; object-fit: contain; }
.hm-headimg { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.18)); }

/* 房間留言板：收起時只顯示一行 */
.board-mini { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; color: inherit; padding: 12px 14px; }
.board-mini small { margin-left: 6px; background: #c62828; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.bd-peek { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-head { background: none; color: inherit; padding: 0; width: 100%; }

/* 我的家：底色加深，商店卡片和頁籤看得清楚 */
.hm-page .hm-hero { background: linear-gradient(135deg, #7a1c12, #4a0d0d); }
.hm-page .hm-stats { background: rgba(30,4,4,.88); padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(255,213,79,.35); }
.hm-page .hm-prog { background: rgba(20,2,2,.9); }
.hm-page .hm-tabs { background: rgba(30,4,4,.94); border: 1px solid rgba(255,213,79,.35); }
.hm-shop { background: rgba(35,6,6,.95); border: 1.5px solid rgba(255,213,79,.45); border-radius: 18px; padding: 10px; }
.hm-shop .col-tabs button, .hm-page .col-tabs button { background: #5a1414; border-color: rgba(255,213,79,.55); color: #fff; }
.hm-shop .col-tabs button.on { background: linear-gradient(160deg, #ffe082, #ffb300); color: #4e2600; }
.hm-card { background: #fffaf0; border: 2px solid #e0b860; box-shadow: 0 4px 0 #b8892f, 0 6px 12px rgba(0,0,0,.35); }
.hm-card.own { border-color: #66bb6a; box-shadow: 0 4px 0 #2e7d32, 0 6px 12px rgba(0,0,0,.35); }
.hm-card.eq { border-color: #ffb300; box-shadow: 0 0 0 3px #ffd54f, 0 4px 0 #b8892f; }
.hm-card b { color: #3e2723; }
.hm-wear { background: rgba(35,6,6,.95); border: 1.5px solid rgba(255,213,79,.45); border-radius: 18px; padding: 10px; }
.hm-hint { background: rgba(30,4,4,.85); border-radius: 10px; padding: 4px 8px; opacity: 1; color: #ffe9c4; }
.hm-book .hm-write { box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.redeem-amt { font-size: 26px; font-weight: 900; color: #c62828; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.hm-pres { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.35); }
.hm-pres.ok { color: #69f0ae; } .hm-pres.warn { color: #ffd54f; } .hm-pres.bad { color: #ff8a80; }

/* 公告按鈕（頭像右邊）＋新玩家提示 */
.topbar { position: sticky; }
.news-btn { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; font-size: 21px; background: rgba(0,0,0,.3); border: 1.5px solid rgba(255,213,79,.55); display: flex; align-items: center; justify-content: center; padding: 0; }
.news-btn.pulse { animation: newsPulse 1.4s ease-in-out infinite; }
@keyframes newsPulse { 50% { box-shadow: 0 0 0 6px rgba(255,213,79,.35), 0 0 16px #ffd54f; transform: scale(1.08); } }
.news-dot { position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: #ff1744; box-shadow: 0 0 0 2px #5a0000; }
.coach { position: absolute; left: 50px; top: calc(100% + 10px); z-index: 60; max-width: 260px; padding: 10px 34px 10px 12px; border-radius: 14px; background: #fffbe6; color: #4e2600; font-size: 14px; line-height: 1.5; box-shadow: 0 8px 20px rgba(0,0,0,.45); border: 2px solid #ffb300; cursor: pointer; animation: coachBob 1.6s ease-in-out infinite; }
.coach b { display: block; font-size: 15px; }
.coach::before { content: ''; position: absolute; left: 22px; top: -9px; width: 14px; height: 14px; background: #fffbe6; border-left: 2px solid #ffb300; border-top: 2px solid #ffb300; transform: rotate(45deg); }
.coach-x { position: absolute; right: 6px; top: 6px; background: none; color: #8d6e63; font-size: 14px; padding: 2px 6px; }
@keyframes coachBob { 50% { transform: translateY(4px); } }
.tutorial-box video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; aspect-ratio: 9 / 16; object-fit: contain; }
.news-tag { flex: none; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #c62828; color: #fff; }
.news-item.unread { border-color: #ffd54f; box-shadow: 0 0 0 2px rgba(255,213,79,.5); }

/* ---------- 我的家：後院、物件功效 ---------- */
.hm-page .hm-tabs { grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); }
.hm-page .hm-tabs button { font-size: 12px; padding: 8px 0; }
.hm-yard { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; border: 3px solid #33691e; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.hm-ysky { position: absolute; inset: 0 0 62% 0; background: linear-gradient(180deg, #81d4fa, #e1f5fe); }
.hm-ysky i { position: absolute; top: 18%; width: 22%; height: 22%; border-radius: 50px; background: #fff; opacity: .9; box-shadow: 18px 8px 0 -2px #fff, -16px 8px 0 -4px #fff; animation: hmCloud 30s linear infinite; }
.hm-ysky i:nth-child(2) { top: 44%; width: 15%; animation-duration: 42s; animation-delay: -18s; }
@keyframes hmCloud { from { left: -30%; } to { left: 110%; } }
.hm-ygrass { position: absolute; inset: 34% 0 0 0; background: radial-gradient(circle at 20% 40%, rgba(255,255,255,.12) 0 2px, transparent 3px) 0 0 / 26px 26px, linear-gradient(180deg, #9ccc65, #689f38); }
.hm-fence { position: absolute; left: 0; right: 0; top: 27%; height: 11%; background: repeating-linear-gradient(90deg, #fff3e0 0 10px, transparent 10px 22px), linear-gradient(transparent 30%, #d7ccc8 30% 40%, transparent 40% 70%, #d7ccc8 70% 80%, transparent 80%); opacity: .95; }
.hm-yard .hm-roomfig { left: 38%; bottom: 4%; }
.hm-yard.locked { display: flex; align-items: center; justify-content: center; }
.hm-yard.locked > :not(.hm-ylock) { filter: grayscale(.6) brightness(.7); }
.hm-ylock { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: rgba(30,4,4,.88); color: #ffe9c4; border: 1px solid rgba(255,213,79,.5); border-radius: 16px; padding: 14px 18px; max-width: 86%; }
.hm-ylock b { font-size: 17px; } .hm-ylock span, .hm-ylock small { font-size: 12px; opacity: .9; }
.hm-furn[data-h] { cursor: pointer; }
.hm-prev[data-h] { cursor: pointer; position: relative; }
.hm-prev[data-h]::after { content: 'ⓘ'; position: absolute; right: -6px; top: -2px; font-size: 13px; color: #8d6e63; opacity: .8; }
.hm-effects { margin-top: 10px; background: rgba(30,4,4,.9); border: 1px solid rgba(255,213,79,.45); border-radius: 14px; padding: 10px 12px; color: #ffe9c4; display: flex; flex-direction: column; gap: 8px; }
.hm-effects > small { font-size: 11px; color: #e0c9a6; }
.hm-eff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hm-eff-row > div { background: rgba(255,255,255,.06); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.hm-eff-row span { font-size: 12px; } .hm-eff-row b { font-size: 20px; color: #ffd54f; }
.hm-eff-row i { display: block; height: 6px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.hm-eff-row em { display: block; height: 100%; background: linear-gradient(90deg, #ffe082, #ffb300); }
.hm-eff-row small { font-size: 10px; color: #c9b08a; }
.hm-info { text-align: center; }
.hm-info-art { width: 110px; height: 110px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 72px; }
.hm-info-art .hm-img, .hm-info-art .hm-emo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; object-fit: contain; }
.hm-info-art .hm-fig.xs { transform: none; }
.hm-eff { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; text-align: left; }
.hm-eff-l { background: #fff8e1; border: 1px solid #ffe082; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; color: #4e2600; }
.hm-eff-l small { font-size: 12px; color: #795548; }
.hm-off .btn { margin-left: 8px; }
.lucky-luck { width: 100%; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(90deg, rgba(76,175,80,.25), rgba(30,4,4,.6)); border: 1px solid rgba(165,214,167,.5); color: #e8f5e9; font-size: 14px; text-align: left; }
.lucky-luck b { color: #c5e1a5; font-size: 16px; } .lucky-luck small { flex: 1; font-size: 11px; opacity: .85; } .lucky-luck span { font-size: 20px; opacity: .7; }
.hm-info .muted, .hm-info small.muted { color: #8d6e63; opacity: 1; }
.hm-info p.muted { color: #6d4c41; }
.hm-yard.locked.has-art::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: grayscale(.6); }
.hm-page .hm-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.hm-tabs button { display: flex; align-items: center; justify-content: center; gap: 3px; position: relative; }
.hm-tabs button i { font-style: normal; }
@media (max-width: 400px) { .hm-page .hm-tabs button { flex-direction: column; gap: 0; padding: 5px 0; line-height: 1.15; } .hm-page .hm-tabs button i { font-size: 15px; } }
.hm-tabs .hm-badge { position: absolute; top: -5px; right: 0; margin: 0; }
