/**
 * backscatter - Main Stylesheet
 * Prefix: pg5e-
 * Color Palette: #FAFAFA (light) | #F08080 (accent) | #273746 (dark)
 */

/* ===== CSS Variables ===== */
:root {
  --pg5e-primary: #F08080;
  --pg5e-primary-dark: #d66a6a;
  --pg5e-bg: #273746;
  --pg5e-bg-light: #34495e;
  --pg5e-surface: #FAFAFA;
  --pg5e-text: #1a1a2e;
  --pg5e-text-light: #f5f5f5;
  --pg5e-text-muted: #8899aa;
  --pg5e-border: #e0e0e0;
  --pg5e-shadow: rgba(39, 55, 70, 0.15);
  --pg5e-radius: 12px;
  --pg5e-radius-sm: 8px;
  --pg5e-transition: all 0.3s ease;
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5rem;
  color: var(--pg5e-text);
  background-color: var(--pg5e-surface);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--pg5e-transition);
}

ul, ol {
  list-style: none;
}

/* ===== Container ===== */
.pg5e-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
}

/* ===== Header ===== */
.pg5e-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 56px;
  background: linear-gradient(135deg, var(--pg5e-bg) 0%, var(--pg5e-bg-light) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 2px 12px var(--pg5e-shadow);
}

.pg5e-logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pg5e-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}

.pg5e-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pg5e-text-light);
  letter-spacing: -0.3px;
}

.pg5e-header-btns {
  display: flex;
  gap: 8px;
}

.pg5e-header-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--pg5e-transition);
  white-space: nowrap;
}

.pg5e-btn-register {
  background-color: var(--pg5e-primary);
  color: #fff;
}

.pg5e-btn-register:hover,
.pg5e-btn-register:active {
  background-color: var(--pg5e-primary-dark);
  transform: scale(1.05);
}

.pg5e-btn-login {
  background-color: transparent;
  color: var(--pg5e-text-light);
  border: 1.5px solid var(--pg5e-primary);
}

.pg5e-btn-login:hover,
.pg5e-btn-login:active {
  background-color: var(--pg5e-primary);
  color: #fff;
}

/* Hamburger Menu Button */
.pg5e-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.pg5e-menu-toggle span {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--pg5e-text-light);
  border-radius: 2px;
  transition: var(--pg5e-transition);
}

/* ===== Mobile Menu Overlay ===== */
.pg5e-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--pg5e-transition);
}

.pg5e-overlay-visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Mobile Menu ===== */
.pg5e-mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100%;
  background: linear-gradient(180deg, var(--pg5e-bg) 0%, var(--pg5e-bg-light) 100%);
  z-index: 9999;
  transition: right 0.35s ease;
  padding: 70px 20px 20px;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.pg5e-menu-open {
  right: 0 !important;
}

.pg5e-mobile-menu h3 {
  color: var(--pg5e-primary);
  font-size: 1.3rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(240, 128, 128, 0.3);
}

.pg5e-menu-link {
  display: block;
  padding: 10px 14px;
  color: var(--pg5e-text-light);
  font-size: 1.25rem;
  border-radius: var(--pg5e-radius-sm);
  transition: var(--pg5e-transition);
  margin-bottom: 4px;
}

.pg5e-menu-link:hover,
.pg5e-menu-link:active {
  background-color: rgba(240, 128, 128, 0.15);
  color: var(--pg5e-primary);
  padding-left: 20px;
}

/* ===== Main Content ===== */
.pg5e-main {
  padding-top: 68px;
  min-height: calc(100vh - 120px);
}

@media (max-width: 768px) {
  .pg5e-main {
    padding-bottom: 90px;
  }
}

/* ===== Hero Banner / Carousel ===== */
.pg5e-hero {
  margin-bottom: 20px;
  border-radius: var(--pg5e-radius);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--pg5e-shadow);
}

.pg5e-hero-slide {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: transform 0.3s ease;
}

.pg5e-hero-slide:hover {
  transform: scale(1.02);
}

/* ===== Section Titles ===== */
.pg5e-section-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--pg5e-bg);
  margin: 24px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--pg5e-primary);
  line-height: 1.3;
}

/* ===== Game Grid ===== */
.pg5e-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.pg5e-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: var(--pg5e-radius-sm);
  padding: 8px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: var(--pg5e-transition);
  text-align: center;
}

.pg5e-game-item:hover,
.pg5e-game-item:active {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px var(--pg5e-shadow);
}

.pg5e-game-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 6px;
}

.pg5e-game-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--pg5e-text);
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== Category Tabs ===== */
.pg5e-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pg5e-category-tabs::-webkit-scrollbar {
  display: none;
}

.pg5e-cat-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
  background: #fff;
  color: var(--pg5e-text-muted);
  border: 1.5px solid var(--pg5e-border);
  cursor: pointer;
  transition: var(--pg5e-transition);
  white-space: nowrap;
}

.pg5e-cat-tab.active,
.pg5e-cat-tab:hover {
  background: var(--pg5e-primary);
  color: #fff;
  border-color: var(--pg5e-primary);
}

/* ===== Cards ===== */
.pg5e-card {
  background: #fff;
  border-radius: var(--pg5e-radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px var(--pg5e-shadow);
}

.pg5e-card h3 {
  font-size: 1.45rem;
  color: var(--pg5e-bg);
  margin-bottom: 10px;
}

.pg5e-card p {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ===== Buttons ===== */
.pg5e-btn {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--pg5e-primary) 0%, var(--pg5e-primary-dark) 100%);
  color: #fff;
  border-radius: 25px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--pg5e-transition);
  text-align: center;
}

.pg5e-btn:hover,
.pg5e-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(240, 128, 128, 0.35);
}

.pg5e-btn-outline {
  background: transparent;
  border: 2px solid var(--pg5e-primary);
  color: var(--pg5e-primary);
}

.pg5e-btn-outline:hover,
.pg5e-btn-outline:active {
  background: var(--pg5e-primary);
  color: #fff;
}

/* ===== Feature List ===== */
.pg5e-feature-list {
  padding-left: 4px;
}

.pg5e-feature-list li {
  position: relative;
  padding: 8px 0 8px 28px;
  font-size: 1.15rem;
  color: #444;
  line-height: 1.5;
}

.pg5e-feature-list li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--pg5e-primary);
  border-radius: 50%;
}

/* ===== Bottom Navigation ===== */
.pg5e-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 62px;
  background: linear-gradient(180deg, var(--pg5e-bg) 0%, #1e2b38 100%);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(240, 128, 128, 0.2);
}

.pg5e-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 58px;
  cursor: pointer;
  transition: var(--pg5e-transition);
  border: none;
  background: none;
  padding: 4px 8px;
  position: relative;
  text-decoration: none;
  color: var(--pg5e-text-muted);
}

.pg5e-nav-item:hover,
.pg5e-nav-item:active {
  transform: scale(1.08);
}

.pg5e-nav-item.pg5e-nav-active .pg5e-nav-icon {
  color: var(--pg5e-primary);
}

.pg5e-nav-item.pg5e-nav-active .pg5e-nav-label {
  color: var(--pg5e-primary);
  font-weight: 600;
}

.pg5e-nav-icon {
  font-size: 22px;
  color: #99aabb;
  margin-bottom: 2px;
  transition: var(--pg5e-transition);
  line-height: 1;
}

.pg5e-nav-label {
  font-size: 0.75rem;
  color: #777;
  font-weight: 400;
  transition: var(--pg5e-transition);
}

/* Active indicator dot */
.pg5e-nav-item.pg5e-nav-active::after {
  content: '';
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  background: var(--pg5e-primary);
  border-radius: 50%;
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .pg5e-bottom-nav {
    display: none;
  }

  .pg5e-main {
    padding-bottom: 40px;
  }
}

/* Show hamburger only on mobile */
@media (min-width: 769px) {
  .pg5e-menu-toggle {
    display: none;
  }
}

/* ===== Footer ===== */
.pg5e-footer {
  background: linear-gradient(180deg, var(--pg5e-bg) 0%, #1a2633 100%);
  color: var(--pg5e-text-muted);
  padding: 30px 16px 80px;
  margin-top: 30px;
}

.pg5e-footer h4 {
  color: var(--pg5e-text-light);
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.pg5e-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 20px;
}

.pg5e-footer-links a {
  font-size: 1.05rem;
  color: #99aabb;
  transition: var(--pg5e-transition);
}

.pg5e-footer-links a:hover {
  color: var(--pg5e-primary);
}

.pg5e-footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  color: #667788;
}

/* ===== Utility Classes ===== */
.pg5e-text-center { text-align: center; }
.pg5e-mt-1 { margin-top: 10px; }
.pg5e-mt-2 { margin-top: 18px; }
.pg5e-mb-1 { margin-bottom: 10px; }
.pg5e-mb-2 { margin-bottom: 18px; }
.pg5e-p-1 { padding: 12px; }
.pg5e-p-2 { padding: 20px; }

/* Touch feedback for mobile */
.pg5e-touch-active {
  opacity: 0.7;
  transform: scale(0.96);
}

/* ===== Internal Link Style ===== */
.pg5e-internal-link {
  color: var(--pg5e-bg);
  text-decoration: underline;
  text-decoration-color: var(--pg5e-primary);
  text-underline-offset: 2px;
  font-weight: 500;
}

.pg5e-internal-link:hover {
  color: var(--pg5e-primary);
}

/* ===== Promo Text Link ===== */
.pg5e-promo-link {
  color: var(--pg5e-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.pg5e-promo-link:hover {
  color: var(--pg5e-primary-dark);
}
