/* 响应式适配 - 手机竖屏 / 平板 / 电脑横屏 */

/* === 手机竖屏 (默认) === */
#game-container {
  max-width: 100vw;
}

/* 角色卡片网格 - 手机 3列 */
.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* === 平板 / 手机横屏 (宽度 >= 600px) === */
@media (min-width: 600px) {
  #game-container {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
  }

  .char-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .btn {
    padding: 10px 20px;
  }
}

/* === 电脑横屏 (宽度 >= 900px) === */
@media (min-width: 900px) {
  #game-container {
    max-width: 420px;
    height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-top: 5vh;
  }

  .char-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 电脑端鼠标悬停效果 */
  .btn:hover {
    filter: brightness(1.1);
  }

  .card--clickable:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .bottom-nav__item:hover {
    color: var(--color-primary-light);
  }
}

/* === 大屏 (宽度 >= 1200px) === */
@media (min-width: 1200px) {
  #game-container {
    max-width: 480px;
    height: 85vh;
    margin-top: 7.5vh;
  }
}

/* === 高分屏优化 === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .border-radius-sm {
    border-radius: 3px;
  }
}

/* === 暗色模式偏好 === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-dark: #15152a;
    --bg-darker: #0a0a15;
  }
}

/* === 横屏适配 (短屏设备) === */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --nav-height: 48px;
    --topbar-height: 40px;
  }

  .bottom-nav__label {
    display: none;
  }

  .bottom-nav__icon {
    width: 20px;
    height: 20px;
  }
}
