/* Modern Responsive H5 Game Center Theme */
:root {
  --bg-primary: #0f111a;
  --bg-secondary: #1a1d2e;
  --bg-card: #22263d;
  --accent: #ff477e;
  --accent-gradient: linear-gradient(135deg, #ff477e 0%, #7928ca 100%);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #2e3451;
  --radius: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}

a, button, .game-card, .btn-play, .control-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* Header */
header {
  background: rgba(26, 29, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 99px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: var(--bg-card);
}

.nav-link.active {
  background: var(--accent-gradient);
}

/* Hero Section */
.hero {
  padding: 24px 0 16px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Game Grid */
.game-section {
  flex: 1;
  padding: 16px 0 32px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

@media (min-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
  }
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.game-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover .game-thumb img {
  transform: scale(1.08);
}

.game-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.game-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ad Placeholders & Anti-IVT Shield */
.ad-slot {
  width: 100%;
  text-align: center;
  grid-column: 1 / -1;
  overflow: hidden;
  position: relative;
  transition: min-height 0.25s ease, margin 0.25s ease;
}

.ad-click-shield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

.ad-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #71717a;
  text-align: center;
  margin-bottom: 6px;
}

/* Game Detail Page */
.detail-wrapper {
  max-width: 900px;
  margin: 24px auto;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.detail-banner {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

@media (min-width: 640px) {
  .detail-banner {
    flex-direction: row;
    align-items: center;
  }
}

.detail-thumb {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.detail-info {
  flex: 1;
}

.detail-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(255, 71, 126, 0.4);
  transition: transform 0.2s ease;
  margin-top: 14px;
}

.btn-play:hover {
  transform: scale(1.03);
}

.detail-body {
  padding: 24px;
  border-top: 1px solid var(--border);
}

.detail-body h3 {
  font-size: 18px;
  margin: 16px 0 8px;
  color: var(--text-main);
}

.detail-body p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* Game Playing Fullscreen Wrapper */
#game-player-wrapper {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

#game-player-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Floating player controls */
.player-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 17, 26, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.player-controls.collapsed {
  transform: translateX(-80%);
  opacity: 0.4;
}

.player-controls.collapsed:hover {
  transform: translateX(0);
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
}

/* Legal / Compliance Pages */
.legal-page {
  max-width: 800px;
  margin: 32px auto;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 32px 24px;
}

.legal-page h1 {
  font-size: 26px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.legal-page h2 {
  font-size: 18px;
  margin: 24px 0 10px;
}

.legal-page p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 15px;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 0 24px;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

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

.footer-links a:hover {
  color: #fff;
}

/* GDPR / CCPA Cookie Consent Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 17, 26, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  #cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
  }
}

.cookie-content {
  flex: 1;
}

.cookie-content a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
}

.btn-cookie-accept {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 22px;
  border-radius: 99px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-cookie-accept:hover {
  opacity: 0.9;
}
