/**
 * PK Lock - Main Stylesheet
 * All classes use s388- prefix for namespace isolation
 * Color palette: #0A0A0A bg | #FAF0E6 text | #8B4513 primary | #9966CC accent | #D2691E highlight
 */

:root {
  --s388-bg: #0A0A0A;
  --s388-text: #FAF0E6;
  --s388-primary: #8B4513;
  --s388-accent: #9966CC;
  --s388-highlight: #D2691E;
  --s388-card-bg: #1A1A1A;
  --s388-border: #2A2A2A;
  --s388-muted: #999;
  --s388-radius: 8px;
  --s388-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

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

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--s388-bg);
  color: var(--s388-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--s388-accent); text-decoration: none; }
a:hover { color: var(--s388-highlight); }
img { max-width: 100%; height: auto; display: block; }

/* === HEADER === */
.s388-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1000;
  background: linear-gradient(180deg, #0D0D0D 0%, #1A1209 100%);
  border-bottom: 1px solid var(--s388-primary);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.s388-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.s388-site-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--s388-highlight);
  letter-spacing: 0.5px;
}

.s388-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.s388-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--s388-radius);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: 34px;
  min-width: 44px;
}

.s388-btn-register {
  background: linear-gradient(135deg, var(--s388-primary), var(--s388-highlight));
  color: var(--s388-text);
}

.s388-btn-login {
  background: transparent;
  color: var(--s388-text);
  border: 1px solid var(--s388-primary);
}

.s388-btn:hover { transform: scale(1.04); }
.s388-btn:active { transform: scale(0.96); }

.s388-menu-toggle {
  background: none;
  border: none;
  color: var(--s388-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === MOBILE MENU === */
.s388-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.s388-overlay-active { opacity: 1; pointer-events: auto; }

.s388-mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100%;
  background: #111;
  z-index: 9999;
  padding: 60px 16px 20px;
  transition: right 0.3s ease;
  overflow-y: auto;
  border-left: 2px solid var(--s388-primary);
}

.s388-menu-active { right: 0; }

.s388-mobile-menu a {
  display: block;
  padding: 12px 8px;
  color: var(--s388-text);
  font-size: 1.4rem;
  border-bottom: 1px solid var(--s388-border);
  transition: color 0.2s;
}

.s388-mobile-menu a:hover { color: var(--s388-highlight); }

.s388-menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--s388-text);
  font-size: 2.4rem;
  cursor: pointer;
}

/* === CAROUSEL === */
.s388-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 52px;
  border-radius: 0 0 var(--s388-radius) var(--s388-radius);
}

.s388-carousel-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.s388-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

.s388-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s388-slide-active { opacity: 1; }

/* === MAIN CONTENT === */
main {
  padding: 12px;
  padding-top: 8px;
}

.s388-section {
  margin-bottom: 20px;
}

.s388-section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--s388-highlight);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--s388-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.s388-section-title i,
.s388-section-title .material-icons {
  font-size: 2rem;
  color: var(--s388-primary);
}

/* === GAME GRID === */
.s388-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.s388-game-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.s388-game-item:hover { transform: translateY(-2px); }
.s388-game-item:active { transform: scale(0.95); }

.s388-game-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--s388-radius);
  object-fit: cover;
  border: 1px solid var(--s388-border);
  margin-bottom: 4px;
}

.s388-game-item span {
  display: block;
  font-size: 1.1rem;
  color: var(--s388-text);
  line-height: 1.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === CATEGORY TABS === */
.s388-cat-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--s388-primary);
  color: var(--s388-text);
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* === CARDS === */
.s388-card {
  background: var(--s388-card-bg);
  border-radius: var(--s388-radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--s388-border);
}

.s388-card h3 {
  font-size: 1.5rem;
  color: var(--s388-highlight);
  margin-bottom: 8px;
}

.s388-card p {
  font-size: 1.3rem;
  line-height: 1.6rem;
  color: var(--s388-text);
  opacity: 0.9;
}

/* === PROMO BUTTON === */
.s388-promo-btn {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--s388-primary), var(--s388-highlight));
  color: var(--s388-text);
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: var(--s388-radius);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}

.s388-promo-btn:hover {
  background: linear-gradient(135deg, var(--s388-highlight), var(--s388-primary));
  transform: scale(1.03);
}

.s388-promo-link {
  color: var(--s388-highlight);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.s388-promo-link:hover { color: var(--s388-accent); }

/* === H1 TITLE === */
.s388-page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--s388-text);
  text-align: center;
  margin: 16px 0;
  line-height: 2.4rem;
}

/* === FOOTER === */
.s388-footer {
  background: #111;
  padding: 20px 12px 30px;
  border-top: 2px solid var(--s388-primary);
  margin-top: 20px;
}

.s388-footer-brand {
  text-align: center;
  margin-bottom: 14px;
  font-size: 1.3rem;
  color: var(--s388-muted);
  line-height: 1.6rem;
}

.s388-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.s388-footer-links a {
  padding: 6px 12px;
  background: var(--s388-card-bg);
  border: 1px solid var(--s388-border);
  border-radius: 4px;
  font-size: 1.2rem;
  color: var(--s388-text);
  transition: all 0.2s;
}

.s388-footer-links a:hover {
  background: var(--s388-primary);
  color: var(--s388-text);
}

.s388-footer-copy {
  text-align: center;
  font-size: 1.1rem;
  color: var(--s388-muted);
  border-top: 1px solid var(--s388-border);
  padding-top: 10px;
}

/* === BOTTOM NAV (Mobile) === */
.s388-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 60px;
  background: linear-gradient(180deg, #1A1209, #0D0D0D);
  border-top: 2px solid var(--s388-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding: 0 4px;
}

.s388-bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 52px;
  background: none;
  border: none;
  color: var(--s388-muted);
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
  border-radius: 8px;
}

.s388-bottom-nav-btn:hover,
.s388-bottom-nav-btn:focus {
  color: var(--s388-highlight);
  background: rgba(139,69,19,0.15);
}

.s388-bottom-nav-btn:active {
  transform: scale(0.92);
}

.s388-bottom-nav-btn i,
.s388-bottom-nav-btn .material-icons,
.s388-bottom-nav-btn ion-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.s388-bottom-nav-btn span {
  font-size: 10px;
  font-weight: 500;
}

.s388-bottom-nav-btn.s388-nav-active {
  color: var(--s388-highlight);
}

/* === HELPERS === */
.s388-text-center { text-align: center; }
.s388-mt-8 { margin-top: 8px; }
.s388-mt-16 { margin-top: 16px; }
.s388-mb-8 { margin-bottom: 8px; }
.s388-mb-16 { margin-bottom: 16px; }
.s388-hidden { display: none; }
.s388-divider {
  height: 1px;
  background: var(--s388-border);
  margin: 16px 0;
}

/* === FAQ === */
.s388-faq-item {
  margin-bottom: 10px;
  padding: 10px;
  background: var(--s388-card-bg);
  border-radius: var(--s388-radius);
  border-left: 3px solid var(--s388-primary);
}

.s388-faq-item h3 {
  font-size: 1.3rem;
  color: var(--s388-highlight);
  margin-bottom: 4px;
}

.s388-faq-item p {
  font-size: 1.2rem;
  color: var(--s388-text);
  opacity: 0.85;
  line-height: 1.5rem;
}

/* === FEATURES LIST === */
.s388-feature-list {
  list-style: none;
  padding: 0;
}

.s388-feature-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--s388-border);
  font-size: 1.3rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.s388-feature-list li i {
  color: var(--s388-primary);
  margin-top: 2px;
  font-size: 1.4rem;
}

/* === INTERNAL LINK === */
.s388-internal-link {
  color: var(--s388-accent);
  text-decoration: underline;
  font-weight: 500;
}

.s388-internal-link:hover { color: var(--s388-highlight); }

/* === RESPONSIVE === */
@media (min-width: 769px) {
  .s388-bottom-nav { display: none; }
}

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

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--s388-bg); }
::-webkit-scrollbar-thumb { background: var(--s388-primary); border-radius: 4px; }
