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

:root {
  --bg-dark: #020617;
  --bg-card: rgba(15, 23, 42, 0.92);
  --accent: #e11d48;
  --accent-soft: rgba(248, 113, 113, 0.18);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --radius-lg: 1.5rem;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.85);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1e293b, #020617 55%, #000 100%);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.page {
  width: 100%;
  max-width: 1040px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f97316, #dc2626 55%, #111827 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(248, 113, 113, 0.4);
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.18s ease-out;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(120deg, #fb7185, #e11d48);
  border-color: rgba(248, 113, 113, 0.35);
  color: white;
  box-shadow: 0 18px 40px rgba(248, 113, 113, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 55px rgba(248, 113, 113, 0.55);
}

.btn-ghost {
  border-color: var(--border-subtle);
  background: rgba(15, 23, 42, 0.65);
}

.btn-ghost:hover {
  border-color: rgba(248, 113, 113, 0.5);
  background: radial-gradient(circle at top, rgba(248, 113, 113, 0.14), rgba(15, 23, 42, 0.9));
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.3fr);
  gap: 22px;
}

@media (max-width: 880px) {
  body {
    padding-top: 24px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav {
    margin-bottom: 18px;
  }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(248, 113, 113, 0.14), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
}

.card-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

h1 {
  font-size: clamp(2.2rem, 3vw, 2.7rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.gradient-text {
  background: linear-gradient(120deg, #fb7185, #f97316);
  -webkit-background-clip: text;
  color: transparent;
}

.lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 22px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.meta-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
}

.meta-pill strong {
  color: #e5e7eb;
}

/* Game list on homepage */
.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .game-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.game-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.98));
  padding: 12px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.game-title {
  font-weight: 600;
}

.game-tag {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.game-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.link {
  color: #fb7185;
  text-decoration: none;
  font-size: 12px;
}

.link:hover {
  text-decoration: underline;
}

.side-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.side-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  border-radius: 14px;
  padding: 10px 10px 9px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.98));
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--text-muted);
}

.badge-main {
  font-weight: 600;
}

.badge-note {
  font-size: 11px;
  color: var(--text-muted);
}

.side-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Shared game page styles */
.game-wrapper {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
}

.game-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  margin-bottom: 10px;
}

.score-label {
  font-weight: 500;
}

canvas {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at top, #0b1120, #020617 75%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
}

.game-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.game-hint span {
  color: #e5e7eb;
}

.reaction-box {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.98));
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
}

.reaction-state {
  font-size: 15px;
  margin-bottom: 8px;
}

.reaction-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.grid-click {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.grid-cell {
  border-radius: 12px;
  border: 1px solid rgba(30, 64, 175, 0.7);
  background: radial-gradient(circle at top, #020617, #020617);
  padding: 20px 0;
  cursor: pointer;
  transition: all 0.12s ease-out;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.grid-cell.active {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
  color: #e5e7eb;
  background: radial-gradient(circle at top, #f97316, #7f1d1d 70%, #020617);
}

.grid-click-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .card {
    padding: 18px 16px;
  }
  .badge-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dev-banner {
  border-radius: 999px;
  padding: 8px 14px;
  margin-bottom: 18px;
  border: 1px dashed rgba(248, 250, 252, 0.4);
  background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.18), rgba(15, 23, 42, 0.96));
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dev-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
  animation: pulse 1.8s infinite;
}

.dev-strong {
  color: #e5e7eb;
  font-weight: 500;
}
