/* ==========================================================================
   五子棋对战平台 - 主样式 v2
   - 圆角统一 (12px / 16px / 24px)
   - 浅色 + 渐变 + 卡片
   - 4 个 mode-card 尺寸完全一致 (1:1, 圆角 24px)
   - 移动端友好
   ========================================================================== */

:root {
    /* 主色 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #ec4899;
    --accent: #06b6d4;
    
    /* 状态色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 中性 */
    --bg: #f5f7fb;
    --bg-2: #ffffff;
    --card: #ffffff;
    --text: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    
    /* 棋盘 */
    --board-bg: #f5deb3;
    --board-line: #5d4037;
    --piece-black: #1a1a1a;
    --piece-white: #fafafa;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
    --shadow: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, .16);
    
    /* 圆角 */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
}

img { max-width: 100%; display: block; }

/* ============= 工具 ============= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* ============= 按钮 ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--r);
    font-size: 14px;
    font-weight: 600;
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary { background: var(--secondary); color: #fff; }

.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-xl { padding: 18px 36px; font-size: 18px; border-radius: var(--r-lg); }

.btn-block { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============= 输入 ============= */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: var(--r);
    font-size: 15px;
    color: var(--text);
    transition: all .15s;
}
.input:focus { background: #fff; border-color: var(--primary); }
.input::placeholder { color: var(--text-3); }

/* ============= 通知 (toast) ============= */
.toast-wrap {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(90%, 360px);
}
.toast {
    background: rgba(30, 41, 59, .92);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--r);
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastIn .2s ease;
}
.toast.success { background: rgba(16, 185, 129, .95); }
.toast.error   { background: rgba(239, 68, 68, .95); }
.toast.warning { background: rgba(245, 158, 11, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ============= 顶栏 ============= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.navbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.navbar-nav a {
    padding: 8px 14px;
    border-radius: var(--r);
    color: var(--text-2);
    font-weight: 500;
    font-size: 14px;
    transition: all .15s;
}
.navbar-nav a:hover { background: var(--bg); color: var(--text); }
.navbar-nav a.active { background: var(--primary-light); color: var(--primary); }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-user .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* ============= 登录注册页 ============= */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    top: -200px;
    right: -200px;
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    bottom: -100px;
    left: -100px;
}
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--r-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-xl);
}
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo .icon {
    width: 64px;
    height: 64px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    margin-bottom: 12px;
}
.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.auth-logo p {
    font-size: 14px;
    color: var(--text-3);
}
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--r);
    padding: 4px;
    margin-bottom: 20px;
}
.auth-tabs button {
    flex: 1;
    padding: 8px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    transition: all .15s;
}
.auth-tabs button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form .form-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.auth-form .form-row .input { flex: 1; }
.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-2);
}
.auth-switch a { font-weight: 600; }

/* ============= 大厅 4 模式 ============= */
.lobby-page {
    min-height: calc(100vh - 60px);
    padding: 32px 0 80px;
}
.lobby-hero {
    text-align: center;
    margin-bottom: 40px;
}
.lobby-hero h1 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.lobby-hero p {
    font-size: 15px;
    color: var(--text-2);
}
.lobby-hero .user-stats {
    display: inline-flex;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 100px;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}
.lobby-hero .user-stats span strong {
    color: var(--primary);
    font-weight: 700;
}

/* 4 个 mode-card, 1:1 圆角, 完全统一尺寸 */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}
@media (max-width: 640px) {
    .mode-grid { grid-template-columns: 1fr; max-width: 360px; }
}

.mode-card {
    position: relative;
    aspect-ratio: 1 / 1;            /* 严格 1:1 */
    border-radius: var(--r-xl);     /* 统一大圆角 */
    overflow: hidden;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1.5px solid var(--border);
}
.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--card-color-1, #6366f1), var(--card-color-2, #8b5cf6));
    opacity: 0;
    transition: opacity .25s;
    z-index: 0;
}
.mode-card:hover::before { opacity: .05; }
.mode-card > * { position: relative; z-index: 1; }

.mode-card .mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-color-1, #6366f1), var(--card-color-2, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    flex-shrink: 0;
}
.mode-card .mode-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.mode-card .mode-desc {
    font-size: 13px;
    color: var(--text-2);
    text-align: center;
    line-height: 1.4;
}
.mode-card .mode-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}
.mode-card .mode-badge.hot { background: #fee2e2; color: var(--danger); }
.mode-card .mode-badge.new { background: #d1fae5; color: var(--success); }

.mode-card[data-mode="single"]  { --card-color-1: #6366f1; --card-color-2: #8b5cf6; }
.mode-card[data-mode="online"]  { --card-color-1: #ec4899; --card-color-2: #f43f5e; }
.mode-card[data-mode="friend"]  { --card-color-1: #06b6d4; --card-color-2: #3b82f6; }
.mode-card[data-mode="puzzle"]  { --card-color-1: #f59e0b; --card-color-2: #ef4444; }

/* ============= 设置面板 (难度选择) ============= */
.setup-panel {
    max-width: 600px;
    margin: 24px auto 0;
    background: #fff;
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.setup-panel h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 480px) {
    .difficulty-grid { grid-template-columns: repeat(2, 1fr); }
}
.diff-btn {
    padding: 14px 8px;
    border-radius: var(--r);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all .15s;
    text-align: center;
}
.diff-btn .diff-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.diff-btn .diff-name { display: block; }
.diff-btn:hover { background: #fff; border-color: var(--primary); }
.diff-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.diff-btn.active .diff-name { color: #fff; }
.diff-btn .diff-emoji { margin-left: 4px; }

/* ============= 匹配中 ============= */
.matching {
    text-align: center;
    padding: 32px;
}
.matching-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.matching p { font-size: 16px; color: var(--text-2); margin-bottom: 8px; }
.matching .room-id { font-size: 22px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.matching .hint { font-size: 13px; color: var(--text-3); }

/* ============= 房间列表 ============= */
.room-list-panel {
    max-width: 720px;
    margin: 24px auto 0;
}
.room-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.room-list-header h3 { font-size: 18px; font-weight: 700; }
.room-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    transition: all .15s;
}
.room-item:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.room-item-info { display: flex; align-items: center; gap: 10px; }
.room-item-info .room-id { font-weight: 700; color: var(--text); }
.room-item-info .room-host { color: var(--text-2); font-size: 14px; }
.room-item .room-status {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-3);
    font-size: 14px;
}

/* ============= 残局关卡 ============= */
.puzzle-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-width: 720px;
    margin: 24px auto 0;
}
.puzzle-item {
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: var(--r-lg);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}
.puzzle-item:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.puzzle-item .puzzle-icon { font-size: 32px; margin-bottom: 6px; }
.puzzle-item .puzzle-name { font-size: 14px; font-weight: 600; color: var(--text); }
.puzzle-item .puzzle-diff {
    font-size: 11px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 100px;
}
.puzzle-item .puzzle-diff.easy { background: #d1fae5; color: var(--success); }
.puzzle-item .puzzle-diff.medium { background: #fef3c7; color: var(--warning); }
.puzzle-item .puzzle-diff.hard { background: #fee2e2; color: var(--danger); }

/* ============= 游戏界面 ============= */
.game-page {
    min-height: calc(100vh - 60px);
    background: var(--bg);
    padding: 16px;
}
.game-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 16px;
}
@media (max-width: 960px) {
    .game-layout { grid-template-columns: 1fr; }
    .game-side, .game-chat-side { display: none; }
}

.game-side, .game-chat-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-card {
    background: #fff;
    border-radius: var(--r-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid transparent;
    transition: all .15s;
}
.player-card.active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.player-card .piece-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.player-card .piece-icon.black { background: radial-gradient(circle at 30% 30%, #4a4a4a, #1a1a1a); }
.player-card .piece-icon.white { background: radial-gradient(circle at 30% 30%, #fff, #d4d4d4); }
.player-card .player-name { font-weight: 600; font-size: 15px; color: var(--text); }
.player-card .player-score { font-size: 12px; color: var(--text-3); }
.player-card .player-turn {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.player-card.active .player-turn { background: var(--primary); color: #fff; }

.game-main {
    background: #fff;
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.game-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding: 8px 16px;
    background: var(--bg);
    border-radius: 100px;
}
.board-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    touch-action: none;
}
#board {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--r);
    cursor: crosshair;
}

.game-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.game-actions .btn { flex: 1; min-width: 0; }

.friend-card { background: #fff; border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-sm); }
.friend-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-2); }
.friend-card .empty { padding: 16px 0; font-size: 13px; }

.chat-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; height: 400px; max-height: 70vh; }
.chat-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.chat-body { flex: 1; padding: 12px; overflow-y: auto; font-size: 13px; }
.chat-msg { margin-bottom: 8px; line-height: 1.4; }
.chat-msg .sender { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.chat-msg .text { padding: 6px 10px; background: var(--bg); border-radius: var(--r-sm); display: inline-block; max-width: 85%; word-break: break-all; }
.chat-msg.mine { text-align: right; }
.chat-msg.mine .text { background: var(--primary); color: #fff; }
.chat-input {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--border);
}
.chat-input input { flex: 1; padding: 8px 12px; background: var(--bg); border-radius: 100px; font-size: 13px; }
.chat-input .voice-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-input .voice-btn.recording { background: var(--danger); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

/* ============= 模态框 ============= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-content {
    background: #fff;
    border-radius: var(--r-xl);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.modal-icon { font-size: 64px; margin-bottom: 12px; }
.modal-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.modal-desc { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ============= 排行榜 ============= */
.rank-page { min-height: calc(100vh - 60px); padding: 32px 0 80px; }
.rank-page h1 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 24px;
}
.rank-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}
.rank-tabs button {
    padding: 8px 18px;
    border-radius: 100px;
    background: #fff;
    color: var(--text-2);
    font-weight: 600;
    font-size: 14px;
    border: 1.5px solid var(--border);
    transition: all .15s;
}
.rank-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rank-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rank-item {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px 80px;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}
.rank-item .rank-no {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-3);
    text-align: center;
}
.rank-item.top1 .rank-no { color: #fbbf24; }
.rank-item.top2 .rank-no { color: #9ca3af; }
.rank-item.top3 .rank-no { color: #d97706; }
.rank-item .rank-user { display: flex; align-items: center; gap: 10px; }
.rank-item .rank-user .name { font-weight: 600; }
.rank-item .stat { text-align: center; font-size: 13px; color: var(--text-2); }
.rank-item .stat strong { color: var(--text); font-weight: 600; }
.rank-item.me { background: var(--primary-light); border: 1.5px solid var(--primary); }

@media (max-width: 640px) {
    .rank-item { grid-template-columns: 40px 1fr 60px 60px; padding: 10px 12px; font-size: 13px; }
    .rank-item .stat.losses { display: none; }
}

/* ============= 移动端 (game 页面) ============= */
@media (max-width: 960px) {
    .game-page { padding: 8px; }
    .game-main { padding: 12px; }
    .board-container { max-width: 100%; }
    .game-status { font-size: 14px; }
}

/* ============= 通用隐藏 ============= */
.hidden { display: none !important; }
