/* ========== Achievements Button ========== */
.achievements-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.achievements-btn:hover {
    transform: scale(1.1);
}

.achievements-btn span {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ========== 搜索功能样式 ========== */
.game-search-container {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    z-index: 100;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
}

.search-input:focus {
    border-color: #009CFF;
    box-shadow: 0 0 0 3px rgba(0, 156, 255, 0.1);
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.search-clear:hover {
    background: #d1d5db;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 101;
}

.search-results-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.search-results-list {
    padding: 10px 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f9fafb;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.search-result-rating {
    display: flex;
    align-items: center;
    gap: 3px;
}

.search-result-favorite {
    color: #ff4757;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.search-no-results p:first-child {
    font-size: 16px;
    margin-bottom: 10px;
}

.search-tip {
    font-size: 14px;
    color: #999;
}

/* ========== 评分系统样式 ========== */
.game-rating-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.rating-score {
    font-size: 36px;
    font-weight: bold;
    color: #009CFF;
}

.rating-stars-display {
    display: flex;
    gap: 3px;
}

.rating-count {
    font-size: 14px;
    color: #666;
}

.rating-input-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}

.rating-input-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.rating-stars {
    display: flex;
    gap: 8px;
}

.rating-star {
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.rating-star:hover {
    transform: scale(1.2);
}

.rating-star.active {
    color: #fbbf24;
}

.rating-star.inactive {
    color: #d1d5db;
}

.rating-thank-you {
    margin-top: 10px;
    padding: 10px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* ========== 收藏按钮样式 ========== */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.favorite-btn:hover {
    border-color: #ff4757;
    background: #fff5f7;
}

.favorite-btn.active {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
}

.favorite-btn .heart-icon {
    font-size: 18px;
    transition: transform 0.2s;
}

.favorite-btn.active .heart-icon {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ========== 最近玩过样式 ========== */
.recent-games-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recent-games-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #002B50;
}

.recent-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.recent-game-card {
    position: relative;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
}

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

.recent-game-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

.recent-game-name {
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-game-time {
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* ========== 收藏列表样式 ========== */
.favorites-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.favorites-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #002B50;
}

.favorites-count {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.favorite-game-card {
    position: relative;
    text-decoration: none;
    color: #333;
}

.favorite-game-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.2s;
}

.favorite-game-card:hover img {
    transform: scale(1.05);
}

.favorite-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: rgba(255, 71, 87, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.favorite-game-card:hover .favorite-remove-btn {
    opacity: 1;
}

.favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.favorites-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ========== 成就系统样式 ========== */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.achievement-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-icon {
    font-size: 48px;
    line-height: 1;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 3px;
}

.achievement-desc {
    font-size: 13px;
    opacity: 0.9;
}

.achievements-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.achievements-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #002B50;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.achievement-card {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    text-align: center;
}

.achievement-card-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.achievement-card-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.achievement-card-desc {
    font-size: 13px;
    opacity: 0.9;
}

.achievement-card.locked {
    background: #e5e7eb;
    color: #999;
}

/* ========== 热门标签样式 ========== */
.game-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.badge-new {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.badge-featured {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

/* ========== 成就弹窗样式 ========== */
.achievements-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievements-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.achievements-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.achievements-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.achievements-modal-header h2 {
    margin: 0;
    font-size: 28px;
    color: #002B50;
}

.achievements-modal-close {
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.achievements-modal-close:hover {
    background: #d1d5db;
    transform: rotate(90deg);
}

.achievements-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.achievement-card-date {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.8;
}

.achievements-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .game-search-container {
        padding: 0 15px;
    }

    .search-results {
        max-width: calc(100vw - 30px);
        max-height: 400px;
    }

    .search-result-item img {
        width: 40px;
        height: 40px;
    }

    .recent-games-grid,
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }

    .rating-score {
        font-size: 28px;
    }

    .rating-star {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .search-input {
        font-size: 14px;
        padding: 10px 40px 10px 40px;
    }

    .recent-games-grid,
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
