:root {
  color-scheme: dark;
  --bg-grad-1: radial-gradient(1380px 880px at -18% -12%, rgba(241, 118, 255, 0.35), transparent 70%);
  --bg-grad-2: radial-gradient(1300px 880px at 115% -10%, rgba(132, 189, 255, 0.26), transparent 72%);
  --bg-base: linear-gradient(150deg, #211036 0%, #341349 38%, #461558 100%);
  --surface: rgba(36, 23, 54, 0.72);
  --surface-strong: rgba(40, 26, 60, 0.88);
  --surface-soft: rgba(66, 39, 90, 0.8);
  --text-primary: #f8fafc;
  --text-muted: #a5b4fc;
  --text-subtle: #94a3b8;
  --border: rgba(148, 163, 184, 0.26);
  --border-strong: rgba(148, 163, 184, 0.4);
  --card-radius: 24px;
  --shadow-card: 0 28px 52px rgba(7, 12, 24, 0.55);
  --shadow-card-hover: 0 36px 62px rgba(7, 12, 24, 0.65);
  --shadow-pill: 0 18px 36px rgba(7, 12, 24, 0.45);
  --player-shadow: 0 16px 34px rgba(7, 12, 24, 0.48);
  --master: #E421FD;
}

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

html, body {
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--bg-grad-1), var(--bg-grad-2), var(--bg-base);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

.hero {
  padding: clamp(3rem, 6vw, 4.6rem) clamp(1.4rem, 4vw, 2.6rem) clamp(2rem, 4vw, 2.6rem);
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-title {
  display: grid;
  gap: 1.1rem;
  max-width: 640px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.28rem;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.78;
}

.hero-eyebrow::after {
  content: "";
  width: 56px;
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
}

.hero-title h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-title p {
  margin: 0;
  color: var(--text-subtle);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  max-width: 560px;
}

.hero-meta {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.admin-pill {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-pill);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-pill:hover {
  background: rgba(226, 232, 240, 0.12);
  border-color: rgba(226, 232, 240, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(7, 12, 24, 0.55);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 0.65rem 1.2rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 30px rgba(7, 12, 24, 0.45);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(7, 12, 24, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(148, 163, 184, 0.25);
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto clamp(2.4rem, 5vw, 3.4rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3.2vw, 2rem);
}

.game-card {
  position: relative;
  min-height: clamp(360px, 40vw, 420px);
  padding: clamp(1.6rem, 3vw, 1.9rem);
  border-radius: var(--card-radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.game-card::before {
  content: "";
  position: absolute;
  inset: -45% -20%;
  background:
    radial-gradient(70% 70% at 85% 10%, rgba(var(--card-accent-rgb, 148, 163, 184), 0.35), transparent 70%),
    radial-gradient(65% 60% at 10% 0%, rgba(255, 255, 255, 0.12), transparent 70%);
  opacity: 1;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.game-card:hover::before {
  transform: translateY(-4px) scale(1.02);
}

.game-card > * {
  position: relative;
  z-index: 1;
}

.game-top {
  display: grid;
  gap: 1rem;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-row .emoji {
  font-size: 2.2rem;
}

.title-row h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.game-top p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.98rem;
  line-height: 1.55;
}

.game-actions {
  margin-top: auto;
  display: grid;
  gap: 1rem;
}

.master-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  background: var(--master);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(228, 33, 253, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.master-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px rgba(228, 33, 253, 0.45);
}

.player-buttons {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.player-entry {
  display: flex;
  flex-direction: column;
}

.player-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--player-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.player-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(7, 12, 24, 0.6);
}

.player-btn.locked {
  opacity: 0.3;
  filter: grayscale(0.4);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.player-btn.locked.admin-active {
  opacity: 0.85;
  filter: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.player-btn.locked.admin-active:hover {
  box-shadow: 0 18px 32px rgba(7, 12, 24, 0.5);
}

.notice {
  width: min(680px, 92vw);
  margin: 0 auto 1.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 24px 44px rgba(7, 12, 24, 0.5);
  font-weight: 600;
}

.notice.info {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.notice.error {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}

footer {
  margin-top: auto;
  padding: 1.6rem;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

footer a {
  color: #38bdf8;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-meta {
    width: 100%;
    justify-content: space-between;
  }

  .admin-pill {
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
