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

html,
body {
  height: 100%;
}

:root {
  --bg: #080c16;
  --bg-panel: #0e1526;
  --bg-panel-2: #121a30;
  --border: #1e2a45;
  --text: #d7e2f5;
  --text-dim: #8ea0c2;
  --text-faint: #5c6d8c;
  --blue: #3a8bff;
  --blue-light: #7db4ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #ff5f56;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Baloo 2", "SF Mono", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}

.bg-blocks {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.bg-blocks::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  background-image:
    linear-gradient(rgba(58, 139, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 139, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 72%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 460px at 18% 10%, rgba(58, 139, 255, 0.16), transparent 65%),
    radial-gradient(680px 520px at 85% 25%, rgba(29, 78, 216, 0.14), transparent 65%),
    radial-gradient(760px 540px at 50% 105%, rgba(58, 139, 255, 0.08), transparent 70%);
  animation: pulseGlow 9s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow, .brand-mark, .dot-live, .cursor { animation: none !important; }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.brand-accent {
  color: var(--blue-light);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-game-picker > .game-picker-trigger {
  cursor: pointer;
  list-style: none;
}

.page-game-picker > .game-picker-trigger::-webkit-details-marker {
  display: none;
}

.page-game-options .game-option {
  display: flex;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatMark 3.4s ease-in-out infinite;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 0 8px rgba(58, 139, 255, 0.5));
}

@keyframes floatMark {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

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

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary:hover,
.mobile-nav summary:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.mobile-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3;
  min-width: 126px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 14px 26px rgba(0,0,0,0.35);
  animation: gameDropdownIn 0.16s ease-out both;
}

.mobile-nav-menu a {
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a:focus-visible {
  background: var(--bg-panel-2);
  color: var(--text);
  outline: none;
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  padding: 4px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: width 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  width: 100%;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  display: inline-block;
  box-shadow: 0 0 8px rgba(210,153,34,0.9);
  animation: blinkDot 1.6s ease-in-out infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

main {
  flex: 1;
}

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 100px 32px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-page {
  max-width: 780px;
  min-height: 520px;
  margin: 0 auto;
  padding: 100px 32px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.35);
  color: #e8c273;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero-accent {
  background: linear-gradient(90deg, var(--blue-light), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 16.5px;
  color: var(--text-dim);
  max-width: 480px;
  margin-bottom: 34px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #05070d;
  box-shadow: 0 8px 24px rgba(58, 139, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(58, 139, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}

.game-picker {
  position: relative;
  width: 136px;
}

.game-picker-trigger,
.game-option {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}

.game-picker-trigger {
  min-height: 38px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.game-picker-trigger:hover,
.game-picker-trigger:focus-visible {
  border-color: var(--blue);
  background: #17233e;
  outline: none;
}

.game-picker-image,
.game-option-image {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  object-fit: cover;
}

.game-picker-image {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.game-picker-chevron {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-2px);
}

.game-options {
  position: absolute;
  z-index: 2;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 28px rgba(0,0,0,0.35);
}

.game-options:not([hidden]) {
  animation: gameDropdownIn 0.16s ease-out both;
}

.game-options[hidden] {
  display: block;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-5px);
}

@keyframes gameDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-option {
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}

.game-option:hover,
.game-option:focus-visible {
  background: var(--bg-panel-2);
  outline: none;
}

.game-option[hidden] {
  display: none !important;
}

.game-option-image {
  border: 1px solid rgba(125,180,255,0.4);
}

.game-option-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.game-option-type {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
}

.game-picker.is-loading .game-picker-trigger {
  cursor: wait;
  opacity: 0.7;
}

.about {
  padding: 20px 32px 110px;
  max-width: 680px;
  margin: 0 auto;
  scroll-margin-top: 100px;
}

.console-window {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #10182c;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.console-title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
}

.console-body {
  padding: 20px;
  font-size: 13.5px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.9;
  min-height: 170px;
}

.console-body .line {
  white-space: pre-wrap;
}

.console-body .ok {
  color: var(--green);
}

.console-body .pending {
  color: var(--yellow);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--blue);
  vertical-align: middle;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  text-align: center;
}

.brand-mini {
  color: var(--blue-light);
  font-weight: 700;
}

.brand-mini::after {
  content: "•";
  margin-left: 8px;
  color: var(--text-faint);
}

@media (max-width: 640px) {
  .site-header {
    padding: 16px 20px;
  }
  .hero {
    padding: 64px 20px 56px;
  }
  .game-page {
    min-height: 460px;
    padding: 64px 20px 56px;
  }
  .about {
    padding-left: 20px;
    padding-right: 20px;
  }
  .hero-actions {
    width: 100%;
  }
  .btn-primary {
    width: min(100%, 280px);
    justify-content: center;
  }
  .header-left {
    gap: 8px;
  }
  .header-left .game-picker {
    width: 108px;
  }
  .site-nav {
    display: none;
  }
  .mobile-nav {
    display: block;
  }
}