/* ================= 游戏大厅 · 全局样式 =================
   风格：米色底 + 几何色块 + 毛玻璃卡片 + 彩色 3D 按钮 + 明暗主题
   ========================================================= */
* {
  margin: 0; padding: 0; box-sizing: border-box;
  transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease,
              box-shadow 0.3s ease, opacity 0.4s ease, transform 0.2s ease;
}

:root {
  --bg: #f0e6d0;
  --text: #2d2a3e;
  --muted: #5a4e6b;
  --card: rgba(255, 255, 255, 0.75);
  --card-solid: rgba(245, 240, 250, 0.6);
  --line: rgba(200, 180, 210, 0.25);
  --badge: #b8a0c9;
  --badge-text: #1e1a2a;
  --input-bg: rgba(255, 255, 255, 0.65);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.1);
  --red: #f94144;
  --yellow: #f9c74f;
  --bluegray: #577590;
  --orange: #f9844a;
  --green: #43aa8b;
  --blue: #277da1;
  --gold: #f8961e;
  --purple: #6c5b7b;
}
body.dark {
  --bg: #1a1a2e;
  --text: #f0e6d0;
  --muted: #b0aac0;
  --card: rgba(26, 26, 46, 0.82);
  --card-solid: rgba(50, 50, 70, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --badge: #5a4a6a;
  --badge-text: #d0c8dd;
  --input-bg: rgba(40, 40, 60, 0.7);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  transition: background 0.5s ease;
}

a { color: var(--blue); text-decoration: none; }
body.dark a { color: #7fc4e8; }
button { font-family: inherit; }

/* ---------------- 几何色块背景 ---------------- */
.geo-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
.geo-bg div { position: absolute; border-radius: 12px; transition: background 0.5s ease, opacity 0.5s ease, transform 0.5s ease; }
.geo1 { width: 200px; height: 200px; background: #f94144; top: 5%; left: 3%; transform: rotate(15deg); opacity: 0.35; }
.geo2 { width: 300px; height: 180px; background: #f9c74f; bottom: 10%; right: 2%; transform: rotate(-8deg); border-radius: 50px 12px 50px 12px; opacity: 0.35; }
.geo3 { width: 160px; height: 160px; background: #577590; top: 20%; right: 8%; border-radius: 60% 40% 30% 70%; opacity: 0.35; }
.geo4 { width: 240px; height: 240px; background: #f9844a; bottom: 20%; left: 5%; border-radius: 30% 70% 50% 50%; opacity: 0.35; }
.geo5 { width: 120px; height: 120px; background: #43aa8b; top: 55%; left: 20%; border-radius: 20% 80% 40% 60%; opacity: 0.35; }
.geo6 { width: 180px; height: 180px; background: #277da1; top: 10%; left: 40%; border-radius: 70% 30% 60% 40%; opacity: 0.2; }
.geo7 { width: 100px; height: 100px; background: #f8961e; bottom: 40%; right: 15%; border-radius: 40% 60% 30% 70%; opacity: 0.35; }
body.dark .geo1 { background: #8f2a2e; opacity: 0.25; transform: rotate(15deg) scale(0.9); }
body.dark .geo2 { background: #a87d2e; opacity: 0.25; transform: rotate(-8deg) scale(0.9); }
body.dark .geo3 { background: #3a4a5e; opacity: 0.3; transform: scale(0.9); }
body.dark .geo4 { background: #9e5a30; opacity: 0.25; transform: scale(0.9); }
body.dark .geo5 { background: #2a6b55; opacity: 0.3; transform: scale(0.9); }
body.dark .geo6 { background: #1a4a63; opacity: 0.25; transform: scale(0.9); }
body.dark .geo7 { background: #9e6018; opacity: 0.25; transform: scale(0.9); }

/* ---------------- 主题切换（内嵌在顶栏 / 登录卡，不遮挡用户信息） ---------------- */
.theme-toggle {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 15px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 117, 125, 0.25); }
body.dark .theme-toggle { background: rgba(40, 40, 60, 0.7); border-color: rgba(255, 255, 255, 0.1); }
body.dark .theme-toggle:hover { background: rgba(60, 60, 85, 0.8); }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 17px; font-weight: 600; letter-spacing: 0.3px; color: #fff;
  text-align: center; position: relative; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease; user-select: none;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* 主按钮 - iOS 蓝 */
.btn { background: linear-gradient(145deg, #007aff, #0055b3); border-radius: 50px; border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3); }
.btn:hover { box-shadow: 0 10px 32px rgba(0, 122, 255, 0.45); transform: translateY(-3px) scale(1.01); }

/* 绿色 - Android 涟漪 */
.btn-green {
  background: linear-gradient(145deg, #3ddc84, #1f8b4c); border-radius: 40px;
  box-shadow: 0 4px 16px rgba(61, 220, 132, 0.3); border: none;
}
.btn-green:hover { transform: scale(1.02); box-shadow: 0 8px 28px rgba(61, 220, 132, 0.5); }

/* 金色 - Linux 3D */
.btn-gold {
  background: linear-gradient(145deg, #f2b84b, #d4942a); border-radius: 16px;
  box-shadow: 0 4px 0 #a5731e, 0 6px 18px rgba(210, 150, 40, 0.3); color: #1e1a1a;
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 6px 0 #a5731e, 0 12px 28px rgba(210, 150, 40, 0.4); }
.btn-gold:active { transform: translateY(2px); box-shadow: 0 2px 0 #a5731e; }

/* 红色 - 警示 */
.btn-red {
  background: linear-gradient(145deg, #f94144, #c92a2d); border-radius: 16px;
  box-shadow: 0 4px 0 #a51f22, 0 6px 18px rgba(249, 65, 68, 0.3);
}
.btn-red:hover { transform: translateY(-3px); box-shadow: 0 6px 0 #a51f22, 0 12px 28px rgba(249, 65, 68, 0.4); }
.btn-red:active { transform: translateY(2px); box-shadow: 0 2px 0 #a51f22; }

/* 紫色 - macOS 圆润 */
.btn-purple {
  background: linear-gradient(145deg, #6c5b7b, #4a3a5a); border-radius: 60px;
  box-shadow: 0 4px 12px rgba(100, 80, 120, 0.25); border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-purple:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 10px 30px rgba(100, 80, 120, 0.4); }

/* 次要 - 灰 */
.btn-ghost {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); color: var(--text);
}
.btn-ghost:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 117, 125, 0.25); }

.btn-sm { padding: 8px 15px; font-size: 13px; border-radius: 12px; }

.card {
  background: var(--card); border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.dark .card { border-color: rgba(255, 255, 255, 0.08); }

.input {
  width: 100%; padding: 13px 17px; border-radius: 16px; font-size: 15px;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 125, 161, 0.22); }

.tag {
  display: inline-block; padding: 3px 14px; border-radius: 30px; font-size: 12px;
  background: var(--badge); color: var(--badge-text); font-weight: 500; letter-spacing: 0.3px;
}
.tag-gold { background: rgba(248, 150, 30, 0.85); color: #1e1a1a; }

/* ---------------- Toast ---------------- */
#toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 12px 22px; border-radius: 20px; font-size: 14px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(-12px);
  transition: all .28s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(67, 170, 139, 0.6); color: var(--green); }
.toast-error { border-color: rgba(249, 65, 68, 0.6); color: var(--red); }
.toast-warn { border-color: rgba(248, 150, 30, 0.6); color: var(--gold); }

/* ================= 顶栏 ================= */
.topbar {
  position: relative; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 26px;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.brand .logo-fallback {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(145deg, var(--blue), var(--green));
}
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #f8961e, #f94144); color: #fff; font-weight: 800;
}

/* ================= 登录 / 注册 ================= */
.auth-wrap { position: relative; z-index: 10; min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }
.auth-card {
  width: 100%; max-width: 440px; padding: 40px 36px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 36px; box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.dark .auth-card { border-color: rgba(255, 255, 255, 0.08); }
.auth-title { font-size: 30px; font-weight: 800; text-align: center; margin-bottom: 6px; letter-spacing: 1px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 26px; letter-spacing: 0.5px; }
.auth-tabs {
  display: flex; background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 30px; padding: 5px; margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1; padding: 11px; border: none; border-radius: 30px; background: transparent;
  color: var(--muted); font-size: 15px; font-weight: 700; cursor: pointer;
}
.auth-tabs button.active { background: linear-gradient(145deg, #007aff, #0055b3); color: #fff; box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; letter-spacing: 0.5px; }
.auth-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; line-height: 1.8; }

/* ================= 大厅 ================= */
.lobby { position: relative; z-index: 10; max-width: 1180px; margin: 0 auto; padding: 10px 22px 60px; }
.hero { text-align: center; padding: 30px 10px 22px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 900; letter-spacing: 1px; }
.hero h1 .grad {
  background: linear-gradient(90deg, #f94144, #f9844a, #f8961e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 12px; font-size: 15px; letter-spacing: 0.5px; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 26px; }
.game-card { overflow: hidden; display: flex; flex-direction: column; }
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.game-cover { position: relative; height: 190px; background: linear-gradient(145deg, #577590, #277da1); overflow: hidden; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 62px; }
.game-cover .badge { position: absolute; top: 14px; left: 14px; }
.game-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.game-body h3 { font-size: 21px; font-weight: 800; letter-spacing: 0.5px; }
.game-body .desc { color: var(--muted); font-size: 14px; line-height: 1.85; flex: 1; }
.game-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 26px; }
.stat-card { padding: 22px 24px; border-radius: 24px; }
.stat-card .k { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0.5px; }
.stat-card .v { font-size: 28px; font-weight: 800; margin-top: 8px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

.section-title {
  font-size: 21px; font-weight: 800; margin: 40px 0 18px;
  display: flex; align-items: center; gap: 10px; letter-spacing: 0.5px;
}
.section-title::before {
  content: ''; width: 10px; height: 26px; border-radius: 6px;
  background: linear-gradient(#f94144, #f8961e);
}

/* ================= 排行榜 ================= */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: var(--card-solid); border: 1px solid transparent; font-size: 14px;
}
.rank-item.me { border-color: rgba(0, 122, 255, 0.45); background: rgba(0, 122, 255, 0.12); }
.rank-no {
  width: 32px; height: 32px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; background: var(--badge); color: var(--badge-text);
}
.rank-no.top1 { background: linear-gradient(145deg, #f9c74f, #f8961e); color: #1e1a1a; }
.rank-no.top2 { background: linear-gradient(145deg, #d7dee8, #93a5bb); color: #22303f; }
.rank-no.top3 { background: linear-gradient(145deg, #e0a06b, #b0703c); color: #2b1500; }
.rank-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-weight: 800; color: var(--gold); }

/* ================= 游戏页通用 ================= */
.game-page { position: relative; z-index: 10; max-width: 1180px; margin: 0 auto; padding: 10px 18px 60px; }
.game-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.game-title { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .game-layout { grid-template-columns: 1fr; } }

.canvas-wrap {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow); background: #0d1428;
}
body.dark .canvas-wrap { border-color: rgba(255, 255, 255, 0.08); }
.canvas-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }

.overlay {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  background: rgba(240, 230, 208, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 20; border-radius: 28px;
}
body.dark .overlay { background: rgba(26, 26, 46, 0.82); }
.overlay.show { display: grid; }
.overlay-inner { padding: 28px; max-width: 440px; }
.overlay-inner h2 { font-size: 30px; font-weight: 900; margin-bottom: 12px; }
.overlay-inner p { color: var(--muted); line-height: 2; font-size: 15px; margin-bottom: 18px; }
.overlay-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.side-panel { padding: 22px; display: flex; flex-direction: column; gap: 16px; border-radius: 24px; }
.panel-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; letter-spacing: 0.5px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; }

/* ================= 贪吃蛇专用 ================= */
.snake-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.snake-stat { padding: 13px 20px; border-radius: 20px; background: var(--card); border: 1px solid rgba(255, 255, 255, 0.4); min-width: 112px; box-shadow: var(--shadow-sm); }
body.dark .snake-stat { border-color: rgba(255, 255, 255, 0.08); }
.snake-stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.snake-stat .v { font-size: 24px; font-weight: 800; margin-top: 3px; }

.dpad { display: grid; grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(3, 68px); gap: 10px; justify-content: center; margin: 18px auto 6px; }
.dpad button {
  border: 1px solid var(--line); border-radius: 20px; background: var(--card-solid);
  color: var(--text); font-size: 26px; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}
.dpad button:active { background: linear-gradient(145deg, #007aff, #0055b3); color: #fff; transform: translateY(2px) scale(0.95); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .center { grid-column: 2; grid-row: 2; font-size: 15px; opacity: .7; }
.dpad .right { grid-column: 3; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 3; }
.key-hint { text-align: center; color: var(--muted); font-size: 13px; line-height: 2; margin-top: 10px; }
kbd {
  display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 12px;
  background: var(--card-solid); border: 1px solid var(--line); margin: 0 2px;
  box-shadow: 0 2px 0 var(--line);
}

/* ================= 挖穿地球专用 ================= */
/* 商店侧栏：独立滚动，不随整页一起滑动 */
.shop-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.shop-panel::-webkit-scrollbar { width: 8px; }
.shop-panel::-webkit-scrollbar-thumb { background: var(--badge); border-radius: 8px; }
.shop-panel::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 980px) {
  /* 窄屏单列布局时恢复常规流，避免内部小滚动框 */
  .shop-panel { position: static; max-height: none; overflow: visible; }
}

.dig-hud { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dig-hud .chip {
  padding: 12px 18px; border-radius: 20px; background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.4); font-size: 13px; box-shadow: var(--shadow-sm);
}
body.dark .dig-hud .chip { border-color: rgba(255, 255, 255, 0.08); }
.dig-hud .chip b { display: block; font-size: 20px; margin-top: 3px; }
.progress-wrap { margin: 8px 0 16px; }
.progress-bar {
  height: 16px; border-radius: 999px; overflow: hidden; position: relative;
  background: var(--card-solid); border: 1px solid var(--line);
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #43aa8b, #f8961e, #f94144);
  background-size: 200% 100%; animation: shine 3s linear infinite;
  transition: width .5s ease;
}
@keyframes shine { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
.progress-text { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }

.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-item {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 18px;
  background: var(--card-solid); border: 1px solid transparent; cursor: pointer;
}
.shop-item:hover { background: rgba(39, 125, 161, 0.14); border-color: var(--line); transform: translateY(-2px); }
.shop-item.disabled { opacity: .5; cursor: not-allowed; }
.shop-item.disabled:hover { transform: none; }
.shop-item.maxed { border-color: rgba(248, 150, 30, 0.55); background: rgba(248, 150, 30, 0.14); }
.shop-ico {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  background: rgba(255, 255, 255, 0.5); flex-shrink: 0; overflow: hidden;
}
body.dark .shop-ico { background: rgba(255, 255, 255, 0.1); }
.shop-ico img { width: 100%; height: 100%; object-fit: cover; }
.shop-info { flex: 1; min-width: 0; }
.shop-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.shop-desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.shop-price { text-align: right; font-size: 12px; flex-shrink: 0; }
.shop-price .cost { font-weight: 800; color: var(--gold); font-size: 13px; }
.shop-price .cnt { color: var(--muted); font-size: 11px; margin-top: 3px; }

.divider { height: 1px; background: var(--line); margin: 6px 0; }
.sub-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.5px; margin: 6px 0 2px; }

.achv-list { display: flex; flex-wrap: wrap; gap: 8px; }
.achv {
  padding: 6px 13px; border-radius: 30px; font-size: 12px;
  background: var(--card-solid); color: var(--muted); border: 1px solid var(--line);
}
.achv.on { background: rgba(67, 170, 139, 0.18); color: var(--green); border-color: rgba(67, 170, 139, 0.45); }
.me-rank {
  margin: 10px 0 4px; padding: 10px 16px; border-radius: 14px; font-size: 13px;
  background: rgba(0, 122, 255, 0.12); border: 1px solid rgba(0, 122, 255, 0.35);
}

.win-box { text-align: center; padding: 30px; }
.win-box h1 {
  font-size: 34px; letter-spacing: 1px;
  background: linear-gradient(90deg, #f8961e, #f94144, #6c5b7b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}

/* ================= 响应式 ================= */
@media (max-width: 720px) {
  .topbar { padding: 12px 15px; }
  .brand span.bname { font-size: 16px; }
  .brand img, .brand .logo-fallback { width: 38px; height: 38px; }
  .game-page, .lobby { padding: 8px 12px 48px; }
  .auth-card { padding: 28px 20px; border-radius: 28px; }
  .overlay-inner h2 { font-size: 23px; }
  .dpad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); }
  .snake-stat { min-width: 92px; padding: 10px 14px; }
  .snake-stat .v { font-size: 19px; }
  .btn { padding: 12px 18px; font-size: 15px; }
  .theme-toggle { padding: 7px 11px; font-size: 12px; }
}
