* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
button, input { font-family: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
body {
  color: #6B3A1F;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
.app {
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 16% 8%, rgba(255,255,255,.7), transparent 26%),
    radial-gradient(ellipse at 86% 0%, rgba(255,255,255,.45), transparent 24%),
    linear-gradient(180deg, #FFE7C8 0%, #FFD3A1 42%, #F6B56C 100%);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 0;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand strong { font-size: 16px; letter-spacing: .02em; color: #7A3E16; }
.logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(180deg, #FFB067, #FF8A3D);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 3px 0 #E06E22;
}
.logo .mp-icon { width: 18px; height: 18px; }
.top-gap { flex: 1; }
.bean-pill, .ad-btn, .gear, .btn-go, .btn-no, .btn-hint, .btn-bid, .switch {
  border: 0;
}
.bean-pill {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 4px 0 8px;
  background: rgba(255,248,240,.92);
  border-radius: 999px;
  color: #7A4320;
  box-shadow: 0 3px 0 rgba(180,100,40,.12), 0 6px 14px rgba(160,80,20,.08);
}
.bean-pill b { font-size: 15px; min-width: 36px; text-align: left; }
.bean-ico {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #FFE7A3, #F5A623 62%, #D98410);
  box-shadow: inset 0 -2px 0 rgba(150,80,0,.25);
  display: inline-block;
}
.plus {
  width: 24px; height: 24px; border-radius: 50%;
  background: #FF8A3D; color: #fff;
  display: grid; place-items: center;
}
.plus .mp-icon { width: 16px; height: 16px; }
.ad-btn {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px 0 8px;
  border-radius: 999px; color: #fff;
  background: linear-gradient(180deg, #FFB15A, #FF8A3D);
  box-shadow: 0 4px 0 #E06A20, 0 8px 16px rgba(220,110,30,.22);
}
.ad-btn .mp-icon { width: 18px; height: 18px; }
.ad-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.ad-btn small { font-size: 10px; font-weight: 700; opacity: .95; }
.ad-btn b { font-size: 13px; }
.ad-btn:active, .bean-pill:active, .gear:active { transform: translateY(2px); }
.gear {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,248,240,.92); color: #C47A3A;
  display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(180,100,40,.12);
}
.gear .mp-icon { width: 20px; height: 20px; }

.stage { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; }
.view.on { display: block; }
.scene { position: absolute; inset: 0; overflow: hidden; }

.arch {
  position: absolute; top: 8px; width: 78px; height: 96px;
  border-radius: 40px 40px 12px 12px;
  background: linear-gradient(180deg, rgba(190,225,250,.9), rgba(255,255,255,.35));
  box-shadow: inset 0 0 0 6px rgba(255,220,180,.45);
  opacity: .7;
}
.arch.a1 { left: 7%; }
.arch.a2 { right: 8%; }

.table {
  position: absolute;
  left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  width: min(78%, 760px);
  height: 64%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.42), transparent 46%),
    radial-gradient(ellipse at 50% 55%, #FFE3C2 0%, #F7B56A 70%, #F09A45 100%);
  box-shadow:
    0 14px 0 #E8883C,
    0 24px 28px rgba(160,70,10,.22),
    inset 0 0 0 10px rgba(255,220,180,.85);
}
.paw-mark {
  position: absolute; left: 50%; top: 46%; width: 28%; height: auto;
  transform: translate(-50%, -50%);
  fill: #fff; opacity: .28;
}

.cat { position: absolute; z-index: 3; width: 132px; display: flex; flex-direction: column; align-items: center; }
.cat-top { left: 50%; top: 0; transform: translateX(-50%); width: 150px; }
.cat-left { left: 2%; top: 4%; }
.cat-right { right: 2%; top: 4%; }
.cat-svg { width: 118px; height: 108px; display: block; }
.cat.turn .cat-fig { filter: drop-shadow(0 0 10px rgba(255,138,61,.9)); }
.seat-name { font-size: 11px; font-weight: 800; color: #8A5330; margin-top: 2px; }
.bean-mini {
  margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(70,36,16,.55); color: #fff;
  border-radius: 999px; padding: 2px 8px 2px 4px;
  font-size: 12px; font-weight: 800;
}
.bean-mini .bean-ico { width: 14px; height: 14px; }
.fan { position: relative; height: 34px; margin-top: -20px; display: flex; align-items: flex-end; justify-content: center; z-index: 2; }
.fan .back { width: 22px; height: 32px; margin-left: -12px; }
.fan .back:first-child { margin-left: 0; }
.fan em, .fan .out {
  position: absolute; right: -6px; bottom: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #fff; color: #7A4324;
  font-style: normal; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 2px 0 rgba(120,60,20,.12);
}
.back {
  display: block; position: relative; border-radius: 4px;
  background: linear-gradient(160deg, #8ECAFF, #3C7DFF 58%, #2C5FE0);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 3px 0 rgba(20,40,90,.12);
}
#hand .back.decor { width: 48px; height: 68px; margin-left: -26px; border-radius: 8px; }
#hand .back.decor:first-child { margin-left: 0; }
.back:after {
  content: ""; position: absolute; inset: 3px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.45);
}
.bottom-cards { display: flex; justify-content: center; position: relative; z-index: 2; min-height: 36px; }
.cat-top .bottom-cards { margin-top: -26px; }
.end-card .bottom-cards { margin: 8px 0 12px; }
.bottom-cards .back { width: 26px; height: 36px; margin-left: -6px; }
.bottom-cards .back:first-child, .bottom-cards .pcard:first-child { margin-left: 0; }
.dealer-label {
  margin-top: 4px; font-size: 12px; font-weight: 800; color: #8A4B22;
  background: rgba(255,248,240,.8); border-radius: 999px; padding: 2px 8px;
}

.lord-wrap {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  z-index: 4; display: flex; flex-direction: column; align-items: center;
}
.lord-wrap em {
  font-style: normal; font-size: 11px; font-weight: 800; color: #fff;
  background: #FF6A4A; border-radius: 999px; padding: 2px 8px;
  box-shadow: 0 3px 0 rgba(180,50,20,.18);
}
.crown { width: 18px; height: 12px; display: block; }
.hand-lord { top: -6px; }

.bubble {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #8A4B22; font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 3px 8px; z-index: 5;
  box-shadow: 0 4px 0 rgba(160,80,20,.1);
}
.bubble.me { top: auto; bottom: 100%; margin-bottom: 4px; }

.slot { position: absolute; z-index: 4; max-width: 34%; }
.slot-l { left: 16%; top: 44%; }
.slot-r { right: 16%; top: 44%; }
.slot-me { left: 50%; bottom: 33%; transform: translateX(-50%); max-width: 70%; }
.mini-row, .bottom-cards { display: flex; align-items: flex-end; }
.pass-pill {
  display: inline-block; background: rgba(255,248,240,.94); color: #8A5A3A;
  font-weight: 800; font-size: 13px; border-radius: 999px; padding: 6px 12px;
  box-shadow: 0 3px 0 rgba(180,110,50,.12);
}

#center {
  position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%);
  z-index: 6; text-align: center; width: min(92%, 640px);
}
.hero h2, .panel h2 { margin: 0; font-size: 34px; letter-spacing: .04em; color: #8A3E16; }
.kicker { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #E07A32; }
.hero p, .lead { margin: 6px 0 12px; font-size: 13px; color: #A56A45; }
.status { font-size: 15px; font-weight: 800; color: #7A4320; }
.status.slim { font-size: 12px; margin-bottom: 6px; color: #A56A45; font-weight: 700; }
.substat { font-size: 12px; color: #A56A45; margin: 2px 0 8px; }
.multi {
  display: inline-block; margin-bottom: 6px;
  background: rgba(255,248,240,.9); color: #E06A20;
  font-weight: 800; font-size: 12px; border-radius: 999px; padding: 3px 10px;
  box-shadow: 0 3px 0 rgba(180,90,20,.1);
}
.actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.btn-go, .btn-no, .btn-hint, .btn-bid {
  border-radius: 999px; font-weight: 800;
}
.btn-go {
  min-width: 108px; height: 46px; padding: 0 18px; color: #fff; font-size: 18px;
  background: linear-gradient(180deg, #FFB067, #FF8A3D);
  box-shadow: 0 5px 0 #E06A20, 0 8px 16px rgba(220,100,30,.22);
}
.btn-go.xl { min-width: 168px; height: 48px; }
.btn-no, .btn-hint, .btn-bid {
  height: 46px; padding: 0 16px; font-size: 16px; color: #8A5A3A;
  background: #FFF6EC;
  box-shadow: 0 5px 0 #EAD3C0;
}
.btn-hint { color: #C47A3A; min-width: 64px; }
.btn-bid { min-width: 58px; }
.btn-go:active, .btn-no:active, .btn-hint:active, .btn-bid:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(180,90,30,.25); }
.btn-go:disabled, .btn-no:disabled, .btn-bid:disabled { opacity: .4; transform: none; }
.clock {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #FFD18A, #FF8A3D 60%, #F07020);
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 0 #E06A20, inset 0 0 0 3px rgba(255,255,255,.4);
}
.clock.hot { animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

#hand-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; height: 36%;
  z-index: 5; display: flex; align-items: flex-end; justify-content: center;
}
#hand { display: flex; align-items: flex-end; justify-content: center; width: 100%; padding: 0 10px 6px; }
.pcard {
  position: relative; flex: none;
  width: 54px; height: 76px; padding: 0;
  border-radius: 8px; border: 1px solid #F0E2D4;
  background: linear-gradient(180deg, #fff, #FFF8F2);
  box-shadow: 0 4px 0 rgba(120,60,20,.08), 0 8px 14px rgba(80,40,10,.12);
  color: #222;
}
.pcard.red { color: #E23B3B; }
.pcard.black { color: #2A2A2A; }
.pcard .tl { position: absolute; left: 4px; top: 3px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pcard .tl b { font-size: 14px; }
.pcard .tl b.two { font-size: 12px; letter-spacing: -.04em; }
.pcard .tl svg { width: 12px; height: 12px; }
.pcard .mid { position: absolute; right: 5px; bottom: 5px; }
.pcard .mid svg { width: 22px; height: 22px; }
.pcard .j {
  position: absolute; inset: 0; display: grid; place-items: center;
  writing-mode: vertical-rl; font-weight: 900; letter-spacing: 2px; font-size: 15px;
}
.pcard.joker { background: linear-gradient(180deg, #fff, #FFE6C2); color: #F08A2A; }
.pcard.joker.big { background: linear-gradient(180deg, #fff, #FFD9D9); color: #E23B3B; }
.pcard.on { transform: translateY(-14px); box-shadow: 0 10px 16px rgba(80,40,10,.16), 0 0 0 2px #FF8A3D; }
.pcard.fresh { box-shadow: 0 4px 0 rgba(120,60,20,.08), 0 0 0 2px #FF8A3D; }
.pcard.on.fresh { box-shadow: 0 10px 16px rgba(80,40,10,.16), 0 0 0 2px #FF8A3D; }
.pcard.mini {
  width: 32px; height: 46px; border-radius: 5px; margin-left: -14px; pointer-events: none;
}
.mini-row .pcard.mini:first-child { margin-left: 0; }
.pcard.mini .tl b { font-size: 11px; }
.pcard.mini .tl svg, .pcard.mini .mid svg { width: 11px; height: 11px; }
.pcard.mini .j { font-size: 11px; letter-spacing: 0; }
.bottom-cards .pcard.mini { width: 28px; height: 40px; margin-left: -8px; }

.end {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(90, 42, 12, .28);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.end-card {
  width: min(420px, 100%);
  background: #FFF8F1;
  border-radius: 24px;
  padding: 18px 18px 16px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(80,30,0,.22);
}
.end-card h2 { margin: 2px 0 6px; font-size: 28px; }
.end-detail { margin: 0; color: #A56A45; font-size: 13px; }
.end-delta { margin: 10px 0 0; font-size: 32px; font-weight: 800; }
.end-delta.plus { color: #F07A1A; }
.end-delta.minus { color: #8A5340; }
.end-sub { margin: 0 0 10px; color: #A56A45; font-size: 13px; }
.end-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.linkish {
  margin-top: 8px; background: transparent; border: 0; color: #C47A3A;
  font-weight: 700; font-size: 13px; padding: 8px;
}

.panel { height: 100%; overflow: auto; padding: 8px 16px 16px; }
.panel-card {
  background: rgba(255,250,244,.94);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(160,80,20,.1);
  border: 1px solid rgba(255,255,255,.7);
}
.hero-card, .reward-card, .me-card { text-align: center; margin-bottom: 12px; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rule { text-align: left; }
.rule h3, .pop-card h3, .me-card h3 { margin: 0 0 6px; font-size: 16px; }
.rule p, .hint, .lead { margin: 0; color: #A56A45; font-size: 13px; line-height: 1.5; }
.reward-card .gift, .avatar {
  width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #FFB067, #FF8A3D);
  box-shadow: 0 6px 0 #E06A20;
}
.reward-card .gift .mp-icon, .avatar .mp-icon { width: 32px; height: 32px; }
.plus-num { margin: 4px 0; font-size: 40px; font-weight: 800; color: #FF8A3D; }
.nick-label { display: block; font-size: 12px; font-weight: 800; color: #C47A3A; margin-bottom: 6px; }
#nick {
  width: min(280px, 100%); height: 46px; border-radius: 14px;
  border: 1px solid #F0D7C4; background: #fff; color: #6B3A1F;
  text-align: center; font-size: 18px; font-weight: 800;
  box-shadow: inset 0 2px 0 rgba(180,100,40,.04);
}
.hint { margin-top: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; }
.stat span { display: block; font-size: 12px; color: #A56A45; }
.stat b { display: block; margin-top: 4px; font-size: 22px; color: #7A3E16; }

.back-table {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%);
  z-index: 7; border: 0; color: #fff; font-weight: 800;
  background: #FF8A3D; border-radius: 999px; padding: 10px 16px;
  box-shadow: 0 5px 0 #E06A20;
}

.tabbar {
  height: 58px; flex: none;
  display: flex; align-items: stretch;
  background: rgba(255,248,242,.96);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 16px rgba(160,80,20,.08);
}
.tab {
  flex: 1; border: 0; background: transparent; color: #C8B09A;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 700;
}
.tab .mp-icon { width: 22px; height: 22px; }
.tab.on { color: #FF8A3D; }
.tab.on span { box-shadow: inset 0 -2px 0 #FF8A3D; }

.toast {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
  z-index: 40; background: rgba(70,36,16,.88); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
}

.pop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; }
.pop-mask { position: absolute; inset: 0; border: 0; background: rgba(80,40,10,.28); }
.pop-card {
  position: relative; z-index: 1; width: min(360px, calc(100% - 32px));
  background: #FFF8F1; border-radius: 22px; padding: 18px 16px 16px; text-align: center;
  box-shadow: 0 16px 40px rgba(80,30,0,.2);
}
.set-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-weight: 700; }
.switch {
  min-width: 72px; height: 36px; border-radius: 999px; font-weight: 800;
  background: #FFE1C7; color: #C47A3A;
}
.switch.on { background: #FF8A3D; color: #fff; }

.portrait-lock {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: #FFE4C4; color: #7A3E16;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 24px; font-weight: 800;
}
.portrait-lock .mp-icon { width: 48px; height: 48px; color: #FF8A3D; }

@media (orientation: portrait) {
  .portrait-lock { display: flex; }
}
@media (max-width: 820px) {
  .ad-btn small { display: none; }
  .brand strong { font-size: 14px; }
}
@media (max-height: 430px) {
  .topbar { height: 44px; }
  .tabbar { height: 50px; }
  .cat-svg { width: 92px; height: 84px; }
  .cat { width: 108px; }
  .cat-top { width: 120px; }
  .arch { display: none; }
  .pcard { width: 46px; height: 64px; }
  .hero h2 { font-size: 26px; }
  .btn-go, .btn-no, .btn-hint, .btn-bid { height: 40px; font-size: 15px; }
  .clock { width: 40px; height: 40px; font-size: 15px; }
  .rule-grid { grid-template-columns: 1fr; }
}
@media (min-height: 640px) {
  .pcard { width: 64px; height: 90px; }
  .cat-svg { width: 140px; height: 128px; }
}
