/* ==========================================================================
   LanSpace · 私人空间
   Self-contained design system. No external fonts / images / CDN.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
    --ui-version: 14;
    --bg: #07080e;
    --ink: #eef1ff;
    --ink-2: #b8c0d6;
    --muted: #7d859c;
    --line: rgba(255, 255, 255, .085);
    --line-2: rgba(255, 255, 255, .17);
    --card: rgba(255, 255, 255, .042);
    --card-2: rgba(255, 255, 255, .075);
    --v: #8b5cf6;
    --b: #4d7cff;
    --c: #22d3ee;
    --p: #f472b6;
    --g: #34d399;
    --o: #fb923c;
    --radius: 20px;
    --ease: cubic-bezier(.22, .8, .24, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
    --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: .01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -.015em;
    font-weight: 750;
}

button, input {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
}

::selection {
    background: rgba(139, 92, 246, .4);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .22);
    background-clip: content-box;
}

/* ---------- ambient background ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(1200px 760px at 6% -12%, rgba(99, 102, 241, .26), transparent 62%),
        radial-gradient(1000px 640px at 98% 2%, rgba(34, 211, 238, .16), transparent 60%),
        radial-gradient(900px 700px at 52% 118%, rgba(244, 114, 182, .14), transparent 62%),
        #07080e;
}

.bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: .55;
    will-change: transform;
}

.bg .orb.a {
    width: 46vmax;
    height: 46vmax;
    left: -14vmax;
    top: -18vmax;
    background: radial-gradient(circle at 35% 35%, #7c3aed, transparent 68%);
    animation: drift-a 22s var(--ease) infinite alternate;
}

.bg .orb.b {
    width: 40vmax;
    height: 40vmax;
    right: -12vmax;
    top: 8vmax;
    background: radial-gradient(circle at 60% 40%, #0ea5e9, transparent 68%);
    animation: drift-b 26s var(--ease) infinite alternate;
}

.bg .orb.c {
    width: 36vmax;
    height: 36vmax;
    left: 32vmax;
    bottom: -22vmax;
    background: radial-gradient(circle at 50% 50%, #ec4899, transparent 68%);
    opacity: .38;
    animation: drift-c 30s var(--ease) infinite alternate;
}

@keyframes drift-a {
    to { transform: translate3d(9vmax, 6vmax, 0) scale(1.15) rotate(12deg); }
}

@keyframes drift-b {
    to { transform: translate3d(-8vmax, 9vmax, 0) scale(1.1) rotate(-14deg); }
}

@keyframes drift-c {
    to { transform: translate3d(-6vmax, -10vmax, 0) scale(1.2); }
}

/* fine grid + grain */
.bg .grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 78%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 78%);
    opacity: .5;
}

.bg .grain {
    position: absolute;
    inset: -50%;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 8s steps(6) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-2%, 1%); }
    40% { transform: translate(1%, -2%); }
    60% { transform: translate(-1%, 2%); }
    80% { transform: translate(2%, -1%); }
}

/* ---------- topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(8, 9, 16, .9), rgba(8, 9, 16, .55));
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
}

.topbar-in {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-right: auto;
    min-width: 0;
}

.brand-mark {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: linear-gradient(145deg, #a78bfa, #4d7cff 55%, #22d3ee);
    box-shadow:
        0 10px 24px -10px rgba(120, 90, 255, .95),
        inset 0 1px 0 rgba(255, 255, 255, .55);
    color: #0b0c14;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%);
    background-size: 260% 100%;
    animation: sheen 5.5s linear infinite;
    mix-blend-mode: overlay;
}

@keyframes sheen {
    from { background-position: 160% 0; }
    to { background-position: -60% 0; }
}

.brand-txt {
    min-width: 0;
}

.brand-txt strong {
    display: block;
    font-size: .98rem;
    font-weight: 750;
    letter-spacing: .02em;
    white-space: nowrap;
}

.brand-txt span {
    display: block;
    font-size: .64rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

/* segmented tab nav */
.seg {
    position: relative;
    display: flex;
    padding: 4px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    flex: 0 0 auto;
}

.seg-glider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(139, 92, 246, .42), rgba(77, 124, 255, .26));
    border: 1px solid rgba(167, 139, 250, .5);
    box-shadow: 0 6px 18px -8px rgba(124, 92, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: transform .48s var(--ease), width .48s var(--ease);
    pointer-events: none;
    z-index: 0;
}

.seg-btn {
    position: relative;
    z-index: 1;
    padding: 8px 18px;
    border-radius: 11px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color .3s;
}

.seg-btn:hover {
    color: var(--ink-2);
}

.seg-btn.active {
    color: #fff;
}

.icon-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink-2);
    font-size: 15px;
    transition: transform .3s var(--ease), background .3s, border-color .3s, color .3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .09);
    border-color: var(--line-2);
    color: #fff;
    transform: translateY(-1px);
}

.icon-btn.off {
    color: var(--muted);
    opacity: .65;
}

/* ---------- layout ---------- */
.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px 64px;
}

.view {
    display: none;
}

.view.on {
    display: block;
    animation: viewIn .55s var(--ease);
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(14px); filter: blur(18px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------- hero ---------- */
.hero {
    padding: 52px 0 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink-2);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--g);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
    animation: pulseDot 2.4s ease-out infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
    70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.greet {
    font-size: clamp(1.9rem, 5vw, 3.35rem);
    font-weight: 820;
    line-height: 1.08;
    letter-spacing: -.03em;
    background: linear-gradient(112deg, #fff 4%, #d6ccff 38%, #a5b4fc 58%, #8fd8ff 92%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmer 12s ease-in-out infinite alternate;
}

@keyframes shimmer {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

.hero-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    color: var(--muted);
    font-size: .88rem;
}

.hero-row .clock {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    letter-spacing: .04em;
}

.hero-row .sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--line-2);
}

/* search */
.search {
    position: relative;
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 440px;
    padding: 0 14px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    transition: border-color .3s, background .3s, box-shadow .3s;
}

.search:focus-within {
    border-color: rgba(139, 92, 246, .55);
    background: rgba(255, 255, 255, .075);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

.search svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font-size: .9rem;
    color: var(--ink);
}

.search input::placeholder {
    color: var(--muted);
}

.search .clear {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    place-items: center;
    background: rgba(255, 255, 255, .1);
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1;
}

.search .clear.show {
    display: grid;
}

/* ---------- section head ---------- */
.sec-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 34px 0 16px;
}

.sec-head h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.sec-head .count {
    font-size: .72rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
}

.sec-head .hint {
    margin-left: auto;
    font-size: .74rem;
    color: var(--muted);
}

/* ---------- link cards ---------- */
.links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(158deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .022));
    border: 1px solid var(--line);
    overflow: hidden;
    isolation: isolate;
    transition: transform .45s var(--ease), border-color .45s, box-shadow .45s;
    animation: rise .6s var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(12px); }
    60% { filter: blur(1.5px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

.link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity .45s;
    background: radial-gradient(420px 220px at 20% 0%, hsl(var(--h) 90% 64% / .18), transparent 70%);
}

.link::after {
    content: "";
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .14), transparent);
    transform: skewX(-18deg);
    transition: left .75s var(--ease);
    pointer-events: none;
}

.link:hover {
    transform: translateY(-5px);
    border-color: hsl(var(--h) 88% 72% / .4);
    box-shadow: 0 28px 54px -30px hsl(var(--h) 92% 46% / .7);
}

.link:hover::before {
    opacity: 1;
}

.link:hover::after {
    left: 125%;
}

.link:active {
    transform: translateY(-1px) scale(.99);
}

.link .tile {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: linear-gradient(150deg, hsl(var(--h) 92% 62% / .26), hsl(var(--h) 92% 55% / .05));
    border: 1px solid hsl(var(--h) 90% 72% / .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: transform .45s var(--ease-spring);
}

.link:hover .tile {
    transform: rotate(-6deg) scale(1.08);
}

.link .body h3 {
    font-size: .98rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.link .body p {
    margin-top: 4px;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.5;
}

.link .go {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 600;
    color: hsl(var(--h) 85% 78%);
    opacity: .75;
    transition: gap .35s var(--ease), opacity .35s;
}

.link:hover .go {
    gap: 10px;
    opacity: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #d9d0ff;
    background: rgba(139, 92, 246, .2);
    border: 1px solid rgba(139, 92, 246, .4);
}

.link-watermark {
    position: absolute;
    right: 2px;
    bottom: -14px;
    font-size: 86px;
    line-height: 1;
    opacity: .032;
    pointer-events: none;
    filter: grayscale(1);
    transform: rotate(-8deg);
    transition: opacity .45s, transform .55s var(--ease);
}

.link:hover .link-watermark {
    opacity: .07;
    transform: rotate(-4deg) scale(1.06);
}

/* ---------- game shelf ---------- */
.shelf {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gcard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    text-align: left;
    border-radius: 20px;
    background: linear-gradient(158deg, rgba(255, 255, 255, .072), rgba(255, 255, 255, .022));
    border: 1px solid var(--line);
    color: inherit;
    overflow: hidden;
    isolation: isolate;
    transition: transform .45s var(--ease), border-color .45s, box-shadow .45s;
    animation: rise .6s var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.gcard::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    opacity: 0;
    transition: opacity .45s;
    background: radial-gradient(360px 240px at 15% 0%, hsl(var(--h) 92% 62% / .22), transparent 72%);
}

.gcard:hover {
    transform: translateY(-6px);
    border-color: hsl(var(--h) 88% 70% / .42);
    box-shadow: 0 34px 60px -34px hsl(var(--h) 92% 45% / .8);
}

.gcard:hover::before {
    opacity: 1;
}

.gcard:active {
    transform: translateY(-2px) scale(.995);
}

.gcard .top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.gcard .tile {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: linear-gradient(150deg, hsl(var(--h) 92% 62% / .28), hsl(var(--h) 92% 55% / .05));
    border: 1px solid hsl(var(--h) 90% 72% / .3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
    transition: transform .5s var(--ease-spring);
}

.gcard:hover .tile {
    transform: translateY(-2px) rotate(-5deg) scale(1.07);
}

.gcard h3 {
    font-size: 1.05rem;
    font-weight: 750;
}

.gcard .desc {
    font-size: .79rem;
    color: var(--muted);
    line-height: 1.6;
}

.gcard .metas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.tag {
    font-size: .66rem;
    letter-spacing: .04em;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--ink-2);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
}

.gcard .play {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
}

.gcard .play span {
    font-size: .78rem;
    font-weight: 700;
    color: hsl(var(--h) 88% 78%);
}

.gcard .arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid hsl(var(--h) 90% 70% / .35);
    background: hsl(var(--h) 90% 60% / .12);
    color: hsl(var(--h) 90% 82%);
    font-size: 13px;
    transition: transform .4s var(--ease), background .4s;
}

.gcard:hover .arrow {
    transform: translateX(3px);
    background: hsl(var(--h) 90% 60% / .25);
}

.gcard .watermark {
    position: absolute;
    right: -8px;
    top: -6px;
    font-size: 82px;
    line-height: 1;
    opacity: .045;
    pointer-events: none;
    filter: grayscale(1);
    transform: rotate(9deg);
    transition: opacity .45s, transform .55s var(--ease);
}

.gcard:hover .watermark {
    opacity: .09;
    transform: rotate(13deg) scale(1.06);
}

/* 进入游戏后收起大标题，把空间让给棋盘 */
#view-games.playing .hero,
#view-games.playing .sec-head {
    display: none;
}

#view-games.playing .stage {
    padding-top: 18px;
}

/* ---------- game stage ---------- */
.stage {
    display: none;
    padding-top: 24px;
}

.stage.on {
    display: block;
    animation: stageIn .5s var(--ease);
}

@keyframes stageIn {
    from { opacity: 0; transform: translateY(20px) scale(.985); filter: blur(16px); }
    60% { filter: blur(2px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

.stage-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--ink-2);
    font-size: .82rem;
    font-weight: 600;
    transition: background .3s, transform .3s var(--ease), border-color .3s, color .3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, .085);
    border-color: var(--line-2);
    color: #fff;
    transform: translateX(-2px);
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
    min-width: 0;
}

.stage-title .em {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5));
}

.stage-title h2 {
    font-size: 1.12rem;
    font-weight: 750;
}

.stage-title p {
    font-size: .74rem;
    color: var(--muted);
}

.stage-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* buttons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--ink-2);
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    transition: background .28s, color .28s, border-color .28s, transform .2s var(--ease), box-shadow .3s;
}

.btn:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
    border-color: var(--line-2);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(.97);
}

.btn.primary {
    border-color: rgba(167, 139, 250, .55);
    background: linear-gradient(145deg, rgba(139, 92, 246, .9), rgba(77, 124, 255, .85));
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(120, 90, 255, .95);
}

.btn.primary:hover {
    box-shadow: 0 16px 32px -14px rgba(120, 90, 255, 1);
    filter: brightness(1.08);
}

.btn[disabled] {
    opacity: .4;
    pointer-events: none;
}

.btn .ico {
    font-size: 13px;
    line-height: 1;
}

/* status strip */
.hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 auto 16px;
    width: 100%;
    max-width: 620px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: color .3s, border-color .3s, background .3s;
}

.status-pill .led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--v);
    box-shadow: 0 0 8px currentColor;
    transition: background .3s;
}

.status-pill.red {
    color: #ffb4b4;
    border-color: rgba(255, 120, 120, .32);
    background: rgba(255, 90, 90, .1);
}

.status-pill.red .led {
    background: #ff6b6b;
}

.status-pill.blue {
    color: #b9d2ff;
    border-color: rgba(120, 170, 255, .32);
    background: rgba(90, 140, 255, .1);
}

.status-pill.blue .led {
    background: #6ea8ff;
}

.status-pill.good {
    color: #b8f5d8;
    border-color: rgba(52, 211, 153, .35);
    background: rgba(52, 211, 153, .1);
}

.status-pill.good .led {
    background: var(--g);
}

.status-pill.bad {
    color: #ffc9b0;
    border-color: rgba(251, 146, 60, .35);
    background: rgba(251, 146, 60, .1);
}

.status-pill.bad .led {
    background: var(--o);
}

.status-pill.win {
    animation: winPop .6s var(--ease-spring);
}

@keyframes winPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .035);
    font-size: .72rem;
    color: var(--muted);
}

.stat b {
    font-family: var(--mono);
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.hud .spacer {
    margin-left: auto;
}

.hud-stats {
    display: contents;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    margin-top: 18px;
}

.game-root {
    padding-bottom: 10px;
}

/* board frame */
.board-wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.board-frame {
    position: relative;
    width: 100%;
    border-radius: 22px;
    padding: 12px;
    background: linear-gradient(158deg, #2a211c, #171210 70%);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow:
        0 40px 70px -40px rgba(0, 0, 0, .95),
        inset 0 1px 0 rgba(255, 255, 255, .09);
}

.board-frame.dark {
    background: linear-gradient(158deg, #1b1e2b, #0c0d14 70%);
}

.board-frame canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    touch-action: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
}

/* overlay (win / pause) */
.overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(6, 7, 12, .74);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
}

.overlay.on {
    opacity: 1;
    visibility: visible;
}

.overlay-card {
    text-align: center;
    padding: 22px 30px;
    transform: scale(.9) translateY(8px);
    opacity: 0;
    filter: blur(10px);
    transition: transform .45s var(--ease-spring), opacity .35s var(--ease), filter .4s var(--ease);
}

.overlay.on .overlay-card {
    transform: none;
    opacity: 1;
    filter: blur(0);
}

.overlay-card .big {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 10px 22px rgba(124, 92, 255, .55));
}

.overlay-card h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.overlay-card p {
    font-size: .82rem;
    color: var(--ink-2);
    margin-bottom: 16px;
}

.overlay-card .btn {
    height: 40px;
}

/* footer */
.foot {
    padding: 40px 0 8px;
    text-align: center;
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .04em;
}

.foot .dotsep {
    margin: 0 8px;
    opacity: .5;
}

/* toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 90;
    transform: translate(-50%, 20px);
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(20, 22, 34, .92);
    border: 1px solid var(--line-2);
    color: var(--ink);
    font-size: .82rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    filter: blur(10px);
    transition: opacity .3s var(--ease), transform .4s var(--ease), filter .35s var(--ease);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.on {
    opacity: 1;
    transform: translate(-50%, 0);
    filter: blur(0);
}

/* ==========================================================================
   2048
   ========================================================================== */
.g2048 {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    aspect-ratio: 1;
    padding: 12px;
    border-radius: 22px;
    background: linear-gradient(158deg, #232636, #12141d 75%);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
    touch-action: none;
}

.g2048-cells {
    position: absolute;
    inset: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
}

.g2048-cells i {
    display: block;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .035);
}

.g2048-tiles {
    position: absolute;
    inset: 12px;
    pointer-events: none;
}

.t2048 {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 800;
    font-size: clamp(17px, 4.1vw, 28px);
    letter-spacing: -.02em;
    color: #2b2118;
    background: #eee4da;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 14px -8px rgba(0, 0, 0, .6);
    transition: transform .14s cubic-bezier(.32, .9, .25, 1), opacity .18s;
    will-change: transform;
    font-variant-numeric: tabular-nums;
}

.t2048.spawn {
    animation: tileIn .22s var(--ease-spring);
}

@keyframes tileIn {
    from { transform: var(--tf) scale(.35); opacity: 0; }
    to { transform: var(--tf) scale(1); opacity: 1; }
}

.t2048.merge {
    animation: tileMerge .26s var(--ease-spring);
}

@keyframes tileMerge {
    0% { transform: var(--tf) scale(1); }
    50% { transform: var(--tf) scale(1.16); }
    100% { transform: var(--tf) scale(1); }
}

.t2048[data-v="2"] { background: #efe9e2; }
.t2048[data-v="4"] { background: #ece0cb; }
.t2048[data-v="8"] { background: linear-gradient(150deg, #f6b26b, #ef8f45); color: #fff; }
.t2048[data-v="16"] { background: linear-gradient(150deg, #f78a63, #ec6a3c); color: #fff; }
.t2048[data-v="32"] { background: linear-gradient(150deg, #f96f5c, #e14b43); color: #fff; }
.t2048[data-v="64"] { background: linear-gradient(150deg, #f2564c, #cf2f36); color: #fff; }
.t2048[data-v="128"] {
    background: linear-gradient(150deg, #ffd66e, #f5b32c);
    color: #fff;
    font-size: clamp(15px, 3.6vw, 24px);
    box-shadow: 0 0 26px -6px rgba(245, 179, 44, .8), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.t2048[data-v="256"] {
    background: linear-gradient(150deg, #ffd05e, #eba217);
    color: #fff;
    font-size: clamp(15px, 3.6vw, 24px);
    box-shadow: 0 0 30px -6px rgba(235, 162, 23, .85), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.t2048[data-v="512"] {
    background: linear-gradient(150deg, #f7c85a, #de9412);
    color: #fff;
    font-size: clamp(15px, 3.6vw, 24px);
    box-shadow: 0 0 34px -6px rgba(222, 148, 18, .9), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.t2048[data-v="1024"] {
    background: linear-gradient(150deg, #a78bfa, #6d4aff);
    color: #fff;
    font-size: clamp(13px, 3.1vw, 21px);
    box-shadow: 0 0 36px -6px rgba(124, 92, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.t2048[data-v="2048"] {
    background: linear-gradient(150deg, #67e8f9, #3b82f6 60%, #8b5cf6);
    color: #fff;
    font-size: clamp(13px, 3.1vw, 21px);
    box-shadow: 0 0 44px -4px rgba(59, 130, 246, .95), inset 0 1px 0 rgba(255, 255, 255, .5);
    animation: glowPulse 2.4s ease-in-out infinite;
}
.t2048[data-v="4096"],
.t2048[data-v="8192"] {
    background: linear-gradient(150deg, #f472b6, #8b5cf6 55%, #22d3ee);
    color: #fff;
    font-size: clamp(13px, 3vw, 20px);
    box-shadow: 0 0 48px -4px rgba(244, 114, 182, .95), inset 0 1px 0 rgba(255, 255, 255, .5);
}

@keyframes glowPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

.pad {
    display: grid;
    grid-template-columns: repeat(3, 46px);
    grid-template-rows: repeat(3, 46px);
    gap: 8px;
    justify-content: center;
    margin: 18px auto 0;
}

.pad button {
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .075);
    color: var(--ink);
    font-size: 16px;
    transition: background .2s, transform .15s, border-color .2s;
}

.pad button:hover {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.pad button:active {
    transform: scale(.93);
    background: rgba(139, 92, 246, .3);
}

.pad .up { grid-area: 1 / 2; }
.pad .left { grid-area: 2 / 1; }
.pad .down { grid-area: 3 / 2; }
.pad .right { grid-area: 2 / 3; }

/* ==========================================================================
   扫雷
   ========================================================================== */
.mine-wrap {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

.mine-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    width: 100%;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(158deg, #1e2230, #12141d 75%);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mine-cell {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: linear-gradient(150deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .055));
    border: 1px solid rgba(255, 255, 255, .085);
    color: #dbe0f0;
    font-weight: 800;
    font-size: clamp(10px, 2.4vw, 16px);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.mine-cell:hover {
    background: rgba(255, 255, 255, .15);
}

.mine-cell:active {
    transform: scale(.93);
}

.mine-cell.revealed {
    background: rgba(255, 255, 255, .025);
    border-color: rgba(255, 255, 255, .045);
    cursor: default;
    box-shadow: none;
}

.mine-grid.flag-mode .mine-cell {
    cursor: crosshair;
}

.mine-cell.pop {
    animation: minePop .26s var(--ease) both;
}

@keyframes minePop {
    0% { transform: scale(.72); opacity: 0; }
    60% { transform: scale(1.07); }
    100% { transform: scale(1); opacity: 1; }
}

.mine-cell[data-n="1"] { color: #7dd3fc; }
.mine-cell[data-n="2"] { color: #86efac; }
.mine-cell[data-n="3"] { color: #fca5a5; }
.mine-cell[data-n="4"] { color: #c4b5fd; }
.mine-cell[data-n="5"] { color: #fdba74; }
.mine-cell[data-n="6"] { color: #67e8f9; }
.mine-cell[data-n="7"] { color: #f9a8d4; }
.mine-cell[data-n="8"] { color: #cbd5e1; }

.mine-cell.flagged {
    background: linear-gradient(150deg, rgba(251, 146, 60, .3), rgba(251, 146, 60, .12));
    border-color: rgba(251, 146, 60, .5);
    font-size: clamp(9px, 2.1vw, 14px);
}

.mine-cell.mine {
    background: rgba(255, 80, 80, .2) !important;
    border-color: rgba(255, 90, 90, .5) !important;
}

.mine-cell.boom {
    background: rgba(255, 60, 60, .55) !important;
    border-color: rgba(255, 120, 120, .9) !important;
    animation: boom .5s var(--ease);
}

@keyframes boom {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 70, 70, .8); }
    50% { transform: scale(1.16); }
    100% { transform: scale(1); box-shadow: 0 0 0 22px rgba(255, 70, 70, 0); }
}

.mine-cell.wrong {
    background: rgba(251, 146, 60, .2) !important;
    border-color: rgba(251, 146, 60, .55) !important;
}

.btn.active-flag {
    background: rgba(251, 146, 60, .22);
    border-color: rgba(251, 146, 60, .55);
    color: #ffd9b0;
}

/* ==========================================================================
   memory
   ========================================================================== */
.memory-wrap {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
    width: 100%;
    margin: 0 auto;
    perspective: 1400px;
}

.mcard {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 15px;
    transform-style: preserve-3d;
    transition: transform .55s var(--ease);
    cursor: pointer;
}

.mcard.flip {
    transform: rotateY(180deg);
}

.mcard.done {
    cursor: default;
}

.mface {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 15px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    font-size: clamp(24px, 6vw, 38px);
    user-select: none;
}

.mface.back {
    background:
        radial-gradient(120% 100% at 20% 0%, rgba(167, 139, 250, .34), transparent 60%),
        linear-gradient(155deg, #2a2550, #171a2c 75%);
    border: 1px solid rgba(167, 139, 250, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 14px 26px -20px #000;
    color: rgba(255, 255, 255, .7);
    font-size: 18px;
    overflow: hidden;
}

.mface.back::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, .08) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .08) 50%, rgba(255, 255, 255, .08) 75%, transparent 75%);
    background-size: 12px 12px;
    opacity: .5;
}

.mface.front {
    transform: rotateY(180deg);
    background:
        radial-gradient(120% 100% at 28% 6%, #fffdf7, #f2e7d1 62%, #e2d2b4 100%);
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: inset 0 1px 0 #fff, 0 12px 22px -16px rgba(0, 0, 0, .9);
}

.mcard.done .mface.front {
    border-color: rgba(52, 211, 153, .85);
    background:
        radial-gradient(120% 100% at 28% 6%, #f4fff9, #cdf1dd 62%, #a9e4c2 100%);
    box-shadow: 0 0 30px -8px rgba(52, 211, 153, .85), inset 0 1px 0 #fff;
    animation: matchPop .5s var(--ease-spring);
}

@keyframes matchPop {
    0% { transform: rotateY(180deg) scale(1); }
    45% { transform: rotateY(180deg) scale(1.09); }
    100% { transform: rotateY(180deg) scale(1); }
}

.mcard.shake {
    animation: shake .45s ease;
}

@keyframes shake {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    25% { transform: rotateY(180deg) translateX(-5px); }
    50% { transform: rotateY(180deg) translateX(5px); }
    75% { transform: rotateY(180deg) translateX(-3px); }
}

/* ==========================================================================
   snake controls
   ========================================================================== */
.snake-pad {
    display: grid;
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(2, 50px);
    gap: 9px;
    justify-content: center;
    margin: 16px auto 0;
}

.snake-pad button {
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .075);
    color: var(--ink);
    font-size: 17px;
    transition: background .2s, transform .15s;
}

.snake-pad button:hover {
    background: rgba(255, 255, 255, .13);
    color: #fff;
}

.snake-pad button:active {
    transform: scale(.92);
    background: rgba(52, 211, 153, .28);
}

.snake-pad .up { grid-area: 1 / 2; }
.snake-pad .left { grid-area: 2 / 1; }
.snake-pad .down { grid-area: 2 / 2; }
.snake-pad .right { grid-area: 2 / 3; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .links,
    .shelf {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gcard .watermark {
        font-size: 78px;
    }
}

@media (max-width: 760px) {
    .topbar-in {
        padding: 10px 16px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .brand-txt span {
        display: none;
    }

    .seg {
        order: 3;
        width: 100%;
    }

    .seg-btn {
        flex: 1;
        padding: 9px 10px;
        font-size: .8rem;
    }

    .lan-grid {
        grid-template-columns: 1fr;
    }

    .lan-create {
        grid-template-columns: 1fr 1fr;
    }

    .lan-room {
        padding: 14px 16px;
        gap: 12px;
    }

    .lan-room-code {
        font-size: 1.4rem;
    }

    .shell {
        padding: 0 16px 48px;
    }

    .hero {
        padding: 34px 0 22px;
    }

    .hero-row {
        font-size: .8rem;
        gap: 8px 12px;
    }

    .hero-row .sep {
        display: none;
    }

    .links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .link {
        padding: 15px;
        gap: 12px;
        border-radius: 16px;
    }

    .link .tile {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 20px;
    }

    .link .body h3 {
        font-size: .9rem;
    }

    .link .body p {
        font-size: .72rem;
    }

    .shelf {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gcard {
        padding: 16px;
        border-radius: 18px;
        gap: 10px;
    }

    .gcard .desc {
        font-size: .76rem;
    }

    .stage {
        padding-top: 16px;
    }

    .stage-head {
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }

    .stage-title {
        flex: 1 1 auto;
        min-width: 0;
        gap: 9px;
    }

    .stage-title .em {
        font-size: 22px;
    }

    .stage-title h2 {
        font-size: .95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stage-title p {
        display: none;
    }

    .back-btn span {
        display: none;
    }

    .back-btn {
        padding: 0 12px;
        flex: 0 0 auto;
    }

    .stage-actions {
        width: auto;
        gap: 6px;
        flex: 0 0 auto;
    }

    .stage-actions .btn {
        height: 36px;
        padding: 0 11px;
        font-size: .74rem;
    }

    .stage-actions .btn .ico {
        font-size: 12px;
    }

    .hud {
        gap: 6px;
        margin-bottom: 12px;
    }

    .status-pill,
    .stat {
        font-size: .7rem;
        padding: 5px 10px;
    }

    .status-pill .led {
        width: 6px;
        height: 6px;
    }

    .g2048 {
        padding: 9px;
    }

    .g2048-cells,
    .g2048-tiles {
        inset: 9px;
        gap: 8px;
    }

    .memory-grid {
        gap: 9px;
    }

    .pad {
        grid-template-columns: repeat(3, 44px);
        grid-template-rows: repeat(3, 44px);
    }
}

@media (max-width: 380px) {
    .links {
        grid-template-columns: 1fr;
    }
}

/* immersive fullscreen mode */
body.locked {
    overflow: hidden;
}

.stage.immersive {
    position: fixed;
    inset: 0;
    z-index: 80;
    padding: 12px 14px 18px;
    background: radial-gradient(900px 700px at 50% -10%, #161a2b, #06070c 65%);
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.stage.immersive .stage-head {
    flex: 0 0 auto;
}

.stage.immersive .hud {
    max-width: none;
}

.stage.immersive .board-wrap {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    max-width: none;
    width: 100%;
    min-height: 0;
}

.stage.immersive .board-frame {
    width: min(92vw, 62vh * var(--fit, 0.9));
    max-width: none;
}

.stage.immersive .g2048 {
    width: min(92vw, 62vh);
    max-width: none;
    margin: auto;
}

.stage.immersive .memory-wrap {
    width: min(92vw, 72vh);
    max-width: none;
    margin: auto;
}

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

    .greet {
        animation: none;
    }
}

/* ==========================================================================
   联机大厅
   ========================================================================== */
.lan-grid {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.lan-card {
    position: relative;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(158deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    border: 1px solid var(--line);
    overflow: hidden;
}

.lan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.lan-head h3 {
    font-size: .96rem;
    font-weight: 700;
}

.lan-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .72rem;
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    transition: color .3s, border-color .3s, background .3s;
}

.lan-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6b7280;
}

.lan-status.on {
    color: #b8f5d8;
    border-color: rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .1);
}

.lan-status.on i {
    background: var(--g);
    animation: pulseDot 2.4s ease-out infinite;
}

.lan-status.checking i {
    background: var(--o);
    animation: pulseDot 1s ease-out infinite;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.field > span {
    font-size: .68rem;
    color: var(--muted);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .88rem;
    outline: 0;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.field input:focus {
    border-color: rgba(139, 92, 246, .55);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

.lan-wide {
    width: 100%;
    height: 42px;
}

.lan-tiny {
    height: 30px;
    padding: 0 12px;
    font-size: .72rem;
    border-radius: 10px;
}

.lan-hint {
    margin-top: 12px;
    font-size: .72rem;
    color: var(--muted);
    line-height: 1.7;
}

.lan-hint code {
    font-family: var(--mono);
    font-size: .7rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--line);
}

.lan-create {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.lan-game {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 54px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--ink);
    font-weight: 700;
    font-size: .86rem;
    transition: transform .3s var(--ease), background .3s, border-color .3s, box-shadow .3s;
}

.lan-game span {
    font-size: 19px;
}

.lan-game:hover {
    transform: translateY(-2px);
    background: rgba(139, 92, 246, .16);
    border-color: rgba(167, 139, 250, .55);
    box-shadow: 0 16px 30px -20px rgba(124, 92, 255, .9);
}

.lan-game:active {
    transform: translateY(0) scale(.98);
}

.lan-rooms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 46px;
}

.lan-empty {
    font-size: .78rem;
    color: var(--muted);
    padding: 8px 2px;
}

.lan-room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .035);
    transition: background .25s, border-color .25s, transform .25s;
    animation: rise .35s var(--ease) backwards;
}

.lan-room-item:hover {
    background: rgba(255, 255, 255, .07);
    border-color: var(--line-2);
    transform: translateX(2px);
}

.lan-room-item .code {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .14em;
    color: #d9d0ff;
}

.lan-room-item .meta {
    font-size: .74rem;
    color: var(--muted);
}

.lan-room-item .join {
    margin-left: auto;
}

.lan-room {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(167, 139, 250, .35);
    background: linear-gradient(158deg, rgba(139, 92, 246, .16), rgba(77, 124, 255, .05));
    animation: rise .4s var(--ease);
}

.lan-room[hidden] {
    display: none;
}

.lan-room-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.lan-room-label {
    font-size: .72rem;
    color: var(--muted);
    letter-spacing: .08em;
}

.lan-room-code {
    font-family: var(--mono);
    font-size: 1.7rem;
    letter-spacing: .2em;
    background: linear-gradient(120deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lan-room-players {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lan-player {
    font-size: .74rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--line);
}

.lan-player.red {
    border-color: rgba(255, 120, 120, .4);
    color: #ffc9c9;
}

.lan-player.black {
    border-color: rgba(160, 180, 255, .35);
    color: #c9d6ff;
}

.lan-player.white {
    border-color: rgba(255, 255, 255, .4);
    color: #f1f5ff;
}

.lan-room-side {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.lan-room-tip {
    font-size: .78rem;
    color: var(--ink-2);
}

/* 光标光晕 */
.spot {
    position: fixed;
    left: 0;
    top: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    z-index: 0;
    pointer-events: none;
    opacity: .55;
    background: radial-gradient(circle, rgba(139, 92, 246, .13), transparent 62%);
    mix-blend-mode: screen;
    will-change: transform;
}

@media (pointer: coarse) {
    .spot { display: none; }
}

@media (min-width: 1160px) {
    .shelf {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ==========================================================================
   自定义入口 / 闪传
   ========================================================================== */
.link.add-card {
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 158px;
    text-align: center;
    border-style: dashed;
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .018);
    color: var(--muted);
    font-weight: 600;
    font-size: .85rem;
}

.link.add-card .plus {
    font-size: 24px;
    line-height: 1;
    opacity: .8;
}

.link.add-card:hover {
    color: #fff;
    border-color: rgba(167, 139, 250, .5);
    background: rgba(139, 92, 246, .08);
    transform: translateY(-3px);
}

.link.custom .custom-del {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    opacity: 0;
    transition: opacity .25s, background .25s, color .25s;
}

.link.custom:hover .custom-del {
    opacity: 1;
}

.link.custom .custom-del:hover {
    color: #fff;
    background: rgba(255, 80, 80, .55);
    border-color: rgba(255, 120, 120, .6);
}

.link-editor {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(167, 139, 250, .32);
    background: linear-gradient(158deg, rgba(139, 92, 246, .14), rgba(255, 255, 255, .02));
    animation: rise .35s var(--ease);
}

.link-editor[hidden] {
    display: none;
}

.le-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.le-head h3 {
    font-size: .95rem;
}

.le-tip {
    font-size: .7rem;
    color: var(--muted);
}

.le-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px;
}

.le-grid .field {
    margin-bottom: 0;
}

.le-wide {
    grid-column: 1 / -1;
}

.le-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.lan-online {
    font-size: .72rem;
    color: var(--muted);
}

.clip-row {
    display: flex;
    gap: 10px;
}

.clip-row input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .86rem;
    outline: 0;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.clip-row input:focus {
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
    background: rgba(255, 255, 255, .08);
}

.clip-row .btn {
    height: 42px;
    flex: 0 0 auto;
}

.clip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 260px;
    overflow: auto;
}

.clip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .035);
    animation: rise .3s var(--ease);
}

.clip-item .txt {
    flex: 1;
    min-width: 0;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-item .meta {
    font-size: .68rem;
    color: var(--muted);
    white-space: nowrap;
}

.clip-copy {
    height: 28px;
    padding: 0 10px;
    font-size: .7rem;
    border-radius: 8px;
}

@media (max-width: 760px) {
    .le-grid {
        grid-template-columns: 1fr;
    }

    .link.add-card {
        min-height: 96px;
        flex-direction: row;
        justify-content: center;
    }
}

/* ==========================================================================
   今日待办 / 内网地址
   ========================================================================== */
.addr-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    flex-wrap: wrap;
    font-size: .76rem;
    color: var(--muted);
}

.addr-text {
    font-family: var(--mono);
    font-size: .74rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    color: var(--ink-2);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.addr-copy {
    height: 26px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink-2);
    font-size: .72rem;
    transition: background .25s, color .25s, border-color .25s, transform .2s;
}

.addr-copy:hover {
    background: rgba(139, 92, 246, .18);
    border-color: rgba(167, 139, 250, .45);
    color: #fff;
    transform: translateY(-1px);
}

.todo-card {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(158deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .022));
    animation: rise .55s var(--ease) .15s backwards;
}

.todo-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.todo-head h3 {
    font-size: .98rem;
    font-weight: 700;
}

.todo-head span {
    font-size: .72rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.todo-add {
    display: flex;
    gap: 8px;
}

.todo-add input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .86rem;
    outline: 0;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.todo-add input:focus {
    border-color: rgba(139, 92, 246, .55);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

.todo-add .btn {
    height: 40px;
    flex: 0 0 auto;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    animation: rise .3s var(--ease);
    transition: background .25s, border-color .25s;
}

.todo-item:hover {
    background: rgba(255, 255, 255, .05);
    border-color: var(--line-2);
}

.todo-item .box {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 6px;
    border: 1.5px solid var(--line-2);
    display: grid;
    place-items: center;
    font-size: 11px;
    color: #07120c;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
    user-select: none;
}

.todo-item .box:hover {
    transform: scale(1.1);
    border-color: rgba(52, 211, 153, .7);
}

.todo-item.done .box {
    background: var(--g);
    border-color: var(--g);
}

.todo-item .txt {
    flex: 1;
    min-width: 0;
    font-size: .85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .25s;
}

.todo-item.done .txt {
    color: var(--muted);
    text-decoration: line-through;
}

.todo-item .del {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
    opacity: 0;
    transition: opacity .2s, background .2s, color .2s;
}

.todo-item:hover .del {
    opacity: 1;
}

.todo-item .del:hover {
    background: rgba(255, 80, 80, .3);
    color: #fff;
}

@media (max-width: 760px) {
    .todo-card {
        padding: 14px;
        margin-top: 18px;
    }

    .todo-item .del {
        opacity: .55;
    }
}

.todo-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.todo-clear {
    font-size: .7rem;
    color: var(--muted);
    padding: 3px 9px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    transition: color .25s, background .25s, border-color .25s;
}

.todo-clear:hover {
    color: #fff;
    background: rgba(255, 80, 80, .22);
    border-color: rgba(255, 120, 120, .45);
}

.todo-clear[hidden] {
    display: none;
}

.todo-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, .08);
}

.todo-foot-tip {
    margin-left: auto;
    font-size: .68rem;
    color: var(--muted);
    opacity: .8;
}

/* 游戏分类筛选 */
.shelf-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}

.shelf-tab {
    padding: 6px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    transition: color .25s, background .25s, border-color .25s, transform .2s;
}

.shelf-tab:hover {
    color: #fff;
    transform: translateY(-1px);
}

.shelf-tab.active {
    color: #fff;
    background: rgba(139, 92, 246, .22);
    border-color: rgba(167, 139, 250, .55);
    box-shadow: 0 8px 20px -14px rgba(124, 92, 255, .9);
}

#view-games.playing .shelf-tabs {
    display: none;
}

/* ==========================================================================
   奇妙工具箱
   ========================================================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(158deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    color: inherit;
    text-align: left;
    overflow: hidden;
    transition: transform .4s var(--ease), border-color .4s, box-shadow .4s, background .3s;
    animation: rise .55s var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 50ms);
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(320px 180px at 15% 0%, hsl(var(--h) 90% 62% / .18), transparent 70%);
    opacity: 0;
    transition: opacity .4s;
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: hsl(var(--h) 88% 70% / .42);
    box-shadow: 0 26px 50px -30px hsl(var(--h) 92% 45% / .75);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card.active {
    border-color: hsl(var(--h) 88% 70% / .6);
    background: hsl(var(--h) 70% 50% / .1);
}

.tool-ico {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: linear-gradient(150deg, hsl(var(--h) 92% 62% / .26), hsl(var(--h) 92% 55% / .05));
    border: 1px solid hsl(var(--h) 90% 72% / .3);
    transition: transform .45s var(--ease-spring);
}

.tool-card:hover .tool-ico {
    transform: rotate(-6deg) scale(1.07);
}

.tool-card h3 {
    font-size: .95rem;
    font-weight: 700;
}

.tool-card p {
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.5;
}

.tool-panel {
    margin-top: 18px;
    padding: 22px;
    border-radius: 20px;
    border: 1px solid rgba(167, 139, 250, .32);
    background: linear-gradient(158deg, rgba(139, 92, 246, .13), rgba(255, 255, 255, .02));
}

.tool-panel[hidden] {
    display: none;
}

.tool-panel.open {
    animation: rise .35s var(--ease);
}

.tool-panel-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.tool-panel-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
}

.tool-panel-title {
    flex: 1;
    min-width: 0;
}

.tool-panel-title h3 {
    font-size: 1.05rem;
}

.tool-panel-title p {
    font-size: .74rem;
    color: var(--muted);
    margin-top: 2px;
}

.tool-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink-2);
    font-size: 13px;
    transition: background .25s, color .25s, transform .2s;
}

.tool-close:hover {
    background: rgba(255, 80, 80, .3);
    color: #fff;
    transform: rotate(90deg);
}

.tool-body {
    max-width: 720px;
}

.t-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.t-row > .btn {
    height: 42px;
}

.t-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 130px;
}

.t-field > span {
    font-size: .68rem;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.t-input,
.t-area {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .9rem;
    outline: 0;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.t-input:focus,
.t-area:focus {
    border-color: rgba(139, 92, 246, .55);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

.t-input[type="number"] {
    font-family: var(--mono);
}

.t-area {
    height: auto;
    min-height: 110px;
    padding: 11px 13px;
    line-height: 1.6;
    resize: vertical;
    font-family: var(--font);
}

.t-out {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ece8ff;
    padding: 13px 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .24);
    border: 1px solid var(--line);
    word-break: break-all;
    min-height: 48px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.t-out.t-big {
    font-size: 1.7rem;
    letter-spacing: .04em;
}

.t-out.t-small {
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink-2);
    white-space: pre-wrap;
    max-height: 220px;
    overflow: auto;
    align-items: flex-start;
}

.t-note {
    font-size: .72rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 10px;
}

.t-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.t-chip {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink-2);
    font-size: .78rem;
    transition: color .25s, background .25s, border-color .25s;
}

.t-chip:hover {
    color: #fff;
    border-color: var(--line-2);
}

.t-chip.on {
    color: #fff;
    background: rgba(139, 92, 246, .24);
    border-color: rgba(167, 139, 250, .55);
}

.t-dice {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    font-size: 38px;
    line-height: 1;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: #fff;
}

.t-dice.roll {
    animation: diceShake .18s linear infinite;
}

@keyframes diceShake {
    0% { transform: rotate(-8deg) scale(.95); }
    50% { transform: rotate(8deg) scale(1.05); }
    100% { transform: rotate(-8deg) scale(.95); }
}

.t-color {
    width: 64px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: none;
    cursor: pointer;
}

.t-palette {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.t-swatch {
    width: 56px;
    height: 56px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .18);
    cursor: pointer;
    transition: transform .2s;
}

.t-swatch:hover {
    transform: scale(1.07);
}

.t-clock-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    margin-bottom: 8px;
}

.t-clock-name {
    width: 70px;
    font-size: .85rem;
    font-weight: 700;
}

.t-clock-time b {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.t-clock-row .t-note {
    margin: 0 0 0 auto;
}

.t-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.t-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    font-size: .82rem;
    color: var(--muted);
}

.t-line b {
    margin-left: auto;
    font-family: var(--mono);
    font-size: .95rem;
    color: var(--ink);
    word-break: break-all;
}

@media (max-width: 760px) {
    .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-card {
        padding: 14px;
    }

    .tool-panel {
        padding: 16px;
    }

    .t-clock-name {
        width: 54px;
    }
}

/* ==========================================================================
   联机派对游戏
   ========================================================================== */
.party-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}

.party-player {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(158deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    transition: border-color .3s, background .3s, transform .3s var(--ease);
}

.party-player.me {
    border-color: rgba(167, 139, 250, .55);
    background: linear-gradient(158deg, rgba(139, 92, 246, .16), rgba(77, 124, 255, .04));
}

.party-player.winner {
    border-color: rgba(52, 211, 153, .8);
    box-shadow: 0 0 34px -10px rgba(52, 211, 153, .9);
    animation: winPop .5s var(--ease-spring);
}

.party-name {
    font-size: .85rem;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.party-dice {
    font-size: 56px;
    line-height: 1;
    margin: 4px 0;
    color: #f8fafc;
    text-shadow: 0 6px 22px rgba(167, 139, 250, .6);
    font-family: "Segoe UI Symbol", "Apple Symbols", serif;
}

.party-meta {
    font-size: .7rem;
    color: var(--muted);
}

.party-tag {
    margin-top: 2px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .66rem;
    border: 1px solid rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .12);
    color: #b8f5d8;
}

.party-tag.waiting {
    border-color: var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
}

.party-status {
    text-align: center;
    margin-top: 18px;
    font-size: .9rem;
    color: var(--ink-2);
    min-height: 26px;
}

.party-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.party-wrap {
    position: relative;
    max-width: 620px;
    margin: 0 auto;
    padding: 6px 0 12px;
}

.party-range {
    font-family: var(--mono);
    font-size: clamp(2rem, 6vw, 2.9rem);
    font-weight: 800;
    text-align: center;
    letter-spacing: .06em;
    background: linear-gradient(120deg, #fff, #c4b5fd 55%, #fca5a5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 10px 0 4px;
}

.party-turn {
    text-align: center;
    font-size: .86rem;
    color: var(--ink-2);
    margin-bottom: 16px;
}

.party-guess {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
}

.party-input {
    max-width: 200px;
    height: 44px;
    font-family: var(--mono);
    font-size: 1.1rem;
    text-align: center;
}

.party-guess .btn {
    height: 44px;
    padding: 0 22px;
}

.bomb-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
    margin-top: 8px;
}

.bomb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    font-size: .8rem;
    color: var(--ink-2);
}

.bomb-item b {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 500;
}

.lan-party {
    margin-bottom: 14px;
}

.lan-party-tip {
    display: block;
    font-size: .7rem;
    color: var(--muted);
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.lan-party .lan-create {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .party-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .party-dice {
        font-size: 44px;
    }

    .party-guess {
        flex-wrap: wrap;
    }

    .party-input {
        max-width: none;
        flex: 1;
    }
}

/* ==========================================================================
   打地鼠
   ========================================================================== */
.mole-wrap {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(158deg, #1c2618, #0e1410 70%);
    box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.mole-hole {
    position: relative;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
    background: radial-gradient(circle at 50% 68%, rgba(0, 0, 0, .62), rgba(255, 255, 255, .04) 72%);
    cursor: pointer;
    overflow: hidden;
    display: grid;
    place-items: end center;
    transition: background .2s;
}

.mole {
    font-size: clamp(28px, 7vw, 46px);
    line-height: 1.05;
    transform: translateY(125%);
    transition: transform .16s var(--ease-spring);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .55));
    pointer-events: none;
}

.mole-hole.up .mole {
    transform: translateY(6%);
}

.mole-hole.up {
    cursor: crosshair;
    background: radial-gradient(circle at 50% 60%, rgba(139, 92, 246, .22), rgba(0, 0, 0, .5) 70%);
}

.mole-hole.hit {
    background: radial-gradient(circle at 50% 60%, rgba(52, 211, 153, .45), transparent 72%);
}

.mole-hole.miss {
    animation: shake .2s ease;
}

/* ==========================================================================
   数字华容道
   ========================================================================== */
.puzzle-wrap {
    position: relative;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(158deg, #1b2130, #0e1119 70%);
    box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.puzzle-tile {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(150deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
    color: #eef2ff;
    font-family: var(--mono);
    font-weight: 800;
    font-size: clamp(16px, 4vw, 26px);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .15s, background .2s, box-shadow .2s, border-color .2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

.puzzle-tile:hover:not(.blank) {
    background: rgba(139, 92, 246, .3);
    border-color: rgba(167, 139, 250, .55);
    box-shadow: 0 10px 22px -12px rgba(124, 92, 255, .95);
}

.puzzle-tile:active:not(.blank) {
    transform: scale(.94);
}

.puzzle-tile.blank {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    cursor: default;
}


/* 点阵骰子 */
.die {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    background: linear-gradient(150deg, #ffffff, #e4eaf6);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 10px;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, .5);
    box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .85), inset 0 1px 0 #fff;
}

.die i {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1b2030;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25);
}

.die[data-v="1"] i:nth-child(1) { display: block; grid-area: 2 / 2; }
.die[data-v="2"] i:nth-child(1) { display: block; grid-area: 1 / 1; }
.die[data-v="2"] i:nth-child(2) { display: block; grid-area: 3 / 3; }
.die[data-v="3"] i:nth-child(1) { display: block; grid-area: 1 / 1; }
.die[data-v="3"] i:nth-child(2) { display: block; grid-area: 2 / 2; }
.die[data-v="3"] i:nth-child(3) { display: block; grid-area: 3 / 3; }
.die[data-v="4"] i:nth-child(1) { display: block; grid-area: 1 / 1; }
.die[data-v="4"] i:nth-child(2) { display: block; grid-area: 1 / 3; }
.die[data-v="4"] i:nth-child(3) { display: block; grid-area: 3 / 1; }
.die[data-v="4"] i:nth-child(4) { display: block; grid-area: 3 / 3; }
.die[data-v="5"] i:nth-child(1) { display: block; grid-area: 1 / 1; }
.die[data-v="5"] i:nth-child(2) { display: block; grid-area: 1 / 3; }
.die[data-v="5"] i:nth-child(3) { display: block; grid-area: 2 / 2; }
.die[data-v="5"] i:nth-child(4) { display: block; grid-area: 3 / 1; }
.die[data-v="5"] i:nth-child(5) { display: block; grid-area: 3 / 3; }
.die[data-v="6"] i:nth-child(1) { display: block; grid-area: 1 / 1; }
.die[data-v="6"] i:nth-child(2) { display: block; grid-area: 1 / 3; }
.die[data-v="6"] i:nth-child(3) { display: block; grid-area: 2 / 1; }
.die[data-v="6"] i:nth-child(4) { display: block; grid-area: 2 / 3; }
.die[data-v="6"] i:nth-child(5) { display: block; grid-area: 3 / 1; }
.die[data-v="6"] i:nth-child(6) { display: block; grid-area: 3 / 3; }

.die.empty {
    background: rgba(255, 255, 255, .05);
    border: 1px dashed rgba(255, 255, 255, .18);
    box-shadow: none;
}

.die.empty i {
    display: none !important;
}

@media (max-width: 760px) {
    .die {
        width: 58px;
        height: 58px;
        padding: 8px;
        border-radius: 13px;
    }
}

/* ==========================================================================
   纹理 / 细节增强
   ========================================================================== */
/* 极光带 */
.bg .aurora {
    position: absolute;
    inset: -25%;
    background: conic-gradient(from 0deg at 50% 50%,
        transparent 0deg,
        rgba(139, 92, 246, .10) 55deg,
        transparent 120deg,
        rgba(34, 211, 238, .07) 195deg,
        transparent 260deg,
        rgba(244, 114, 182, .06) 320deg,
        transparent 360deg);
    filter: blur(70px);
    opacity: .8;
    animation: auroraSpin 46s linear infinite;
    will-change: transform;
}

@keyframes auroraSpin {
    to { transform: rotate(360deg); }
}

/* 点击涟漪 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 62%);
    transform: scale(0);
    opacity: .75;
    pointer-events: none;
    animation: rippleOut .62s var(--ease);
    z-index: 0;
}

@keyframes rippleOut {
    60% { opacity: .32; }
    100% { transform: scale(1); opacity: 0; }
}

.btn,
.back-btn,
.icon-btn,
.seg-btn,
.lan-game,
.gcard,
.tool-card,
.shelf-tab,
.addr-copy,
.todo-clear,
.tool-close,
.lan-tiny {
    position: relative;
    overflow: hidden;
}

/* 卡片扫光 */
.gcard::after,
.tool-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .12), transparent);
    transform: skewX(-18deg);
    transition: left .8s var(--ease);
    pointer-events: none;
}

.gcard:hover::after,
.tool-card:hover::after {
    left: 130%;
}

/* 键盘焦点 */
:focus-visible {
    outline: 2px solid rgba(167, 139, 250, .75);
    outline-offset: 2px;
}

/* 工具面板开启动画 */
.tool-panel.open {
    animation: toolIn .42s var(--ease);
}

@keyframes toolIn {
    from { opacity: 0; transform: translateY(10px) scale(.99); filter: blur(14px); }
    60% { filter: blur(1.5px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

/* 骰子出现 */
.die:not(.empty) {
    animation: dieIn .35s var(--ease-spring);
}

@keyframes dieIn {
    from { transform: scale(.6) rotate(-8deg); opacity: .35; }
    to { transform: none; opacity: 1; }
}

/* 手机端降低模糊开销 */
@media (max-width: 760px) {
    .bg .orb {
        filter: blur(48px);
        opacity: .42;
    }

    .bg .aurora {
        display: none;
    }
}

/* ==========================================================================
   滚动进度 / 轻动效
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 70;
    background: linear-gradient(90deg, #8b5cf6, #4d7cff 55%, #22d3ee);
    box-shadow: 0 0 12px rgba(139, 92, 246, .75);
    transition: width .08s linear;
    pointer-events: none;
}

.todo-item.done .box {
    animation: checkPop .35s var(--ease-spring);
}

@keyframes checkPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.todo-item .txt {
    transition: color .3s;
}

.toast {
    overflow: hidden;
}

.toast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, #8b5cf6, #22d3ee);
    transform-origin: left;
    transform: scaleX(0);
}

.toast.on::after {
    animation: toastBar 1.7s linear forwards;
}

@keyframes toastBar {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* 滑块输入 */
input[type="range"].t-input {
    height: 42px;
    padding: 0 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
    accent-color: #8b5cf6;
    cursor: pointer;
}

input[type="range"].t-input:focus {
    box-shadow: none;
}

/* 派对游戏隐藏全屏按钮后，标题栏自适应 */
.stage-actions:empty {
    display: none;
}

.t-len-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    margin-top: 18px;
    font-size: .78rem;
    color: var(--muted);
}

.t-len-inline b {
    font-family: var(--mono);
    font-size: 1.05rem;
    color: #e9e4ff;
}

/* ==========================================================================
   国际象棋
   ========================================================================== */
.intl-wrap {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

.intl-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 34px 60px -34px rgba(0, 0, 0, .95), inset 0 0 0 1px rgba(255, 255, 255, .06);
    user-select: none;
}

.sq {
    position: relative;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: filter .15s;
}

.sq.light {
    background: linear-gradient(160deg, #f0e2c0, #e2cfa6);
}

.sq.dark {
    background: linear-gradient(160deg, #a9855b, #8d6a43);
}

.sq:hover {
    filter: brightness(1.07);
}

.sq.last {
    box-shadow: inset 0 0 0 999px rgba(52, 211, 153, .2);
}

.sq.sel {
    box-shadow: inset 0 0 0 3px rgba(139, 92, 246, .95), inset 0 0 22px rgba(139, 92, 246, .42);
}

.sq.check {
    box-shadow: inset 0 0 0 3px rgba(255, 70, 70, .95), inset 0 0 30px rgba(255, 70, 70, .55);
}

.sq.hint::after {
    content: "";
    position: absolute;
    width: 26%;
    height: 26%;
    border-radius: 50%;
    background: rgba(52, 211, 153, .9);
    box-shadow: 0 0 10px rgba(52, 211, 153, .9);
    pointer-events: none;
}

.sq.hint.capture::after {
    width: 76%;
    height: 76%;
    background: transparent;
    border: 3px solid rgba(244, 63, 94, .95);
    box-shadow: 0 0 14px rgba(244, 63, 94, .65);
}

.piece {
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", serif;
    font-size: clamp(24px, 7vw, 46px);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: transform .15s var(--ease);
}

.piece.w {
    background-image: linear-gradient(180deg, #ffffff 0%, #fdf8ee 58%, #ece0c9 100%);
    -webkit-text-stroke: 0;
    filter: drop-shadow(0 1px 1px rgba(60, 44, 22, .55)) drop-shadow(0 3px 5px rgba(40, 28, 10, .42));
}

.piece.b {
    background-image: linear-gradient(180deg, #565e6d 0%, #2b313d 55%, #101318 100%);
    -webkit-text-stroke: .8px rgba(236, 240, 248, .55);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)) drop-shadow(0 3px 5px rgba(0, 0, 0, .5));
}

.piece.pop {
    animation: piecePop .28s var(--ease-spring);
}

@keyframes piecePop {
    0% { transform: scale(.72); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}


/* ==========================================================================
   斗地主
   ========================================================================== */
.ddz-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 4px 0 10px;
}

.ddz-opponents {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ddz-opp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .035);
    font-size: .8rem;
    color: var(--muted);
    transition: border-color .25s, background .25s, color .25s;
}

.ddz-opp b {
    font-family: var(--mono);
    color: var(--ink);
    font-size: .9rem;
}

.ddz-opp.active {
    border-color: rgba(167, 139, 250, .55);
    background: rgba(139, 92, 246, .12);
    color: #e9e4ff;
}

.ddz-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 150px;
    padding: 12px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .18);
}

.ddz-note {
    font-size: .72rem;
    color: var(--muted);
}

.ddz-play {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.ddz-card {
    position: relative;
    width: 52px;
    height: 72px;
    border-radius: 8px;
    background: linear-gradient(160deg, #ffffff, #e7eaf3);
    border: 1px solid rgba(0, 0, 0, .18);
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .8), inset 0 1px 0 #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #1a1e28;
    flex: 0 0 auto;
    transition: transform .14s var(--ease), box-shadow .2s, border-color .2s;
    user-select: none;
}

.ddz-card .r {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    font-family: var(--mono);
}

.ddz-card .s {
    font-size: 14px;
    line-height: 1;
}

.ddz-card.red {
    color: #cf2f3c;
}

.ddz-card.joker .r {
    font-size: 15px;
}

.ddz-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 14px 4px 4px;
    min-height: 100px;
}

.ddz-hand .ddz-card.interactive {
    cursor: pointer;
}

.ddz-hand .ddz-card.interactive:hover {
    transform: translateY(-6px);
}

.ddz-hand .ddz-card.sel {
    transform: translateY(-14px);
    border-color: #8b5cf6;
    box-shadow: 0 14px 22px -12px rgba(139, 92, 246, .95);
}

.ddz-turn {
    text-align: center;
    font-size: .82rem;
    color: var(--ink-2);
    margin-top: 6px;
}

@media (max-width: 760px) {
    .ddz-card {
        width: 38px;
        height: 54px;
        border-radius: 6px;
    }

    .ddz-card .r {
        font-size: 15px;
    }

    .ddz-card .s {
        font-size: 10px;
    }

    .ddz-hand {
        gap: 3px;
    }

    .ddz-center {
        min-height: 120px;
    }
}

/* 掼蛋（4 人）布局微调 */
.gd-hand {
    max-height: 230px;
    overflow: auto;
}

.gd-hand .ddz-card {
    width: 42px;
    height: 58px;
}

.gd-hand .ddz-card .r {
    font-size: 16px;
}

.gd-hand .ddz-card .s {
    font-size: 11px;
}

.gd-opps {
    flex-wrap: wrap;
}

.gd-opps .ddz-opp.blue {
    border-color: rgba(120, 170, 255, .35);
    color: #c9d6ff;
}

@media (max-width: 760px) {
    .gd-hand .ddz-card {
        width: 34px;
        height: 48px;
    }

    .gd-hand .ddz-card .r {
        font-size: 13px;
    }

    .gd-hand .ddz-card .s {
        font-size: 9px;
    }
}

.ddz-play .ddz-card {
    animation: cardPop .24s var(--ease-spring);
}

@keyframes cardPop {
    from { transform: scale(.72); opacity: .35; }
    to { transform: none; opacity: 1; }
}

/* ==========================================================================
   21 点
   ========================================================================== */
.bj-wrap {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 4px;
}

.bj-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 96px;
}

.bj-label {
    width: 34px;
    flex: 0 0 34px;
    font-size: .8rem;
    color: var(--muted);
    letter-spacing: .1em;
}

.bj-side {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bj-mid {
    text-align: center;
    font-size: .84rem;
    color: var(--ink-2);
    padding: 12px 0;
    margin: 6px 0;
    border-top: 1px dashed rgba(255, 255, 255, .1);
    border-bottom: 1px dashed rgba(255, 255, 255, .1);
    font-family: var(--mono);
}

.bj-back {
    background: linear-gradient(150deg, #4c3a8f, #241d47) !important;
    color: #b7adff !important;
    border-color: rgba(255, 255, 255, .2) !important;
}

.bj-side .ddz-card {
    animation: cardPop .24s var(--ease-spring);
}

.shelf-tab .st-count {
    font-family: var(--mono);
    font-size: .68rem;
    opacity: .55;
    margin-left: 6px;
    transition: opacity .2s;
}

.shelf-tab.active .st-count {
    opacity: .95;
}


/* 联机连接错误提示 */
.lan-err {
    font-size: .74rem;
    line-height: 1.55;
    color: #ffb4b4;
    background: rgba(255, 80, 80, .08);
    border: 1px solid rgba(255, 80, 80, .26);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 8px 0 0;
    word-break: break-all;
}

/* 联机页：连接状态 / 加入房间 */
.lan-connected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, .3);
    background: rgba(52, 211, 153, .08);
}

.lan-me {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lan-me-ico {
    color: #34d399;
    font-size: .7rem;
}

.lan-me-txt {
    display: block;
    font-size: .66rem;
    color: var(--muted);
    letter-spacing: .04em;
}

.lan-me b {
    font-size: .95rem;
    color: var(--ink);
}

.lan-me-actions {
    display: flex;
    gap: 6px;
}

.lan-join {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.lan-join input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(8, 10, 18, .55);
    color: var(--ink);
    padding: 0 12px;
    font-size: .86rem;
    font-family: var(--mono);
    letter-spacing: .12em;
}

.lan-join input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, .6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

.lan-join-tip {
    font-size: .74rem;
    color: var(--muted);
    white-space: nowrap;
}

@media (max-width: 760px) {
    .lan-connected {
        flex-direction: column;
        align-items: flex-start;
    }

    .lan-join {
        flex-wrap: wrap;
    }

    .lan-join input {
        flex: 1 1 100%;
    }
}


/* ==========================================================================
   联机大厅 v2 —— 玩家 Dock + Bento
   ========================================================================== */
.lan-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 0 16px;
}

.lan-hero-glow {
    position: absolute;
    left: -60px;
    top: -80px;
    width: 340px;
    height: 240px;
    background: radial-gradient(circle, hsla(268, 90%, 62%, .20), transparent 66%);
    filter: blur(18px);
    pointer-events: none;
}

.lan-hero-copy {
    position: relative;
}

.lan-hero-title {
    margin: 10px 0 8px;
    font-size: clamp(1.7rem, 3.2vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: -.02em;
}

.lan-hero-title em {
    font-style: normal;
    background: linear-gradient(100deg, #a78bfa, #7dd3fc 55%, #6ee7b7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lan-hero-sub {
    max-width: 560px;
    font-size: .86rem;
    line-height: 1.65;
    color: var(--muted);
}

.lan-online-pill {
    position: relative;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, .3);
    background: rgba(52, 211, 153, .08);
    color: #a7f3d0;
    font-size: .78rem;
    font-family: var(--mono);
    white-space: nowrap;
}

.lan-dock {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.lan-dock-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.lan-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    box-shadow: 0 10px 24px -10px rgba(139, 92, 246, .95), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.lan-dock-id {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lan-dock-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lan-dock-name b {
    font-size: 1rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lan-dock-sub {
    font-size: .7rem;
    color: var(--muted);
}

.lan-dock-side {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lan-dock-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lan-dock-form input {
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(8, 10, 18, .55);
    color: var(--ink);
    font-size: .82rem;
}

.lan-dock-form input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, .6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

#lanName {
    width: 128px;
}

#lanUrl {
    width: 210px;
}

.lan-dock-btns {
    display: flex;
    gap: 6px;
}

.lan-dock .lan-hint {
    flex-basis: 100%;
    margin: 2px 0 0;
    font-size: .68rem;
    color: var(--muted);
}

.lan-dock .lan-err {
    flex-basis: 100%;
    margin: 0;
}

.lan-bento {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.lan-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
    overflow: hidden;
}

.lan-panel-games {
    grid-column: span 2;
}

.lan-panel-clip {
    grid-column: span 2;
}

.lan-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.lan-panel-head h3 {
    font-size: 1rem;
    margin: 0;
}

.lan-panel-head span {
    font-size: .68rem;
    color: var(--muted);
}

.lan-panel-tip {
    font-size: .68rem;
    color: var(--muted);
    margin: 0;
}

.lan-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.lan-tile {
    --h: 260;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 104px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(130% 120% at 0% 0%, hsla(var(--h), 85%, 62%, .22), rgba(255, 255, 255, .02) 58%),
        rgba(255, 255, 255, .02);
    text-align: left;
    cursor: pointer;
    transition: transform .22s var(--ease), border-color .22s, box-shadow .28s, background .28s;
}

.lan-tile:hover {
    transform: translateY(-4px);
    border-color: hsla(var(--h), 85%, 65%, .5);
    box-shadow: 0 20px 34px -20px hsla(var(--h), 80%, 50%, .6);
}

.lan-tile:active {
    transform: translateY(-1px) scale(.995);
}

.lan-tile .lt-ico {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}

.lan-tile b {
    font-size: .9rem;
}

.lan-tile .lt-meta {
    font-size: .68rem;
    color: var(--muted);
}

.lan-code-input {
    width: 100%;
    height: 64px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(8, 10, 18, .55);
    color: var(--ink);
    text-align: center;
    font-family: var(--mono);
    font-size: 1.6rem;
    letter-spacing: .5em;
    text-indent: .5em;
    padding: 0 8px;
    transition: border-color .2s, box-shadow .2s;
}

.lan-code-input::placeholder {
    color: rgba(255, 255, 255, .18);
}

.lan-code-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, .6);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

.lan-panel .lan-room-item {
    margin: 0;
}

@media (max-width: 960px) {
    .lan-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lan-panel-games,
    .lan-panel-clip {
        grid-column: span 2;
    }

    .lan-panel-rooms,
    .lan-panel-join {
        grid-column: span 1;
    }
}

@media (max-width: 760px) {
    .lan-bento {
        grid-template-columns: 1fr;
    }

    .lan-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lan-panel-games,
    .lan-panel-clip,
    .lan-panel-rooms,
    .lan-panel-join {
        grid-column: span 1;
    }

    .lan-dock {
        align-items: flex-start;
        flex-direction: column;
    }

    .lan-dock-side {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .lan-dock-form {
        width: 100%;
    }

    #lanName,
    #lanUrl {
        width: 100%;
    }

    .lan-dock-form .btn {
        width: 100%;
    }

    .lan-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

/* hidden 属性优先于任何 display 规则 */
[hidden] {
    display: none !important;
}

/* ==========================================================================
   世界征服
   ========================================================================== */
.cv-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.cv-map {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(30, 64, 175, .20), rgba(2, 6, 23, .72)),
        #060b16;
    box-shadow: 0 34px 60px -40px #000, inset 0 0 0 1px rgba(255, 255, 255, .03);
    overflow: hidden;
}

.cv-hex {
    cursor: pointer;
}

.cv-hex polygon {
    stroke: rgba(255, 255, 255, .16);
    stroke-width: 1.2;
    transition: filter .18s;
}

.cv-hex .cv-hex-inner {
    fill: none;
    stroke: rgba(255, 255, 255, .05);
    stroke-width: 1;
}

.cv-hex:hover polygon,
.cv-hex.cv-hover polygon {
    filter: brightness(1.2);
}

.cv-hex.sel polygon:first-child {
    stroke: #f8fafc;
    stroke-width: 2.4;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, .55));
}

.cv-hex.target-move polygon:first-child {
    stroke: rgba(110, 231, 183, .9);
    stroke-width: 2;
    stroke-dasharray: 4 3;
}

.cv-hex.target-attack polygon:first-child {
    stroke: rgba(251, 113, 133, .95);
    stroke-width: 2.4;
    stroke-dasharray: 5 3;
}

.cv-troops {
    font-family: var(--mono);
    font-size: 17px;
    font-weight: 800;
    text-anchor: middle;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, .55);
    stroke-width: 3px;
    pointer-events: none;
}

.cv-terrain {
    font-size: 12px;
    text-anchor: middle;
    opacity: .85;
    pointer-events: none;
}

.cv-cap {
    font-size: 12px;
    fill: #fde68a;
    text-anchor: middle;
    pointer-events: none;
}

.cv-flash {
    fill: rgba(255, 255, 255, .85);
    transform-box: fill-box;
    transform-origin: center;
    animation: cvFlash .6s ease-out forwards;
    pointer-events: none;
}

@keyframes cvFlash {
    from { opacity: .9; transform: scale(.3); }
    to { opacity: 0; transform: scale(1.7); }
}

.cv-info {
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
}

.cv-info-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .84rem;
    color: var(--ink-2);
}

.cv-info-main b {
    font-size: .92rem;
    color: var(--ink);
}

.cv-info-main span {
    font-size: .74rem;
    color: var(--muted);
}

@media (max-width: 760px) {
    .cv-troops {
        font-size: 14px;
    }
}

.cv-hex.border polygon:first-child {
    stroke: rgba(255, 255, 255, .42);
    stroke-width: 1.8;
}

.cv-map.cv-wait {
    filter: saturate(.82) brightness(.9);
}

/* ==========================================================================
   海战棋
   ========================================================================== */
.bs-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.bs-boards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bs-board {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
}

.bs-board-title {
    margin-bottom: 8px;
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
}

.bs-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
    aspect-ratio: 1;
}

.bs-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(56, 189, 248, .05);
    padding: 0;
    transition: background .15s, transform .12s, box-shadow .2s;
}

.bs-cell.clickable {
    cursor: crosshair;
    background: rgba(56, 189, 248, .12);
}

.bs-cell.clickable:hover {
    background: rgba(56, 189, 248, .28);
    transform: scale(1.06);
}

.bs-cell.ship {
    background: rgba(148, 163, 184, .35);
    border-color: rgba(255, 255, 255, .2);
}

.bs-cell.hit {
    background: rgba(251, 113, 133, .6);
    border-color: rgba(251, 113, 133, .95);
    box-shadow: 0 0 10px rgba(251, 113, 133, .55);
}

.bs-cell.miss {
    background: rgba(255, 255, 255, .07);
}

.bs-cell.sunk {
    background: rgba(120, 20, 32, .7);
    border-color: rgba(251, 113, 133, .8);
}

@media (max-width: 760px) {
    .bs-boards {
        grid-template-columns: 1fr;
    }
}

/* 海战棋材质细节 */
.bs-wrap {
    max-width: 860px;
}

.bs-cell {
    position: relative;
}

.bs-cell.ship {
    background: linear-gradient(160deg, rgba(203, 213, 225, .42), rgba(100, 116, 139, .38));
    border-color: rgba(255, 255, 255, .22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.bs-cell.hit::after {
    content: "";
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, rgba(255, 255, 255, 0) 62%);
    box-shadow: 0 0 14px rgba(255, 90, 90, .95);
    animation: bsHit .5s var(--ease-spring);
}

.bs-cell.miss::after {
    content: "";
    position: absolute;
    inset: 38%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

@keyframes bsHit {
    0% { transform: scale(.2); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   卡牌对战
   ========================================================================== */
.cb-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.cb-hero {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    padding: 10px 14px;
    transition: box-shadow .2s, border-color .2s;
}

.cb-hero.target {
    border-color: rgba(251, 113, 133, .8);
    box-shadow: 0 0 0 2px rgba(251, 113, 133, .3), 0 0 26px rgba(251, 113, 133, .25);
    cursor: pointer;
}

.cb-hero-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cb-hero-name {
    font-weight: 700;
}

.cb-hp {
    font-family: var(--mono);
    color: #fda4af;
    font-size: 1.02rem;
}

.cb-hp-tip {
    margin-left: auto;
    font-size: .7rem;
    color: var(--muted);
}

.cb-board {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 88px;
    padding: 0 2px;
}

.cb-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .78rem;
}

.cb-divider::before,
.cb-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .08);
}

.cb-unit {
    position: relative;
    width: 74px;
    height: 86px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: linear-gradient(160deg, rgba(56, 189, 248, .18), rgba(15, 23, 42, .85));
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    transition: transform .15s, box-shadow .2s, border-color .2s;
}

.cb-unit.ready {
    cursor: pointer;
    border-color: rgba(110, 231, 183, .5);
    box-shadow: 0 0 0 1px rgba(110, 231, 183, .22);
}

.cb-unit.ready:hover {
    transform: translateY(-3px);
}

.cb-unit.sleep {
    opacity: .68;
    filter: saturate(.55);
}

.cb-unit.target {
    border-color: rgba(251, 113, 133, .9);
    cursor: pointer;
    animation: cbPulse 1s ease-in-out infinite;
}

.cb-unit-name {
    font-weight: 700;
}

.cb-unit .cb-atk {
    position: absolute;
    left: 6px;
    bottom: 4px;
    color: #fbbf24;
    font-family: var(--mono);
    font-weight: 800;
}

.cb-unit .cb-hp-num {
    position: absolute;
    right: 6px;
    bottom: 4px;
    color: #f87171;
    font-family: var(--mono);
    font-weight: 800;
}

.cb-hand {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 110px;
    padding: 8px 0 2px;
}

.cb-card {
    position: relative;
    width: 96px;
    height: 124px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    color: var(--ink);
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    transition: transform .18s, box-shadow .2s, border-color .2s;
}

.cb-card.playable {
    cursor: pointer;
    border-color: rgba(167, 139, 250, .55);
    box-shadow: 0 12px 26px -16px rgba(139, 92, 246, .85);
}

.cb-card.playable:hover {
    transform: translateY(-6px);
}

.cb-card.spell {
    background: linear-gradient(180deg, rgba(251, 113, 133, .16), rgba(255, 255, 255, .02));
}

.cb-cost {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .78rem;
    box-shadow: 0 4px 10px -4px rgba(79, 70, 229, .9);
}

.cb-name {
    font-size: .82rem;
}

.cb-text {
    font-size: .63rem;
    color: var(--muted);
    line-height: 1.35;
}

.cb-card .cb-atk {
    position: absolute;
    left: 8px;
    bottom: 6px;
    color: #fbbf24;
    font-family: var(--mono);
    font-weight: 800;
}

.cb-card .cb-hp-num {
    position: absolute;
    right: 8px;
    bottom: 6px;
    color: #f87171;
    font-family: var(--mono);
    font-weight: 800;
}

.cb-spell {
    position: absolute;
    right: 8px;
    bottom: 6px;
    color: #fda4af;
}

.cb-hint {
    min-height: 18px;
    text-align: center;
    font-size: .74rem;
    color: var(--muted);
}

@keyframes cbPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(251, 113, 133, .35); }
    50% { box-shadow: 0 0 26px rgba(251, 113, 133, .75); }
}

@media (max-width: 760px) {
    .cb-card {
        width: 78px;
        height: 104px;
    }

    .cb-unit {
        width: 62px;
        height: 72px;
    }

    .cb-hand {
        gap: 6px;
    }
}

/* ==========================================================================
   教程弹层
   ========================================================================== */
.tut-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
}

.tut-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 12, .52);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .25s var(--ease);
}

.tut-modal.on .tut-backdrop {
    opacity: 1;
}

.tut-card {
    position: relative;
    width: min(560px, 100%);
    max-height: 84vh;
    overflow: auto;
    padding: 26px 26px 20px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .13);
    background: linear-gradient(180deg, rgba(24, 28, 44, .97), rgba(10, 13, 24, .99));
    box-shadow: 0 46px 90px -40px #000, inset 0 1px 0 rgba(255, 255, 255, .08);
    opacity: 0;
    transform: translateY(18px) scale(.97);
    filter: blur(10px);
    transition: transform .32s var(--ease), opacity .26s var(--ease), filter .32s var(--ease);
}

.tut-modal.on .tut-card {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

.tut-kicker {
    font-size: .64rem;
    letter-spacing: .22em;
    color: var(--muted);
    text-transform: uppercase;
}

.tut-card h3 {
    margin: 6px 0 4px;
    font-size: 1.28rem;
}

.tut-sub {
    margin: 0 0 16px;
    font-size: .8rem;
    color: var(--muted);
}

.tut-steps {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: .83rem;
    line-height: 1.55;
}

.tut-steps li::marker {
    color: #a78bfa;
    font-family: var(--mono);
    font-weight: 700;
}

.tut-steps b {
    display: block;
    font-size: .86rem;
}

.tut-steps span {
    color: var(--ink-2);
}

.tut-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.tut-tip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, .35);
    background: rgba(139, 92, 246, .12);
    color: #dcd4ff;
    font-size: .68rem;
}

.tut-ok {
    margin-top: 18px;
    width: 100%;
}

.tut-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, background .2s;
}

.tut-close:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, .1);
}

@media (max-width: 760px) {
    .tut-card {
        padding: 22px 18px 16px;
    }
}

/* 卡牌对战：图标 / 法力点 / 飘字 */
.cb-wrap {
    position: relative;
}

.cb-ico {
    font-size: 22px;
    line-height: 1;
    margin: 2px 0;
}

.cb-unit-ico {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 2px;
}

.cb-pips {
    display: flex;
    gap: 4px;
    justify-content: center;
    min-height: 12px;
}

.cb-pip {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .12);
}

.cb-pip.on {
    background: linear-gradient(160deg, #818cf8, #38bdf8);
    box-shadow: 0 0 8px rgba(99, 102, 241, .7);
}

.cb-pop {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-weight: 800;
    font-size: 20px;
    pointer-events: none;
    z-index: 6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .65);
    animation: cbPop .8s ease-out forwards;
}

.cb-pop.dmg {
    color: #fda4af;
}

.cb-pop.heal {
    color: #6ee7b7;
}

@keyframes cbPop {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -170%) scale(1.15); }
}

.cb-hero.shake {
    animation: cbShake .42s ease-in-out;
}

@keyframes cbShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

.cb-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 11px;
    line-height: 1;
    opacity: .95;
}

.bs-cell.known-ship {
    box-shadow: inset 0 0 0 2px rgba(251, 113, 133, .9);
}

.bs-cell.known-empty {
    box-shadow: inset 0 0 0 2px rgba(110, 231, 183, .65);
}

.tag.online {
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, .42);
    background: rgba(52, 211, 153, .12);
}

/* 观战席 */
.lan-spectate {
    margin-top: 8px;
}

.stage.spectating .game-controls {
    display: none !important;
}

.spectate-bar {
    margin: 0 auto 10px;
    padding: 6px 16px;
    width: max-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #fde68a;
    background: rgba(251, 191, 36, .12);
    border: 1px solid rgba(251, 191, 36, .35);
    backdrop-filter: blur(8px);
}

/* 局域网聊天 */
.lan-panel-chat {
    display: flex;
    flex-direction: column;
}

.lan-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 170px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
}

.lan-msg {
    max-width: 86%;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

.lan-msg.own {
    align-self: flex-end;
    background: rgba(99, 102, 241, .18);
    border-color: rgba(129, 140, 248, .35);
}

.lan-msg-top {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 2px;
}

.lan-msg .who {
    font-size: 11px;
    color: #c7d2fe;
}

.lan-msg .time {
    font-size: 10px;
    color: rgba(255, 255, 255, .4);
    font-family: var(--mono);
}

.lan-msg-text {
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.lan-msg.system {
    align-self: center;
    max-width: 100%;
    padding: 2px 0;
    background: transparent;
    border: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, .45);
    text-align: center;
}

.lan-chat-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.lan-chat-form input {
    flex: 1;
    min-width: 0;
}



.chess-handicap {
    appearance: none;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .05);
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.chess-handicap option {
    background: #151a2b;
    color: #e2e8f0;
}

.handi-label {
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
    margin-right: 2px;
    white-space: nowrap;
}

/* 斗地主：叫地主 / 底牌 / 地主标记 */
.ddz-bid {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 14px;
    background: rgba(251, 191, 36, .1);
    border: 1px solid rgba(251, 191, 36, .35);
}

.ddz-bid-tip {
    font-size: 13px;
    font-weight: 600;
    color: #fde68a;
}

.ddz-bottom {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-height: 10px;
}

.ddz-bottom-tip {
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
    margin-right: 4px;
}

.ddz-lord {
    font-size: 10px !important;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(251, 191, 36, .18);
    color: #fcd34d !important;
    border: 1px solid rgba(251, 191, 36, .4);
}

/* 围棋：更大的棋盘 + 目数 */
.board-wrap.go-big {
    max-width: min(1180px, 96vw);
}

@media (max-height: 820px) {
    .board-wrap.go-big {
        max-width: min(760px, 92vw);
    }
}

/* 围棋：悬浮在棋盘上的操作条 */
.go-tools {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(20, 12, 6, .55);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
}

.go-tools .btn {
    padding: 7px 12px;
    font-size: 12px;
}

/* 返回官网 */
.icon-btn.back-home { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 18px; line-height: 1; color: var(--txt-dim, #9aa6bd); }
.icon-btn.back-home:hover { color: var(--accent, #8ab4ff); }

/* 顶栏：无品牌，导航居中，操作按钮靠右 */
.topbar-in { display: flex; align-items: center; justify-content: center; position: relative; }
.topbar-actions { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .topbar-actions { right: 12px; } }

/* ===== iOS 26 风格：悬浮玻璃导航 ===== */
.topbar {
    background: transparent !important;
    border-bottom: 0 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    padding-top: 10px;
    pointer-events: none;
}
.topbar-in {
    pointer-events: auto;
    height: 54px;
    padding: 0 22px;
}
.seg {
    background: rgba(18, 24, 40, .5);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
}
.seg-glider {
    border-radius: 999px;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
}
.seg-btn {
    border-radius: 999px;
}
.topbar-actions .icon-btn {
    background: rgba(18, 24, 40, .5);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
/* 进入游戏时隐藏顶部导航 */
body.playing .topbar { display: none !important; }

/* 房间可见性切换（玻璃胶囊 + 弹性滑块） */
.room-vis {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    width: max-content;
    padding: 4px;
    margin: 10px 0 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.vis-glider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .85), rgba(77, 124, 255, .7));
    box-shadow: 0 6px 20px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), width .45s cubic-bezier(.34, 1.4, .64, 1);
    will-change: transform, width;
}
.vis-btn {
    position: relative;
    z-index: 1;
    border: 0;
    background: none;
    color: var(--muted);
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: color .3s, opacity .3s;
    opacity: .75;
}
.vis-btn.on { color: #fff; font-weight: 600; opacity: 1; }
.vis-btn:hover { color: var(--ink-2); }
.vis-tip { display: block; font-size: 12px; color: var(--muted); opacity: .7; transition: opacity .35s ease, transform .35s ease; }
/* 井字棋 */
.ttt-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; }
.ttt-cell { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); color: var(--ink); font-size: clamp(34px, 9vw, 64px); font-weight: 800; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.ttt-cell:hover:not(.x):not(.o) { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); }
.ttt-cell:active { transform: scale(.97); }
.ttt-cell.x { color: #8ab4ff; text-shadow: 0 0 26px rgba(120,160,255,.55); }
.ttt-cell.o { color: #ff9ecb; text-shadow: 0 0 26px rgba(255,140,190,.5); }
.ttt-cell.win { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }
.ttt-line { position: absolute; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #8ab4ff, #ff9ecb); transform-origin: left center; box-shadow: 0 0 22px rgba(160,180,255,.7); pointer-events: none; }

/* 军棋 · 标准棋盘 */
.jq-board { position: relative; height: min(84vh, 860px); width: min(96vw, 540px); margin: 0 auto; background: linear-gradient(160deg, #f7ecd6, #eeddc0); border: 3px solid #8a5330; border-radius: 16px; padding: 10px; box-shadow: 0 26px 60px -30px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.5); }
.jq-net { position: absolute; left: 10px; top: 10px; pointer-events: none; z-index: 0; }
.jq-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(12, 1fr); gap: 8px; height: 100%; }
.jq-cell { position: relative; border: 1.5px solid #b9834f; border-radius: 7px; background: linear-gradient(180deg, #fdf6e6, #f3e4c6); color: #5a3a1c; font-size: clamp(10px, 2.4vw, 15px); font-weight: 800; display: grid; place-items: center; cursor: pointer; transition: box-shadow .18s, transform .18s; }
.jq-cell:hover { box-shadow: 0 0 0 2px rgba(168,69,42,.45); }
.jq-cell.camp { border-radius: 50%; border-style: dashed; border-color: #b9834f; background: rgba(255,255,255,.35); }
.jq-cell.hq { border-width: 2.5px; border-color: #a8452a; background: #fff3d8; }
.jq-cell.red-half { background: linear-gradient(180deg, #fdf1ec, #f7e0d6); }
.jq-cell.has { border-radius: 7px; background: radial-gradient(circle at 50% 50%, #fff8ea 60%, #f0e0c2 61%, #f0e0c2 100%); }
.jq-cell.has.red { color: #b02a1e; border-color: #c0362a; background: radial-gradient(circle at 50% 50%, #fff8ea 58%, #f7d9cf 59%, #f7d9cf 100%); }
.jq-cell.has.blue { color: #1f4d8a; border-color: #2f63a8; background: radial-gradient(circle at 50% 50%, #fff8ea 58%, #dbe7f7 59%, #dbe7f7 100%); }
.jq-cell.sel { box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 6px #a8452a; }
.jq-cell.move { box-shadow: 0 0 0 2px #2f7a4f inset; }
.jq-cell.move::after { content: ''; position: absolute; width: 26%; height: 26%; border-radius: 50%; background: rgba(47,122,79,.5); }
.jq-front { position: absolute; top: 50%; transform: translateY(-50%); font-size: 10px; letter-spacing: .18em; color: rgba(120,70,40,.6); writing-mode: vertical-rl; z-index: 3; pointer-events: none; }
.jq-front.left { left: -2px; }
.jq-front.right { right: -2px; }
/* 房间内聊天 */
.room-chat { width: 300px; max-height: 46vh; display: flex; flex-direction: column; background: rgba(18,22,32,.95); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; box-shadow: 0 26px 60px -26px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.08); overflow: hidden; }
.room-chat[hidden] { display: none; }
.rc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #dbe4f0; border-bottom: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.05), transparent); }
.rc-close { background: none; border: 0; color: #93a2b8; font-size: 16px; cursor: pointer; line-height: 1; padding: 0 2px; }
.rc-close:hover { color: #fff; }
.rc-list { flex: 1; min-height: 120px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.rc-msg { display: flex; gap: 6px; color: #e7edf7; line-height: 1.5; }
.rc-msg .who { color: #8fb4ff; flex: none; }
.rc-msg.mine .who { color: #f0c76a; }
.rc-msg .txt { word-break: break-word; }
.rc-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.rc-input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #e7edf7; font-size: 13px; outline: none; }
.rc-input:focus { border-color: rgba(232,185,106,.55); }
.rc-send { padding: 8px 14px; border-radius: 10px; border: 0; background: linear-gradient(135deg,#f3d9a4,#d99e4a); color: #241a08; font-weight: 700; font-size: 13px; cursor: pointer; }
@media (max-width: 720px) { .room-chat { width: auto; left: 10px; right: 10px; } }
/* 手机上用的虚拟方向键 */
.s2-pad { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.s2-pad-row { display: flex; gap: 8px; }
.s2-pad-btn { width: 64px; height: 56px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #e7edf7; font-size: 18px; font-weight: 700; touch-action: manipulation; user-select: none; }
.s2-pad-btn:active { background: rgba(232,185,106,.25); border-color: rgba(232,185,106,.5); }
/* 坦克大战 手机键位 */
.tk-pad { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tk-pad-row { display: flex; gap: 8px; }
.tk-pad-btn { width: 62px; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #e7edf7; font-size: 17px; font-weight: 700; touch-action: manipulation; user-select: none; }
.tk-pad-btn:active { background: rgba(232,185,106,.25); border-color: rgba(232,185,106,.5); }