/* monopoly-game 核心样式表 */
/* 强制横屏一屏显示 (100vw x 100vh)、微缩沙盘 HUD、零外部字体栈 */

:root {
  --bg-main: #0a1120;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-glass: rgba(30, 41, 59, 0.72);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(56, 189, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-gold: #fbbf24;
  --color-gold-glow: rgba(251, 191, 36, 0.35);
  --color-danger: #ef4444;
  --color-success: #10b981;
  --color-cyan: #38bdf8;

  --player-red: #ef4444;
  --player-blue: #0ea5e9;
  --player-yellow: #f59e0b;
  --player-green: #10b981;
  --player-purple: #a855f7;
  --player-pink: #ec4899;

  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================
   强制横屏容器与竖屏引导层 (规范 4.9.2)
   ========================================== */
.landscape-frame {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#rotateOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 32, 0.96);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.rotate-overlay-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.rotate-overlay-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: pulseRotate 2s infinite ease-in-out;
}

.rotate-overlay-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-cyan);
}

.rotate-overlay-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

@keyframes pulseRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(1.1); }
}

@media screen and (orientation: portrait) {
  #rotateOverlay {
    display: flex;
  }
}

/* ==========================================
   顶部导航与通用 HUD
   ========================================== */
.top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(10, 17, 32, 0.88) 0%, rgba(10, 17, 32, 0) 100%);
  z-index: 50;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.top-hud > * {
  pointer-events: auto;
}

.top-hud-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.room-badge {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.center-turn-hud {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 1;
  min-width: 0;
}

.round-pill {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.turn-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  padding: 0.35rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.countdown-timer {
  color: var(--color-cyan);
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-badge {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 响应式图标/文字两用按钮 */
.btn-responsive-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-responsive-icon .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.btn-responsive-icon .btn-text {
  display: inline;
  white-space: nowrap;
}

/* ==========================================
   按钮通用样式
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1e1b4b;
  border-color: rgba(251, 191, 36, 0.6);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.85);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

/* ==========================================
   3D 画布容器
   ========================================== */
#boardCanvasContainer {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* ==========================================
   左侧：玩家状态面板
   ========================================== */
.left-players-hud {
  position: absolute;
  top: 68px;
  left: 1.5rem;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 40;
  pointer-events: none;
}

.left-players-hud > * {
  pointer-events: auto;
}

.player-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.player-card.active-turn {
  border-color: var(--color-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateX(4px);
}

.player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.color-dot.color-0 { background-color: var(--player-red); color: var(--player-red); }
.color-dot.color-1 { background-color: var(--player-blue); color: var(--player-blue); }
.color-dot.color-2 { background-color: var(--player-yellow); color: var(--player-yellow); }
.color-dot.color-3 { background-color: var(--player-green); color: var(--player-green); }
.color-dot.color-4 { background-color: var(--player-purple); color: var(--player-purple); }
.color-dot.color-5 { background-color: var(--player-pink); color: var(--player-pink); }

.debt-tag {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid var(--color-danger);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  animation: blinkDebt 1.5s infinite;
}

@keyframes blinkDebt {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.player-cash-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cash-amount {
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
}

.cash-amount.is-negative {
  color: #f87171 !important;
}

.player-assets-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   右侧：局内战报走马灯 (支持平滑折叠/展开，默认收起)
   ========================================== */
.right-logs-hud {
  position: absolute;
  top: 68px;
  right: 1.5rem;
  width: 260px;
  max-height: calc(100vh - 160px);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  transform: translateX(0);
  opacity: 1;
}

.right-logs-hud.collapsed {
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  pointer-events: none;
}

.logs-toggle-btn {
  position: absolute;
  top: 68px;
  right: 1.5rem;
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.logs-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border-color: var(--color-cyan);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

.logs-toggle-btn.has-new-log {
  border-color: var(--color-gold);
  animation: logPulse 1.8s infinite;
}

@keyframes logPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

.logs-toggle-arrow {
  font-size: 0.7rem;
  color: var(--color-cyan);
  transition: transform 0.2s ease;
}

.logs-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.3rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.logs-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.logs-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logs-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.25rem;
}

.log-item {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-secondary);
  border-left: 2px solid var(--border-color);
  padding-left: 0.45rem;
}

.log-item.log-dice { border-color: var(--color-cyan); color: #e0f2fe; }
.log-item.log-event { border-color: var(--color-gold); color: #fef3c7; }
.log-item.log-toll { border-color: var(--color-danger); color: #fee2e2; }
.log-item.log-upgrade { border-color: #34d399; color: #d1fae5; }
.log-item.log-item { border-color: #a855f7; color: #f3e8ff; }

/* ==========================================
   底部行动操作台
   ========================================== */
.bottom-action-hud {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  padding: 0.65rem 1.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.dice-action-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
  transition: all 0.2s ease;
}

.dice-action-btn:not(:disabled) {
  animation: dicePulse 1.8s infinite ease-in-out;
}

.dice-action-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(14, 165, 233, 0.75);
}

.dice-action-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.dice-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.85);
  pointer-events: none;
}

@keyframes dicePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 8px 26px rgba(14, 165, 233, 0.8);
  }
}

.backpack-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
}

.item-slot {
  width: 46px;
  height: 46px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-slot.has-item {
  border-style: solid;
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}

.item-slot.has-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.item-slot.cannot-use {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.item-slot.cannot-use:hover {
  transform: none;
  box-shadow: none;
}

.item-slot.can-use {
  animation: itemGlow 2s infinite ease-in-out;
}

@keyframes itemGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.85);
  }
}

.decision-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
  animation: fadeIn 0.25s ease-out;
}

.decision-hint-text {
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 700;
  white-space: nowrap;
}

@keyframes bannerPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.02);
  }
}

/* ==========================================
   全屏幽默消费弹窗 (Humor Popup Modal)
   ========================================== */
.humor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.25s ease-out;
}

.humor-modal-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #f59e0b;
  width: 90%;
  max-width: 520px;
  border-radius: 24px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.35);
  animation: popScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.humor-icon-large {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.humor-building-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-gold);
  margin-bottom: 0.35rem;
}

.humor-spend-amount {
  font-size: 2.2rem;
  font-weight: 900;
  color: #f87171;
  margin: 0.5rem 0;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.humor-story-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0 1.5rem 0;
}

@keyframes popScale {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================
   终局清算大厅与 12 项关怀奖 (Game Over Modal)
   ========================================== */
.gameover-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.gameover-card {
  background: var(--bg-card);
  border: 2px solid var(--color-gold);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 24px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 0 40px var(--color-gold-glow);
}

.gameover-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.winner-crown-badge {
  font-size: 2.5rem;
}

.gameover-title {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.rankings-table th, .rankings-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.rankings-table th {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.rankings-table tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.award-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.award-icon {
  font-size: 2rem;
}

.award-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-gold);
}

.award-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.award-winner {
  font-size: 0.82rem;
  color: #38bdf8;
  margin-top: 0.15rem;
}

/* ==========================================
   大厅页面专属样式 (Lobby)
   ========================================== */
.lobby-container {
  width: 100vw;
  height: 100vh;
  padding: 2rem 4rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

.room-card:hover {
  border-color: var(--color-cyan);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 简易 Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.75rem;
  width: 90%;
  max-width: 450px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-cyan);
}

/* ==========================================
   全局游戏风自定义弹窗 (Game Dialog Modal)
   ========================================== */
.game-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease-out;
}

.game-dialog-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid var(--border-glow);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  width: 90%;
  max-width: 440px;
  padding: 1.75rem;
  text-align: center;
  animation: popScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-dialog-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

.game-dialog-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.game-dialog-message {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  white-space: pre-line;
  word-break: break-word;
}

.game-dialog-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  max-height: 200px;
  overflow-y: auto;
}

.game-dialog-option-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-dialog-option-item:hover, .game-dialog-option-item.is-selected {
  border-color: var(--color-cyan);
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.game-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.game-dialog-actions .btn {
  flex: 1;
  padding: 0.65rem 1rem;
}

/* ==========================================
   顺位决裁 (1~100 摇点) 仪式大厅 (Order Roll)
   ========================================== */
.order-roll-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.92) 0%, rgba(5, 10, 20, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  animation: fadeIn 0.3s ease-out;
}

.order-roll-card {
  width: 92%;
  max-width: 780px;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.3), inset 0 0 20px rgba(251, 191, 36, 0.1);
  border-radius: 28px;
  padding: 2.2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: popScale 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.order-roll-badge {
  display: inline-block;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.order-roll-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.order-roll-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.order-roll-players-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  min-height: 180px;
}

.order-roll-player-card {
  flex: 1;
  min-width: 140px;
  max-width: 170px;
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1.25rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.order-roll-player-card.is-first {
  border-color: var(--color-gold);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18) 0%, rgba(30, 41, 59, 0.8) 100%);
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.45);
  transform: translateY(-8px) scale(1.05);
}

.order-roll-crown {
  position: absolute;
  top: -18px;
  font-size: 1.8rem;
  animation: bounceCrown 1s infinite alternate ease-in-out;
}

@keyframes bounceCrown {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

.order-roll-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* 数字上下滚动轮盘视口 */
.digit-roller-box {
  width: 90px;
  height: 64px;
  background: #090e17;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.8);
}

.order-roll-player-card.is-first .digit-roller-box {
  border-color: var(--color-gold);
}

.digit-roller-value {
  font-family: "Courier New", Courier, monospace, monospace;
  font-size: 2.3rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  transition: transform 0.08s ease-out;
}

.digit-roller-value.rolling {
  animation: rollNumberFlicker 0.1s infinite linear;
  color: #f59e0b;
}

.digit-roller-value.locked {
  color: var(--color-gold);
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.8);
  animation: lockScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes rollNumberFlicker {
  0% { transform: translateY(-2px); opacity: 0.85; }
  50% { transform: translateY(2px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.85; }
}

@keyframes lockScale {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.order-roll-rank-tag {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.order-roll-player-card.is-first .order-roll-rank-tag {
  color: var(--color-gold);
  font-size: 0.82rem;
}

.order-roll-announcement {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-glow);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
  transition: opacity 0.3s ease;
}

/* ==========================================
   全局动态通知系统 (Game Notice Center - 5s Auto)
   ========================================== */
.game-notice-container {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 99990;
  pointer-events: none;
}

.game-notice-card {
  pointer-events: auto;
  min-width: 320px;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 0.9rem 1.25rem 1rem 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: slideNoticeDown 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.3s ease;
}

.game-notice-card.notice-gold {
  border-color: var(--color-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.3);
}

.game-notice-card.notice-danger {
  border-color: var(--color-danger);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.3);
}

.game-notice-card.notice-success {
  border-color: var(--color-success);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.3);
}

.game-notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.game-notice-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-notice-icon {
  font-size: 1.35rem;
}

.game-notice-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.game-notice-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.15s ease;
}

.game-notice-close-btn:hover {
  color: #ffffff;
}

.game-notice-body {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
  padding-left: 1.85rem;
}

/* 5 秒倒计时平滑缩减进度条 */
.game-notice-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.game-notice-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--color-cyan);
  transform-origin: left;
  animation: shrinkProgress 5s linear forwards;
}

.game-notice-card.notice-gold .game-notice-progress-fill {
  background: var(--color-gold);
}

.game-notice-card.notice-danger .game-notice-progress-fill {
  background: var(--color-danger);
}

.game-notice-card.notice-success .game-notice-progress-fill {
  background: var(--color-success);
}

@keyframes shrinkProgress {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes slideNoticeDown {
  from {
    transform: translateY(-25px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ==========================================
   微缩沙盘地标探索名片卡 (Landmark Card)
   ========================================== */
.landmark-card-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99991;
  animation: fadeIn 0.2s ease-out;
}

.landmark-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid #38bdf8;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  padding: 1.6rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.35);
  position: relative;
  animation: popScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.landmark-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.landmark-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.6rem;
}

.landmark-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.landmark-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 1.25rem;
}

.landmark-footer-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* ==========================================
   角色选择弹窗 (24 款宠物手办预览与互斥抢占)
   ========================================== */
.character-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

.character-modal-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  width: min(94vw, 860px);
  max-height: min(92vh, 620px);
  border-radius: 22px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(56, 189, 248, 0.2);
  animation: popScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.character-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.character-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.character-modal-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.character-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-cyan);
}

.character-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.character-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.character-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.character-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.75rem;
  overflow-y: auto;
  padding: 0.35rem 0.25rem;
  flex: 1;
  min-height: 0;
}

.character-grid-container::-webkit-scrollbar {
  width: 6px;
}

.character-grid-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.character-card {
  position: relative;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
  user-select: none;
}

.character-card:hover:not(.is-occupied) {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.25);
}

.character-card-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.18s;
}

.character-card:hover:not(.is-occupied) .character-card-preview {
  transform: scale(1.08);
}

.character-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.35rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.character-card-tag {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* 选中态 */
.character-card.is-selected {
  border-color: var(--color-gold);
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}

.character-card-badge-selected {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--color-gold);
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 900;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* 被占用态 */
.character-card.is-occupied {
  opacity: 0.42;
  filter: grayscale(0.85);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(15, 23, 42, 0.3);
}

.character-card-occupied-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 17, 32, 0.78);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  gap: 0.2rem;
}

.character-card-occupied-label {
  font-size: 0.68rem;
  color: #f87171;
  font-weight: 800;
  text-align: center;
}

.character-card-occupied-user {
  font-size: 0.65rem;
  color: #e2e8f0;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.character-selected-tip {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.character-selected-name {
  color: var(--color-gold);
  font-weight: 700;
}

/* 玩家头像缩略图 (左侧 HUD) */
.player-avatar-thumb {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  margin-right: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* =========================================================
   响应式媒体查询：中等尺寸设备适配 (iPad / 小窗口 / <= 1040px)
   ========================================================= */
@media (max-width: 1040px) {
  /* 1. 顶部 HUD 紧凑化与按钮文字隐藏 (只展示图标) */
  .top-hud {
    height: 48px;
    padding: 0 0.85rem;
  }

  .top-hud-left {
    gap: 0.5rem;
  }

  .brand-title {
    max-width: 110px;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .round-pill {
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
  }

  .round-pill .round-sub {
    display: none;
  }

  /* 核心：中尺寸及以下隐藏按钮文本，仅保留鲜明图标，消除竖排折行挤压 */
  .btn-responsive-icon .btn-text {
    display: none !important;
  }

  .btn-responsive-icon {
    padding: 0.28rem 0.55rem;
    min-width: 34px;
    height: 34px;
    border-radius: 9px;
    justify-content: center;
  }

  .btn-responsive-icon .btn-icon {
    font-size: 1.05rem;
    margin: 0;
  }

  .center-turn-hud {
    gap: 0.5rem;
    max-width: 280px;
  }

  .turn-status-banner {
    padding: 0.25rem 0.75rem;
    font-size: 0.82rem;
    max-width: 220px;
  }

  .turn-status-banner .banner-extra-text {
    display: none;
  }

  .countdown-timer {
    font-size: 0.9rem;
  }

  .user-wrap {
    gap: 0.45rem;
  }

  .user-badge {
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
  }

  .user-badge .user-badge-prefix {
    display: none;
  }

  #myUsernameDisplay {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  /* 2. 左侧玩家 HUD 尺寸收缩，杜绝霸屏与遮挡 */
  .left-players-hud {
    top: 52px;
    left: 0.75rem;
    width: 165px;
    gap: 0.35rem;
  }

  .player-card {
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    gap: 0.2rem;
  }

  .player-name-wrap {
    font-size: 0.82rem;
    gap: 0.35rem;
  }

  .player-avatar-thumb {
    width: 18px;
    height: 18px;
    margin-right: 0.2rem;
  }

  .color-dot {
    width: 8px;
    height: 8px;
  }

  .player-char-tag {
    display: none;
  }

  .cash-amount {
    font-size: 0.82rem;
  }

  .player-assets-text {
    font-size: 0.72rem;
  }

  .player-assets-text .assets-prefix {
    display: none;
  }

  .player-assets-text .assets-suffix {
    display: none;
  }

  .player-assets-text .assets-suffix-short {
    display: inline !important;
  }

  /* 3. 全局动态通知弹窗避免与玩家 HUD 重叠 */
  .game-notice-container {
    top: 52px;
  }

  .game-notice-card {
    min-width: 250px;
    max-width: min(330px, 80vw);
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
  }

  .game-notice-title {
    font-size: 0.88rem;
  }

  .game-notice-body {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  /* 4. 右侧战报展开胶囊收缩为图标圆形按钮 */
  .logs-toggle-btn {
    top: 52px;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .logs-toggle-btn .logs-toggle-text,
  .logs-toggle-btn .logs-toggle-arrow {
    display: none !important;
  }

  .logs-toggle-btn .logs-toggle-icon {
    font-size: 1.1rem;
    margin: 0;
  }

  .right-logs-hud {
    width: min(230px, 75vw);
    right: 0.75rem;
    top: 52px;
    max-height: calc(100vh - 110px);
    font-size: 0.76rem;
  }

  /* 5. 底部操作台紧凑缩放 */
  .bottom-action-hud {
    bottom: 0.75rem;
    padding: 0.45rem 1rem;
    gap: 0.85rem;
    border-radius: 16px;
  }

  .dice-action-btn {
    width: 52px;
    height: 52px;
    font-size: 1.55rem;
    border-radius: 14px;
  }

  .item-slot {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  /* 6. 模态弹窗与角色选择卡片自适应 */
  .character-modal-card {
    width: 95%;
    max-height: 90vh;
    padding: 0.85rem 1rem;
  }

  .character-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.5rem;
  }

  .character-card {
    padding: 0.45rem 0.3rem;
    border-radius: 10px;
  }

  .character-card-preview {
    width: 50px;
    height: 50px;
  }

  .character-card-name {
    font-size: 0.74rem;
  }
}

/* =========================================================
   响应式媒体查询：小尺寸设备适配 (手机横屏 / <= 768px)
   ========================================================= */
@media (max-width: 768px) {
  .top-hud {
    height: 42px;
    padding: 0 0.5rem;
  }

  .top-hud-left {
    gap: 0.35rem;
  }

  .brand-wrap {
    gap: 0.35rem;
  }

  .brand-title {
    display: none; /* 小尺寸设备仅保留发光骰子图标，省出空间 */
  }

  .brand-icon {
    font-size: 1.35rem;
  }

  .round-pill {
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
  }

  .btn-responsive-icon {
    min-width: 30px;
    height: 30px;
    padding: 0.2rem 0.45rem;
  }

  .btn-responsive-icon .btn-icon {
    font-size: 0.95rem;
  }

  .center-turn-hud {
    max-width: 175px;
    gap: 0.35rem;
  }

  .turn-status-banner {
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
    max-width: 135px;
  }

  .countdown-timer {
    font-size: 0.82rem;
  }

  .user-wrap {
    gap: 0.35rem;
  }

  .user-badge {
    padding: 0.15rem 0.45rem;
    font-size: 0.74rem;
  }

  #myUsernameDisplay {
    max-width: 48px;
  }

  /* 左侧玩家 HUD */
  .left-players-hud {
    top: 46px;
    left: 0.5rem;
    width: 145px;
    gap: 0.25rem;
    max-height: calc(100vh - 95px);
    overflow-y: auto;
  }

  .player-card {
    padding: 0.28rem 0.45rem;
  }

  .player-name-wrap {
    font-size: 0.76rem;
  }

  .cash-amount {
    font-size: 0.76rem;
  }

  /* 右侧战报 */
  .logs-toggle-btn {
    top: 46px;
    right: 0.5rem;
    width: 30px;
    height: 30px;
  }

  .right-logs-hud {
    top: 46px;
    right: 0.5rem;
    width: min(210px, 85vw);
  }

  /* 底部操作栏 */
  .bottom-action-hud {
    bottom: 0.5rem;
    padding: 0.35rem 0.75rem;
    gap: 0.65rem;
  }

  .dice-action-btn {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
    border-radius: 12px;
  }

  .item-slot {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
}

/* =========================================================
   横屏矮屏模式适配 (高 <= 520px，如手机横屏 752x429、844x390)
   ========================================================= */
@media (max-height: 520px) {
  .top-hud {
    height: 42px;
    padding: 0 0.65rem;
  }

  .left-players-hud {
    top: 46px;
    max-height: calc(100vh - 85px);
    overflow-y: auto;
    gap: 0.25rem;
  }

  .player-card {
    padding: 0.25rem 0.5rem;
  }

  .logs-toggle-btn {
    top: 46px;
  }

  .right-logs-hud {
    top: 46px;
    max-height: calc(100vh - 85px);
  }

  .game-notice-container {
    top: 46px;
  }

  .game-notice-card {
    padding: 0.45rem 0.75rem;
  }

  .bottom-action-hud {
    bottom: 0.4rem;
    padding: 0.3rem 0.75rem;
    gap: 0.6rem;
    border-radius: 14px;
  }

  .dice-action-btn {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .item-slot {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .character-modal-card {
    max-height: 92vh;
    padding: 0.6rem 0.85rem;
  }

  .character-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.4rem;
  }

  .character-card-preview {
    width: 42px;
    height: 42px;
  }
}


