/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-x: hidden;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), 
                url('./assets/images/backgrounds/game-bg.jpg') center/cover no-repeat fixed;
    position: relative;
}

/* ===== 游戏容器 ===== */
.game-container {
    width: 100%;
    max-width: 1200px;
    background: rgba(25, 25, 45, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 1;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

/* ===== 游戏头部 ===== */
.game-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.game-header h1 {
    font-size: 2.2rem;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #a1c4fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.level-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1rem;
    color: #a0a0c0;
}

/* ===== 游戏状态面板 ===== */
.game-stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 4px solid #4dccff;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(77, 204, 255, 0.1);
}

.stat-item i {
    color: #4dccff;
    font-size: 1.2rem;
}

.stat-label {
    color: #a0a0c0;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-left: auto;
}

.control-buttons {
    grid-column: span 2;
    display: flex;
    gap: 15px;
}

.btn-control {
    flex: 1;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

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

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

.btn-control:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

/* ===== 关卡选择面板 ===== */
.level-select-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 50, 0.95);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    border: 2px solid #6a11cb;
    backdrop-filter: blur(10px);
    animation: popIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popIn {
    0% { 
        transform: translate(-50%, -50%) scale(0.8); 
        opacity: 0; 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
}

.level-select-panel h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #ffd700;
    font-size: 1.8rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.level-btn {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #444;
    border-radius: 10px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.level-btn:hover {
    background: rgba(106, 17, 203, 0.3);
    border-color: #6a11cb;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.3);
}

.level-btn.completed {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.level-btn.completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: linear-gradient(45deg, transparent 30%, rgba(76, 175, 80, 0.1) 50%, transparent 70%);
    animation: shine 2s infinite linear;
    background-size: 200px 100%;
}

@keyframes shine {
    0% { background-position: -100px; }
    100% { background-position: 100px; }
}

.level-btn.current {
    background: rgba(33, 150, 243, 0.3);
    border-color: #2196F3;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.5);
}

.level-btn.locked {
    background: rgba(100, 100, 100, 0.3);
    border-color: #666;
    color: #888;
    cursor: not-allowed;
}

.level-btn i {
    font-size: 1.2rem;
}

.completed-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4CAF50;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 2;
}

/* ===== 游戏主区域 ===== */
.game-main-area {
    margin-bottom: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-board-wrapper {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: auto;
    min-height: 300px;
}

.game-board-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.game-board {
    display: grid;
    gap: 15px;
    justify-content: center;
    align-content: center;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* 形状关卡的特殊样式 */
.game-board.shape-layout {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    position: relative;
    padding: 10px;
}

.game-board.shape-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(106, 17, 203, 0.05) 70%);
    pointer-events: none;
}

/* ===== 卡片样式 ===== */
.card {
    width: 110px;
    height: 147px;
    cursor: pointer;
    perspective: 1000px;
    position: relative;
    transition: transform 0.3s;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    animation: cardAppear 0.5s ease-out;
}

.card:nth-child(odd) {
    animation-delay: 0.1s;
}

.card:nth-child(even) {
    animation-delay: 0.2s;
}

@keyframes cardAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 形状关卡卡片特殊效果 */
.card.shape-card {
    animation: shapeCardAppear 0.6s ease-out;
}

@keyframes shapeCardAppear {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.card:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* 匹配成功的卡片特殊样式 */
.card.matched {
    position: relative;
    animation: matchedPulse 0.5s ease-out;
}

@keyframes matchedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.card.matched .card-inner {
    transform: rotateY(180deg);
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.7);
    border: 3px solid #4CAF50;
    animation: matchedGlow 1.5s infinite alternate;
}

@keyframes matchedGlow {
    0% { 
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
        border-color: #4CAF50;
    }
    100% { 
        box-shadow: 0 0 40px rgba(76, 175, 80, 0.9);
        border-color: #8BC34A;
    }
}

.card.matched::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
    animation: checkmarkPulse 1s infinite alternate;
}

@keyframes checkmarkPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    border: 3px solid #3498db;
}

.card-front::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
}

.card-front img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.5));
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    border: 3px solid #e0e0e0;
    position: relative;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.05) 25%, transparent 25%, 
                transparent 50%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.05) 75%, 
                transparent 75%, transparent);
    background-size: 20px 20px;
    opacity: 0.3;
}

.nft-image {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* ===== 关卡进度条 ===== */
.level-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 16px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #4CAF50 0%, 
        #8BC34A 30%, 
        #FFC107 70%,
        #FF5722 100%);
    border-radius: 8px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0%;
    position: relative;
    overflow: hidden;
}

/* 进度条内的动态效果 */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

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

/* 火焰效果 */
.fire-effect {
    position: absolute;
    top: -15px;
    right: -5px;
    width: 40px;
    height: 50px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(to top, 
        #ff5722 0%,
        #ff9800 30%,
        #ffd740 60%,
        transparent 100%);
    border-radius: 50% 50% 20% 20%;
    filter: blur(3px);
    animation: fireBlaze 0.5s infinite alternate;
    opacity: 0;
    transition: opacity 0.3s;
}

.fire-effect.visible {
    opacity: 1;
}

@keyframes fireBlaze {
    0% {
        transform: scale(1) rotate(-5deg);
        opacity: 0.8;
        box-shadow: 0 0 10px #ff5722, 0 0 20px #ff9800;
    }
    100% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
        box-shadow: 0 0 15px #ff5722, 0 0 30px #ff9800, 0 0 45px #ffd740;
    }
}

/* 进度百分比数字样式 */
.progress-text {
    display: flex;
    justify-content: space-between;
    color: #a0a0c0;
    font-size: 1rem;
    font-weight: bold;
}

#progress-percent {
    color: #FFC107;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

/* ===== 游戏消息区域 ===== */
.game-message-area {
    margin-bottom: 25px;
}

.game-message {
    background: rgba(33, 150, 243, 0.1);
    border-left: 4px solid #2196F3;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease-out;
}

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

.game-message i {
    color: #2196F3;
}

/* ===== 游戏提示 ===== */
.game-hint {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #FFC107;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    animation: pulseHint 2s infinite;
}

@keyframes pulseHint {
    0%, 100% {
        border-color: #FFC107;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        border-color: #FFD54F;
        box-shadow: 0 0 0 5px rgba(255, 193, 7, 0);
    }
}

.game-hint i {
    color: #FFC107;
    font-size: 1.5rem;
}

#hint-text {
    color: #FFD54F;
    font-size: 1rem;
}

/* ===== 弹窗样式 ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
    border: 2px solid;
    animation: popIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.popup-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.pass-popup {
    border-color: #4CAF50;
}

.fail-popup {
    border-color: #f44336;
}

.complete-popup {
    border-color: #FFD700;
}

.popup-header {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.popup-header i {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    animation: bounce 1s ease infinite alternate;
}

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

.pass-popup .popup-header i { color: #4CAF50; }
.fail-popup .popup-header i { color: #f44336; }
.complete-popup .popup-header i { color: #FFD700; }

.popup-header h2 {
    font-size: 2.5rem;
    color: white;
    margin: 0;
}

.popup-body {
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.popup-body p {
    margin: 15px 0;
    font-size: 1.1rem;
    color: #ddd;
}

.result-stats, .final-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
}

.stat i {
    color: #4dccff;
    margin-right: 10px;
}

.popup-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.btn-primary, .btn-secondary {
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 176, 155, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.next-level-hint, .fail-hint, .congrats {
    font-style: italic;
    color: #aaa;
    margin-top: 15px;
}

/* ===== 特效容器 ===== */
.effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* ===== 卡片占位符 ===== */
.card-placeholder {
    width: 100%;
    height: 100%;
    visibility: hidden;
    pointer-events: none;
}

/* ===== 时间警告动画 ===== */
@keyframes timeWarning {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.05);
    }
}

.time-warning {
    animation: timeWarning 0.5s infinite !important;
    color: #f44336 !important;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.5) !important;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .game-container {
        max-width: 1000px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        margin-top: 80px;
    }
    
    .game-stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .control-buttons {
        grid-column: span 2;
    }
    
    .game-board-wrapper {
        min-height: 320px;
        padding: 15px;
    }
    
    .card {
        width: 85px;
        height: 113px;
    }
    
    .level-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .popup-buttons {
        flex-direction: column;
    }
    
    .audio-controls {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .audio-activate-btn {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .audio-btn {
        width: 40px;
        height: 40px;
    }
    
    #volume-slider {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
        margin-top: 70px;
        min-height: 95vh;
    }
    
    .game-header h1 {
        font-size: 1.8rem;
    }
    
    .level-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-board-wrapper {
        min-height: 260px;
        padding: 10px;
    }
    
    .card {
        width: 70px;
        height: 93px;
    }
    
    .stat-item {
        padding: 8px 10px;
    }
    
    .popup-content {
        padding: 20px;
    }
    
    .popup-header h2 {
        font-size: 2rem;
    }
    
    .audio-controls {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .audio-activate-btn {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .audio-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    #volume-slider {
        width: 60px;
    }
}

/* 小屏幕下的卡片大小调整 */
@media (max-height: 700px) {
    .game-container {
        margin-top: 20px;
        padding: 15px;
    }
    
    .game-board-wrapper {
        min-height: 260px;
    }
    
    .game-stats-panel {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .game-header {
        margin-bottom: 15px;
    }
    
    .level-progress {
        margin-bottom: 15px;
    }
}

/* 针对大屏幕优化 */
@media (min-width: 1600px) {
    .game-container {
        max-width: 1400px;
    }
    
    .card {
        width: 130px;
        height: 173px;
    }
}

/* 确保游戏板在小屏幕上仍然可读 */
@media (max-width: 360px) {
    .game-board-wrapper {
        min-height: 240px;
        padding: 8px;
    }
    
    .card {
        width: 65px;
        height: 87px;
    }
    
    .game-stats-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .control-buttons {
        grid-column: span 1;
    }
}

/* 针对高密度屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .card:hover {
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    }
}

/* 打印样式 */
@media print {
    .game-board-wrapper,
    .game-hint,
    .audio-controls,
    .audio-activate-btn,
    .popup-overlay {
        display: none !important;
    }
    
    .game-container {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white;
        color: black;
    }
}