/* =========================================================
   欢喜棋牌 · base
   ========================================================= */
:root {
  --bg-deep: #031713;
  --bg-dark: #06231e;
  --jade-900: #07342b;
  --jade-800: #0a4438;
  --jade-700: #0e5a49;
  --jade-600: #15715b;
  --jade-500: #22896f;
  --felt: #1b8063;
  --gold-50: #fff8de;
  --gold-100: #f9e8b7;
  --gold-200: #f1d388;
  --gold-300: #e2b85e;
  --gold-400: #c99139;
  --gold-500: #a66b23;
  --gold-600: #7c4b16;
  --red-500: #c03b30;
  --red-600: #96251f;
  --red-700: #671816;
  --cream: #f6eedb;
  --cream-dim: #cfc3a9;
  --muted: #8fa99d;
  --blue: #5daddc;
  --teal: #78e0c3;
  --shadow-deep: 0 24px 60px rgba(0, 0, 0, .38);
  --font-body: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-display: "STXINGKA", "STKaiti", "KaiTi", "FangSong", serif;
  --font-kai: "STKaiti", "KaiTi", "FangSong", serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.2, 1.5, .42, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button, [role="button"], .pcard, .mj-tile, .quick-entry { touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(232, 192, 109, .35); color: #fff9e9; }
:focus-visible { outline: 2px solid rgba(245, 210, 135, .9); outline-offset: 3px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .16); }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 105, .3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 105, .48); }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.svg-sprite.icons { pointer-events: none; }
[hidden] { display: none !important; }
.disabled { opacity: .45; pointer-events: none; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

/* ---------------------------------------------------------
   Ambient background
   --------------------------------------------------------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 50% -10%, rgba(50, 128, 101, .34), transparent 62%),
    radial-gradient(ellipse 50% 50% at 12% 40%, rgba(180, 124, 45, .12), transparent 70%),
    radial-gradient(ellipse 55% 55% at 92% 42%, rgba(158, 45, 38, .12), transparent 68%),
    linear-gradient(155deg, #082b25 0%, #051e1a 46%, #031512 100%);
}
.ambient-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 90%);
}
.ambient-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 36%, rgba(0, 0, 0, .22) 100%),
    linear-gradient(to top, rgba(1, 10, 8, .6), transparent 28%);
}
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .6;
}
.glow-a { width: 620px; height: 500px; left: 22%; top: -260px; background: rgba(31, 137, 108, .38); }
.glow-b { width: 440px; height: 400px; right: -80px; top: 22%; background: rgba(224, 177, 91, .12); }
.lattice {
  position: absolute;
  width: 380px;
  height: 440px;
  top: -40px;
  opacity: .3;
  border: 1px solid rgba(218, 183, 110, .24);
  background-image:
    linear-gradient(45deg, transparent 45%, rgba(218, 183, 110, .18) 45%, rgba(218, 183, 110, .18) 46%, transparent 46%),
    linear-gradient(-45deg, transparent 45%, rgba(218, 183, 110, .18) 45%, rgba(218, 183, 110, .18) 46%, transparent 46%),
    linear-gradient(45deg, transparent 47%, rgba(218, 183, 110, .1) 47%, rgba(218, 183, 110, .1) 53%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(218, 183, 110, .1) 47%, rgba(218, 183, 110, .1) 53%, transparent 53%);
  background-size: 54px 54px, 54px 54px, 108px 108px, 108px 108px;
  mask-image: linear-gradient(135deg, #000, transparent 72%);
  border-radius: 16px;
  transform: perspective(900px) rotateY(15deg);
}
.lattice-left { left: -210px; }
.lattice-right { right: -210px; transform: perspective(900px) rotateY(-15deg) scaleX(-1); }
.cloud {
  position: absolute;
  width: 300px;
  height: 90px;
  opacity: .07;
  background: #d9e6d9;
  border-radius: 50%;
  filter: blur(20px);
}
.cloud-a { left: 7%; top: 28%; transform: scale(1.4); }
.cloud-b { right: 8%; top: 56%; transform: scale(.9); }
.mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34vh;
  opacity: .4;
  background:
    linear-gradient(to top, rgba(2, 18, 15, .9), transparent 80%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 500' preserveAspectRatio='none'%3E%3Cpath d='M0 500V350c85-20 135-90 215-98 62-7 90 24 156 13 86-15 130-126 236-121 94 4 121 94 208 98 105 5 131-96 232-86 97 9 128 97 201 108 75 11 130-40 192-23v259z' fill='%23061f1b'/%3E%3Cpath d='M0 500V407c83-6 141-50 224-38 92 13 101 53 192 40 112-16 140-72 244-53 97 18 138 70 230 55 103-17 144-64 235-43 74 17 133 33 215 19v113z' fill='%23041714'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: bottom;
}
.lantern {
  position: absolute;
  top: -10px;
  width: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: .8;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35));
  animation: lanternSway 8s ease-in-out infinite;
  transform-origin: 50% -50px;
}
.lantern-left { left: clamp(10px, 4vw, 80px); }
.lantern-right { right: clamp(8px, 3.4vw, 70px); animation-delay: -3.5s; transform: scale(.86); }
.lantern-rope { display: block; width: 2px; height: 90px; background: linear-gradient(to bottom, rgba(220, 188, 118, .1), rgba(220, 188, 118, .7)); }
.lantern-body {
  width: 72px;
  height: 82px;
  border-radius: 42% 42% 40% 40%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 219, 144, .75), transparent 19%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .09) 0 2px, transparent 2px 11px),
    linear-gradient(160deg, #b73830, #791c1b);
  border: 2px solid rgba(255, 220, 152, .36);
  box-shadow: 0 0 34px rgba(220, 92, 59, .34), inset 0 0 24px rgba(78, 8, 8, .46);
  display: grid;
  place-items: center;
  position: relative;
}
.lantern-body::before, .lantern-body::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #e5bd70, #74521e);
}
.lantern-body::before { top: -4px; }
.lantern-body::after { bottom: -4px; }
.lantern-body span { font-family: var(--font-display); font-size: 34px; color: #f5d78e; opacity: .9; text-shadow: 0 2px 0 #5b1612; }
.lantern-tail {
  display: block;
  width: 28px;
  height: 46px;
  margin-top: 4px;
  background: repeating-linear-gradient(90deg, #c94539 0 2px, transparent 2px 6px);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 50% 78%, 0 100%);
  opacity: .8;
}
.dust-layer { position: absolute; inset: 0; }
.dust {
  position: absolute;
  border-radius: 50%;
  background: #f0d68e;
  box-shadow: 0 0 8px rgba(246, 220, 142, .5);
  opacity: 0;
  animation: dustDrift linear infinite;
}

@keyframes dustDrift {
  0% { transform: translate3d(0, 20px, 0) scale(.5); opacity: 0; }
  18% { opacity: .55; }
  70% { opacity: .28; }
  100% { transform: translate3d(var(--drift, 60px), -220px, 0) scale(1); opacity: 0; }
}
@keyframes lanternSway {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}

/* ---------------------------------------------------------
   Utility type
   --------------------------------------------------------- */
.brush { font-family: var(--font-display); }
.gold-text {
  color: var(--gold-200);
  background: linear-gradient(180deg, #fff7d8 0%, #f0d184 38%, #d3a543 70%, #a96b22 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--gold-200);
  opacity: .8;
  font-size: 12px;
  transition: opacity .2s, color .2s;
}
.text-link:hover { opacity: 1; color: var(--gold-50); }
.text-link svg { width: 11px; height: 11px; }
.text-link:disabled { opacity: .35; }

/* ---------------------------------------------------------
   Currencies & icons
   --------------------------------------------------------- */
.coin-icon {
  display: inline-block;
  position: relative;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff4b6 0%, #ffd66e 26%, #e0a637 66%, #a66918 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 239, 172, .6), 0 2px 6px rgba(0, 0, 0, .28);
  flex: 0 0 auto;
}
.coin-icon::before {
  content: "";
  position: absolute;
  inset: 6.5px;
  border-radius: 1px;
  background: #8a5417;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 233, 163, .26);
}
.coin-icon i { position: absolute; top: 2px; left: 4px; width: 6px; height: 3px; border-radius: 50%; background: rgba(255, 253, 217, .75); transform: rotate(-24deg); }
.coin-icon.sm { width: 17px; height: 17px; }
.coin-icon.sm::before { inset: 5.2px; }
.coin-icon.tiny { width: 14px; height: 14px; }
.coin-icon.tiny::before { inset: 4.2px; }
.diamond-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: linear-gradient(135deg, #e9ffff 0%, #77dfe4 35%, #26a9c8 72%, #136c9a 100%);
  box-shadow: inset 0 0 0 1px rgba(236, 255, 255, .65), 0 2px 6px rgba(0, 0, 0, .25);
  flex: 0 0 auto;
}
.diamond-icon.sm { width: 13px; height: 13px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #c8d4c9;
  position: relative;
  border: 1px solid transparent;
  transition: .2s var(--ease-out);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--gold-100); background: rgba(243, 210, 137, .08); border-color: rgba(243, 210, 137, .16); }
.icon-btn .badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: linear-gradient(#e45446, #a72722);
  border-radius: 8px;
  font-size: 9px;
  line-height: 14px;
  color: #fff4e8;
  text-align: center;
  border: 1px solid #76201c;
  font-weight: 700;
}
#sound-toggle .icon-sound-off { display: none; }
body.is-muted #sound-toggle .icon-sound-on { display: none; }
body.is-muted #sound-toggle .icon-sound-off { display: block; }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.gold-btn {
  --btn-h: 44px;
  min-height: var(--btn-h);
  padding: 0 26px;
  border-radius: 10px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4c2b0b;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(180deg, #fff1b7 0%, #f4d47f 28%, #dfb459 62%, #c09038 100%);
  box-shadow: 0 4px 0 #81561c, 0 8px 20px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .75);
  border: 1px solid rgba(255, 241, 191, .65);
  transition: transform .16s var(--ease-out), box-shadow .16s, filter .2s;
  overflow: hidden;
  white-space: nowrap;
}
.gold-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, .5) 36%, transparent 50%);
  transform: translateX(-110%);
  transition: transform .6s var(--ease-out);
}
.gold-btn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 6px 0 #81561c, 0 12px 26px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .8); }
.gold-btn:hover::before { transform: translateX(110%); }
.gold-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #81561c, 0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.6); }
.gold-btn:disabled { background: linear-gradient(#8c8778, #5e5b51); color: #c4c0b2; box-shadow: 0 3px 0 #3d3b35; border-color: rgba(255,255,255,.1); filter: saturate(.3); }
.ghost-btn {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  border: 1px solid rgba(237, 204, 133, .32);
  background: rgba(7, 33, 27, .52);
  color: var(--gold-100);
  font-weight: 600;
  transition: .2s;
}
.ghost-btn:hover { border-color: rgba(237, 204, 133, .6); background: rgba(227, 190, 112, .1); }
.red-btn {
  background: linear-gradient(180deg, #ef6c56 0%, #c93b31 50%, #93221d 100%);
  color: #fff5e8;
  box-shadow: 0 4px 0 #5c1715, 0 8px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 212, 183, .35);
  border-color: rgba(255, 186, 153, .34);
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid rgba(240, 208, 140, .22);
  background: rgba(255, 255, 255, .05);
  color: var(--cream);
  font-size: 12px;
  transition: .2s;
}
.chip-btn:hover { background: rgba(240, 208, 140, .12); border-color: rgba(240, 208, 140, .4); }

/* ---------------------------------------------------------
   Panels
   --------------------------------------------------------- */
.ornate-panel {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(227, 191, 116, .24);
  background:
    linear-gradient(165deg, rgba(13, 59, 49, .92) 0%, rgba(7, 39, 33, .92) 56%, rgba(5, 29, 25, .95) 100%);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, .32),
    inset 0 1px 0 rgba(255, 243, 203, .07),
    inset 0 -24px 50px rgba(0, 0, 0, .11);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.ornate-panel::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 11px;
  pointer-events: none;
  background-image:
    linear-gradient(var(--gold-300), var(--gold-300)), linear-gradient(var(--gold-300), var(--gold-300)),
    linear-gradient(var(--gold-300), var(--gold-300)), linear-gradient(var(--gold-300), var(--gold-300)),
    linear-gradient(var(--gold-300), var(--gold-300)), linear-gradient(var(--gold-300), var(--gold-300)),
    linear-gradient(var(--gold-300), var(--gold-300)), linear-gradient(var(--gold-300), var(--gold-300));
  background-size: 15px 1px, 1px 15px, 15px 1px, 1px 15px, 15px 1px, 1px 15px, 15px 1px, 1px 15px;
  background-position:
    left top, left top, right top, right top,
    left bottom, left bottom, right bottom, right bottom;
  background-repeat: no-repeat;
  opacity: .22;
}
.panel-shine {
  position: absolute;
  pointer-events: none;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}
.panel-shine::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 500px;
  top: -290px;
  left: -80px;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 198, .045), transparent);
  transform: rotate(28deg);
}

/* ---------------------------------------------------------
   Avatars
   --------------------------------------------------------- */
.avatar,
.mini-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #285d4e, #0a2822);
  flex: 0 0 auto;
}
.avatar svg, .mini-avatar svg { width: 100%; height: 100%; object-fit: cover; }
.avatar { width: 100%; height: 100%; border-radius: inherit; }
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(241, 208, 137, .35); }
.mini-avatar.user { border-color: rgba(114, 224, 190, .5); }

/* ---------------------------------------------------------
   Modals / toast / transitions
   --------------------------------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  z-index: 900;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 12, 9, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: auto;
}
.modal {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(231, 195, 118, .4);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(58, 128, 102, .3), transparent 60%),
    linear-gradient(165deg, #0e3e33, #071f1b 78%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 246, 214, .12);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .28s var(--ease-out), transform .32s var(--ease-out);
  pointer-events: auto;
  overflow: hidden;
}
.modal.open { opacity: 1; transform: translateY(0) scale(1); }
.modal-backdrop.open { opacity: 1; }
.modal--wide { width: min(860px, calc(100vw - 32px)); }
.modal--small { width: min(420px, calc(100vw - 32px)); }
.modal-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(230, 196, 125, .13);
  flex: 0 0 auto;
}
.modal-kicker {
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(234, 205, 143, .55);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--gold-100);
}
.modal-head h3 small { font-family: var(--font-body); font-size: 11px; color: var(--muted); letter-spacing: 1px; margin-left: 10px; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(238, 219, 180, .6);
  border: 1px solid rgba(236, 208, 148, .2);
  background: rgba(255, 255, 255, .03);
  transition: .2s;
  flex: 0 0 auto;
}
.modal-close:hover { color: #fff4dc; border-color: rgba(236, 208, 148, .45); transform: rotate(90deg); }
.modal-close svg { width: 17px; height: 17px; }
.modal-body { padding: 22px 26px 26px; overflow: auto; overscroll-behavior: contain; }
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 26px 24px;
  border-top: 1px solid rgba(230, 196, 125, .1);
  flex: 0 0 auto;
}
.modal-body > p { color: var(--cream-dim); font-size: 13px; line-height: 1.85; }
.modal-note { font-size: 11px; color: var(--muted); line-height: 1.7; }

.toast-root {
  position: fixed;
  z-index: 1200;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 58, 47, .97), rgba(5, 31, 26, .97));
  border: 1px solid rgba(238, 207, 139, .35);
  color: var(--gold-100);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  animation: toastIn .35s var(--ease-out), toastOut .3s ease 2.5s forwards;
}
.toast svg { width: 16px; height: 16px; color: var(--gold-300); }
.toast.error { border-color: rgba(227, 110, 89, .5); color: #ffd6c9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

.coin-fly-layer { position: fixed; inset: 0; z-index: 1300; pointer-events: none; overflow: hidden; }
.fly-coin {
  position: fixed;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff4b6, #ffd66e 32%, #e0a637 72%, #9e6416);
  box-shadow: 0 0 10px rgba(242, 205, 114, .45);
  z-index: 1300;
}
.fly-coin::after { content: ""; position: absolute; inset: 5px; border-radius: 1px; background: rgba(108, 65, 15, .9); }

/* ---------------------------------------------------------
   Loading / scene transition
   --------------------------------------------------------- */
.scene-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(28, 98, 80, .4), transparent 55%),
    linear-gradient(160deg, #062a23, #031410);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility .45s;
}
.scene-transition.active { opacity: 1; visibility: visible; pointer-events: auto; }
.transition-inner { text-align: center; transform: translateY(8px); }
.transition-seal {
  width: 86px;
  height: 86px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid rgba(241, 210, 141, .5);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--gold-200);
  position: relative;
  animation: sealPulse 2s ease-in-out infinite;
}
.transition-seal::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px solid rgba(241, 210, 141, .15);
  border-top-color: rgba(241, 210, 141, .72);
  animation: spin 2.8s linear infinite;
}
.transition-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 6px; color: var(--gold-100); }
.transition-sub { font-size: 11px; letter-spacing: 4px; color: rgba(218, 203, 170, .55); margin-top: 10px; }
.transition-bar { width: 210px; height: 2px; margin: 26px auto 0; background: rgba(255, 255, 255, .08); overflow: hidden; border-radius: 4px; }
.transition-bar i { display: block; width: 34%; height: 100%; background: linear-gradient(90deg, transparent, var(--gold-200), transparent); animation: loadingBar 1.1s var(--ease-out) infinite; }
@keyframes loadingBar { from { transform: translateX(-110%); } to { transform: translateX(400%); } }
@keyframes sealPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(241, 210, 141, .1); } 50% { box-shadow: 0 0 50px rgba(241, 210, 141, .1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------
   Animations & motion preference
   --------------------------------------------------------- */
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(118, 225, 190, .55); } 50% { box-shadow: 0 0 0 5px rgba(118, 225, 190, 0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shine { from { transform: translateX(-120%) rotate(20deg); } to { transform: translateX(220%) rotate(20deg); } }

body.reduce-fx *,
body.reduce-fx *::before,
body.reduce-fx *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

/* =========================================================
   Landscape-only phone gate
   ========================================================= */
.rotate-device {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: max(22px, env(safe-area-inset-top)) 28px max(22px, env(safe-area-inset-bottom));
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(41, 128, 96, .35), transparent 53%),
    radial-gradient(ellipse at 50% 100%, rgba(188, 138, 57, .1), transparent 48%),
    linear-gradient(165deg, #082e25 0%, #041a15 58%, #020d0a 100%);
}
.rotate-device::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(232, 197, 124, .14);
  border-radius: 18px;
  pointer-events: none;
}
.rotate-device::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  border: 1px solid rgba(228, 190, 113, .07);
  box-shadow: 0 0 0 34px rgba(228, 190, 113, .018), 0 0 0 92px rgba(228, 190, 113, .012);
  pointer-events: none;
}
.rotate-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image:
    radial-gradient(circle at 18% 25%, rgba(239, 197, 111, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 72%, rgba(239, 197, 111, .55) 0 1px, transparent 2px),
    radial-gradient(circle at 65% 22%, rgba(93, 214, 174, .45) 0 1px, transparent 2px);
  background-size: 71px 83px, 113px 97px, 137px 121px;
}
.rotate-art {
  position: relative;
  width: 176px;
  height: 174px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.rotate-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(235, 200, 126, .18);
}
.rotate-ring.r1 { width: 154px; height: 154px; animation: rotateRing 8s linear infinite; border-style: dashed; }
.rotate-ring.r2 { width: 124px; height: 124px; border-color: rgba(235, 200, 126, .1); }
@keyframes rotateRing { to { transform: rotate(360deg); } }
.rotate-phone {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 118px;
  border-radius: 13px;
  border: 2px solid rgba(248, 221, 159, .78);
  background: linear-gradient(155deg, #0f4b3d, #08241d);
  box-shadow: 0 0 0 4px rgba(6, 28, 23, .9), 0 0 0 5px rgba(232, 195, 118, .18), 0 18px 38px rgba(0, 0, 0, .44);
  transform: rotate(-8deg);
  animation: deviceTurn 3.8s cubic-bezier(.45, 0, .25, 1) infinite;
}
.rotate-phone::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: rgba(230, 198, 132, .3);
  transform: translateX(-50%);
}
.rotate-phone i {
  position: absolute;
  inset: 15px 8px 12px;
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(64, 171, 132, .28), rgba(4, 29, 23, .7)),
    repeating-linear-gradient(45deg, rgba(233, 199, 129, .05) 0 1px, transparent 1px 13px);
  border: 1px solid rgba(229, 194, 122, .13);
}
.rotate-phone b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f0d18c;
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 500;
  text-shadow: 0 0 20px rgba(242, 200, 109, .22);
}
@keyframes deviceTurn {
  0%, 16% { transform: rotate(-8deg); }
  38%, 58% { transform: rotate(82deg); }
  80%, 100% { transform: rotate(-8deg); }
}
.rotate-arrow {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f4d79d;
  font-size: 24px;
  line-height: 1;
  background: rgba(8, 38, 30, .92);
  border: 1px solid rgba(235, 198, 122, .3);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .3);
  animation: arrowPulse 2.4s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translateY(0) rotate(0); opacity: .65; }
  50% { transform: translateY(-3px) rotate(18deg); opacity: 1; }
}
.rotate-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; max-width: 330px; }
.rotate-kicker { font-size: 8px; letter-spacing: 3.2px; color: rgba(238, 207, 141, .48); }
.rotate-copy h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(27px, 8vw, 37px);
  font-weight: 400;
  letter-spacing: 2px;
  color: #f6e1af;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 0 26px rgba(238, 197, 107, .14);
}
.rotate-copy p { margin: 10px 0 0; font-size: 11px; line-height: 1.7; color: rgba(203, 208, 185, .6); }
.rotate-copy small {
  max-width: 280px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(231, 196, 122, .12);
  font-size: 8px;
  line-height: 1.8;
  color: rgba(188, 184, 161, .36);
}
.rotate-retry {
  margin-top: 14px;
  min-height: 34px;
  padding: 0 18px;
  border-radius: 17px;
  border: 1px solid rgba(236, 200, 128, .34);
  color: #f1d69a;
  background: linear-gradient(180deg, rgba(78, 57, 24, .66), rgba(36, 28, 15, .72));
  font-size: 10px;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 244, 211, .12);
}
.rotate-retry:active { transform: translateY(1px); }
.rotate-brand {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  letter-spacing: 1px;
  color: rgba(217, 196, 153, .34);
  white-space: nowrap;
}
.rotate-brand span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(233, 198, 123, .28);
  font-family: var(--font-kai);
  font-size: 12px;
  color: rgba(244, 217, 159, .68);
  background: rgba(255, 255, 255, .025);
}
/* 首页保持竖屏；开局会先尝试自动全屏横屏。
   若系统/微信禁止网页锁定方向，则自动进入竖屏兼容牌桌，不阻塞操作。 */
body.portrait-fallback .rotate-device { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 760px) {
  .lantern { display: none; }
  .lattice { opacity: .18; }
  .modal-head { padding: 18px 18px 14px; }
  .modal-body { padding: 18px; }
  .modal-actions { padding: 14px 18px 18px; }
  .toast-root { top: 72px; }
  .toast { font-size: 12px; padding: 9px 14px; }
}
