@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* --- Minimalist White/Clean Palette --- */
  --bg-body: #ffffff;
  --bg-surface: #f8fafc;
  --bg-surface-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  
  --primary: #4f46e5; /* Indigo 600 - Slightly darker for better contrast on white */
  --primary-glow: rgba(79, 70, 229, 0.15);
  --accent: #db2777; /* Pink 600 */
  --accent-glow: rgba(219, 39, 119, 0.15);
  
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;

  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  --nav-height: 70px;
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --bg-subtle: #1e293b;
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.2);
  
  --border: #334155;
  --border-hover: #475569;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
}

/* --- Reset & Base --- */
* { box-sizing: border-box; outline: none; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
img { max-width: 100%; display: block; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- Layout Utilities --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* --- Navbar (Glassmorphism) --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset,
              0 8px 24px -16px rgba(15, 23, 42, 0.10);
  height: var(--nav-height);
  transition: background-color 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] header {
  background: rgba(15, 23, 42, 0.85);
}

.bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo span {
  font-size: 1.8rem;
  /* Remove drop-shadow for cleaner look on white */
}

/* —— 首页 / 错误页:精致品牌 logo —— */
.logo.logo-brand {
  gap: 12px;
  padding: 6px 18px 6px 8px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.logo.logo-brand:hover {
  background: rgba(99,102,241,0.06);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04),
              0 4px 12px -4px rgba(99,102,241,0.18);
}
.logo.logo-brand:active { transform: scale(0.985); }

.logo.logo-brand .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.3rem;
  color: #fff;
  background:
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 2px 4px rgba(99,102,241,0.25),
    0 6px 14px -4px rgba(99,102,241,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}
.logo.logo-brand:hover .logo-mark {
  transform: rotate(-6deg) scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 3px 6px rgba(99,102,241,0.3),
    0 10px 20px -4px rgba(99,102,241,0.45);
}

.logo.logo-brand .logo-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--text-primary) 0%, var(--text-primary) 60%, var(--primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: background-position 0.5s ease;
}
.logo.logo-brand:hover .logo-name {
  background-position: 100% 50%;
}

@media (max-width: 640px) {
  .logo.logo-brand { gap: 10px; padding: 4px 14px 4px 4px; }
  .logo.logo-brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; }
  .logo.logo-brand .logo-name { font-size: 1.15rem; letter-spacing: 0.3px; }
}

/* —— 多语言切换器(下拉) —— */
.lang-switcher {
  position: relative;
}
.lang-switcher > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary::marker { display: none; content: ''; }

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lang-current:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(99,102,241,0.04);
}
.lang-switcher[open] .lang-current {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 2px 6px rgba(99,102,241,0.15);
}
.lang-current .lang-icon { flex-shrink: 0; opacity: 0.85; }
.lang-current .lang-caret {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.lang-switcher[open] .lang-current .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 4px 6px -2px rgba(15,23,42,0.05),
    0 16px 32px -8px rgba(15,23,42,0.18);
  z-index: 200;
  animation: langDropdownIn 0.18s ease-out;
}
@keyframes langDropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-option:hover {
  background: rgba(99,102,241,0.08);
  color: var(--primary);
}
.lang-option.active {
  color: var(--primary);
  font-weight: 700;
  background: linear-gradient(135deg, #eef2ff, #fce7f3);
}

@media (max-width: 640px) {
  .lang-current { padding: 5px 10px; font-size: 0.82rem; }
  .lang-menu { min-width: 150px; }
}

/* —— 详情页头部:返回 + 当前游戏 —— */
.logo.logo-back {
  gap: 14px;
  padding: 6px 16px 6px 8px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.logo.logo-back:hover {
  background: rgba(99,102,241,0.06);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04),
              0 4px 12px -4px rgba(99,102,241,0.18);
}
.logo.logo-back:active {
  transform: scale(0.985);
}
.logo.logo-back .back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #475569;
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.logo.logo-back .back-arrow svg {
  display: block;
}
.logo.logo-back:hover .back-arrow {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateX(-3px);
}
.logo.logo-back:hover .detail-current-name {
  color: var(--primary);
}

/* 返回与当前游戏之间的细分隔 */
.logo.logo-back .back-arrow + .detail-current-icon,
.logo.logo-back .back-arrow + .detail-current-icon--text {
  position: relative;
  margin-left: 6px;
}
.logo.logo-back .back-arrow + .detail-current-icon::before,
.logo.logo-back .back-arrow + .detail-current-icon--text::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 22px;
  background: linear-gradient(to bottom, transparent, rgba(148,163,184,0.5), transparent);
}

.detail-current-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06),
              0 4px 10px -4px rgba(99,102,241,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.logo.logo-back:hover .detail-current-icon {
  transform: scale(1.04);
  box-shadow: 0 2px 4px rgba(15,23,42,0.08),
              0 8px 16px -6px rgba(99,102,241,0.30);
}
.detail-current-icon--text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--primary);
  font-size: 1.15rem;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
}
.detail-current-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
  transition: color 0.25s ease;
}
@media (max-width: 640px) {
  .logo.logo-back { gap: 10px; padding: 4px 12px 4px 4px; }
  .logo.logo-back .back-arrow { width: 30px; height: 30px; font-size: 0.95rem; }
  .detail-current-icon { width: 32px; height: 32px; border-radius: 8px; }
  .detail-current-name { font-size: 1rem; max-width: 200px; letter-spacing: 0.2px; }
  .logo.logo-back .back-arrow + .detail-current-icon::before,
  .logo.logo-back .back-arrow + .detail-current-icon--text::before { display: none; }
}

/* 详情页:header 与卡片之间的柔和介绍区 */
.detail-intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
  padding: 32px 20px 36px;
  margin: 0 -16px 8px;
  background: #f8fafc; /* 极淡灰,与白色页面温和衔接 */
}
.detail-intro__text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #64748b; /* slate-500 柔和灰蓝 */
  white-space: nowrap;
}
.detail-intro__arrows {
  font-size: 1.1rem;
  color: #94a3b8; /* slate-400 更淡 */
  letter-spacing: 4px;
  font-weight: 700;
  display: inline-flex;
  animation: introBounce 1.6s ease-in-out infinite;
}
.detail-intro__arrows:last-child {
  animation-delay: 0.8s;
}
@keyframes introBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(5px); opacity: 1; }
}
@media (max-width: 640px) {
  .detail-intro { padding: 24px 12px 28px; gap: 8px; }
  .detail-intro__text { font-size: 1.05rem; letter-spacing: 1.5px; }
  .detail-intro__arrows { font-size: 0.95rem; letter-spacing: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .detail-intro__arrows { animation: none; }
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--radius-full);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--bg-surface-hover);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--primary);
  border-color: var(--border-hover);
}

/* --- Hero Section --- */
.hero-wrapper {
  position: relative;
  padding: 10px 0 0;
  overflow: hidden;
}

/* Background Glow Effects - Adjusted for Light Mode */
.glow-blob {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  filter: blur(80px);
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(79, 70, 229, 0.05);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  display: none;
}

/* --- Search --- */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 20px;
}

.search-input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  padding: 16px 24px 16px 54px;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.2rem;
  pointer-events: none;
}

/* --- Category Pills --- */
.cat-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 10px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .cat-pill:hover, [data-theme="dark"] .cat-pill.active {
    color: #fff;
}

/* Dark mode overrides for pills and buttons */
[data-theme="dark"] .cat-pill {
    background: var(--bg-surface);
    color: var(--text-secondary);
}

[data-theme="dark"] .cat-pill:hover, 
[data-theme="dark"] .cat-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

[data-theme="dark"] .btn-back {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .btn-back:hover {
    background: var(--bg-surface-hover);
    color: #fff;
    border-color: var(--primary);
}
/* --- Bento Grid --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Slightly smaller min-width for mobile */
  gap: 16px; /* Reduced gap for mobile */
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
  }
}

.game-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  width: 100%;
}

.game-card::before { display: none; }

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 12px 28px -8px rgba(99,102,241,0.22),
              0 4px 10px rgba(0,0,0,0.04);
}

.card-icon-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  background: var(--bg-subtle);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .card-icon { transform: scale(1.06); }

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0;
  padding: 0 2px;
  line-height: 1.35;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}
.game-card:hover .card-title { color: var(--primary); }

@media (min-width: 768px) {
  .card-title { font-size: 1.15rem; }
}

/* Removed card-desc styles */

/* Removed card-btn styles as element is removed */

/* --- Game Detail Page --- */
.detail-header {
  position: relative;
  padding: 10px 0 0; /* Reduced padding */
  overflow: hidden;
  border-bottom: none; /* Removed border */
  background: transparent; /* Removed background */
}

.detail-bg {
  display: none; /* Removed background image/blur */
}

.detail-content {
  display: flex;
  flex-direction: column; /* Stack vertically by default */
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 10;
}

.detail-icon {
  width: 160px;
  height: 160px;
  border-radius: 40px;
  box-shadow: var(--shadow-lg);
  border: 4px solid #fff;
  background: #fff;
}

.detail-info h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.1;
  color: var(--text-primary);
}

.detail-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

/* --- Buttons & Inputs --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}
.btn-primary:hover {
  background: #4338ca; /* Indigo 700 */
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  height: 32px; /* Force consistent height */
  line-height: 1; /* Reset line-height to center properly with flex */
  display: inline-flex; /* Ensure flex behavior */
  align-items: center;
  justify-content: center;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}
.btn-danger:hover {
  background: #fecaca;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-tertiary); }

/* --- File Input Styling --- */
input[type="file"] {
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 6px; /* Reduced padding for file input container */
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: none;
  background: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

input[type="file"]::file-selector-button:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* --- Icon Upload Small (for subgames) --- */
.icon-upload-small {
  cursor: pointer;
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
}

.icon-upload-small input[type="file"] {
  display: none;
}

.icon-upload-small .preview-box {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-upload-small .upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.icon-upload-small:hover .upload-overlay {
  opacity: 1;
}

.icon-upload-small .upload-overlay span {
  font-size: 1.5rem;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  text-align: left;
  padding: 16px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.95rem;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.tag-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-right: 4px;
}

/* --- Admin Layout --- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9; /* Lighter grey for admin bg */
}
.admin-sidebar {
  width: 260px;
  background: var(--bg-body);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-main {
  flex: 1;
  padding: 40px;
  max-width: 1400px; /* Constrain width for better readability on huge screens */
  margin: 0 auto;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  font-weight: 500;
  transition: all 0.2s;
}
.admin-nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.admin-nav-item.active {
  background: var(--bg-surface-hover); /* Keep subtle background */
  color: var(--primary);
  font-weight: 600;
}
.admin-card {
  background: var(--bg-body);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px; /* Space between cards */
}
/* Ensure tables inside cards look good */
.admin-card table {
  width: 100%;
}

/* --- Buttons --- */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--bg-surface-hover);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(-2px);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .detail-content { flex-direction: column; text-align: center; gap: 24px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { position: relative; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-main { margin-left: 0; padding: 24px; }
  .detail-icon { width: 120px; height: 120px; border-radius: 30px; }
  .detail-info h1 { font-size: 2rem; }
  
  /* Mobile Grid - 3 Columns per row */
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 40px;
  }
  
  .game-card {
    padding: 10px 8px 10px;
    border-radius: var(--radius-md);
  }
  
  .card-icon-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
  }
  
  .card-title {
    font-size: 1.0rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  
  .card-desc {
    font-size: 0.7rem;
    -webkit-line-clamp: 1;
    margin-bottom: 8px;
    height: 1.2em; /* constrain height */
  }
  
  .card-btn {
    padding: 6px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  
  .cat-pill {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  /* Responsive Data Table (Card View) */
  .data-table, .data-table tbody, .data-table tr, .data-table td { 
    display: block; 
    width: 100%; 
  }
  .data-table thead { 
    display: none; 
  }
  .data-table tr { 
    margin-bottom: 16px; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-md); 
    padding: 16px; 
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
  }
  .data-table td { 
    text-align: right; 
    padding: 8px 0; 
    border: none; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px dashed var(--border);
  }
  .data-table td:last-child { 
    border-bottom: none;
    margin-top: 12px; 
    padding-top: 12px; 
    border-top: 1px solid var(--border); 
    justify-content: flex-end; 
    gap: 8px; 
  }
  .data-table td::before { 
    content: attr(data-label); 
    font-weight: 600; 
    color: var(--text-secondary); 
    font-size: 0.85rem;
  }
  
  /* Make buttons full width/larger on mobile if needed, or just flex */
  .data-table td:last-child > div {
    width: 100%;
    display: flex;
    gap: 12px;
  }
  .data-table td:last-child .btn-sm {
    flex: 1;
    padding: 10px;
    justify-content: center;
  }
}
