:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #5b6472;
  --accent: #6c5ce7;
  --accent-dark: #5344c9;
  --green: #43a047;
  --yellow: #f2b01e;
  --border: #e3e6ee;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 34, 60, 0.07);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}
nav a:hover, nav a.active {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Hero */
.hero { text-align: center; padding: 42px 0 26px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 26px 0;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: block;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(30, 34, 60, 0.12);
  text-decoration: none;
}
.game-card .emoji { font-size: 2.2rem; }
.game-card h2, .game-card h3 { font-size: 1.15rem; margin: 8px 0 6px; }
.game-card p { color: var(--muted); font-size: 0.92rem; }
.badge {
  display: inline-block;
  background: #efeafe;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-top: 10px;
}

/* Ad slots */
.ad-slot {
  background: #eef0f6;
  border: 1px dashed #c9cede;
  border-radius: 10px;
  color: #9aa1b2;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 28px 10px;
  margin: 24px 0;
}

/* Game page layout */
.game-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}
.game-wrap h1 { font-size: 1.6rem; margin-bottom: 4px; }
.game-sub { color: var(--muted); margin-bottom: 18px; font-size: 0.95rem; }
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-weight: 700;
}
.stats-bar .label { color: var(--muted); font-weight: 600; font-size: 0.8rem; display: block; text-transform: uppercase; letter-spacing: 0.05em; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin: 6px 4px;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #e8eaf2; color: var(--text); }
.btn.secondary:hover { background: #dcdfe9; }
.msg { min-height: 28px; font-weight: 700; margin: 10px 0; }
.msg.win { color: var(--green); }
.msg.lose { color: #d63031; }

/* Content sections */
.content-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin: 24px 0;
}
.content-section h2 { font-size: 1.3rem; margin-bottom: 12px; }
.content-section h3 { font-size: 1.05rem; margin: 16px 0 6px; }
.content-section p { color: var(--muted); margin-bottom: 10px; }
.content-section ul, .content-section ol { color: var(--muted); margin: 0 0 10px 22px; }
.content-section li { margin-bottom: 6px; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
footer nav { justify-content: center; margin-bottom: 8px; }

/* Touch controls */
.touch-pad { display: none; margin-top: 14px; }
.touch-pad .row { display: flex; justify-content: center; gap: 8px; margin: 4px 0; }
.touch-pad button {
  width: 56px; height: 48px;
  font-size: 1.2rem;
  border: 1px solid var(--border);
  background: #eef0f6;
  border-radius: 10px;
  cursor: pointer;
}
@media (hover: none) and (pointer: coarse) {
  .touch-pad { display: block; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .header-inner { justify-content: center; }
}
