* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #e94560;
  --gold: #f0c040;
  --jade: #2ecc71;
  --text: #eee;
  --text-dim: #999;
  --card-bg: #0f3460;
  --border: #333;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--primary);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.header {
  background: linear-gradient(135deg, var(--secondary), #0a0a1a);
  border-bottom: 2px solid var(--gold);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--gold), #e67e22);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.nav { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hero {
  text-align: center;
  padding: 60px 20px;
  background: radial-gradient(ellipse at center, rgba(233,69,96,0.15) 0%, transparent 70%);
}

.hero h1 {
  font-size: 48px;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero p { font-size: 18px; color: var(--text-dim); max-width: 600px; margin: 0 auto; }

.section { display: none; padding: 40px 24px; max-width: 1200px; margin: 0 auto; }
.section.active { display: block; }

.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 32px;
  color: var(--gold);
}

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

.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(233,69,96,0.2);
  border-color: var(--accent);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.card-body { padding: 20px; }

.card-body h3 { font-size: 18px; margin-bottom: 8px; color: var(--gold); }
.card-body p { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.product-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s;
}

.product-card:hover { transform: translateY(-4px); }

.product-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #0f3460, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.product-info { padding: 16px; }

.product-info h3 { font-size: 16px; margin-bottom: 4px; }

.product-info .price {
  font-size: 20px;
  color: var(--accent);
  font-weight: bold;
  margin-top: 8px;
}

.product-info .tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-bottom: 8px;
}

.game-area {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
}

.game-info {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 16px;
}

.game-info .turn { color: var(--gold); font-weight: bold; }

.game-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.game-btn:hover { opacity: 0.85; transform: scale(1.05); }

.game-btn.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.learn-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.learn-content h3 {
  color: var(--gold);
  margin: 24px 0 12px;
  font-size: 20px;
}

.learn-content p, .learn-content li {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.learn-content ul { padding-left: 24px; }

.highlight-box {
  background: rgba(240,192,64,0.1);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}

.tile-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}

.tile {
  width: 56px;
  height: 76px;
  background: linear-gradient(145deg, #fafafa, #e0e0e0);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #333;
  font-weight: bold;
  border: 2px solid #ccc;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s;
}

.tile:hover { transform: translateY(-4px) rotate(-2deg); }

.tile.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(233,69,96,0.5);
}

.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.board-container {
  position: relative;
  display: inline-block;
}

canvas { border-radius: 8px; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

.modal {
  background: var(--secondary);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--border);
  max-width: 400px;
}

.modal h2 { color: var(--gold); margin-bottom: 12px; }
.modal p { color: var(--text-dim); margin-bottom: 20px; }

@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .nav { gap: 4px; }
  .nav-btn { padding: 6px 12px; font-size: 12px; }
  .header { flex-direction: column; gap: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .tile { width: 44px; height: 60px; font-size: 18px; }
}
