@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Outfit:wght@600;700&family=Space+Mono&display=swap');

/* Critical CSS for LCP - extracted to improve initial render */
:root {
  --space-dark: #0B0D17;
  --space-blue: #1A1D2E;
  --star-white: #F0F4F8;
  --nebula-pink: #FF6B9D;
  --comet-cyan: #4ECDC4;
  --sun-gold: #FFE66D;
  --planet-purple: #9B59B6;
  --shadow-glow: 0 4px 20px rgba(78,205,196,0.15);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--space-dark);
  color: var(--star-white);
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  margin-top: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.brief-comment-game{
  margin: 0; /* Reset default <p> margins so clamping area isn't squeezed */
  line-height: 1.4; /* Make -webkit-line-clamp calculation consistent */
  white-space: normal; /* Override .daily-special{white-space:nowrap} so it can wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.85rem;
  color: rgba(209, 207, 207, 0.75);
}
/* 面包屑导航样式 */
.breadcrumb-nav {
  margin: 20px 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item a {
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--comet-cyan);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  position: relative;
}

.breadcrumb-item a:hover {
  background: rgba(78, 205, 196, 0.1);
  transform: translateY(-1px);
}

.breadcrumb-item span[aria-current="page"] {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--comet-cyan);
  font-weight: 600;
  padding: 4px 8px;
}

.breadcrumb-separator {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--comet-cyan);
  user-select: none;
  font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .breadcrumb-list {
      gap: 6px;
  }
  
  .breadcrumb-item a,
  .breadcrumb-item span[aria-current="page"] {
      padding: 3px 6px;
      font-size: 14px;
  }
  
  .breadcrumb-separator {
      font-size: 12px;
  }
}

/* Header */
header {
  height: 80px;
  background-color: var(--space-dark);
  border-bottom: 1px solid rgba(240, 244, 248, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--star-white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-desktop {
  display: flex;
  gap: 30px;
}

.nav-link {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  position: relative;
  padding-bottom: 5px;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--comet-cyan);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active::after {
  width: 100%;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--nebula-pink);
  background-image: url('https://via.placeholder.com/40');
  background-size: cover;
  background-position: center;
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: rgba(26, 29, 46, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(240, 244, 248, 0.1);
}

.mobile-nav-item {
  font-size: 24px;
  color: var(--star-white);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mobile-nav-item.active {
  color: var(--comet-cyan);
}

/* Footer */
footer {
  background-color: var(--space-blue);
  margin-top: auto;
  position: relative;
  padding-top: 60px;
  padding-bottom: 20px;
}

.footer-wave {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.footer-wave svg {
  display: block;
  width: calc(100% + 1.3px);
  height: 50px;
}

.footer-wave .shape-fill {
  fill: var(--space-dark);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col div {
  color: var(--comet-cyan);
  font-size: 18px;
  margin-bottom: 20px;
}

.footer-col p, .footer-col li {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(240, 244, 248, 0.1);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  opacity: 0.6;
}

/* Sidebar (Tags page) */
.sidebar {
  width: 280px;
  background-color: var(--space-blue);
  border-radius: 20px;
  border: 1px solid rgba(240, 244, 248, 0.1);
  padding: 20px;
  flex-shrink: 0;
}

.sidebar-title {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--comet-cyan);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-item {
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.category-item:hover {
  background-color: var(--planet-purple);
}

.category-item.active {
  background-color: var(--planet-purple);
}

.category-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background-color: var(--nebula-pink);
  transition: width 0.3s ease;
}

.category-item:hover::before {
  width: 4px;
}

.category-item.active::before {
  width: 4px;
}

/* Index Hero */
.hero {
  height: 500px;
  background-color: var(--space-dark);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin-top: 80px;
}

.stars-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  opacity: 0;
  animation: star-twinkle var(--duration) infinite ease-in-out;
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.hero-content {
  z-index: 10;
}

.hero-title {
  font-size: 52px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--comet-cyan), var(--nebula-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-cta {
  background-color: var(--nebula-pink);
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  display: inline-block;
  transition: box-shadow 0.3s ease;
}

.hero-cta:hover {
  box-shadow: var(--shadow-glow);
}

.portholes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  margin-top: 40px;
  flex-wrap: nowrap;
}

.porthole {
  flex: 0 1 clamp(120px, 16vw, 180px);
  width: clamp(120px, 16vw, 180px);
  height: clamp(120px, 16vw, 180px);
  border-radius: 50%;
  border: 4px solid rgba(240, 244, 248, 0.2);
  overflow: hidden;
  transition: border-color 0.3s ease;
  position: relative;
}

.porthole:hover {
  border-color: var(--comet-cyan);
}

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

/* Daily Special */
.daily-special {
  padding: 20px 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.special-card {
  background-color: var(--space-blue);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(240, 244, 248, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.special-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.special-card-img {
  height: 60%;
  width: 100%;
  object-fit: cover;
}

.special-card-content {
  padding: 20px;
  text-align: left;
}

/* Orbit Categories */
.orbit-categories {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 60px 0;
  flex-wrap: wrap;
}

.planet {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.6s ease;
  background-color: var(--space-blue);
  border: 2px solid rgba(255,255,255,0.1);
}

.planet:hover {
  transform: rotate(360deg);
}

/* Detail Page */
.game-detail-container {
  padding-top: 100px;
}

.breadcrumbs {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--comet-cyan);
  margin-bottom: 20px;
}

.game-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 20px;
}

.game-cover-wrapper {
  position: relative;
}

.game-cover {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow-glow);
}

.favorite-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.favorite-btn.active {
  color: var(--sun-gold);
}

.game-info h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

.game-info .game-star--detail-hero {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
}

.game-info .game-star--detail-hero .detail-rating-visual {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #fbbf24;
  font-size: 1.05rem;
  line-height: 1;
}

.game-info .game-star--detail-hero .detail-rating-visual .star-icon {
  margin-right: 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 15px;
}

.section-header-row h2 {
  flex: 1;
  margin: 0;
}

.section-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.module-link-more {
  color: var(--comet-cyan, #54e7ff);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.module-link-more:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.game-empty {
  margin: 40px auto 80px;
  padding: 48px 36px;
  max-width: 720px;
  text-align: center;
  background: linear-gradient(180deg, rgba(24, 26, 42, 0.9), rgba(10, 12, 26, 0.9));
  border: 1px solid rgba(84, 231, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(6, 8, 18, 0.6), 0 0 30px rgba(84, 231, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.game-empty::before {
  content: '';
  position: absolute;
  inset: -40% auto auto -40%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(84, 231, 255, 0.25), rgba(84, 231, 255, 0));
  filter: blur(2px);
}

.game-empty h1,
.game-empty .game-empty-title {
  font-size: 32px;
  margin: 18px 0 12px;
  color: var(--comet-cyan);
  text-shadow: 0 0 18px rgba(84, 231, 255, 0.25);
}

.game-empty p {
  margin: 0 auto 28px;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(240, 244, 248, 0.8);
}

.empty-orbit {
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px dashed rgba(84, 231, 255, 0.45);
  position: relative;
  box-shadow: inset 0 0 16px rgba(84, 231, 255, 0.2);
}

.empty-orbit::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nebula-pink);
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(255, 107, 157, 0.8);
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .game-empty {
    padding: 36px 24px;
    margin: 30px 16px 60px;
  }

  .game-empty h1,
  .game-empty .game-empty-title {
    font-size: 26px;
  }
}

.developer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 20px;
}

.tags-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tag-pill {
  background-color: var(--planet-purple);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
}

.game-description {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 30px;
  background: linear-gradient(180deg, rgba(26, 29, 46, 0.9), rgba(26, 29, 46, 0.6));
  border: 1px solid rgba(240, 244, 248, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 12px 30px rgba(11, 13, 23, 0.45);
}

.game-description > *:first-child {
  margin-top: 0;
}

.game-description > *:last-child {
  margin-bottom: 0;
}

.game-description h2,
.game-description h3,
.game-description h4 {
  color: var(--comet-cyan);
  margin: 16px 0 8px;
  font-weight: 600;
}

.game-description p {
  margin: 10px 0;
  opacity: 0.92;
}

.game-description a {
  color: var(--sun-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-description ul,
.game-description ol {
  margin: 12px 0;
  padding: 0;
}

.game-description li {
  margin: 6px 0;
  list-style-position: inside;
  padding-left: 0;
}

.game-description ul li {
  list-style-type: disc;
}

.game-description ol li {
  list-style-type: decimal;
}

.game-description blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--nebula-pink);
  background: rgba(11, 13, 23, 0.55);
  border-radius: 12px;
  color: rgba(240, 244, 248, 0.9);
}

.action-buttons {
  display: flex;
  gap: 20px;
  align-items: center;
}

.btn-launch {
  background: linear-gradient(135deg, var(--nebula-pink), #ff8fb3);
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 10px 24px rgba(255, 107, 157, 0.35);
}

.btn-launch:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 32px rgba(255, 107, 157, 0.45);
  filter: brightness(1.05);
}

.btn-orbit {
  background-color: transparent;
  border: 2px solid var(--space-blue);
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.tab-btn {
  background: transparent;
  border: 1px solid rgba(240, 244, 248, 0.1);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background-color: var(--comet-cyan);
  color: var(--space-dark);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
  padding-top: 4px;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tags Page */
.tags-box{
  padding-top: 100px;
  padding-bottom: 40px;
}

.tags-layout {
  display: flex;
  gap: 32px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.tags-main {
  flex: 1;
}

.tags-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  position: sticky;
  top: 80px;
  background-color: var(--space-dark);
  z-index: 100;
  padding: 20px 0;
  border-bottom: 1px solid rgba(240, 244, 248, 0.1);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.game-card {
  background-color: var(--space-blue);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-5px);
}

.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.card-content {
  padding: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--comet-cyan);
}

.load-more-btn {
  display: block;
  width: fit-content;
  margin: 40px auto;
  background-color: var(--comet-cyan);
  color: var(--space-dark);
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

/* Contact Page */
.contact-container {
  max-width: 640px;
  margin: 100px auto;
  background-color: var(--space-blue);
  border-radius: 24px;
  border: 1px solid rgba(240, 244, 248, 0.1);
  padding: 48px;
}

.contact-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--comet-cyan), var(--nebula-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 30px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-input, .form-textarea {
  width: 100%;
  background-color: var(--space-dark);
  border: 1px solid rgba(240, 244, 248, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: var(--star-white);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--comet-cyan);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
  outline: none;
}

.btn-send {
  width: 100%;
  background-color: var(--nebula-pink);
  color: white;
  padding: 14px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.btn-send:hover {
  transform: translateX(5px);
}

/* Legal Pages */
.legal-container {
  max-width: 800px;
  margin: 100px auto;
  background-color: var(--space-blue);
  border-radius: 24px;
}

.legal-title {
  font-size: 24px;
  margin-bottom: 30px;
  color: var(--star-white);
}

.legal-content h3 {
  border-left: 4px solid var(--comet-cyan);
  padding-left: 12px;
  margin-top: 30px;
  margin-bottom: 15px;
}

.legal-content p {
  line-height: 1.8;
  margin-bottom: 15px;
  opacity: 0.9;
}

.legal-highlight {
  background-color: rgba(155, 89, 182, 0.2);
  padding: 15px;
  border-radius: 8px;
}

/* Optimize animations for mobile - reduce heavy animations */
@media (max-width: 768px) {
  .star {
    animation: none !important;
  }
  
  .planet:hover {
    transform: none;
  }
  
  .special-card:hover,
  .carousel-card:hover,
  .game-card:hover {
    transform: none;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .sidebar.mobile-active {
    display: block;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    z-index: 900;
    border-radius: 0 0 20px 20px;
    animation: slideDown 0.3s ease;
  }
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-desktop, .user-avatar {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .portholes {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    width: 100%;
  }

  .porthole {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: auto;
    aspect-ratio: 1;
    border-width: 3px;
  }
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-hero {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 36px;
  }
  .hero-content {
    width: 100%;
    padding: 0 16px;
  }
  .hero-content form[role="search"] {
    max-width: none !important;
    width: 100%;
    padding: 0 4px;
    flex-wrap: wrap;
  }
  .hero-content form[role="search"] .form-input {
    min-width: 0;
  }
  .hero-content form[role="search"] .hero-cta {
    width: 100%;
  }
  .contact-container, .legal-container {
    margin: 100px 0;
  }
}

.tags-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .tags-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    top: 80px;
    padding: 20px;
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
  }
  .tags-header h2 {
    font-size: 20px;
    margin: 0;
  }
  .tags-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }
  .filter-toggle-btn {
    flex: 1;
    text-align: center;
  }
  #sort-select {
    flex: 2;
  }
}

@keyframes slideDown {
  from { height: 0; opacity: 0; }
  to { height: auto; opacity: 1; }
}

.filter-toggle-btn {
  display: none;
  background: var(--comet-cyan);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  color: var(--space-dark);
}

@media (max-width: 1024px) {
  .filter-toggle-btn {
    display: block;
  }
}

.games-grid.list-view .game-card {
  display: flex;
  flex-direction: row;
  height: 150px;
  align-items: center;
}

.games-grid.list-view .card-img {
  width: 250px;
  height: 100%;
  aspect-ratio: auto;
}

.games-grid.list-view .card-content {
  flex: 1;
}

@media (max-width: 768px) {
  .games-grid.list-view .game-card {
    flex-direction: column;
    height: auto;
  }
  .games-grid.list-view .card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}

.special-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-bottom: 20px;
}

/* Carousel Layout */
.special-carousel {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.carousel-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-card {
  flex: 0 0 300px;
  background-color: var(--space-blue);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(240, 244, 248, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.carousel-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.carousel-card-img {
  height: 60%;
  width: 100%;
  object-fit: cover;
}

.carousel-card-content {
  padding: 20px;
  text-align: left;
}

.carousel-card-content h3 {
  font-size: 16px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

@media (max-width: 1024px) {
  .special-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .carousel-card {
    flex: 0 0 250px;
  }
}

@media (max-width: 768px) {
  .special-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .special-card {
    border-radius: 12px;
  }
  .special-card-img {
    height: 65%;
  }
  .special-card-content {
    padding: 10px;
  }
  .special-card-content h4 {
    font-size: 14px;
    margin-bottom: 2px;
  }
  .special-card-content span {
    font-size: 10px;
  }
  .carousel-card {
    flex: 0 0 150px;
    border-radius: 12px;
  }
  .carousel-card-img {
    height: 65%;
  }
  .carousel-card-content {
    padding: 10px;
  }
  .carousel-card-content h3 {
    font-size: 14px;
    margin-bottom: 2px;
  }
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Unified single-line truncation for game titles in lists */
.game-title,
.title-game,
.title-similar-game,
.card-title,
.sidebar-game-title,
.recommended-name,
.new-game-title {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-info,
.container-game-info,
.sidebar-game-info,
.card-content,
.recommended-info,
.game-meta {
  min-width: 0;
}

/* Unified star rating render */
.game-star {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.85rem;
    color: #ffd700;
    min-height: 1.1em;
}

.game-star .star-icon,
.game-star .star-full,
.game-star .star-empty,
.game-star .fa,
.game-star .fas,
.game-star .far {
    color: inherit;
}

.game-star .star-placeholder {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 215, 0, 0.55);
    letter-spacing: 1px;
    white-space: nowrap;
    animation: starPlaceholderPulse 1.1s ease-in-out infinite;
}

@keyframes starPlaceholderPulse {
    0% { opacity: 0.45; }
    50% { opacity: 0.95; }
    100% { opacity: 0.45; }
}

/* Match rendered star_html structure */
.game-star .star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: inherit;
    color: inherit;
    line-height: 1;
}

.game-star .star-rating .star-icon,
.game-star .star-rating .star-full,
.game-star .star-rating .star-empty,
.game-star .star-rating .fa,
.game-star .star-rating .fas,
.game-star .star-rating .far,
.game-star .star-rating i {
    color: inherit;
    font-size: 0.95em;
}

.game-star .star-rating .star-icon::before,
.game-star .star-rating .star-full::before,
.game-star .star-rating .fa-star::before {
    content: "★";
}

.game-star .star-rating .star-empty::before,
.game-star .star-rating .fa-star-o::before,
.game-star .star-rating .far.fa-star::before,
.game-star .star-rating .fa-regular.fa-star::before {
    content: "☆";
}
