:root {
  color-scheme: dark;
  font-family: "STKaiti", "KaiTi", "PingFang SC", system-ui, sans-serif;
  color: #fff8dc;
  background: #06131b;
  --gold: #ffd86e;
  --gold2: #b66b19;
  --jade: #55efc4;
  --deep: #03131c;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; overflow-x: hidden; }
body { min-height: 100vh; background: #06131b; }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.game-shell { position: relative; min-height: 100vh; overflow: hidden; isolation: isolate; }

/* 手游开屏 */
.splash-screen {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #07131b url('/assets/login-splash-v2.png') center center / cover no-repeat;
}
.splash-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 8, 16, .22), transparent 25%, transparent 66%, rgba(0, 7, 13, .8)),
    radial-gradient(ellipse at 50% 25%, rgba(2, 16, 26, .52), transparent 33%),
    radial-gradient(ellipse at 50% 58%, transparent 28%, rgba(0, 4, 10, .2) 78%);
}
.splash-screen::before,
.splash-screen::after {
  content: '';
  position: absolute;
  z-index: 1;
  width: 32vw;
  height: 32vw;
  border: 1px solid rgba(255, 215, 98, .16);
  border-radius: 50%;
  animation: rune-spin 28s linear infinite;
}
.splash-screen::before { left: -18vw; top: -19vw; box-shadow: 0 0 70px rgba(43, 235, 197, .18), inset 0 0 60px rgba(43, 235, 197, .08); }
.splash-screen::after { right: -19vw; bottom: -20vw; animation-direction: reverse; box-shadow: 0 0 70px rgba(255, 99, 37, .17), inset 0 0 60px rgba(255, 99, 37, .08); }
@keyframes rune-spin { to { transform: rotate(360deg); } }

.game-logo {
  position: absolute;
  z-index: 3;
  top: clamp(22px, 5.5vh, 66px);
  left: 50%;
  width: min(550px, 58vw);
  transform: translateX(-50%);
  text-align: center;
  filter: drop-shadow(0 7px 10px #000) drop-shadow(0 0 18px rgba(255, 198, 68, .22));
}
.logo-stars { display: block; color: #ffe485; letter-spacing: .42em; font-size: clamp(8px, 1vw, 14px); text-shadow: 0 0 9px #f1b229; }
.logo-ribbon { position: relative; display: inline-block; margin-top: 7px; padding: 3px 26px; color: #8df4dd; border-block: 1px solid rgba(113, 238, 210, .34); font: 700 clamp(7px, .7vw, 10px) system-ui; letter-spacing: .45em; }
.game-logo h1 { margin: -2px 0 0; line-height: .96; white-space: nowrap; }
.game-logo h1 i,
.game-logo h1 b { font-style: normal; font-size: clamp(52px, 7.2vw, 108px); font-weight: 900; letter-spacing: .03em; -webkit-text-stroke: 1px #693c09; }
.game-logo h1 i { color: #fff3b1; text-shadow: 0 3px 0 #d99d2d, 0 7px 0 #74420d, 0 11px 16px #000; }
.game-logo h1 b { margin-left: .12em; color: #ffcf58; text-shadow: 0 3px 0 #c07819, 0 7px 0 #633207, 0 11px 16px #000; }
.game-logo p { display: inline-block; margin: 13px 0 0; padding: 6px 30px; color: #fff4c5; background: linear-gradient(90deg, transparent, rgba(2, 22, 28, .78), transparent); font-weight: 900; font-size: clamp(11px, 1.1vw, 16px); letter-spacing: .45em; text-shadow: 0 2px 4px #000; }

.splash-entry { position: absolute; z-index: 4; left: 50%; bottom: clamp(52px, 8vh, 90px); width: min(560px, 82vw); transform: translateX(-50%); text-align: center; }
.start-button {
  position: relative;
  width: min(430px, 72vw);
  height: clamp(72px, 9vh, 90px);
  overflow: hidden;
  border: 2px solid #fff0a1;
  border-radius: 50%;
  color: #522900;
  cursor: pointer;
  background: linear-gradient(180deg, #fff6bd 0%, #ffd76a 38%, #e89a2f 65%, #a84c0c 100%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.8), inset 0 -6px 9px rgba(99, 37, 2, .45), 0 0 0 5px rgba(83, 40, 4, .62), 0 0 0 7px rgba(255, 215, 99, .55), 0 10px 28px rgba(0,0,0,.7), 0 0 34px rgba(255, 185, 44, .55);
  animation: start-pulse 1.7s ease-in-out infinite;
}
.start-button::before,
.start-button::after { content: '◆'; position: absolute; top: 50%; transform: translateY(-50%); color: #8c4e0c; font-size: 18px; }
.start-button::before { left: 32px; }
.start-button::after { right: 32px; }
.start-button b { position: relative; z-index: 1; display: block; font-size: clamp(24px, 2.4vw, 34px); line-height: 1; letter-spacing: .3em; padding-left: .3em; text-shadow: 0 1px #fff6c3; }
.start-button small { position: relative; z-index: 1; display: block; margin-top: 5px; font: 800 8px system-ui; letter-spacing: .48em; opacity: .65; }
.start-flare { position: absolute; inset: -30% auto -30% -20%; width: 22%; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: flare 2.6s linear infinite; }
@keyframes flare { 0%, 45% { left: -25%; } 80%, 100% { left: 115%; } }
@keyframes start-pulse { 50% { transform: scale(1.025); box-shadow: inset 0 3px 0 rgba(255,255,255,.8), inset 0 -6px 9px rgba(99,37,2,.45), 0 0 0 5px rgba(83,40,4,.62), 0 0 0 7px rgba(255,215,99,.72), 0 10px 28px rgba(0,0,0,.7), 0 0 50px rgba(255,185,44,.8); } }
.server-line { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; color: #eafaf5; font: 12px system-ui; text-shadow: 0 2px 3px #000; }
.server-line i { width: 8px; height: 8px; border-radius: 50%; background: #51f491; box-shadow: 0 0 9px #51f491; }
.server-line button { margin-left: 12px; border: 0; color: #ffe295; background: transparent; cursor: pointer; }
.splash-corner { position: absolute; z-index: 4; bottom: 16px; color: rgba(227, 244, 238, .63); font: 9px system-ui; letter-spacing: .08em; text-shadow: 0 1px 3px #000; }
.left-corner { left: 22px; }
.right-corner { right: 22px; }
.spark { position: absolute; z-index: 2; width: 4px; height: 4px; border-radius: 50%; background: #fff1a0; box-shadow: 0 0 12px 5px rgba(255, 212, 88, .5); animation: drift 5s ease-in-out infinite; }
.spark-one { left: 35%; bottom: 27%; }
.spark-two { left: 63%; bottom: 35%; animation-delay: -2s; }
.spark-three { left: 52%; bottom: 53%; animation-delay: -3.5s; }
@keyframes drift { 50% { transform: translate(12px, -28px) scale(.55); opacity: .45; } }

/* 游戏登录弹窗 */
.auth-dialog, .game-dialog { padding: 0; border: 0; color: #fff3c2; background: transparent; overflow: visible; }
.auth-dialog { width: min(500px, calc(100vw - 28px)); }
.auth-dialog::backdrop, .game-dialog::backdrop { background: rgba(0, 5, 10, .76); backdrop-filter: blur(8px) saturate(.75); }
.auth-frame, .dialog-frame {
  position: relative;
  padding: 30px 36px 24px;
  border: 2px solid #e6b84c;
  border-radius: 8px 34px 8px 34px;
  background: linear-gradient(145deg, rgba(14, 74, 72, .98), rgba(2, 19, 29, .99) 60%, rgba(28, 17, 12, .99));
  box-shadow: inset 0 0 0 4px rgba(5, 30, 34, .8), inset 0 0 0 5px rgba(255, 222, 124, .15), inset 0 0 52px rgba(63, 213, 174, .08), 0 25px 80px #000, 0 0 28px rgba(255, 197, 58, .2);
}
.auth-frame::before, .auth-frame::after, .dialog-frame::before, .dialog-frame::after { content: '◆'; position: absolute; color: #ffdd77; font-size: 18px; text-shadow: 0 0 8px #ebb33b; }
.auth-frame::before, .dialog-frame::before { top: -11px; left: 20px; }
.auth-frame::after, .dialog-frame::after { right: 20px; bottom: -11px; }
.dialog-close { position: absolute; z-index: 2; top: -16px; right: -16px; width: 38px; height: 38px; border: 2px solid #f0ce71; border-radius: 50%; color: #ffefb4; background: radial-gradient(circle, #185d5e, #05232d 72%); cursor: pointer; box-shadow: 0 5px 12px #000; font: 23px system-ui; }
.auth-title, .dialog-title { display: flex; justify-content: center; align-items: center; gap: 15px; }
.auth-title h2, .dialog-title h2 { margin: 0; color: #ffe89b; font-size: 25px; letter-spacing: .12em; text-shadow: 0 2px 0 #6e3e06, 0 4px 8px #000; }
.auth-title span, .dialog-title span { color: #f5c94f; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 18px; padding: 4px; border: 1px solid rgba(95, 231, 197, .22); border-radius: 25px; background: rgba(0, 7, 13, .62); }
.auth-tabs button { padding: 10px; border: 0; border-radius: 20px; color: #76aaa2; background: transparent; cursor: pointer; }
.auth-tabs button.active { color: #4f2a02; background: linear-gradient(#fff1a9, #d8952b); box-shadow: inset 0 1px #fff, 0 3px 8px #000; font-weight: 900; }
.auth-frame label { display: grid; grid-template-columns: 48px 1fr; align-items: center; margin: 12px 0; overflow: hidden; border: 1px solid rgba(100, 224, 198, .28); border-radius: 7px; background: rgba(0, 11, 18, .72); box-shadow: inset 0 0 14px rgba(63, 216, 187, .05); }
.auth-frame label span { display: grid; place-items: center; width: 48px; height: 46px; color: #f7d579; border-right: 1px solid rgba(100,224,198,.2); background: rgba(30, 102, 94, .15); font-weight: 900; }
.auth-frame input { min-width: 0; padding: 13px 12px; border: 0; outline: 0; color: white; background: transparent; }
.auth-frame input::placeholder { color: #5c827d; }
.primary-game-button { position: relative; width: 100%; margin-top: 10px; padding: 11px; border: 2px solid #fff0a0; border-radius: 50%; color: #4d2701; cursor: pointer; background: linear-gradient(#fff2a5, #f0b13b 55%, #b86116); box-shadow: inset 0 2px #fff8c6, inset 0 -4px rgba(99, 38, 2, .38), 0 6px 16px #000, 0 0 17px rgba(255, 190, 50, .24); }
.primary-game-button b, .primary-game-button small { display: block; }
.primary-game-button b { font-size: 18px; letter-spacing: .3em; padding-left: .3em; }
.primary-game-button small { margin-top: 2px; font: 8px system-ui; letter-spacing: .35em; opacity: .65; }
.primary-game-button:disabled { filter: grayscale(.7); cursor: wait; }
.login-tip { margin: 16px 0 0; text-align: center; color: #638d87; font: 10px system-ui; }

/* 真正游戏化的大厅 */
.lobby { position: relative; width: 100vw; min-height: 100svh; overflow: hidden; background: #07151c url('/assets/lobby-bg.png') center / cover fixed no-repeat; }
.lobby-sky { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 9, 17, .35), transparent 35%, rgba(0, 9, 14, .12) 64%, rgba(0, 7, 12, .76)), radial-gradient(ellipse at 50% 48%, rgba(14, 139, 119, .08), rgba(0, 8, 14, .56) 78%); }
.lobby-hud { position: relative; z-index: 5; height: 82px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 24px; background: linear-gradient(180deg, rgba(1, 10, 18, .94), rgba(4, 28, 34, .66) 74%, transparent); filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)); }
.player-card { display: flex; align-items: center; gap: 10px; justify-self: start; padding: 5px 18px 5px 5px; border: 1px solid rgba(255, 221, 127, .36); border-radius: 34px 9px 9px 34px; background: linear-gradient(90deg, rgba(8, 67, 67, .95), rgba(2, 24, 31, .88)); }
.avatar { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid #f7cf63; border-radius: 50%; color: #fff2a7; background: radial-gradient(circle at 35% 25%, #35c5a4, #075362 70%); box-shadow: 0 0 12px rgba(65, 228, 190, .36); font-size: 25px; font-weight: 900; }
.avatar i { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border: 2px solid #06232a; border-radius: 50%; background: #5cf28a; box-shadow: 0 0 8px #5cf28a; }
.player-meta strong, .player-meta small { display: block; }
.player-meta strong { max-width: 145px; overflow: hidden; color: #fff0bb; text-overflow: ellipsis; white-space: nowrap; }
.player-meta small { margin-top: 3px; color: #7ca69f; font: 9px system-ui; }
.hud-title { text-align: center; filter: drop-shadow(0 3px 4px #000); }
.hud-title span, .hud-title b, .hud-title small { display: block; }
.hud-title span { color: #e8bc4c; font-size: 8px; letter-spacing: .45em; }
.hud-title b { color: #ffe7a1; font-size: 23px; letter-spacing: .16em; text-shadow: 0 2px 0 #66400d; }
.hud-title small { color: #65b5a5; font: 7px system-ui; letter-spacing: .52em; }
.hud-wallets { display: flex; justify-self: end; align-items: center; gap: 9px; }
.currency-pill { min-width: 150px; height: 38px; display: flex; align-items: center; gap: 7px; padding: 3px 4px 3px 8px; border: 1px solid #b98532; border-radius: 22px; color: #ffedab; background: linear-gradient(#443113, #17170e); cursor: pointer; box-shadow: inset 0 0 11px rgba(255,196,55,.08); }
.currency-pill > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #643a03; background: radial-gradient(circle at 35% 25%, #fff4a5, #e3a52c 60%, #90500d); box-shadow: 0 0 9px #d18e24; }
.currency-pill b { flex: 1; font: 800 14px system-ui; }
.currency-pill em { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(#61e8c3, #137c70); font: normal 900 18px system-ui; }
.hud-icon { position: relative; width: 40px; height: 40px; border: 1px solid rgba(255,220,123,.5); border-radius: 50%; color: #ffe59c; background: radial-gradient(circle, #155b59, #041d28 72%); cursor: pointer; box-shadow: inset 0 0 8px rgba(255,255,255,.07); }
.hud-icon i { position: absolute; right: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: #ff5941; box-shadow: 0 0 7px #ff5941; }
.lobby-rail { position: absolute; z-index: 5; left: 16px; top: 50%; display: grid; gap: 13px; transform: translateY(-46%); }
.lobby-rail button { position: relative; width: 68px; padding: 0; border: 0; background: transparent; cursor: pointer; filter: drop-shadow(0 5px 6px rgba(0,0,0,.55)); }
.lobby-rail button span { width: 55px; height: 55px; display: grid; place-items: center; margin: auto; border: 2px solid #efd171; border-radius: 50%; color: #643705; background: radial-gradient(circle at 35% 25%, #fff2ac, #daa039 61%, #8c4a0d); box-shadow: inset 0 0 0 4px rgba(91,45,5,.22), 0 0 11px rgba(255,191,42,.3); font-size: 22px; font-weight: 900; }
.lobby-rail button b { display: block; margin-top: 2px; color: #fff0b9; font-size: 11px; text-shadow: 0 2px 3px #000; }
.lobby-rail button i { position: absolute; top: -2px; right: 3px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #ffe3a0; border-radius: 50%; color: white; background: #e64a2e; font: normal 800 10px system-ui; }
.portal-stage { position: relative; z-index: 2; width: calc(100% - 150px); min-height: calc(100svh - 160px); margin: 0 auto; padding: 3vh 1vw 96px; text-align: center; }
.season-badge { position: absolute; left: 0; top: 3vh; width: 130px; padding: 8px 5px; border: 1px solid rgba(255,213,104,.45); border-radius: 4px 18px 4px 18px; background: linear-gradient(135deg, rgba(12, 80, 75, .86), rgba(2, 26, 35, .9)); box-shadow: 0 7px 15px rgba(0,0,0,.35); }
.season-badge span, .season-badge b { display: block; }
.season-badge span { color: #77d5c1; font: 7px system-ui; letter-spacing: .22em; }
.season-badge b { margin-top: 3px; color: #ffe4a2; font-size: 13px; }
.stage-heading { display: flex; justify-content: center; align-items: center; gap: 15px; filter: drop-shadow(0 3px 6px #000); }
.stage-heading i { width: min(10vw, 150px); height: 1px; background: linear-gradient(90deg, transparent, #e9bd59); }
.stage-heading i:last-child { transform: scaleX(-1); }
.stage-heading small, .stage-heading h2 { display: block; margin: 0; }
.stage-heading small { color: #70c7b5; font-size: 9px; letter-spacing: .45em; }
.stage-heading h2 { color: #ffe7a0; font-size: clamp(29px, 3vw, 42px); letter-spacing: .18em; padding-left: .18em; text-shadow: 0 2px 0 #70450e; }
.game-portals { min-height: 435px; display: flex; justify-content: center; align-items: center; gap: clamp(10px, 1.5vw, 28px); margin-top: 1vh; perspective: 1100px; }
.game-portal { position: relative; width: clamp(145px, 16vw, 225px); transform: translateY(10px) scale(.9); transition: transform .24s ease, filter .24s ease; filter: drop-shadow(0 14px 12px rgba(0,0,0,.55)); }
.game-portal:nth-child(2), .game-portal:nth-child(4) { transform: translateY(28px) scale(.82); }
.game-portal:nth-child(3), .game-portal:nth-child(5) { transform: translateY(46px) scale(.74); }
.game-portal:hover, .game-portal.featured { z-index: 2; transform: translateY(-3px) scale(1.03); }
.portal-halo { position: relative; width: 100%; aspect-ratio: .82; padding: 8px; overflow: visible; border: 3px solid #e7bd55; border-radius: 48% 48% 16% 16%; background: linear-gradient(145deg, #45c7a2, #074b55 52%, #ca8725); box-shadow: inset 0 0 0 4px #062e37, inset 0 0 0 6px rgba(255,229,145,.32), inset 0 0 26px rgba(104,251,213,.24), 0 0 24px rgba(38,209,174,.2); }
.portal-halo::before { content: ''; position: absolute; z-index: -1; inset: -16px; border: 1px solid rgba(255,217,107,.38); border-radius: 50%; animation: rune-spin 18s linear infinite; }
.portal-halo::after { content: '◆'; position: absolute; left: 50%; top: -18px; width: 32px; height: 32px; display: grid; place-items: center; transform: translateX(-50%) rotate(45deg); border: 1px solid #ffe498; color: #ffe16f; background: #0b5d5c; box-shadow: 0 0 14px rgba(62,232,192,.4); font-size: 10px; }
.portal-halo img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 46% 46% 13% 13%; box-shadow: inset 0 0 22px #000; }
.portal-seal { position: absolute; right: -10px; top: 24px; width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid #ffe6a0; border-radius: 50%; color: #fff3bf; background: radial-gradient(circle, #ec6940, #9a251c 72%); box-shadow: 0 4px 8px #000; font-weight: 900; }
.portal-info { position: relative; z-index: 2; width: 92%; margin: -35px auto 0; padding: 34px 8px 10px; border: 1px solid #d8a643; border-radius: 8px 8px 28px 28px; background: linear-gradient(180deg, rgba(8, 65, 64, .96), rgba(2, 22, 31, .98)); box-shadow: inset 0 0 16px rgba(68, 222, 184, .1), 0 8px 15px rgba(0,0,0,.5); }
.portal-info h3 { margin: 0; overflow: hidden; color: #ffecad; font-size: clamp(17px, 1.6vw, 23px); text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 3px #000; }
.portal-info p { height: 28px; margin: 3px 0 8px; overflow: hidden; color: #79aaa1; font: 9px/1.5 system-ui; }
.portal-info button { min-width: 110px; padding: 7px 15px; border: 1px solid #fff0a5; border-radius: 20px; color: #4b2903; background: linear-gradient(#fff0a0, #db962a); cursor: pointer; box-shadow: inset 0 1px white, 0 3px 8px #000; }
.portal-info button b { font-size: 12px; letter-spacing: .12em; }
.portal-info button span { margin-left: 8px; }
.game-portal.locked { filter: grayscale(.65) brightness(.66) drop-shadow(0 12px 10px rgba(0,0,0,.48)); }
.game-portal.locked .portal-halo::before { animation: none; }
.game-portal.locked button { color: #9eb3ad; border-color: rgba(255,255,255,.2); background: #122c31; cursor: not-allowed; }
.stage-tip { margin: -5px 0 0; color: #8ab5ac; font-size: 11px; letter-spacing: .12em; text-shadow: 0 2px 3px #000; }
.stage-tip span { color: #e7bd55; }
.lobby-dock { position: fixed; z-index: 6; left: 50%; bottom: 12px; display: flex; transform: translateX(-50%); padding: 5px 12px; border: 1px solid rgba(255,221,127,.45); border-radius: 36px 36px 12px 12px; background: linear-gradient(180deg, rgba(14, 67, 67, .96), rgba(2, 18, 27, .98)); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.62); }
.lobby-dock button { min-width: 110px; padding: 5px 15px; border: 0; border-right: 1px solid rgba(255,255,255,.08); color: #6f9c94; background: transparent; cursor: pointer; }
.lobby-dock button:last-child { border: 0; }
.lobby-dock span, .lobby-dock b { display: block; }
.lobby-dock span { font-size: 20px; }
.lobby-dock b { margin-top: 2px; font-size: 10px; }
.lobby-dock .active, .lobby-dock button:hover { color: #ffe39a; text-shadow: 0 0 9px rgba(255,207,61,.5); }

/* 通用弹层 */
.game-dialog { width: min(640px, calc(100% - 30px)); }
.dialog-frame { padding: 25px; }
.wallet-total { margin: 20px 0 10px; padding: 15px; text-align: center; border: 1px solid rgba(255,216,109,.25); border-radius: 15px; background: rgba(1,16,22,.55); }
.wallet-total small, .wallet-total strong { display: block; }
.wallet-total small { color: #76a49b; }
.wallet-total strong { margin-top: 5px; color: var(--gold); font: 900 36px system-ui; }
.ledger { max-height: 340px; overflow: auto; }
.ledger-row { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 13px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ledger-row time { color: #648d86; font: 11px system-ui; }
.ledger-row strong { font: 900 16px system-ui; }
.credit { color: #73f0bd; }
.debit { color: #ff9f7d; }
#message { position: fixed; z-index: 30; left: 50%; bottom: 88px; max-width: 80%; padding: 10px 22px; transform: translateX(-50%); border: 1px solid rgba(255,228,153,.5); border-radius: 23px; color: #fff3c6; background: rgba(3,35,40,.96); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#message:empty { display: none; }
#message.error { border-color: #ff8b6b; background: rgba(91,27,25,.96); }

/* 内置麻将联调场 */
.demo-game { position: relative; min-height: 100vh; overflow: hidden; background: #06151c url('/assets/lobby-bg.png') center / cover fixed no-repeat; }
.demo-game::before { content: ''; position: absolute; inset: 0; background: rgba(0,9,15,.48); }
.demo-hud { position: relative; z-index: 2; height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 22px; background: linear-gradient(180deg,rgba(2,14,21,.94),rgba(4,30,35,.55),transparent); }
.hud-button { justify-self: start; padding: 9px 16px; border: 1px solid rgba(255,220,137,.38); border-radius: 20px; color: #ffe6a0; background: rgba(4,36,42,.82); cursor: pointer; }
.room-title { text-align: center; }
.room-title small, .room-title strong { display: block; }
.room-title small { color: #67cdb5; font-size: 11px; letter-spacing: .22em; }
.room-title strong { color: #ffeab0; font-size: 21px; text-shadow: 0 2px 5px #000; }
.hud-wallet { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 110px; padding: 7px 14px; border: 1px solid rgba(255,213,91,.4); border-radius: 22px; background: rgba(40,30,10,.72); }
.hud-wallet span { color: var(--gold); }
.hud-wallet b { font: 900 16px system-ui; }
.mahjong-table { position: absolute; left: 50%; top: 50%; width: min(76vw,980px); aspect-ratio: 1.65; transform: translate(-50%,-47%); border: 9px solid #875018; border-radius: 34%; background: radial-gradient(circle,#118a74 0%,#08625e 45%,#053b43 100%); box-shadow: inset 0 0 0 5px #e0ad53,inset 0 0 55px rgba(0,0,0,.55),0 22px 50px rgba(0,0,0,.62); }
.mahjong-table::before { content: ''; position: absolute; inset: 26px; border: 1px solid rgba(255,231,160,.18); border-radius: 33%; }
.table-glow { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle,rgba(95,255,210,.2),transparent 66%); }
.table-center { position: absolute; left: 50%; top: 45%; width: 118px; height: 118px; display: grid; place-items: center; align-content: center; transform: translate(-50%,-50%); border: 2px solid rgba(255,218,113,.55); border-radius: 20px; background: linear-gradient(145deg,#123e46,#06252f); box-shadow: inset 0 0 22px rgba(92,231,193,.13),0 8px 16px rgba(0,0,0,.4); }
.table-center small { color: #7eaaa1; }
.table-center strong { color: #ffe08a; font: 900 35px system-ui; }
.wind { position: absolute; right: -12px; bottom: -12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #4f2c03; background: linear-gradient(#fff0a2,#d9982f); font-weight: 900; }
.seat { position: absolute; display: flex; align-items: center; gap: 8px; color: #97beb6; font-size: 12px; }
.seat span { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #d9a647; border-radius: 50%; color: #ffe8a6; background: #0b4248; font-size: 19px; }
.seat-top { left: 50%; top: 4%; transform: translateX(-50%); }
.seat-left { left: 3%; top: 45%; transform: rotate(90deg); }
.seat-right { right: 3%; top: 45%; transform: rotate(-90deg); }
.tile-wall { position: absolute; color: #f7e7bc; letter-spacing: -2px; text-shadow: 0 3px 0 #98702f,0 5px 5px #000; white-space: nowrap; }
.tile-wall-top { left: 50%; top: 18%; transform: translateX(-50%); }
.tile-wall-left { left: 17%; top: 46%; transform: rotate(90deg); }
.tile-wall-right { right: 17%; top: 46%; transform: rotate(90deg); }
.self-seat { position: absolute; left: 7%; bottom: 3%; display: flex; align-items: center; gap: 8px; }
.self-avatar { width: 50px; height: 50px; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 50%; color: #fff1b7; background: radial-gradient(circle,#29b598,#07566a); font-size: 24px; font-weight: 900; }
.self-seat strong, .self-seat small { display: block; }
.self-seat strong { max-width: 160px; overflow: hidden; color: white; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.self-seat small { color: #7ca69f; font-size: 10px; }
.hand-tiles { position: absolute; left: 50%; bottom: 3%; display: flex; align-items: flex-end; gap: 3px; transform: translateX(-42%); }
.hand-tiles span { width: clamp(34px,4vw,51px); height: clamp(48px,5.8vw,72px); display: grid; place-items: center; border: 2px solid #d9c48f; border-radius: 6px; color: #075647; background: linear-gradient(105deg,#fffbe6,#e4d9b8); box-shadow: inset -3px -4px rgba(85,112,80,.18),0 5px 5px rgba(0,0,0,.42); font-size: clamp(9px,1vw,13px); font-weight: 900; writing-mode: vertical-rl; }
.hand-tiles span:nth-child(3n) { color: #b43b2e; }
.hand-tiles span.drawn { margin-left: 12px; transform: translateY(-8px); color: #147e58; }
.demo-actions { position: fixed; right: 4vw; bottom: 22px; display: flex; gap: 13px; }
.demo-actions button { min-width: 108px; padding: 8px 15px; border: 2px solid #ffe49a; border-radius: 50%; aspect-ratio: 1; cursor: pointer; box-shadow: inset 0 2px rgba(255,255,255,.5),0 8px 18px rgba(0,0,0,.45); }
.demo-actions span, .demo-actions small { display: block; }
.demo-actions span { font-size: 30px; font-weight: 900; }
.demo-actions small { font: 9px system-ui; opacity: .76; }
.action-pass { color: #18423b; background: radial-gradient(circle at 35% 25%,#d8fff0,#5ac6a8 62%,#197b70); }
.action-win { color: #623505; background: radial-gradient(circle at 35% 25%,#fff4ac,#efa93d 62%,#b85e1f); }
#gameMessage { position: fixed; left: 50%; bottom: 24px; margin: 0; padding: 8px 20px; transform: translateX(-50%); border-radius: 18px; color: #fff2c2; background: rgba(0,16,22,.76); }
#gameMessage:empty { display: none; }

@media (max-width: 1050px) {
  .game-portals { gap: 5px; }
  .game-portal { width: clamp(125px, 17vw, 185px); }
  .portal-stage { width: calc(100% - 115px); margin-left: 95px; }
  .lobby-dock button { min-width: 90px; }
}
@media (max-height: 650px) and (orientation: landscape) {
  .game-logo { top: 18px; transform: translateX(-50%) scale(.78); transform-origin: top center; }
  .splash-entry { bottom: 43px; transform: translateX(-50%) scale(.82); transform-origin: bottom center; }
  .lobby-hud { height: 68px; }
  .portal-stage { padding-top: 0; }
  .game-portals { min-height: 350px; margin-top: -8px; }
  .game-portal { width: clamp(120px, 14vw, 180px); }
  .lobby-rail { transform: translateY(-43%) scale(.8); transform-origin: left center; }
  .lobby-dock { transform: translateX(-50%) scale(.82); transform-origin: bottom center; bottom: 6px; }
  .stage-tip { display: none; }
}
@media (max-width: 760px), (orientation: portrait) {
  .splash-screen { min-height: 620px; background-position: 46% center; }
  .splash-shade { background: linear-gradient(180deg,rgba(0,8,16,.28),transparent 28%,rgba(0,5,10,.25) 58%,rgba(0,5,10,.9)); }
  .game-logo { top: 35px; width: 92vw; }
  .game-logo h1 i, .game-logo h1 b { font-size: clamp(54px,16vw,78px); }
  .splash-entry { bottom: 75px; }
  .start-button { width: min(340px,82vw); }
  .splash-corner { bottom: 12px; }
  .right-corner { display: none; }
  .auth-frame { padding: 27px 20px 20px; }
  .lobby { overflow-y: auto; }
  .lobby-hud { position: sticky; top: 0; height: 68px; grid-template-columns: 1fr auto; padding: 6px 9px; }
  .hud-title { display: none; }
  .player-card { padding-right: 8px; }
  .player-meta small { display: none; }
  .currency-pill { min-width: 112px; }
  .hud-wallets .hud-icon:first-of-type { display: none; }
  .lobby-rail { position: fixed; z-index: 7; top: auto; left: 50%; bottom: 69px; display: flex; transform: translateX(-50%) scale(.72); transform-origin: bottom center; }
  .portal-stage { width: 100%; min-height: calc(100vh - 70px); margin: 0; padding: 12px 10px 165px; }
  .season-badge { position: static; margin: 0 auto 8px; }
  .game-portals { min-height: auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px 8px; margin-top: 25px; }
  .game-portal, .game-portal:nth-child(n) { width: min(43vw,205px); margin: auto; transform: none; }
  .game-portal:hover, .game-portal.featured { transform: scale(1.02); }
  .game-portal.featured { grid-column: 1 / -1; }
  .stage-tip { margin-top: 24px; }
  .lobby-dock { width: calc(100% - 12px); bottom: 5px; padding-inline: 4px; }
  .lobby-dock button { min-width: 0; flex: 1; padding-inline: 4px; }
  .lobby-dock button:nth-child(2), .lobby-dock button:nth-child(4) { display: none; }
  .mahjong-table { width: 94vw; transform: translate(-50%,-50%); }
  .seat b, .tile-wall-left, .tile-wall-right { display: none; }
  .hand-tiles { bottom: 7%; transform: translateX(-50%); }
  .self-seat { left: 2%; bottom: -22%; }
  .demo-actions { right: 10px; bottom: 82px; }
  .demo-actions button { min-width: 74px; }
}
