/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #131517;
  --bg-darker: #0e1011;
  --nav-bg: #0b0e0f;
  --green: #6ea96e;
  --green-hover: #5d945d;
  --green-active: #4e834e;
  --green-outline: #7fb87f;
  --text-primary: #ffffff;
  --text-secondary: #b0b0c0;
  --card-bg: #1e2023;
  --card-border: #2a2d31;
  --card-border-light: #35383d;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ===== Staggered Entry Animation ===== */
.stagger {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerIn 0.35s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 86px;
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  flex: 1;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.nav-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  position: relative;
  top: -5px;
}

.nav-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-primary);
}

.nav-center {
  display: flex;
  gap: 48px;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: 4px 0;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-icon:hover {
  opacity: 1;
}

.nav-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-icon-lg {
  width: 48px;
  height: 48px;
  position: relative;
  top: -1px;
}

.nav-icon-lg img {
  width: 42px;
  height: 42px;
}

/* ===== Play Page ===== */
.play-page {
  height: calc(100vh - 86px);
  display: flex;
  flex-direction: column;
}

.hero {
  position: relative;
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(14, 16, 17, 0) 70%, rgba(14, 16, 17, 1) 100%),
    url('/img/BG.png') center/cover no-repeat;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* ===== Launch Button ===== */
.launch-wrapper {
  position: relative;
  display: flex;
}

.launch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 340px;
  height: 100px;
  background: var(--green);
  border: 2px solid var(--green-outline);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.launch-btn:hover {
  background: var(--green-hover);
}

.launch-btn:active {
  background: var(--green-active);
}

.launch-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 10px;
}

.launch-version {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.launch-dropdown {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 100px;
  background: var(--green);
  border: 2px solid var(--green-outline);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.launch-dropdown:hover {
  background: var(--green-hover);
}

.dropdown-arrow {
  font-size: 18px;
  color: var(--text-primary);
}

/* ===== Resolution Slider ===== */
.resolution-slider {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  width: 396px;
}

.resolution-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.resolution-header input[type="range"] {
  flex: 1;
}

.resolution-info-icon {
  font-size: 18px;
  color: var(--text-secondary);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
  user-select: none;
  line-height: 1;
}

.resolution-info-icon:hover {
  opacity: 1;
}

.resolution-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 396px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  z-index: 10;
}

.resolution-tooltip.visible,
.resolution-slider:has(.resolution-info-icon:hover) .resolution-tooltip,
.resolution-tooltip:hover {
  display: block;
}

.resolution-tooltip p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.resolution-tooltip p + p {
  margin-top: 8px;
}

.resolution-tooltip strong {
  color: var(--text-primary);
}

.resolution-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  outline: none;
  cursor: pointer;
}

.resolution-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--green-outline);
  cursor: pointer;
  transition: background 0.2s;
}

.resolution-slider input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--green-hover);
}

.resolution-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--green-outline);
  cursor: pointer;
}

.resolution-label {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.resolution-pixels {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.5;
  letter-spacing: 0.5px;
}

.versions-resolution {
  margin: 32px auto 0;
}

/* ===== Launch Animation ===== */
html.launching {
  background: #fff;
}

body.launching {
  animation: launchOut 1s ease-in-out forwards;
}

@keyframes launchOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.15);
    opacity: 0;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

body.launching::after {
  content: '';
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10000;
  opacity: 0;
  animation: whiteFlash 1s ease-in-out forwards;
}

@keyframes whiteFlash {
  0% { opacity: 0; }
  65% { opacity: 0; }
  100% { opacity: 1; }
}

/* ===== Play Bottom ===== */
.play-bottom {
  flex: 1;
  background: var(--bg-darker);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ===== Footer ===== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 48px;
  background: #1a1d1f;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-right {
  display: flex;
  align-items: center;
}

.footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.footer-icon:hover {
  opacity: 1;
}

.footer-icon svg {
  width: 18px;
  height: 18px;
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.4;
}

/* ===== News Section ===== */
.news-section {
  padding: 28px 84px 40px;
}

.news-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.news-card-img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-dark);
  border-radius: 5px 5px 0 0;
}

.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
}

.news-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  background: rgba(110, 169, 110, 0.12);
  border-radius: 4px;
  padding: 2px 8px;
  width: fit-content;
}

.news-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.news-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.news-card-date {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-top: 4px;
}

/* ===== Versions Page ===== */
.versions-page {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.versions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.version-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  min-height: 260px;
  background-color: var(--card-bg);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--card-border);
  display: flex;
  flex-direction: column;
}

.version-card-overlay {
  flex: 1;
  background: linear-gradient(to top, rgba(20, 20, 36, 0.95) 40%, rgba(20, 20, 36, 0.3) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.version-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.version-card-info h2 {
  font-size: 20px;
  font-weight: 600;
}

.version-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
}

.version-badge.recommended {
  background: rgba(110, 169, 110, 0.2);
  color: var(--green);
}

.version-badge.stable {
  background: rgba(100, 150, 220, 0.2);
  color: #6496dc;
}

.version-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.version-select-btn {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-top: 2px solid var(--card-border-light);
  border-radius: 0 0 10px 10px;
  background: #1e2023;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.version-select-btn:not(.selected):hover {
  background: #262a2d;
  color: var(--green);
}

.version-select-btn.selected {
  background: var(--green);
  border-top-color: var(--green-outline);
  color: var(--text-primary);
  cursor: default;
}

/* ===== Startup Animation (Versions Page) ===== */
#startup-overlay {
  position: fixed;
  inset: 0;
  background: var(--nav-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: eb-overlay-fade 2.1s ease forwards;
}

#startup-logo {
  height: 120px;
  width: auto;
  animation: eb-logo-intro 2.1s forwards;
}

@keyframes eb-logo-intro {
  0% {
    transform: scale(0.25);
    opacity: 0;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
  22% {
    transform: scale(1.5);
    opacity: 1;
    animation-timing-function: linear;
  }
  60% {
    transform: scale(1.5);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
  }
  68% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes eb-overlay-fade {
  0%, 63% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== Back to Play ===== */
.back-to-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 20px auto 0;
  padding: 12px 40px;
  font-size: 14px;
  font-weight: 500;
  background: #1e2023;
  border: 2px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.back-to-play:hover {
  background: #262a2d;
  color: var(--text-primary);
}
