/* ============================================================
   CrazyGames Clone — Global Design System  (style.css)
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Colors */
  --bg-root:       #0C0D14;
  --bg-surface:    #13141F;
  --bg-card:       #1A1B28;
  --bg-card-hover: #212233;
  --bg-input:      #1E1F2E;
  --bg-modal:      #181926;

  --accent:        #6842FF;
  --accent-hover:  #7C5EFF;
  --accent-glow:   rgba(104,66,255,0.35);

  --text-primary:  #F9FAFF;
  --text-secondary:#BDBFCE;
  --text-muted:    #AAADBE;
  --text-dim:      #6B6E88;

  --border:        #2F3148;
  --border-hover:  #4A4D6A;

  --success:       #06D6A0;
  --warning:       #FFBA08;
  --danger:        #FF4757;
  --info:          #4CC9F0;

  --new-badge:     #06D6A0;
  --hot-badge:     #FF5757;

  /* Layout */
  --sidebar-width:       250px;
  --sidebar-collapsed:   70px;
  --header-height:       60px;
  --content-max:         100%;

  /* Misc */
  --radius-sm:    8px;
  --radius-md:    18px;
  --radius-lg:    24px;
  --radius-xl:    32px;
  --radius-full:  9999px;

  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow:  0 0 30px var(--accent-glow);

  --transition:   all 0.2s ease;
  --transition-bounce: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
html::-webkit-scrollbar { width: 6px; } html::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }
body { font-family: 'Nunito', Arial, sans-serif; font-size: 14px; background: var(--bg-root); color: var(--text-primary); line-height: 1.5; min-height: 100vh; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 800; color: var(--text-primary); line-height: 1.2; }

/* ── Site Layout ───────────────────────────────────────────── */
.site-layout { display: flex; min-height: 100vh; }

/* ── Header ────────────────────────────────────────────────── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: rgba(13,14,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.header__menu-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.header__menu-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.header__logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 900; white-space: nowrap;
  transition: var(--transition); flex-shrink: 0;
}
.header__logo:hover { opacity: 0.85; }
.header__logo-icon { font-size: 26px; line-height: 1; }
.header__logo-text {
  background: linear-gradient(135deg, #fff 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.header__search { flex: 1; max-width: 560px; }
.header__search-wrap { position: relative; }
.header__search-input {
  width: 100%; padding: 9px 44px 9px 16px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-full); color: var(--text-primary); font-family: inherit; font-size: 14px;
  transition: var(--transition); outline: none;
}
.header__search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.header__search-input::placeholder { color: var(--text-dim); }
.header__search-btn {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.header__search-btn:hover { background: var(--accent-hover); }
.header__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-full); font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition);
  white-space: nowrap; border: 2px solid transparent;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text-primary); }
.btn--outline { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 5px 12px; font-size: 12px; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.15); }
.btn--success { background: var(--success); color: #000; }
.btn--icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0; z-index: 90;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  transform: translateX(-100%);
}
#sidebar.sidebar--open {
  transform: translateX(0);
}
.sidebar__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; scrollbar-width: thin; }
.sidebar__scroll::-webkit-scrollbar { width: 4px; } .sidebar__scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; }
.sidebar__section { display: flex; flex-direction: column; gap: 2px; }
.sidebar__divider { height: 1px; background: var(--border); margin: 10px 16px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-md);
  color: var(--text-muted); font-weight: 700; font-size: 14px;
  transition: var(--transition); white-space: nowrap; overflow: hidden;
}
.sidebar__link:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar__link--active { background: rgba(104,66,255,0.15); color: var(--accent); }
.sidebar__link--active .sidebar__icon { filter: none; }
.sidebar__icon { font-size: 18px; flex-shrink: 0; min-width: 22px; text-align: center; }
.sidebar__label { overflow: hidden; text-overflow: ellipsis; }
.sidebar__footer { padding: 16px 12px 8px; border-top: 1px solid var(--border); }
.sidebar__footer-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.sidebar__footer-links a { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.sidebar__footer-links a:hover { color: var(--accent); }
.sidebar__copyright { font-size: 11px; color: var(--text-dim); }

/* ── Sidebar Overlay (mobile) ──────────────────────────────── */
#sidebarOverlay {
  display: none; position: fixed; inset: 0; z-index: 89;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
#sidebarOverlay.overlay--visible { display: block; }

/* ── Main Content ──────────────────────────────────────────── */
#site-main {
  flex: 1;
  margin-left: 0;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.3s ease;
}
.main-inner { max-width: var(--content-max); padding: 16px 16px 36px; }

/* ── Hero Banner ───────────────────────────────────────────── */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(135deg, #1A0840 0%, #0D1B3E 50%, #0C0D14 100%);
  min-height: 340px; display: flex; align-items: center;
  margin-bottom: 32px; padding: 40px 48px;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 80% 50%, rgba(104,66,255,0.25), transparent);
}
.hero__content { position: relative; z-index: 1; max-width: 520px; }
.hero__badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(104,66,255,0.2); border: 1px solid rgba(104,66,255,0.4); border-radius: var(--radius-full); padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--accent-hover); margin-bottom: 16px; }
.hero__title { font-size: 38px; font-weight: 900; line-height: 1.1; margin-bottom: 14px; }
.hero__title span { color: var(--accent-hover); }
.hero__desc { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__img-wrap { position: absolute; right: 0; top: 0; bottom: 0; width: 45%; display: flex; align-items: center; justify-content: center; }
.hero__game-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; }
.hero__preview-card {
  width: 130px; height: 90px; border-radius: var(--radius-md); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; position: relative;
  animation: float 3s ease-in-out infinite;
}
.hero__preview-card:nth-child(2) { animation-delay: 0.5s; }
.hero__preview-card:nth-child(3) { animation-delay: 1s; }
.hero__preview-card:nth-child(4) { animation-delay: 1.5s; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* ── Section heading ──────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.section-title span { font-size: 22px; }
.section-link { font-size: 13px; color: var(--accent); font-weight: 700; transition: var(--transition); }
.section-link:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Category Grid ────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 32px; }
.category-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 8px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-weight: 700; font-size: 13px;
  transition: var(--transition-bounce); text-align: center; cursor: pointer;
}
.category-chip:hover { background: var(--bg-card-hover); border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.category-chip__emoji { font-size: 28px; }
.category-chip__label { font-size: 12px; }

/* ── Carousel ─────────────────────────────────────────────── */
.carousel-section { margin-bottom: 28px; }
.carousel-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-right: 4px; }
.carousel-section__title { font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.carousel-section__title span { font-size: 20px; }
.carousel-section__controls { display: flex; align-items: center; gap: 6px; }
.carousel-section__see-all { font-size: 12px; color: var(--accent); font-weight: 700; margin-right: 6px; }
.carousel-section__see-all:hover { text-decoration: underline; }
.carousel-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.carousel-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.carousel-track-wrap { overflow: hidden; }
.carousel-track {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { flex-shrink: 0; width: 175px; scroll-snap-align: start; }

/* ── Game Card ─────────────────────────────────────────────── */
.game-card {
  display: flex; flex-direction: column; border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition-bounce); cursor: pointer;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.game-card__thumb {
  position: relative; width: 100%; aspect-ratio: 1/1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.game-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.game-card:hover .game-card__img { transform: scale(1.05); }
.game-card__placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center;
}
.game-card__placeholder-emoji { font-size: 32px; line-height: 1; }
.game-card__placeholder-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.7); max-height: 2.4em; overflow: hidden; }
.game-card__overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.game-card:hover .game-card__overlay { opacity: 1; }
.game-card__play-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: var(--accent); color: #fff; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 800; cursor: pointer;
  transform: scale(0.9); transition: var(--transition-bounce);
}
.game-card:hover .game-card__play-btn { transform: scale(1); }
.game-card__play-btn:hover { background: var(--accent-hover); }
.game-card__fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  background: rgba(13, 14, 20, 0.7); backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0; transform: translateY(-4px);
}
.game-card:hover .game-card__fav-btn,
.game-card__fav-btn.active {
  opacity: 1; transform: translateY(0);
}
.game-card__fav-btn:hover {
  background: rgba(13, 14, 20, 0.95);
  transform: scale(1.15) !important;
  border-color: rgba(255, 255, 255, 0.2);
}
.game-card__info { padding: 9px 10px 10px; }
.game-card__title { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.game-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.game-card__cat { font-size: 11px; font-weight: 700; }
.game-card__rating { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.game-card__plays { font-size: 11px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }

/* large card */
.game-card--large { width: 260px; }
.game-card--large .game-card__placeholder-emoji { font-size: 48px; }
.game-card--large .game-card__placeholder-title { font-size: 13px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  position: absolute; top: 8px; z-index: 2;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge--new  { left: 8px; background: var(--new-badge); color: #000; }
.badge--hot  { right: 8px; background: var(--hot-badge); color: #fff; font-size: 13px; }

/* ── Game Grid ────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.game-grid .game-card { width: 100%; }
.game-grid .game-card__thumb { width: 100%; }

/* ── Game Page Layout ─────────────────────────────────────── */
.game-page { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.game-page__main {}
.game-frame-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.game-frame-wrap.game-frame-wrap--small {
  max-width: 960px;
  max-height: 55vh;
  margin-left: auto;
  margin-right: auto;
}
.game-frame-wrap.game-frame-wrap--theater {
  max-width: 100%;
  max-height: 75vh;
}
.game-frame-wrap.game-frame-wrap--mobile-full {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.game-frame-wrap.game-frame-wrap--rotated {
  position: fixed !important;
  width: 100vh !important;
  height: 100vw !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  z-index: 999999 !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: #000 !important;
}
.game-frame-wrap iframe { width: 100%; height: 100%; border: none; }
.game-frame-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(135deg, #1A0840, #0D1B3E);
  color: var(--text-muted);
}
.game-frame-placeholder .placeholder-emoji { font-size: 64px; }
.game-frame-placeholder .placeholder-text { font-size: 16px; font-weight: 700; }
.game-info { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); }
.game-info__title { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.game-info__meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.game-info__meta-item { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }
.game-info__meta-item strong { color: var(--text-primary); }
.game-info__desc { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.game-info__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game-tag { padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.game-tag:hover { border-color: var(--accent); color: var(--accent); }
.game-page__sidebar {}
.related-title { font-size: 15px; font-weight: 900; margin-bottom: 14px; }
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-card {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition);
}
.related-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateX(3px); }
.related-card__thumb {
  width: 64px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.related-card__info { flex: 1; overflow: hidden; }
.related-card__title { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.related-card__meta { font-size: 11px; color: var(--text-dim); }

/* ── Search Page ──────────────────────────────────────────── */
.search-header { margin-bottom: 24px; }
.search-header h1 { font-size: 26px; margin-bottom: 6px; }
.search-header p { color: var(--text-muted); }
.search-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-btn {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 700;
  background: var(--bg-card); border: 1.5px solid var(--border); color: var(--text-muted);
  transition: var(--transition); cursor: pointer;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn--active { background: rgba(104,66,255,0.15); border-color: var(--accent); color: var(--accent); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text-muted); font-size: 14px; font-weight: 700;
  transition: var(--transition); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.4; pointer-events: none; }

/* ── Stats Banner (Homepage) ──────────────────────────────── */
.stats-banner {
  display: flex; gap: 24px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 28px; margin-bottom: 28px;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-item__value { font-size: 22px; font-weight: 900; color: var(--accent-hover); }
.stat-item__label { font-size: 12px; color: var(--text-dim); font-weight: 600; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state__emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state__title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.empty-state__text { font-size: 14px; }

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--bg-card-hover); border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; color: var(--text-primary); box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease; max-width: 320px;
}
.toast--success { border-left: 4px solid var(--success); }
.toast--error   { border-left: 4px solid var(--danger);  }
.toast--info    { border-left: 4px solid var(--info);    }
@keyframes slideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: 32px 20px; text-align: center; margin-top: 48px;
}
.site-footer p { color: var(--text-dim); font-size: 13px; }
.site-footer a { color: var(--accent); font-weight: 600; }

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { from{background-position:200% 0} to{background-position:-200% 0} }

/* ── Back to Top ─────────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 80px; right: 24px; z-index: 500;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); cursor: pointer; transition: var(--transition);
  opacity: 0; pointer-events: none; border: none;
}
.back-to-top.visible { opacity: 1; pointer-events: all; }
.back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

@media (min-width: 769px) {
  #sidebar.sidebar--open ~ #site-main {
    margin-left: var(--sidebar-width);
  }
  #sidebarOverlay {
    display: none !important;
  }
}

/* ══ RESPONSIVE ════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-width: 220px; }
  .hero { padding: 32px; }
  .hero__title { font-size: 30px; }
  .hero__img-wrap { display: none; }
  .hero__content { max-width: 100%; }
}

@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.sidebar--open { transform: translateX(0); }
  #site-main { margin-left: 0; }
  .hero { min-height: 240px; padding: 24px; }
  .hero__title { font-size: 24px; }
  .game-page { grid-template-columns: 1fr; }
  .game-page__sidebar { display: none; }
  .carousel-item { width: 145px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .stats-banner { gap: 16px; padding: 16px; }
  .header__actions .btn--ghost { display: none; }
  
  /* Game View responsive enhancements */
  .game-frame-wrap {
    aspect-ratio: 4/3 !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    border-radius: var(--radius-lg) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
  .main-inner {
    padding: 12px 16px 30px !important;
  }
  .game-info {
    padding: 16px !important;
  }
  .game-info__title {
    font-size: 20px !important;
  }
  .game-view-sidebar {
    padding: 16px !important;
  }
  #resizeBtn {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .header__logo-text { display: none; }
  .header__search { max-width: calc(100% - 140px); }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .game-frame-wrap {
    aspect-ratio: 4/3 !important;
    height: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    border-radius: var(--radius-md) !important;
  }
  .main-inner {
    padding: 10px 12px 24px !important;
  }
}

/* ══ ANIMATED BRAND LOGO ════════════════════════════════════ */
.header__logo:hover .game-logo-svg {
  transform: scale(1.12) rotate(6deg);
  filter: drop-shadow(0 0 16px var(--accent-hover, #8462FF)) !important;
}

.header__logo:hover .header__logo-text {
  background: linear-gradient(135deg, #06D6A0 0%, #6842FF 50%, #FF4757 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateX(4px);
}

.game-logo-svg {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes logoSpin {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 800; }
}

/* ══ NEON LOADING SPINNER ════════════════════════════════════ */
.spinner-neon {
  width: 40px;
  height: 40px;
  border: 3.5px solid rgba(104, 66, 255, 0.08);
  border-top-color: var(--accent, #6842FF);
  border-radius: 50%;
  animation: neonSpinnerRotate 0.8s cubic-bezier(0.4, 0.1, 0.3, 0.9) infinite;
  filter: drop-shadow(0 0 10px var(--accent, #6842FF));
  flex-shrink: 0;
  display: inline-block;
}

@keyframes neonSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-dim);
}

/* ── GAME VIEW COLUMN LAYOUT ───────────────────────────────── */
.game-view-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.game-view-layout.game-view-layout--theater {
  grid-template-columns: 1fr;
}

.game-grid.game-grid--sidebar {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 0 !important;
}

@media (max-width: 991px) {
  .game-view-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Custom Share Popover */
.share-popover {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  width: 280px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInDown 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-popover__title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.share-popover__socials {
  display: flex;
  gap: 8px;
}

.share-popover__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.share-popover__btn:hover {
  background: rgba(104, 66, 255, 0.1);
  border-color: var(--accent);
  color: #fff;
}

.share-popover__copy-wrap {
  display: flex;
  gap: 6px;
}

.share-popover__input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  outline: none;
  font-family: inherit;
}

.share-popover__copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.share-popover__copy-btn:hover {
  background: var(--accent-hover);
}
