/* ----- PAGE WRAPPER + SIDEBAR ----- */
.page-wrapper {
  display: flex;
  padding-top: 4rem;
  min-height: 100vh;
}

.sidebar {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 1rem;
  width: 16rem;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  padding-top: 5rem;
  background: #f8fafc;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow-y: auto;
}

.sidebar-brand {
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.sidebar-brand h2 {
  font-size: 1.125rem;
  font-weight: 900;
  color: #0f172a;
  font-family: var(--font-headline);
}

.sidebar-brand p {
  font-size: 0.75rem;
  color: var(--color-outline);
  font-weight: 400;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #64748b;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.3s;
}

.sidebar-nav-item:hover {
  transform: translateX(4px);
}

.sidebar-nav-item.active {
  background: white;
  color: #7c3aed;
  box-shadow: 0 1px 8px rgba(106, 55, 212, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-premium {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-container));
  color: var(--color-on-primary);
  font-weight: 700;
  font-family: var(--font-headline);
  box-shadow: var(--shadow-nav);
  transition: opacity 0.2s;
  text-align: center;
}

.btn-premium:hover {
  opacity: 0.92;
}

.sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid rgba(218, 221, 223, 0.3);
  padding-top: 1rem;
}

/* ----- MAIN CONTENT ----- */
.main-content {
  flex: 1;
  padding: 2rem;
}

/* ===== GAME SPECIFIC LAYOUT ===== */
.game-single-container {
  max-width: 1400px;
  margin: 0 auto;
}

.game-two-columns {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
  }

  .main-content {
    margin-left: 16rem;
    padding: 2rem 2.5rem;
  }

  .game-two-columns {
    flex-direction: row;
    align-items: flex-start;
  }
}

.game-left {
  flex: 2;
  min-width: 0;
}

.game-right {
  flex: 1;
  min-width: 0;
}

/* video player block */
.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

.player-wrap__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-wrap__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.player-wrap:hover .player-wrap__overlay {
  opacity: 1;
}

.player-wrap__play-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  width: 5rem;
  height: 5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.player-wrap__play-btn:hover {
  transform: scale(1.1);
}

.player-wrap__play-btn .material-symbols-outlined {
  font-size: 3rem;
  color: white;
  font-variation-settings: 'FILL' 1;
}

.player-wrap__hud {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
}

.player-hud-badge {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.player-hud-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.player-hud-ctrl {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 0.4rem;
  border-radius: var(--radius-full);
  color: white;
  display: inline-flex;
}

/* iframe should be the playable layer */
.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  position: relative;
  z-index: 1;
}

/* HUD visible but does NOT block clicks */
.player-wrap__hud {
  z-index: 10;
  pointer-events: none;
}

/* buttons inside HUD still clickable */
.player-hud-ctrl {
  pointer-events: auto;
}

/* overlay should not block game after load */
.player-wrap__overlay {
  z-index: 5;
}

.player-wrap__poster {
  z-index: 2;
  position: relative;
}

/* game info card */
.game-info-card {
  background: var(--color-surface-container-low);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.game-title {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.game-developer {
  color: var(--color-on-surface-variant);
  margin-bottom: 1rem;
}

.game-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.game-tag {
  background: var(--color-primary-container);
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.about-text {
  margin: 1.25rem 0;
  line-height: 1.6;
  color: var(--color-on-surface-variant);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.meta-item .meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-outline);
}

.meta-item .meta-value {
  font-weight: 700;
  font-size: 1rem;
}

/* right column widgets */
.stats-card,
.recommended,
.multipass-card,
.friends-card {
  background: var(--color-surface-container-low);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stats-card h3,
.recommended h3,
.friends-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--color-outline);
  margin-bottom: 1rem;
}

.progress-row {
  margin-bottom: 1rem;
}

.progress-row .labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.progress-track {
  background: #e2e8f0;
  border-radius: var(--radius-full);
  height: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  height: 100%;
  border-radius: var(--radius-full);
}

.stats-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.mini-stat {
  background: white;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.mini-stat .number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rec-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
}

.rec-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.rec-info .rec-name {
  font-weight: 700;
}

.rec-genre {
  font-size: 0.7rem;
  color: var(--color-outline);
}

.rec-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--color-primary);
}

.multipass-card {
  background: linear-gradient(135deg, #7c3aed, #4338ca);
  color: white;
}

.multipass-card h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: normal;
}

.multipass-card p {
  font-size: 0.8rem;
  margin: 0.5rem 0 1rem;
}

.multipass-btn {
  background: white;
  color: #7c3aed;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-block;
  cursor: pointer;
}

.friends-avatars {
  display: flex;
  margin-bottom: 0.75rem;
}

.friends-avatars img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -0.4rem;
}

.friends-avatars img:first-child {
  margin-left: 0;
}

.friends-avatars__count {
  background: #ede9fe;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  margin-left: -0.4rem;
}

/* mobile bottom nav */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-surface-container);
  justify-content: space-around;
  padding: 0.75rem 0.5rem;
  z-index: 50;
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 500;
}

.mobile-nav-item.active {
  color: #7c3aed;
  font-weight: 700;
}

/* ================================================================
   RESPONSIVE ADDITIONS FOR single-game.php
   Add this block at the END of your style.css
   Breakpoints: 370, 390, 410, 430px | 768px landscape | tablet portrait/landscape
   ================================================================ */

/* ────────────────────────────────────────────────────────
   BASE MOBILE FIXES  (applies to all screens ≤ 767px)
──────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Page wrapper: no top-pad eating into content */
  .page-wrapper {
    padding-top: 3.5rem;
    flex-direction: column;
  }

  /* Main content: give bottom room for the sticky nav */
  .main-content {
    margin-left: 0 !important;
    padding: 1rem 0.75rem 5rem;   /* bottom = nav height + breathing room */
  }

  /* Two-column → single column */
  .game-two-columns {
    flex-direction: column;
    gap: 1.25rem;
  }

  /* Player: keep 16/9 but don't let it overflow */
  .player-wrap {
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
  }

  /* HUD tweaks: smaller text, tighter padding */
  .player-wrap__hud {
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .player-hud-badge,
  .player-hud-live {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }

  .player-hud-ctrl {
    padding: 0.3rem;
  }

  .player-hud-ctrl .material-symbols-outlined {
    font-size: 1.1rem;
  }

  /* Game info card */
  .game-info-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
  }

  .game-title {
    font-size: 1.4rem;
    line-height: 1.25;
  }

  .game-developer {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .game-tags {
    gap: 0.35rem;
    margin-bottom: 1rem;
  }

  .game-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.65rem;
  }

  .about-text {
    font-size: 0.85rem;
    margin: 1rem 0;
  }

  /* Meta grid: 2 cols on mobile */
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .meta-item .meta-label {
    font-size: 0.6rem;
  }

  .meta-item .meta-value {
    font-size: 0.875rem;
  }

  /* Right column: full width, slightly smaller padding */
  .game-right {
    width: 100%;
  }

  .stats-card,
  .recommended,
  .multipass-card,
  .friends-card {
    padding: 1.1rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
  }

  .stats-card h3,
  .recommended h3,
  .friends-card h3 {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
  }

  .stats-mini-grid {
    gap: 0.6rem;
  }

  .mini-stat .number {
    font-size: 1.25rem;
  }

  /* Recommended list */
  .rec-item {
    gap: 0.75rem;
  }

  .rec-thumb {
    width: 3rem;
    height: 3rem;
  }

  .rec-info .rec-name {
    font-size: 0.85rem;
  }

  /* Multipass card */
  .multipass-card h3 {
    font-size: 1rem;
  }

  .multipass-card p {
    font-size: 0.75rem;
  }

  /* Friends card */
  .friends-avatars img,
  .friends-avatars__count {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* ────────────────────────────────────────────────────────
   370 px  (very small phones: SE 1st gen, Galaxy A03 core)
──────────────────────────────────────────────────────── */
@media (max-width: 374px) {

  .main-content {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }

  .game-title {
    font-size: 1.2rem;
  }

  .player-wrap__hud {
    gap: 0.25rem;
  }

  /* stack HUD left items vertically if they'd overflow */
  .player-wrap__hud-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
  }

  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stats-mini-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .mini-stat .number {
    font-size: 1.1rem;
  }

  .mobile-bottom-nav {
    padding: 0.5rem 0.25rem;
  }

  .mobile-nav-item {
    font-size: 0.55rem;
  }

  .mobile-nav-item .material-symbols-outlined {
    font-size: 1.2rem;
  }
}

/* ────────────────────────────────────────────────────────
   390 px  (iPhone 14 / 15, Pixel 7)
──────────────────────────────────────────────────────── */
@media (min-width: 375px) and (max-width: 399px) {

  .main-content {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .game-title {
    font-size: 1.35rem;
  }

  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ────────────────────────────────────────────────────────
   410 px  (Pixel 8 Pro, Galaxy S23+)
──────────────────────────────────────────────────────── */
@media (min-width: 400px) and (max-width: 429px) {

  .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .game-title {
    font-size: 1.45rem;
  }

  /* Allow 4-col meta grid on wider small phones */
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ────────────────────────────────────────────────────────
   430 px  (iPhone 14 Plus / 15 Plus, Galaxy S24+)
──────────────────────────────────────────────────────── */
@media (min-width: 430px) and (max-width: 767px) {

  .main-content {
    padding-left: 1.125rem;
    padding-right: 1.125rem;
  }

  .game-title {
    font-size: 1.55rem;
  }

  /* 4-col meta grid comfortable from 430 up */
  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Recommended: slightly bigger thumbs */
  .rec-thumb {
    width: 3.25rem;
    height: 3.25rem;
  }
}

/* ────────────────────────────────────────────────────────
   768 px  LANDSCAPE (phones rotated, small tablets)
   Targets: width ≥ 640px AND height ≤ 500px
──────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 1023px) and (orientation: landscape) {

  .page-wrapper {
    padding-top: 3.5rem;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem 1.5rem 2rem;
  }

  /* Two-column layout re-enabled in landscape */
  .game-two-columns {
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .game-left {
    flex: 2;
  }

  .game-right {
    flex: 1;
    /* Right col scrolls independently so the player stays visible */
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    position: sticky;
    top: 4.5rem;
  }

  /* Player is shorter in landscape to leave room for HUD */
  .player-wrap {
    margin-bottom: 0.875rem;
  }

  .game-info-card {
    padding: 1rem;
  }

  .game-title {
    font-size: 1.5rem;
  }

  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hide the bottom nav in landscape – sidebar becomes visible */
  .mobile-bottom-nav {
    display: none;
  }
}

/* ────────────────────────────────────────────────────────
   TABLET PORTRAIT  (768 px – 1023 px)
──────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {

  .page-wrapper {
    padding-top: 4rem;
    flex-direction: column;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 2rem 3rem;
  }

  /* Two-column layout, tighter ratio */
  .game-two-columns {
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .game-left {
    flex: 3;
  }

  .game-right {
    flex: 2;
  }

  .game-title {
    font-size: 1.75rem;
  }

  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .player-wrap {
    margin-bottom: 1.25rem;
  }

  .game-info-card {
    padding: 1.5rem;
  }

  /* Show sidebar if theme renders it */
  .sidebar {
    display: none; /* still hidden on tablet portrait — no space */
  }

  /* Hide mobile bottom nav */
  .mobile-bottom-nav {
    display: none;
  }
}

/* ────────────────────────────────────────────────────────
   TABLET LANDSCAPE  (1024 px – 1279 px)
──────────────────────────────────────────────────────── */
@media (min-width: 1024px) and (max-width: 1279px) {

  /* Sidebar is now visible (already handled in base CSS) */
  .main-content {
    margin-left: 16rem;
    padding: 1.5rem 1.75rem;
  }

  .game-two-columns {
    flex-direction: row;
    gap: 1.75rem;
  }

  .game-left {
    flex: 2;
  }

  .game-right {
    flex: 1;
  }

  .game-title {
    font-size: 1.85rem;
  }

  .game-info-card {
    padding: 1.75rem;
  }

  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ────────────────────────────────────────────────────────
   LARGE DESKTOP  (≥ 1280 px) — minor polish
──────────────────────────────────────────────────────── */
@media (min-width: 1280px) {

  .main-content {
    padding: 2rem 3rem;
  }

  .game-two-columns {
    gap: 2.5rem;
  }
}

/* ────────────────────────────────────────────────────────
   UTILITY: smooth scroll inside sticky right column
──────────────────────────────────────────────────────── */
.game-right {
  scrollbar-width: thin;
  scrollbar-color: var(--color-surface-dim) transparent;
}

.game-right::-webkit-scrollbar {
  width: 4px;
}

.game-right::-webkit-scrollbar-thumb {
  background: var(--color-surface-dim);
  border-radius: var(--radius-full);
}

/* ===== BREADCRUMBS (clean version) ===== */
.breadcrumbs {
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-size: 0.813rem;
  line-height: 1.5;
}

.breadcrumbs p {
  margin: 0;
}

.breadcrumbs a {
  color: var(--color-on-surface-variant);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumbs .breadcrumb_last {
  color: var(--color-on-surface);
  font-weight: 600;
  cursor: default;
}

/* Style the separator (») */
.breadcrumbs span span + span {
  margin-left: 0.25rem;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.75rem;
  }
}

.mobile-only-overlay {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.mobile-message {
  color: white;
  text-align: center;
  max-width: 260px;
}

.mobile-message p {
  margin: 0.5rem 0;
  font-weight: 600;
}

.mobile-message .sub-text {
  font-size: 0.8rem;
  opacity: 0.8;
}



.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: black;
}

/* make iframe fill actual fullscreen pixels */
.player-wrap:fullscreen iframe,
.player-wrap:-webkit-full-screen iframe {
  position: absolute;
  inset: 0;
  z-index: 9999;
}

.player-wrap:fullscreen .player-wrap__overlay,
.player-wrap:-webkit-full-screen .player-wrap__overlay {
  display: none !important;
}

.player-wrap:fullscreen iframe,
.player-wrap:-webkit-full-screen iframe {
  pointer-events: auto !important;
  z-index: 1;
}

.player-wrap:fullscreen .player-wrap__hud,
.player-wrap:-webkit-full-screen .player-wrap__hud {
  display: none !important;
}