/* =============================================
   GAME PAGE — game.css
   Loaded only on game.html. Reuses vars from main.css.
   ============================================= */

/* BREADCRUMB */
.game-breadcrumb {
  padding: 16px 0 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.breadcrumb-link {
  color: var(--text-muted);
  transition: color 0.15s;
}
.breadcrumb-link:hover {
  color: var(--text);
}

.breadcrumb-sep {
  color: var(--border);
  font-weight: 400;
}

.breadcrumb-current {
  color: var(--text);
}

/* =============================================
   GAME TITLE BAR
   ============================================= */
.game-title-bar {
  padding: 16px 0 20px;
}

.game-title-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-page-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 2px;
}

.game-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-page-category {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.game-page-exclusive {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: var(--radius-full);
  background: #8B5CF6;
  color: white;
}

/* =============================================
   GAME CANVAS SECTION
   ============================================= */
.game-canvas-section {
  padding-bottom: 0;
}

.game-canvas-wrapper {
  position: relative;
  max-width: 1136px; /* 960px canvas + 16px gap + 160px ad */
  margin: 0 auto;
}

.game-canvas-container {
  max-width: 960px;
  width: calc(100% - 176px); /* leave room for 160px ad + 16px gap */
}

.game-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1A1D23;
  box-shadow: var(--shadow-hover);
}

.game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 2;
}

/* Loading state */
.game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.game-loading--fading {
  opacity: 0.5;
  pointer-events: none;
}

.game-loading-text {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  display: none;
}

.game-loading--fading .game-loading-text {
  display: block;
}

.game-loading--fading .game-play-btn {
  display: none;
}

.game-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

.game-play-btn svg {
  width: 20px;
  height: 20px;
}

/* =============================================
   SIDEBAR ADS
   ============================================= */
.game-sidebar-ad {
  position: absolute;
  right: 0;
  top: 0;
  width: 160px;
}

/* =============================================
   AD PLACEHOLDERS
   ============================================= */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.ad-skyscraper {
  width: 160px;
  height: 600px;
}

.ad-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
}

.ad-size {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.4;
}

/* =============================================
   GAME INFO SECTION
   ============================================= */
.game-info-section {
  padding: 32px 0 0;
}

.game-info-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.game-info-heading {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

/* Tags & Player Mode */
.game-info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.info-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.info-tag--mode {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.info-tag--exclusive {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: white;
  font-weight: 700;
}

/* Description */
.game-info-desc {
  margin-bottom: 28px;
}

.game-info-desc-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* How to Play */
.game-info-howto {
  margin-bottom: 28px;
}

.game-info-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-info-steps li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.game-info-steps li::marker {
  color: var(--blue);
  font-weight: 700;
}

/* FAQ */
.game-info-faq {
  margin-bottom: 8px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  padding: 14px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-answer {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 0 0 14px;
}

/* =============================================
   MORE GAMES
   ============================================= */
.more-games-section {
  padding: 32px 0 48px;
}

.more-games-row {
  display: flex;
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-top: 8px;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.more-games-row::-webkit-scrollbar {
  height: 6px;
}

.more-games-row::-webkit-scrollbar-track {
  background: transparent;
}

.more-games-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Small card variant — reuses .game-card from main.css */
.more-games-row .game-card--small {
  flex-shrink: 0;
  width: 140px;
  scroll-snap-align: start;
  border-radius: var(--radius);
}

.more-games-row .game-card--small .card-thumb {
  aspect-ratio: 4 / 3;
}

.more-games-row .game-card--small .card-info {
  padding: 10px 12px 12px;
}

.more-games-row .game-card--small .card-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-games-row .game-card--small .card-category {
  font-size: 11px;
}

.more-games-row .game-card--small .card-play-circle {
  width: 36px;
  height: 36px;
}

.more-games-row .game-card--small .card-play-circle svg {
  width: 16px;
  height: 16px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Hide sidebar ad on narrower screens */
@media (max-width: 900px) {
  .game-sidebar-ad {
    display: none;
  }
  .game-canvas-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .game-title-bar {
    padding: 12px 0 16px;
  }

  .game-page-title {
    font-size: 20px;
  }

  .game-canvas {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
  }

  .more-games-row .game-card--small {
    width: 120px;
  }

  .game-info-section {
    padding: 24px 0 0;
  }

  .game-info-heading {
    font-size: 16px;
  }

  .game-info-tags {
    margin-bottom: 24px;
  }

  .game-info-desc,
  .game-info-howto {
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  .game-breadcrumb {
    padding: 12px 0 0;
  }

  .game-title-bar {
    padding: 10px 0 12px;
  }

  .game-page-title {
    font-size: 18px;
  }

  .game-canvas {
    border-radius: 0;
  }

  .more-games-row .game-card--small {
    width: 110px;
  }

  .game-info-section {
    padding: 20px 0 0;
  }

  .info-tag {
    padding: 5px 12px;
    font-size: 12px;
  }

  .faq-question {
    padding: 12px 0;
    font-size: 13px;
  }
}

/* =============================================
   MOBILE FULLSCREEN OVERLAY
   ============================================= */
.game-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
}

.game-fullscreen-overlay[hidden] {
  display: none;
}

.overlay-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.overlay-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  color: white;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
  text-decoration: none;
}

.overlay-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.overlay-back-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.overlay-logo-img {
  height: 20px;
  max-height: 20px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.overlay-game-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Force-hide overlay on desktop */
@media (min-width: 769px) {
  .game-fullscreen-overlay {
    display: none !important;
  }
}

/* =============================================
   SPIKTAR SDK — AD OVERLAY
   ============================================= */
.spiktar-ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spiktar-ad-overlay[hidden] {
  display: none;
}
