/* KetherGame 全局样式 — 可读性优先, 不做美化 */

/* === 重置 & 基础 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background: #f9f9f9;
}

a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* === 导航栏 === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.nav-brand a {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.nav-link {
  padding: 4px 8px;
  border-radius: 4px;
}

.nav-user {
  font-weight: 600;
  color: #333;
}

.nav-coins {
  color: #b45309;
  font-weight: 600;
}

/* === 容器 === */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* === 按钮 === */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  /* 移动端触摸友好: 最小 44px 高度, 这里8px padding + 24px内容 = 约40px, block按钮配合其他布局 */
}
.btn:hover {
  background: #f0f0f0;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

.btn-full {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px;
}

/* === 表单 === */
.form-card {
  max-width: 400px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 32px 24px;
}

.form-card h1 {
  font-size: 22px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #444;
}

.form-group input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-height: 42px;
}

.form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.form-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #666;
}

/* === 游戏卡片网格 === */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.game-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.game-card-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.game-card-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.game-card-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* === 个人中心 === */
.profile-card {
  max-width: 480px;
  margin: 16px auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
}

.profile-info {
  margin-bottom: 20px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  color: #666;
  font-weight: 600;
}

.profile-value {
  color: #222;
}

.profile-actions {
  text-align: right;
}

/* === 错误/空状态 === */
.error-message {
  text-align: center;
  padding: 48px 16px;
  color: #dc2626;
  font-size: 16px;
}

/* === h1 等标题 === */
h1 {
  font-size: 22px;
  margin-bottom: 12px;
}

/* === 响应式 === */

/* 平板 (640-1024px) */
@media (max-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* 手机 (< 640px) */
@media (max-width: 640px) {
  .navbar {
    padding: 0 12px;
    height: 48px;
  }

  .nav-brand a {
    font-size: 16px;
  }

  .container {
    padding: 16px 12px;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-card {
    margin: 16px auto;
    padding: 20px 16px;
    border-radius: 0;
    max-width: 100%;
  }

  .form-card h1 {
    font-size: 20px;
  }

  h1 {
    font-size: 20px;
  }
}
