/* 通用样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 游戏卡片样式 */
.game-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 游戏预览样式 */
.tetris-preview div {
    width: 100%;
    height: 100%;
    animation: tetrisFloat 2s ease-in-out infinite;
}

@keyframes tetrisFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.preview-2048 div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.gomoku-preview div {
    width: 100%;
    height: 100%;
    position: relative;
}

.gomoku-preview div.bg-black,
.gomoku-preview div.bg-white {
    width: 60%;
    height: 60%;
    margin: 20%;
}

.snake-preview div {
    width: 100%;
    height: 100%;
    animation: snakeMove 3s linear infinite;
}

@keyframes snakeMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

.minesweeper-preview div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
}

/* 按钮样式 */
.play-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.play-btn:hover::before {
    left: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .game-card {
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 1rem !important;
    }
    
    .game-preview {
        height: 100px !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}