/* 全局样式 */
body {
    font-feature-settings: "kern" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Righteous', cursive;
}

/* Gaming font styles */
.font-gaming {
    font-family: 'Fredoka One', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.font-title {
    font-family: 'Bungee', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.font-futuristic {
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.05em;
}

.font-playful {
    font-family: 'Righteous', cursive;
}

/* 玻璃态效果 */
.glass-morphism {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 50%, #AF52DE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background: linear-gradient(135deg, #007AFF 0%, #5856D6 50%, #AF52DE 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        background: linear-gradient(135deg, #AF52DE 0%, #007AFF 50%, #5856D6 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* 搜索框焦点效果 */
.search-focus:focus {
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

/* 隐藏滚动条但保持滚动功能 */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

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

/* 水平滚动区域样式 */
.scroll-container {
    position: relative;
}

.scroll-container::before,
.scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 20px;
    width: 20px;
    pointer-events: none;
    z-index: 2;
}

.scroll-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

.scroll-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

/* 移动端样式 */
@media (max-width: 640px) {
    .mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 文本截断样式 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 游戏卡片特殊样式 */
.game-card {
    transition: all 0.2s ease-in-out;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 加载动画 */
.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007AFF;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* 搜索结果高亮 */
.search-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

/* 响应式游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }
}

/* 类别标签样式 */
.category-tag {
    background: linear-gradient(135deg, #007AFF, #34C759);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 错误提示样式 */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c66;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 成功提示样式 */
.success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #6c6;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Game modal fullscreen styles */
#game-modal:fullscreen {
    background: black;
}

#game-modal:fullscreen .bg-slate-900 {
    background: black;
    border-radius: 0;
    height: 100vh !important;
    max-height: 100vh !important;
}

#game-modal:fullscreen #game-iframe {
    height: calc(100vh - 5rem) !important;
}

#game-iframe:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: black;
}

/* 滚动到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #0056cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

/* Tailwind CSS的自定义工具类 */
@layer utilities {
    .text-balance {
        text-wrap: balance;
    }
    
    .bg-grid {
        background-image: 
            linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px);
        background-size: 20px 20px;
    }
}
