/* ============================================================
   大富翁 · 东方雅集 —— 视觉系统
   宣纸底 / 墨色字 / 朱砂印 / 鎏金框
   ============================================================ */
:root {
    --paper: #f1e9d7;
    --paper-light: #faf5ea;
    --paper-dark: #e5dac2;
    --ink: #332b23;
    --ink-soft: #6b6156;
    --ink-faint: #a39785;
    --vermilion: #9e2b25;
    --vermilion-dark: #7c1f1a;
    --gold: #a9822f;
    --gold-light: #d8bc7a;
    --jade: #4a7c59;
    --border: #d5c8ac;
    --shadow-ink: 0 2px 12px rgba(51, 43, 35, 0.14);
    --font-display: "STKaiti", "KaiTi", "Kaiti SC", "FangSong", "SimSun", serif;
    --font-body: "PingFang SC", "Microsoft YaHei", sans-serif;
    /* 宣纸纤维噪点 / 水墨远山：内联 SVG，离线可用 */
    --tex-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.055'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    --tex-mountain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='500' viewBox='0 0 900 500'%3E%3Cdefs%3E%3Cfilter id='a'%3E%3CfeGaussianBlur stdDeviation='10'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%236b6156' stop-opacity='.5'/%3E%3Cstop offset='1' stop-color='%236b6156' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 300 Q120 170 260 280 T520 230 T780 290 T900 240 L900 500 L0 500 Z' fill='url(%23g)' filter='url(%23a)' opacity='.45'/%3E%3Cpath d='M0 370 Q160 260 330 345 T650 315 T900 360 L900 500 L0 500 Z' fill='%235a5248' filter='url(%23a)' opacity='.35'/%3E%3Cpath d='M0 435 Q180 340 380 412 T760 402 T900 422 L900 500 L0 500 Z' fill='%233f382f' filter='url(%23b)' opacity='.5'/%3E%3Cpath d='M596 442 q16 9 34 0' stroke='%233f382f' stroke-width='3' fill='none' opacity='.55'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(241, 233, 215, 0.72), rgba(241, 233, 215, 0.72)),
        var(--tex-paper);
    background-size: auto, 200px;
    overflow: hidden;
}

.screen { height: 100vh; }

/* ==================== 按钮体系 ==================== */
.btn {
    font-family: var(--font-body);
    font-size: 15px;
    letter-spacing: 3px;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--vermilion);
    color: #fdf6ec;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(124, 31, 26, 0.35);
}
.btn-primary:hover { background: var(--vermilion-dark); }

.btn-gold {
    background: var(--gold);
    color: #fdf6ec;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 2px 6px rgba(124, 95, 27, 0.3);
}
.btn-gold:hover { background: #8f6d24; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--gold-light);
}
.btn-ghost:hover { background: rgba(169, 130, 47, 0.12); }

.btn-sm { font-size: 13px; padding: 6px 14px; letter-spacing: 2px; }

.btn:disabled {
    background: #cfc4ab !important;
    color: #8d8371 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

.btn-active {
    background: var(--vermilion) !important;
    color: #fdf6ec !important;
    animation: turn-glow 1.6s ease-in-out infinite;
}
.btn-dimmed {
    background: #cfc4ab !important;
    color: #f6f0e2 !important;
}

/* ==================== 登录界面 ==================== */
#login-screen {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.login-backdrop {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(241, 233, 215, 0.55), rgba(241, 233, 215, 0.8)),
        var(--tex-mountain);
    background-size: auto, cover;
    background-position: center;
    filter: saturate(0.8);
}
.login-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(51, 43, 35, 0.18));
}

.login-card {
    position: relative;
    width: 460px;
    max-width: calc(100vw - 40px);
    background-color: var(--paper-light);
    background-image: var(--tex-paper);
    background-size: 200px;
    border: 1px solid var(--gold-light);
    outline: 1px solid rgba(169, 130, 47, 0.35);
    outline-offset: -7px;
    border-radius: 4px;
    box-shadow: 0 18px 50px rgba(30, 24, 16, 0.35);
    padding: 40px 44px 30px;
    text-align: center;
    animation: rise-in 0.5s ease both;
}

.login-seal {
    position: absolute;
    top: 22px;
    right: 26px;
    writing-mode: vertical-rl;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 3px;
    color: #fdf6ec;
    background: var(--vermilion);
    padding: 8px 5px;
    border-radius: 3px;
    transform: rotate(2deg);
    box-shadow: 0 2px 5px rgba(124, 31, 26, 0.4);
    user-select: none;
}

.brand-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--ink);
}
.brand-dot { color: var(--vermilion); }
.brand-sub {
    margin: 10px 0 24px;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--ink-soft);
}
.brand-sub::before, .brand-sub::after { content: "—— "; color: var(--ink-faint); }
.brand-sub::after { content: " ——"; }

.avatar-picker {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 6px 0 20px;
    flex-wrap: wrap;
}
.ink-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: #fdf6ec;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 8px rgba(51, 43, 35, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    user-select: none;
}
.ink-avatar:hover { transform: translateY(-3px); }
.ink-avatar.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(169, 130, 47, 0.35), 0 4px 10px rgba(51, 43, 35, 0.3);
    transform: scale(1.1);
}
.ink-avatar.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none;
}

/* 水墨头像配色 */
.avatar-1 { background: radial-gradient(circle at 32% 28%, #8fa8b8, #3b4a5a 70%); }
.avatar-2 { background: radial-gradient(circle at 32% 28%, #d98e7e, #9e2b25 70%); }
.avatar-3 { background: radial-gradient(circle at 32% 28%, #e0c98f, #a9822f 70%); }
.avatar-4 { background: radial-gradient(circle at 32% 28%, #a3c4af, #4a7c59 70%); }
.avatar-5 { background: radial-gradient(circle at 32% 28%, #c3a6d1, #7d4a8c 70%); }
.avatar-6 { background: radial-gradient(circle at 32% 28%, #e5b98a, #b96a1f 70%); }

#username {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#username:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(169, 130, 47, 0.15);
}

.lobby-status {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
#wait-tip {
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 10px;
}

/* ==================== 棋局布局 ==================== */
#game-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.board-wrap {
    position: relative;   /* 棋子跳动克隆体的定位基准 */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    min-width: 0;
}

.board {
    width: min(100%, calc(100vh - 28px));
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    gap: 3px;
    padding: 12px;
    background-color: var(--paper-dark);
    background-image: var(--tex-paper);
    background-size: 200px;
    border: 1px solid var(--gold-light);
    outline: 3px double var(--gold);
    outline-offset: -8px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(30, 24, 16, 0.25), var(--shadow-ink);
}

/* ---------- 地块 ---------- */
.cell {
    position: relative;
    background: rgba(255, 253, 246, 0.92);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 3px 2px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.cell:hover { box-shadow: inset 0 0 0 2px rgba(169, 130, 47, 0.4); }

.cell-color-bar {
    width: 100%;
    height: 7px;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px rgba(51, 43, 35, 0.15);
    flex-shrink: 0;
}
.cell-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    line-height: 1.2;
    color: var(--ink);
    padding: 0 1px;
}
.cell-price { font-size: 10px; color: var(--ink-soft); }
.cell-footer { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.cell.corner {
    background: rgba(246, 238, 220, 0.95);
    box-shadow: inset 0 0 0 2px var(--gold-light);
    justify-content: center;
    gap: 3px;
}
.cell.corner .cell-name { font-size: 12px; letter-spacing: 1px; }
.cell.corner .corner-mark {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--vermilion);
    line-height: 1;
}

.cell.owned { box-shadow: inset 0 0 0 2px var(--owner, var(--gold)); }
.owner-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--owner, var(--gold));
    border: 1px solid rgba(255, 255, 255, 0.7);
}
.cell.mortgaged { filter: grayscale(0.75); opacity: 0.8; }
.mortgage-stamp {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-family: var(--font-display);
    font-size: 10px;
    color: #fdf6ec;
    background: var(--vermilion);
    padding: 1px 3px;
    border-radius: 2px;
    transform: rotate(-8deg);
}

.house-row { display: flex; gap: 2px; align-items: center; }
.house-dot {
    width: 7px;
    height: 7px;
    background: var(--jade);
    border: 1px solid #2d5738;
    border-radius: 1px;
}
.hotel-dot {
    width: 12px;
    height: 9px;
    background: var(--vermilion);
    border: 1px solid #6d1a15;
    border-radius: 1px;
    font-size: 8px;
    line-height: 8px;
    color: #fdf6ec;
    font-family: var(--font-display);
}

/* ---------- 棋子 ---------- */
.token-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: center;
    align-items: center;
    margin-top: 1px;
}
.token-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fdf6ec;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    animation: token-pop 0.3s ease both;
}
.token-row .token-avatar + .token-avatar { margin-left: -8px; }
.token-avatar.breathe { animation: token-breathe 1.6s ease-in-out infinite; z-index: 2; }
.token-hidden { visibility: hidden; }

/* 逐格跳动的棋子克隆体 */
.token-move {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fdf6ec;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    z-index: 60;
    pointer-events: none;
    transition: left 0.13s linear, top 0.13s linear;
    animation: token-hop 0.28s ease-in-out infinite;
}

/* ---------- 棋盘中央 ---------- */
.center-title {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(169, 130, 47, 0.55);
    border-radius: 4px;
    background-color: var(--paper-light);
    background-image:
        linear-gradient(rgba(250, 245, 234, 0.62), rgba(250, 245, 234, 0.3)),
        var(--tex-mountain);
    background-size: auto, cover;
    background-position: center;
    overflow: hidden;
}
.center-brand {
    margin: 0;
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 10px;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.center-brand-sub {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 6px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}
.center-brand-sub::before, .center-brand-sub::after {
    content: "";
    width: 46px;
    height: 1px;
    background: var(--gold-light);
}

.dice-row { display: flex; gap: 16px; margin: 6px 0; }
.die {
    width: 46px;
    height: 46px;
    background: rgba(255, 253, 246, 0.95);
    border: 1px solid #c9b78e;
    border-radius: 9px;
    box-shadow: 0 3px 7px rgba(51, 43, 35, 0.25), inset 0 -2px 0 rgba(51, 43, 35, 0.06);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 6px;
}
.die .pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a2b23;
    place-self: center;
    visibility: hidden;
}
.die .pip.on { visibility: visible; }
.die.rolling { animation: dice-shake 0.4s ease-in-out infinite; }

.center-turn {
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--ink);
    min-height: 22px;
}
.center-turn b { font-family: var(--font-display); font-size: 16px; }
.center-stock { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }

/* ==================== 侧栏 ==================== */
.sidebar {
    width: 400px;
    flex-shrink: 0;
    background-color: var(--paper-light);
    background-image: var(--tex-paper);
    background-size: 420px;
    border-left: 3px double var(--gold);
    box-shadow: -6px 0 24px rgba(30, 24, 16, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    overflow-y: auto;
}

.side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.side-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 4px;
    color: var(--vermilion);
}

.action-zone {
    background: rgba(255, 253, 246, 0.7);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}
.dice-note {
    text-align: center;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--ink-soft);
    margin-bottom: 10px;
    min-height: 18px;
}
.action-row { display: flex; gap: 10px; }
.action-row .btn { flex: 1; }

.jail-box {
    position: relative;
    background: rgba(158, 43, 37, 0.08);
    border: 1px dashed rgba(158, 43, 37, 0.5);
    border-radius: 6px;
    padding: 12px 14px 12px 74px;
}
.jail-stamp {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(-6deg);
    font-family: var(--font-display);
    font-size: 22px;
    color: #fdf6ec;
    background: var(--vermilion);
    padding: 8px 6px;
    border-radius: 3px;
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    box-shadow: 0 2px 5px rgba(124, 31, 26, 0.4);
}
.jail-text { font-size: 13px; color: var(--vermilion-dark); margin-bottom: 8px; }
.jail-actions { display: flex; gap: 8px; }
.jail-actions .btn { flex: 1; }

/* ---------- 面板通用 ---------- */
.panel {
    background: rgba(255, 253, 246, 0.55);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
}
.panel-title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 3px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title::before {
    content: "";
    width: 9px;
    height: 9px;
    background: var(--vermilion);
    border-radius: 1px;
    transform: rotate(45deg);
}

/* ---------- 玩家列表 ---------- */
.player-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border);
    border-left: 4px solid var(--pc, var(--ink-soft));
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.player-card.active {
    background: rgba(169, 130, 47, 0.14);
    box-shadow: 0 0 0 1px rgba(169, 130, 47, 0.4);
    animation: turn-glow 1.8s ease-in-out infinite;
}
.player-card.bankrupt { opacity: 0.45; }
.player-card.bankrupt .player-name { text-decoration: line-through; }

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: #fdf6ec;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 5px rgba(51, 43, 35, 0.25);
    flex-shrink: 0;
}
.player-meta { flex: 1; min-width: 0; }
.player-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-money { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.player-money b { color: var(--gold); font-size: 14px; letter-spacing: 0.5px; }

.badge {
    font-size: 10px;
    font-family: var(--font-display);
    color: #fdf6ec;
    border-radius: 2px;
    padding: 1px 4px;
    letter-spacing: 1px;
}
.badge-owner { background: var(--gold); }
.badge-jail { background: var(--vermilion); }
.badge-turn {
    background: var(--vermilion);
    animation: turn-glow 1.8s ease-in-out infinite;
}

/* ---------- 道具与产业 ---------- */
.inv-item, .prop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 9px;
    margin-bottom: 6px;
}
.prop-name { font-family: var(--font-display); font-weight: 700; }
.prop-sub { color: var(--ink-soft); font-size: 12px; }
.prop-actions { display: flex; gap: 6px; }

.color-chip {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
    box-shadow: inset 0 0 0 1px rgba(51, 43, 35, 0.2);
}
.sets-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.set-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 7px;
}
.set-chip .complete { color: var(--gold); font-weight: 700; }

.empty-hint { font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; }

/* ---------- 日志 ---------- */
.logs {
    background: rgba(51, 43, 35, 0.85);
    color: #e8dfcd;
    border-radius: 4px;
    border: 1px solid #4a3f33;
    padding: 10px 12px;
    height: 150px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
}
.logs .log-line { letter-spacing: 0.5px; }
.logs .log-line::before { content: "· "; color: var(--gold-light); }
.logs .log-line.new { color: #f5d9a8; }

/* ---------- 差分动画元素 ---------- */
.money-float {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
    animation: money-float 1.5s ease-out both;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.money-float.gain { color: var(--jade); }
.money-float.loss { color: var(--vermilion); }

.flash-cell { animation: cell-flash 1.1s ease-in-out both; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 24, 16, 0.45);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}
.modal-overlay.show { display: flex; }

.modal-card {
    width: 470px;
    max-width: calc(100vw - 40px);
    max-height: 82vh;
    overflow-y: auto;
    background-color: var(--paper-light);
    background-image: var(--tex-paper);
    background-size: 200px;
    border: 1px solid var(--gold-light);
    outline: 1px solid rgba(169, 130, 47, 0.35);
    outline-offset: -6px;
    border-radius: 4px;
    box-shadow: 0 18px 50px rgba(30, 24, 16, 0.4);
    padding: 30px 34px;
    animation: modal-pop 0.28s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.modal-title {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 4px;
    color: var(--ink);
    padding-left: 12px;
    border-left: 4px solid var(--vermilion);
    line-height: 1.3;
}
.modal-desc {
    font-size: 14px;
    line-height: 1.9;
    color: var(--ink);
    letter-spacing: 0.5px;
}
.modal-desc .desc-box {
    background: rgba(169, 130, 47, 0.1);
    border: 1px solid rgba(169, 130, 47, 0.25);
    border-radius: 4px;
    padding: 8px 10px;
    margin: 8px 0;
}
.modal-buttons {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 14px;
}

/* ==================== Toast ==================== */
#toast-box {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}
.toast {
    background: rgba(51, 43, 35, 0.92);
    color: #f3ecdc;
    border-left: 3px solid var(--vermilion);
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 13px;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(30, 24, 16, 0.35);
    animation: toast-in 0.3s ease both;
}
.toast.out { animation: toast-out 0.3s ease both; }

/* ==================== 动画 ==================== */
@keyframes dice-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, -3px) rotate(-8deg); }
    50% { transform: translate(2px, 1px) rotate(6deg); }
    75% { transform: translate(-1px, 2px) rotate(-4deg); }
}
@keyframes token-pop {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes token-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
    50% { transform: scale(1.22); box-shadow: 0 0 12px 3px rgba(169, 130, 47, 0.65); }
}
@keyframes token-hop {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -7px; }
}
@keyframes money-float {
    0% { opacity: 0; transform: translateY(8px); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-26px); }
}
@keyframes cell-flash {
    0% { box-shadow: inset 0 0 0 2px var(--owner, var(--gold)); }
    55% { box-shadow: inset 0 0 0 3px var(--owner, var(--gold)), 0 0 16px 5px rgba(169, 130, 47, 0.6); }
    100% { box-shadow: inset 0 0 0 2px var(--owner, var(--gold)); }
}
@keyframes modal-pop {
    from { transform: scale(0.86) translateY(14px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes toast-in {
    from { transform: translateY(-16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-12px); opacity: 0; }
}
@keyframes turn-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(169, 130, 47, 0.4); }
    50% { box-shadow: 0 0 12px 2px rgba(158, 43, 37, 0.35); }
}
@keyframes rise-in {
    from { transform: translateY(26px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==================== 窄屏适配 ==================== */
@media (max-width: 1024px) {
    body { overflow: auto; }
    #game-container { flex-direction: column; height: auto; }
    .board { width: min(96vw, 640px); margin: 0 auto; }
    .sidebar { width: 100%; border-left: none; border-top: 3px double var(--gold); }
}
