*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:root {
  --bg: #e8f4fd;
  --surface: #ffffff;
  --primary: #5b9bd5;
  --primary-dark: #3a78b0;
  --text: #2d3748;
  --text-muted: #718096;
  --shadow: 0 4px 16px rgba(91, 155, 213, 0.22);
  --radius: 20px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  user-select: none;
  overflow-x: hidden;
}

header {
  padding: 28px 16px 12px;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: -0.5px;
}

header p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 4px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 16px;
  flex: 1;
  align-content: start;
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 16px 22px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.game-card:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
}

.game-icon {
  font-size: 3.5rem;
  line-height: 1;
}

.game-card h2 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.game-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: none;
}

.back-btn:active { opacity: 0.6; }
