:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-elevated: #232342;
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --accent: #F59E0B;
  --text: #E2E8F0;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --border: #2D2D4A;
  --success: #22C55E;
  --danger: #EF4444;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.site-logo span {
  color: var(--primary);
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.lang-btn {
  background: var(--bg-elevated);
  color: var(--primary-light);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.game-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.game-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.game-back {
  color: var(--text-muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  min-width: 100px;
}

.stat-box .stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-box .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-light);
}

.game-board {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.game-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.game-grid {
  display: grid;
  gap: 2px;
  background: var(--border);
  padding: 2px;
  border-radius: 8px;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 26, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
}

.game-overlay h2 {
  font-size: 32px;
  margin-bottom: 12px;
}

.game-overlay p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.game-overlay .btn {
  font-size: 16px;
  padding: 12px 32px;
}

.game-instructions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.game-instructions h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 10px;
}

.game-instructions p,
.game-instructions li {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.game-instructions ul {
  list-style: none;
}

.game-instructions li::before {
  content: "•";
  color: var(--primary);
  margin-right: 8px;
}

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 40px;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.site-footer-inner a {
  color: var(--text-muted);
  margin: 0 12px;
}

.ad-slot {
  max-width: 728px;
  margin: 20px auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .game-title {
    font-size: 22px;
  }
  .game-page {
    padding: 12px;
  }
  .stat-box {
    min-width: 80px;
    padding: 8px 14px;
  }
  .stat-box .stat-value {
    font-size: 20px;
  }
  .game-board {
    padding: 12px;
    min-height: 300px;
  }
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}
