:root {
    --primary-color: #ff69b4;
    --secondary-color: #ff1493;
    --accent-color: #ffb6c1;
    --bg-color: #ffe6f2;
    --text-color: #333;
    --light-text: #fff;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffe6f2 0%, #fff0f5 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Skip expensive rendering for off-screen sections */
.games-section,
.categories-section,
.related-games-section,
.game-grid,
.description-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 800px;
}

/* Rich-text list marker alignment (fix bullet indentation/marker protrusion) */
.container-game-description-text ul,
.container-game-description-text ol,
.description-box ul,
.description-box ol,
.game-description ul,
.game-description ol,
.game-desc ul,
.game-desc ol,
#game-description ul,
#game-description ol,
#overview ul,
#overview ol {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.container-game-description-text ul li,
.description-box ul li,
.game-description ul li,
.game-desc ul li,
#game-description ul li,
#overview ul li {
    list-style-type: disc !important;
    list-style-position: inside !important;
    padding-left: 0 !important;
}

.container-game-description-text ol li,
.description-box ol li,
.game-description ol li,
.game-desc ol li,
#game-description ol li,
#overview ol li {
    list-style-type: decimal !important;
    list-style-position: inside !important;
    padding-left: 0 !important;
}

.description-box h1{
    font-size: 1.5rem;
}

/* Animations */
@keyframes glow {
    0% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--secondary-color); }
    100% { box-shadow: 0 0 5px var(--primary-color); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

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

/* Breadcrumb — detail */
.breadcrumb-nav {
    margin: 4px 0 16px;
}

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

.breadcrumb-list > li {
    list-style: none;
}

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

.breadcrumb-item a {
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.breadcrumb-item a:hover {
    background: rgba(255, 105, 180, 0.12);
}

.breadcrumb-item span[aria-current="page"] {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary-color);
    padding: 4px 8px;
}

.breadcrumb-separator {
    font-size: 13px;
    color: rgba(51, 51, 51, 0.45);
    user-select: none;
}

.game-star--detail {
    display: inline-flex;
    align-items: center;
    margin: 6px 0 10px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 105, 180, 0.1);
    border: 1px solid rgba(255, 105, 180, 0.35);
}

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

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--primary-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link:hover {
    color: var(--secondary-color);
}

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

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
}

/* Main Content */
main {
    min-height: calc(100vh - var(--header-height) - 100px); /* Adjust for footer */
    padding: 60px 0; /* Increased padding */
    position: relative;
    z-index: 1;
}

/* Background Decorations */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 182, 193, 0.4) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 105, 180, 0.3) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Section Styling */
.games-section, .categories-section {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Related Games Section (detail page) */
.related-games-section {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.related-games-section > h2 {
    color: var(--secondary-color);
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 10px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.related-games-section > h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fff0f5 0%, #ffc0cb 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    margin-top: 20px; /* Added spacing from header */
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-out;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.hero-content {
    flex: 1;
    z-index: 1;
    padding-right: 20px;
}

.hero-tag {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 2px 2px 0px white;
}

.hero-content .hero-slogan {
    font-size: clamp(1.5rem, 2.8vw, 2.4rem);
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px white;
}

#hero-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-content p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
    max-width: 500px;
}

.hero-btn {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
}

.hero-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 20, 147, 0.6);
    background: var(--primary-color);
}

.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.hero-image {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: rotate(3deg);
    transition: transform 0.5s ease;
    border: 5px solid white;
}

.hero-section:hover .hero-image {
    transform: rotate(0deg) scale(1.02);
}

/* Categories Section */
.categories-section {
    margin-bottom: 50px;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Category Grid */
.category-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 0;
}

.category-card {
    flex: 0 0 160px; /* Fixed width for better consistency */
    background: linear-gradient(135deg, #ffffff 0%, #fff0f5 100%);
    border-radius: 25px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    transition: transform 0.4s ease, color 0.3s ease;
    z-index: 2;
    position: relative;
}

.category-card span {
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 2;
    position: relative;
    transition: color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 20, 147, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.category-card:hover::after {
    opacity: 1;
}

.category-card:hover i,
.category-card:hover span {
    color: white;
    transform: scale(1.1);
}

/* Games Section */
.games-section {
    position: relative;
}

.games-section .section-header {
    /* Games 模块的标题 + 简介改为竖排，避免简介挤在标题右侧 */
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.module-description {
    /* 让简介和粉色标题风格保持同一套文字层级 */
    margin: 0;
    color: rgba(51, 51, 51, 0.78);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 720px;
    text-shadow: none;
}

.section-header {
   
    margin-bottom: 30px;
    border-bottom: none;
    padding-bottom: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

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

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

.module-link-more {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.module-link-more:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-header h2 {
    color: var(--secondary-color);
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.view-all {
    background: rgba(255, 105, 180, 0.1);
    color: var(--secondary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.view-all:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(255, 105, 180, 0.3);
}

/* Game Card Enhancements */
.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 105, 180, 0.25);
    border-color: var(--accent-color);
}

.game-thumbnail {
    height: 180px;
    transition: transform 0.5s ease;
}

.game-card:hover .game-thumbnail {
    transform: scale(1.1);
}

.game-info {
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #fffcfd 100%);
    position: relative;
}

.game-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
    transition: color 0.3s ease;
}

.game-card:hover .game-title {
    color: var(--secondary-color);
}

.game-rating {
    color: #ff8c00; /* Darker orange for better visibility */
    display: inline-block;
    padding: 4px 0;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800; /* Extra bold */
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
}

.brief-comment-game {
    margin: 6px 0 0;
    padding: 0;
    font-size: 0.85rem;
    color: rgba(51, 51, 51, 0.75);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* Game Grid Variants */
/* Default list layout: keep existing `.game-grid` styles */
.game-grid--list {
    /* intentionally empty */
}

/* Cover layout: compact horizontal cards */
.game-grid--cover {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.game-grid--cover .game-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.game-grid--cover .game-thumbnail {
    width: 160px;
    /* Let the thumbnail fill the card's height to avoid bottom whitespace */
    height: 100%;
    min-height: 120px;
    border-bottom: none;
    border-right: 2px solid var(--accent-color);
    align-self: stretch;
    display: block;
    object-fit: cover;
}

.game-grid--cover .game-info {
    padding: 15px;
}

.game-grid--cover .game-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.game-grid--cover .brief-comment-game {
    -webkit-line-clamp: 3;
}

/* Spotlight layout: overlay cards (text overlays thumbnail) */
.game-grid--spotlight {
    /* Keep the grid base behavior but with a distinct visual */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.game-grid--spotlight .game-card {
    /* Allow absolutely positioned info overlay */
    max-width: none;
}

.game-grid--spotlight .game-thumbnail {
    height: 180px;
    border-bottom: none;
}

.game-grid--spotlight .game-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 16px 12px;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.05) 100%);
}

.game-grid--spotlight .game-title {
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-grid--spotlight .game-card:hover .game-title {
    color: #fff;
}

.game-grid--spotlight .game-rating {
    color: #ffd700;
}

.game-grid--spotlight .brief-comment-game {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 6px;
    -webkit-line-clamp: 2;
}

.game-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    animation: fadeIn 0.5s ease-out backwards;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(255, 20, 147, 0.4);
    animation: glow 2s infinite;
}

.game-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 2px solid var(--accent-color);
}

/* Variant grid thumbnails override global defaults */
.game-grid--cover .game-thumbnail {
    width: 160px;
    height: 100%;
    min-height: 120px;
    border-bottom: none;
    border-right: 2px solid var(--accent-color);
    align-self: stretch;
    display: block;
    object-fit: cover;
}

.game-grid--spotlight .game-thumbnail {
    width: 100%;
    height: 180px;
    min-height: 180px;
    border-bottom: none;
    border-right: none;
    align-self: stretch;
    display: block;
    object-fit: cover;
}

.game-info {
    padding: 15px;
    text-align: left;
}

.game-title {
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-rating {
    color: #ffd700;
    font-size: 0.9rem;
}

/* Detail Page */
.game-detail-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    margin-top: 20px; /* Added spacing from header */
    animation: fadeIn 0.5s ease-out;
}

.detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: center;
}

.detail-header--empty {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 40px 20px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 20, 147, 0.25);
    background: linear-gradient(135deg, rgba(255, 20, 147, 0.06), rgba(138, 43, 226, 0.04));
}

.detail-header--empty h1,
.detail-header--empty .detail-empty-title {
    margin: 0;
    font-size: 2rem;
}

.detail-empty-hint {
    margin: 0;
    max-width: 48rem;
    color: var(--secondary-color);
    opacity: 0.85;
}

.detail-empty-btn {
    animation: none;
    padding: 12px 28px;
    font-size: 1rem;
    margin-top: 6px;
}

.detail-thumb {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 3px solid var(--primary-color);
}

.detail-info h1 {
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.play-btn {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
    animation: float 3s ease-in-out infinite;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 20, 147, 0.6);
}

.game-meta {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tag-badge {
    display: inline-block;
    margin-bottom: 4px;
    background: var(--accent-color);
    color: var(--secondary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
}

.tag-badge:hover {
    background: var(--primary-color);
    color: white;
}

.description-box {
    margin-top: 30px;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.description-section {
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.75), rgba(255, 255, 255, 0.92));
    border-radius: 16px;
    padding: 18px 20px;
}

.description-section h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
    line-height: 1.25;
}

.description-section .container-game-description-text {
    color: #555;
}

.description-section-about h2 {
    color: var(--secondary-color);
}

.description-section-content h2 {
    color: #c2187a;
}

.description-section-content {
    position: relative;
}

/* Full Screen Game Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.game-overlay.active {
    display: flex;
}

.overlay-header {
    background: #111;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-game {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.close-game:hover {
    background: #cc0000;
}

.game-frame {
    flex: 1;
    width: 100%;
    border: none;
}

/* Footer */
footer {
    background: #fff;
    padding: 40px 0 20px;
    border-top: 3px solid var(--primary-color);
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.9rem;
}

/* Tags Section Header */
.tags-section .section-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.tags-section .page-title {
    font-size: 2.5rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.tags-section .highlight-text {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-style: wavy;

    /* Limit highlight text to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}

/* Keep "Games in {tag}" on the same text line flow */
.tags-section #title-tag .highlight-text {
    display: inline;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    white-space: inherit;
    word-break: normal;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    margin-bottom: 10px; /* Added spacing from footer */
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.page-link.prev, .page-link.next {
    width: auto;
    padding: 0 20px;
    border-radius: 20px;
    gap: 5px;
}

.page-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.3);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: scale(1.1);
}

.page-dots {
    color: #888;
    font-weight: bold;
    letter-spacing: 2px;
}

.no-results {
    width: 100%;
    max-width: 620px;
    margin: 0;
    /* When placed inside .game-grid (CSS grid), force it to span the row
       and center horizontally/vertically for a clean empty-state layout. */
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    justify-self: center;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 34px 22px;
    min-height: 320px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color, #333);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 20, 147, 0.22);
    border-radius: 22px;
    box-shadow:
        0 18px 45px rgba(255, 20, 147, 0.12),
        0 4px 18px rgba(0, 0, 0, 0.04);
}

.no-results::before {
    content: '';
    position: absolute;
    inset: -40px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 20, 147, 0.20), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(255, 182, 193, 0.22), transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(0, 243, 255, 0.10), transparent 45%);
    pointer-events: none;
    transform: rotate(-6deg);
}

.no-results > * {
    position: relative;
    z-index: 1;
}

/* Reduce heavy motion/paint for mobile and motion-sensitive users */
@media (prefers-reduced-motion: reduce), (max-width: 768px) {
    .hero-section,
    .game-card,
    .hero-btn,
    .play-btn,
    .category-card,
    .game-thumbnail,
    .hero-image,
    .nav-link {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .hero-section::before {
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .no-results {
        min-height: 240px;
        padding: 28px 16px;
        border-radius: 18px;
    }
}

/* Static Pages */
.static-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.static-content h1 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.static-content h2 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.static-content p {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 15px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
    }

    .detail-header--empty {
        padding: 28px 16px;
    }

    .detail-info h1 {
        font-size: 1.5rem; /* Smaller game title on mobile */
    }

    .detail-thumb {
        width: 150px;
        height: 150px;
    }
    
    .hero-section {
        flex-direction: column-reverse;
        text-align: center;
        padding: 30px 20px;
    }

    .hero-content {
        padding-right: 0;
        margin-top: 30px;
    }

    .section-header > h2 {
        font-size: 1.3rem; /* Smaller section title on mobile */
        gap: 8px;
    }

    .section-header-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .section-header-actions {
        flex-shrink: 0;
    }

    .related-games-section {
        padding: 20px;
    }

    .related-games-section > h2 {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    .related-games-section > h2::after {
        bottom: -8px;
    }

    .games-section .section-header {
        gap: 8px;
    }

    .module-description {
        font-size: 0.95rem;
        max-width: 100%;
    }

    .view-all {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 0.95rem; /* Reduced description size on mobile */
        margin-bottom: 20px;
    }

    .hero-image {
        max-height: 250px;
        transform: rotate(0deg);
    }

    /* Mobile Category Grid Optimization */
    .category-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4 columns for icons */
        gap: 10px;
        padding: 0;
    }

    .category-card {
        flex: none; /* Disable flex sizing */
        width: 100%;
        max-width: none;
        padding: 10px 5px;
        min-height: auto;
        border-radius: 12px;
        gap: 5px;
    }

    .category-card i {
        font-size: 1.5rem; /* Smaller icon */
        margin-bottom: 2px;
    }

    .category-card span {
        font-size: 0.75rem; /* Smaller text */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        display: block;
        padding: 0 2px;
    }

    /* Mobile Game Grid Optimization - 2 items per row */
    .game-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .game-thumbnail {
        height: 100px; /* Smaller thumbnail height */
    }

    .game-info {
        padding: 10px;
    }

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

    /* Game Grid Variants - Mobile */
    .game-grid--cover .game-card {
        flex-direction: column;
    }

    .game-grid--cover .game-thumbnail {
        width: 100%;
        height: 100px;
        border-right: none;
        border-bottom: 2px solid var(--accent-color);
    }

    .game-grid--spotlight {
        padding: 0;
    }

    .game-grid--spotlight .game-card {
        max-width: none;
    }

    .game-grid--spotlight .game-thumbnail {
        width: 100%;
        height: 120px;
        min-height: 120px;
        border-bottom: none;
    }

    .game-grid--spotlight .game-info {
        padding: 12px 12px 10px;
    }
    
    .games-section, .categories-section {
        padding: 15px; /* Reduce padding on mobile */
    }

    /* Mobile Tags Title Optimization */
    .tags-section .page-title {
        font-size: 1.6rem;
        flex-wrap: wrap;
        gap: 10px;
    }

    .tags-section #title-tag {
        flex: 1 1 auto;
        min-width: 0; /* Allow text to shrink and wrap properly */
    }

    .tags-section .highlight-text {
        font-size: 0.9rem;
        -webkit-line-clamp: 2; /* keep consistent on mobile */
        line-height: 1.3;
    }
}

/* 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: 1.1rem;
    color: #ffd700;
    min-height: 1.1em;
    margin-bottom: 15px;
}

.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: "☆";
}
