/* ==============================
   KOLI GAMES - Game Page CSS (Poki-Style)
   ============================== */

/* ── Game Page Layout ── */
.game-page-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Breadcrumb */
.game-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.game-breadcrumb a { color: rgba(255,255,255,0.85); }
.game-breadcrumb a:hover { color: #fff; }
.bc-current { color: #fff; }

/* ── Two-column game layout ── */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
  align-items: start;
}

/* ── Iframe box ── */
.game-iframe-box {
  position: relative;
  width: 100%;
  max-width: 900px;         /* Bigger default */
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  transition: max-width 0.3s ease;
}

/* Maximized state */
.game-iframe-box.is-maximized {
  max-width: 100%;
}

.game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.game-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #0a1020;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 5;
}

.spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #20c2d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── White control bar (Poki-style) - centered under iframe ── */
.game-embed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;  /* horizontally center both iframe and bar */
}

.game-control-bar {
  background: #fff;
  border-radius: 0 0 16px 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  margin-top: -2px;
  width: 100%;
  max-width: 900px;      /* matches iframe max-width */
  transition: max-width 0.3s ease;
}

.gcb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gcb-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #e0e0ea;
  flex-shrink: 0;
}

.gcb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gcb-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.gcb-genres {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.gcb-genre-tag {
  padding: 1px 8px;
  background: #f0f0f8;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #555;
  text-decoration: none;
}

.gcb-genre-tag:hover { background: #e0e0f0; }

.gcb-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.gcb-btn {
  width: 36px;
  height: 36px;
  background: #f0f0f8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #1a1a2e;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition-fast);
  font-family: var(--font-main);
  white-space: nowrap;
}

/* Pill variant for Love / Share — wider with text */
.gcb-btn--pill {
  width: auto;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 5px;
  border-radius: 99px;
  letter-spacing: 0.01em;
}

.gcb-btn:hover { background: #e0e0f0; }

/* ── Always-Visible Game Info Panels ── */
.game-info-panels {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-info-panel {
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
}

.game-info-panel-header {
  padding: 11px 16px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.game-info-panel-body {
  padding: 12px 16px;
}

.desc-text {
  font-size: 0.85rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  white-space: pre-wrap;
}

.desc-text.mono { font-family: var(--font-main); }

/* ── Right Sidebar (related games) ── */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-sidebar-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 0;
}

.game-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sidebar game card (compact vertical strip) */
.sidebar-card {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 5px 7px 5px 5px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
}

.sidebar-card:hover {
  background: rgba(255,255,255,0.26);
  transform: scale(1.02);
}

.sidebar-card-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #cde9ed;
}

.sidebar-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-see-all {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  padding: 4px 0;
  text-align: center;
  display: block;
  transition: var(--transition-fast);
}

.sidebar-see-all:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-sidebar { flex-direction: row; flex-wrap: wrap; }
  .game-sidebar-list { flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 0 0 calc(50% - 4px); }

  /* Remove max-width caps so iframe + bar fill the full column */
  .game-iframe-box,
  .game-control-bar {
    max-width: 100%;
  }
}

/* ── Hide maximize/minimize button on mobile & tablet; show only on PC (≥ 1024px) ── */
@media (max-width: 1023px) {
  #maximize-btn { display: none; }
}

/* ── Small mobile (≤ 600px) ── */
@media (max-width: 600px) {
  /* Prevent ANY horizontal scroll on the game page */
  .game-page-main {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Iframe fills full width, taller aspect for portrait games */
  .game-iframe-box {
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    max-width: 100%;
  }

  .game-control-bar {
    padding: 8px 10px;
    gap: 6px;
    max-width: 100%;
    border-radius: 0 0 10px 10px;
    flex-wrap: wrap;
  }

  /* Thumbnail: slightly smaller */
  .gcb-thumb { width: 32px; height: 32px; }

  /* Title can grow but truncates */
  .gcb-title {
    font-size: 0.82rem;
    max-width: calc(100vw - 180px);
  }

  /* Genre tags: hide on very small screens to save space */
  .gcb-genres { display: none; }

  /* Actions row */
  .gcb-actions { gap: 5px; }

  /* Love / Share: show emoji only, no text label */
  .gcb-btn--pill {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    font-size: 1rem;
  }

  /* Hide text inside pill buttons, keep only the emoji */
  #like-btn .btn-label,
  #share-btn .btn-label { display: none; }

  /* Maximize button hidden on mobile (already handled by 767px rule above) */
  #maximize-btn { display: none; }

  .sidebar-card { flex: 0 0 100%; }

  /* Info panels: prevent overflow */
  .game-info-panels { overflow: hidden; }
  .game-info-panel { overflow: hidden; }
  .desc-text {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }
}
