/* ============================================
   SINGLE GAME PAGE — game-gate
   3-column layout: Left Nav + Main + Right Sidebar
   Reference: CrazyGames style
   ============================================ */

/* === LAYOUT WRAPPER === */
.sg-wrapper {
  display: flex;
  min-height: calc(100vh - 60px);
  background: #fff;
  color: #e0e6ed;
}

/* === LEFT SIDEBAR NAV === */
.sg-left-nav {
  width: 60px;
  min-width: 60px;
  background: #63ed9e;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  transition: width .25s ease;
  scrollbar-width: none;
}
.sg-left-nav::-webkit-scrollbar { display: none; }
.admin-bar .sg-left-nav {
  top: 32px;
  height: calc(100vh - 32px);
}

/* Push entire page to account for fixed left nav */
body #page {
  margin-leftx: 60px;
}

.sg-left-nav.is-expanded {
  width: 200px;
}

/* Toggle button */
.sg-nav-toggle {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: none;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  transition: background .2s;
}
.sg-nav-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Separators */
.sg-nav-sep {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 8px 0;
  flex-shrink: 0;
}

/* Nav items */
.sg-nav-item {
  display: flex;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 4px;
  color: #333;
  text-decoration: none;
  font-size: 18px;
  justify-content: center;
  transition: all .2s;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sg-nav-item:hover,
.sg-nav-item.is-active {
  background: rgba(255,255,255,.1);
  color: #000;
  text-decoration: none;
}
.sg-nav-item .sg-nav-icon {
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}
.sg-nav-item .sg-nav-label {
  display: none;
  font-size: 13px;
  margin-left: 4px;
  color: #333;
}

/* Expanded state */
.sg-left-nav.is-expanded .sg-nav-item {
  width: 180px;
  justify-content: flex-start;
  padding-left: 0;
}
.sg-left-nav.is-expanded .sg-nav-item .sg-nav-label {
  display: inline;
}

/* Tooltip on hover (collapsed mode) */
.sg-left-nav:not(.is-expanded) .sg-nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 52px;
  background: #1e2d3d;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  pointer-events: none;
}

/* Category section label */
.sg-nav-section-label {
  display: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #566374;
  padding: 10px 12px 4px;
  width: 100%;
}
.sg-left-nav.is-expanded .sg-nav-section-label {
  display: block;
}

/* === MAIN CONTENT AREA === */
.sg-main {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
}
.sg-wrapper .container {
    max-width: unset;
    width: auto;
}
/* --- Hero Banner (below game) --- */
.sg-hero-banner {
  margin-bottom: 16px;
}
@media (max-width: 1024px) {
  .sg-hero-banner { display: none; }
}

/* --- Game Hero (CrazyGames-style) --- */
.sg-hero {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 8px;
}

/* Portrait wrapper: narrower, centered */
.sg-hero.is-portrait {
  margin-left: auto;
  margin-right: auto;
}

/* Inner container: holds the aspect-ratio for the game area only */
.sg-game-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
	@media (max-width: 768px) {
	  aspect-ratio: 9 / 16;
	}
}
.sg-hero.is-landscape .sg-game-containerx {
  aspect-ratio: 16 / 9;
	@media (max-width: 768px) {
	  aspect-ratio: 9 / 16;
	}
}
.sg-hero.is-portrait .sg-game-containerx {
  aspect-ratio: 16 / 9;
	@media (max-width: 768px) {
	  aspect-ratio: 9 / 16;
	}
}

/* Iframe stretches to fill container — absolute positioning */
.sg-hero-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Rotated iframe: swap width/height so game fills container after rotation */
.sg-game-container.is-rotated {
  container-type: size;
  overflow: hidden;
}
.sg-game-container.is-rotated .sg-hero-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Swap dimensions: width becomes container's height, height becomes container's width */
  width: 100cqh;
  transform: translate(-50%, -50%) rotate(var(--game-rotation, 0deg));
  transform-origin: center center;
}

/* Thumbnail fallback */
.sg-hero-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* --- Bottom Toolbar (CrazyGames-style) --- */
.sg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #1a1f2e;
  border-top: 1px solid rgba(255,255,255,.06);
  min-height: 44px;
}
.sg-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.sg-toolbar-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.sg-toolbar-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e6ed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-toolbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.sg-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #8b97a8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
  position: relative;
}
.sg-tb-btn:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sg-tb-btn.is-active {
  color: #7a1fa2;
}
.sg-tb-btn.is-active svg {
  fill: #7a1fa2;
  stroke: #7a1fa2;
}
.sg-tb-btn[data-action="favorite"].is-active svg {
  fill: #ef4444;
  stroke: #ef4444;
}
.sg-tb-btn[data-action="like"].is-active svg {
  fill: #4caf50;
  stroke: #4caf50;
}
.sg-tb-btn.is-copied::after {
  content: 'Đã copy!';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #4caf50;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  animation: sgFadeUp .3s ease;
}
@keyframes sgFadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sg-tb-count {
  font-size: 12px;
  font-weight: 600;
  color: #c8d0da;
}
.sg-tb-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.1);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Fullscreen mode: game fills viewport, toolbar pins to bottom */
.sg-hero.is-fullscreen {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
.sg-hero.is-fullscreen .sg-game-container {
  flex: 1 1 0%;
  min-height: 0;
  max-height: none;
  width: 100%;
  aspect-ratio: unset;
}
/* Portrait fullscreen: fill height, auto width to keep ratio, centered */
.sg-hero.is-fullscreen.is-portrait .sg-game-container {
  width: auto;
  height: calc(100% - 44px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  flex: none;
}
.sg-hero.is-fullscreen .sg-toolbar {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  width: 100%;
  height: 44px;
}

/* Mobile fullscreen: hide toolbar, game fills entire screen */
@media (max-width: 768px) {
  .sg-hero.is-fullscreen .sg-toolbar {
    display: none;
  }
  .sg-hero.is-fullscreen .sg-game-container {
    height: 100%;
    max-height: none;
  }
  .sg-hero.is-fullscreen.is-portrait .sg-game-container {
    height: 100%;
    width: 100%;
    aspect-ratio: unset;
  }
}

/* Toolbar responsive */
@media (max-width: 480px) {
  .sg-toolbar { padding: 4px 8px; gap: 4px; }
  .sg-toolbar-title { display: none; }
  .sg-tb-btn { padding: 6px; }
  .sg-tb-count { font-size: 11px; }
}

/* --- Guide Overlay (CrazyGames-style) --- */
.sg-guide-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sg-guide-overlay.is-open {
  display: flex;
}
.sg-guide-panel {
  position: relative;
  width: 90%;
  max-width: 520px;
  max-height: 80%;
  background: #1a2634;
  border-radius: 16px;
  padding: 24px;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sg-guide-panel::-webkit-scrollbar { width: 6px; }
.sg-guide-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.sg-guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.sg-guide-close:hover {
  background: rgba(255,255,255,.2);
}
.sg-guide-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
}
.sg-guide-body {
  font-size: 14px;
  line-height: 1.7;
  color: #b0bac6;
}
.sg-guide-body p { margin: 0 0 10px; }
.sg-guide-body ul,
.sg-guide-body ol { margin: 0 0 10px; padding-left: 20px; }
.sg-guide-body li { margin-bottom: 4px; }
.sg-guide-body strong,
.sg-guide-body b { color: #e0e6ed; }
.sg-guide-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* Fullscreen: overlay stays on top */
.sg-hero.is-fullscreen .sg-guide-overlay { z-index: 30; }



/* --- Play Overlay (CrazyGames-style) --- */
.sg-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .4s ease;
}
.sg-play-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.sg-play-bg {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(16px) brightness(.45);
}
.sg-play-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 40px;
}
.sg-play-icon {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.sg-play-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.sg-play-btn {
  margin-top: 6px;
  padding: 14px 56px;
  border: none;
  border-radius: 40px;
  background: linear-gradient(135deg, #6c5ce7, #8b7bff);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(108,92,231,.5);
}
.sg-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(108,92,231,.65);
}

/* --- Game Info Bar (two-column) --- */
.sg-info-bar {
  display: flex;
  gap: 24px;
    background: #1a2634;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.sg-info-left {
  flex: 1;
  min-width: 0;
}
.sg-info-right {
  flex-shrink: 0;
  width: 300px;
}
.sg-ad-slot {
  position: sticky;
  top: 16px;
}
@media (max-width: 1024px) {
  .sg-info-right { display: none; }
}

/* Breadcrumb */
.sg-breadcrumb {
  font-size: 13px;
  color: #7f849e;
  margin-bottom: 12px;
}
.sg-breadcrumb a {
  color: #8b7bff;
  text-decoration: none;
}
.sg-breadcrumb a:hover { color: #5ddcff; }
.sg-bc-sep {
  margin: 0 6px;
  color: #4a4f6a;
}
.sg-bc-current {
  color: #b0bac6;
}

/* Info header: icon + title */
.sg-info-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.sg-game-icon {
  width: 80px; height: 80px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.08);
}

/* Tag pills with count */
.sg-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(139,123,255,.1);
  border: 1px solid rgba(139,123,255,.2);
  color: #b0bac6;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.sg-tag:hover {
  background: rgba(139,123,255,.2);
  border-color: rgba(139,123,255,.4);
  color: #fff;
}
.sg-tag-count {
  font-weight: 700;
  color: #fff;
}
.sg-info-content { flex: 1; min-width: 0; }
.sg-game-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.2;
}
.sg-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #8b97a8;
  margin-bottom: 16px;
}
.sg-meta-row span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.5;
}
.sg-meta-row strong {
  color: #7f849e;
  font-weight: 400;
  min-width: 110px;
  flex-shrink: 0;
}
.sg-meta-row span:not(:has(strong)) { color: #e0e6ed; }
.sg-meta-row a { color: #8b7bff; text-decoration: none; font-weight: 600; }
.sg-meta-row a:hover { color: #afbfff; text-decoration: underline; }

/* Action buttons */
.sg-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.sg-btn-primary {
  background: #7a1fa2;
  color: #fff;
}
.sg-btn-primary:hover { background: #8e35b5; color: #fff; text-decoration: none; }
.sg-btn-secondary {
  background: rgba(255,255,255,.08);
  color: #c8d0da;
}
.sg-btn-secondary:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.sg-btn img { width: 20px; height: 20px; }

/* Tags */
.sg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sg-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  font-size: 12px;
  color: #8da4f0;
  text-decoration: none;
  transition: all .2s;
}
.sg-tag:hover { background: rgba(141,164,240,.15); color: #afbfff; text-decoration: none; }

/* --- Rating block --- */
.sg-rating-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1a2634;
  border-radius: 12px;
  margin-bottom: 20px;
}
.sg-rating-score {
  font-size: 28px;
  font-weight: 700;
  color: #4caf50;
  line-height: 1;
}
.sg-rating-stars { flex: 1; }
.sg-rating-count {
  font-size: 12px;
  color: #8b97a8;
}

/* --- Game Description --- */
.sg-description {
  background: #1a2634;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.sg-description-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}
.sg-description .sg-content {
  font-size: 14px;
  line-height: 1.7;
  color: #b0bac6;
}
.sg-description .sg-content p { margin: 0 0 12px; }
.sg-description .sg-content img { max-width: 100%; height: auto; border-radius: 8px; }
.sg-description .sg-content iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 8px;
}
.sg-description .sg-content a { color: #8da4f0; }
.sg-description .sg-content h2,
.sg-description .sg-content h3,
.sg-description .sg-content h4 { color: #e0e6ed; margin: 16px 0 8px; }

/* --- Screenshots Slider --- */
.sg-screenshots {
  margin-bottom: 20px;
}
.sg-screenshots-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}
.sg-screenshots .swiper-slide img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.sg-screenshots .swiper {
  border-radius: 12px;
  overflow: hidden;
}
.sg-screenshots .swiper-button-prev,
.sg-screenshots .swiper-button-next {
  color: #fff;
  background: rgba(0,0,0,.5);
  width: 36px; height: 36px;
  border-radius: 50%;
}
.sg-screenshots .swiper-button-prev::after,
.sg-screenshots .swiper-button-next::after { font-size: 14px; }
.sg-screenshots .swiper-pagination-bullet { background: #fff; }
.sg-screenshots .swiper-pagination-bullet-active { background: #7a1fa2; }

/* --- NPH Info --- */
.sg-nph-block {
  background: #1a2634;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.sg-nph-block h3 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px;
}
.sg-nph-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sg-nph-block ul li {
  padding: 5px 0;
  font-size: 13px;
  color: #8b97a8;
}
.sg-nph-block ul li a { color: #8da4f0; text-decoration: none; }
.sg-nph-block ul li a:hover { text-decoration: underline; }
.sg-nph-block ul li i { width: 18px; margin-right: 6px; color: #566374; }

/* --- Shared Card Component (minigame-item style) --- */
.sg-card-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #fff;
}
.sg-card-thumb {
  width: 100%;
  height: 100%;
  position: relative;
}
.sg-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.sg-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.75) 100%);
  pointer-events: none;
}
.sg-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0;
  z-index: 2;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}

/* --- Animated Icon Video (hover play) --- */
.sg-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.has-anm:hover .sg-card-video {
  opacity: 1;
}
.has-anm:hover .sg-card-thumb img {
  opacity: 0;
}

/* --- Related Games (bottom) --- */
.sg-related {
  margin-bottom: 20px;
}
.sg-related-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px;
}
.sg-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.sg-related-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #171a2f;
  aspect-ratio: 16 / 9;
  transition: transform .25s ease, box-shadow .25s ease;
}
.sg-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.sg-related-card:hover .sg-card-title {
  opacity: 1;
  transform: translateY(0);
}
.sg-related-card:hover .sg-card-thumb img {
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .sg-related-card .sg-card-title {
    opacity: 1;
    transform: translateY(0);
    font-size: 10px;
    padding: 4px 6px;
  }
}

/* --- Comments section --- */
.sg-comments {
  background: #1a2634;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.sg-comments-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

/* === RIGHT SIDEBAR === */
.sg-right-sidebar {
  width: 320px;
  min-width: 320px;
  padding: 20px 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sg-right-sidebar-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  padding-left: 4px;
}
.sg-sidebar-games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sg-sidebar-game {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #171a2f;
  aspect-ratio: 16 / 9;
  transition: transform .25s ease, box-shadow .25s ease;
}
.sg-sidebar-game:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.sg-sidebar-game:hover .sg-card-title {
  opacity: 1;
  transform: translateY(0);
}
.sg-sidebar-game:hover .sg-card-thumb img {
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .sg-sidebar-game .sg-card-title {
    opacity: 1;
    transform: translateY(0);
    font-size: 10px;
    padding: 4px 6px;
  }
}

/* === DOWNLOAD BUTTONS === */
.sg-download-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sg-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: opacity .2s;
}
.sg-download-btn:hover { opacity: .85; color: #fff; text-decoration: none; }
.sg-download-btn.android { background: #3ddc84; color: #1a2634; }
.sg-download-btn.ios { background: #007aff; }
.sg-download-btn.apk { background: #ff6b35; }
.sg-download-btn img { width: 18px; height: 18px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .sg-right-sidebar {
    width: 260px;
    min-width: 260px;
  }
  .sg-sidebar-games {
    grid-template-columns: 1fr;
  }
  .sg-main {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .sg-wrapper {
    flex-direction: column;
  }
  .sg-left-nav {
    display: none;
  }
  body #page {
    margin-left: 0;
  }
  .sg-right-sidebar {
    width: 100%;
    min-width: unset;
    padding: 0 16px 20px;
  }
  .sg-sidebar-games {
    grid-template-columns: repeat(3, 1fr);
  }
  .sg-main {
    padding: 16px 16px 20px;
  }
  .sg-game-title { font-size: 18px; }
  .sg-game-icon { width: 60px; height: 60px; border-radius: 12px; }
  .sg-info-bar { padding: 12px; gap: 12px; }

  /* Portrait game on mobile: full-width, cap height */
  .sg-hero.is-portrait {
    max-width: 100%;
  }
  .sg-hero.is-portrait .sg-game-container {
    max-height: 75vh;
  }
}

/* Mobile held landscape — maximize game area */
@media (max-width: 768px) and (orientation: landscape) {
  .sg-hero {
    border-radius: 0;
  }
  .sg-game-container {
    max-height: 85vh;
  }
}

@media (max-width: 480px) {
  .sg-sidebar-games {
    grid-template-columns: repeat(2, 1fr);
  }
  .sg-related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .sg-hero { border-radius: 8px; }
  .sg-info-bar,
  .sg-description,
  .sg-nph-block,
  .sg-comments,
  .sg-rating-block { border-radius: 8px; }
}

/* === Override theme defaults inside single-game === */
.sg-wrapper * { box-sizing: border-box; }
.sg-wrapper a:hover { text-decoration: none; }

/* KK Star Ratings dark override */
.sg-rating-block .kksr-star { filter: brightness(1.2); }
.sg-rating-block .kksr-legend { color: #8b97a8 !important; font-size: 12px !important; }

/* === REACTION BUTTONS (.sg-reactions) === */
.sg-reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sg-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #8b97a8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.sg-react-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sg-react-btn.is-active[data-action="like"] {
  color: #4caf50;
  border-color: rgba(76,175,80,.3);
  background: rgba(76,175,80,.1);
}
.sg-react-btn.is-active[data-action="like"] svg {
  fill: #4caf50;
  stroke: #4caf50;
}
.sg-react-btn.is-active[data-action="unlike"] {
  color: #ef5350;
  border-color: rgba(239,83,80,.3);
  background: rgba(239,83,80,.1);
}
.sg-react-btn.is-active[data-action="unlike"] svg {
  fill: #ef5350;
  stroke: #ef5350;
}
.sg-react-btn.is-active[data-action="favorite"] {
  color: #ec407a;
  border-color: rgba(236,64,122,.3);
  background: rgba(236,64,122,.1);
}
.sg-react-btn.is-active[data-action="favorite"] svg {
  fill: #ec407a;
  stroke: #ec407a;
}

/* Unlike active color for toolbar buttons */
.sg-tb-btn[data-action="unlike"].is-active svg {
  fill: #ef5350;
  stroke: #ef5350;
}
.sg-tb-btn[data-action="unlike"].is-active {
  color: #ef5350;
}

/* === AD INTERSTITIAL OVERLAY (5s countdown) === */
.sg-ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease;
}
.sg-ad-overlay.is-visible {
  display: flex;
}
.sg-ad-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.sg-ad-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sg-ad-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  max-width: 90%;
  max-height: 85%;
}
.sg-ad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 728px;
}
.sg-ad-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .5);
  font-weight: 600;
}
.sg-ad-timer {
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}
.sg-ad-timer strong {
  color: #fff;
  font-size: 16px;
  display: inline-block;
  min-width: 14px;
  text-align: center;
}
.sg-ad-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
}
.sg-ad-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.sg-ad-skip {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: #8b97a8;
  background: rgba(255, 255, 255, .08);
}
.sg-ad-skip:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.sg-ad-skip:not(:disabled) {
  background: linear-gradient(135deg, #6c5ce7, #8b7bff);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108, 92, 231, .4);
}
.sg-ad-skip:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(108, 92, 231, .55);
}

/* Fullscreen: ad overlay stays on top */
.sg-hero.is-fullscreen .sg-ad-overlay { z-index: 31; }

/* === MOBILE EXIT FULLSCREEN BUTTON === */
.sg-exit-fs {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
.sg-exit-fs:hover {
  background: rgba(0, 0, 0, .8);
}
.sg-exit-fs:active {
  transform: scale(.92);
}

/* Only show on mobile when in fullscreen */
@media (max-width: 768px) {
  .sg-hero.is-fullscreen .sg-exit-fs {
    display: flex;
  }
}
/* Also show in landscape mobile fullscreen */
@media (max-width: 768px) and (orientation: landscape) {
  .sg-hero.is-fullscreen .sg-exit-fs {
    display: flex;
    top: 8px;
    left: 8px;
  }
}

