/* ============================================
   LAYOUT STYLES - SloopyGames
   ============================================ */

body {
  background: var(--sg-bg-base);
  min-height: 100vh;
  color: var(--sg-text-secondary);
  font-family: var(--sg-font);
}

.page-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sg-sidebar-width);
  flex-shrink: 0;
  background: var(--sg-bg-sidebar);
  border-right: var(--sg-border-width) solid var(--sg-border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 14px;
  border-bottom: var(--sg-border-width) solid var(--sg-border);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: background var(--sg-transition-fast);
}

.sidebar-header:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.sidebar-header:focus-visible {
  outline: 2px solid var(--sg-primary);
  outline-offset: -2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 6px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: var(--sg-text-dim);
  text-decoration: none;
  transition: color var(--sg-transition-fast), background var(--sg-transition-fast);
  width: 100%;
  font-size: 12.5px;
}

.nav-item:hover {
  color: var(--sg-text-secondary);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.nav-item-active {
  color: var(--sg-primary);
  background: rgba(0, 188, 212, 0.06);
}

.nav-item-muted {
  opacity: 0.55;
}

.nav-item-muted:hover {
  opacity: 1;
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-item span {
  white-space: nowrap;
}

.sidebar-separator {
  height: 0.5px;
  background: var(--sg-border);
  margin: 8px 14px;
}

.sidebar-category-label {
  padding: 4px 14px 6px;
  font-size: 9.5px;
  color: var(--sg-text-ghost);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Collapsed sidebar variant — hides labels by default; mobile drawer overrides. */
.sidebar.sidebar-collapsed {
  width: var(--sg-sidebar-collapsed);
}

.sidebar.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

.sidebar.sidebar-collapsed .sidebar-wordmark,
.sidebar.sidebar-collapsed .nav-item-label,
.sidebar.sidebar-collapsed .sidebar-category-label {
  display: none;
}

.sidebar.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 9px 0;
}

.sidebar.sidebar-collapsed .sidebar-separator {
  margin: 6px 12px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  background: var(--sg-bg-base);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================
   TOP BAR
   ============================================ */

.top-bar {
  background: var(--sg-bg-topbar);
  padding: 10px 18px;
  border-bottom: var(--sg-border-width) solid var(--sg-border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-input {
  flex: 1;
  max-width: 360px;
  background: var(--sg-bg-card);
  border: var(--sg-border-width) solid var(--sg-border);
  border-radius: var(--sg-radius-md);
  padding: 8px 12px;
  color: var(--sg-text-primary);
  font-family: var(--sg-font);
  font-size: 13px;
  outline: none;
  transition: border-color var(--sg-transition-fast);
}

.search-input::placeholder {
  color: var(--sg-text-dim);
}

.search-input:focus {
  border-color: var(--sg-primary);
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--sg-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--sg-text-dim);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--sg-primary);
}

.breadcrumb-separator {
  color: var(--sg-text-ghost);
}

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

.hamburger-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-menu span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--sg-text-secondary);
  border-radius: 1px;
}

/* ============================================
   HERO
   ============================================ */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 18px;
  padding: 28px 24px 22px;
  border-bottom: var(--sg-border-width) solid var(--sg-border);
}

.hero-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-wordmark {
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--sg-text-primary);
  margin: 0;
}

.hero-wordmark-accent {
  color: var(--sg-primary);
}

.hero-tagline {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--sg-text-muted);
  max-width: 32ch;
  line-height: 1.5;
}

.hero-featured {
  display: grid;
  grid-template-columns: minmax(180px, 40%) 1fr;
  background: var(--sg-bg-card);
  border: var(--sg-border-width) solid var(--sg-border);
  border-radius: var(--sg-radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 180px;
  transition: transform var(--sg-transition-normal), border-color var(--sg-transition-fast);
}

.hero-featured:hover {
  transform: translateY(-2px);
  border-color: var(--sg-primary);
  text-decoration: none;
}

.hero-featured-thumb {
  position: relative;
  background: var(--sg-bg-darkest);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-featured-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-featured-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.hero-featured-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sg-primary);
}

.hero-featured-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--sg-text-primary);
  letter-spacing: -0.4px;
}

.hero-featured-desc {
  margin: 0;
  font-size: 13px;
  color: var(--sg-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-featured-cta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sg-primary);
}

/* ============================================
   GAME SECTION
   ============================================ */

.game-section {
  padding: 22px 24px 6px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--sg-text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

.section-count {
  font-size: 11px;
  color: var(--sg-text-faint);
}

.section-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--sg-accent);
  background: rgba(255, 107, 157, 0.08);
  padding: 3px 8px;
  border-radius: var(--sg-radius-sm);
}

.section-link {
  font-size: 12px;
  color: var(--sg-text-dim);
  text-decoration: none;
}

.section-link:hover {
  color: var(--sg-primary);
}

.empty-state {
  background: var(--sg-bg-card);
  border: var(--sg-border-width) dashed var(--sg-border);
  border-radius: var(--sg-radius-lg);
  padding: 28px;
  text-align: center;
  color: var(--sg-text-muted);
  font-size: 13px;
}

.empty-state p {
  margin: 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.game-card {
  background: var(--sg-bg-card);
  border: var(--sg-border-width) solid var(--sg-border);
  border-radius: var(--sg-radius-lg);
  overflow: hidden;
  transition: transform var(--sg-transition-normal), border-color var(--sg-transition-fast);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  display: block;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--sg-primary);
  text-decoration: none;
}

.game-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background: var(--sg-bg-darkest);
}

.game-thumbnail svg {
  width: 100%;
  height: 100%;
}

.game-info {
  padding: 10px 12px 12px;
}

.game-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-text-secondary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta {
  color: var(--sg-text-faint);
  font-size: 11px;
}

.published-game-card[hidden] {
  display: none;
}

/* ============================================
   GAME DETAIL PAGE
   ============================================ */

.published-game-frame {
  background: var(--sg-bg-darkest);
  border-bottom: var(--sg-border-width) solid var(--sg-border);
  height: min(72vh, 720px);
  min-height: 420px;
}

.published-game-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.game-info.published-game-detail {
  padding: 22px 24px 8px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

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

.published-game-detail .game-info-right {
  flex: 0 0 auto;
}

.published-game-detail .game-title {
  font-size: 26px;
  color: var(--sg-text-primary);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
  white-space: normal;
}

.published-game-detail .game-description {
  color: var(--sg-text-muted);
  line-height: 1.6;
  max-width: 760px;
  font-size: 13.5px;
}

.game-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  background: var(--sg-bg-card);
  border: var(--sg-border-width) solid var(--sg-border);
  color: var(--sg-text-dim);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--sg-radius-sm);
}

.game-play-btn {
  background: var(--sg-primary);
  color: #0E1220;
  font-weight: 700;
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: var(--sg-radius-md);
  display: inline-block;
  text-decoration: none;
  transition: filter var(--sg-transition-fast);
}

.game-play-btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
  color: #0E1220;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  margin-top: auto;
  background: var(--sg-bg-base);
  border-top: var(--sg-border-width) solid var(--sg-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  color: var(--sg-text-ghost);
  font-size: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-right a {
  color: var(--sg-text-ghost);
  text-decoration: none;
  font-size: 12px;
  transition: color var(--sg-transition-fast);
}

.footer-right a:hover {
  color: var(--sg-text-secondary);
}

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}
