/* 像素连连看 - 主样式表 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #1a1a2e;
    color: #eee;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* 屏幕容器 */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* 开始界面 */
.game-title {
    font-size: 48px;
    font-weight: bold;
    color: #e94560;
    text-shadow: 4px 4px 0 #000, -2px -2px 0 #00ff88;
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.game-subtitle {
    font-size: 18px;
    color: #00ff88;
    margin-bottom: 40px;
    letter-spacing: 8px;
}

.level-info {
    margin-top: 40px;
    text-align: center;
    color: #aaa;
}

.level-info p {
    margin: 10px 0;
    font-size: 16px;
}

.level-info span {
    color: #00ff88;
    font-weight: bold;
}

/* 菜单按钮 */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.btn {
    padding: 15px 30px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    border: 4px solid #000;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    box-shadow: 4px 4px 0 #000;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.btn-primary {
    background-color: #e94560;
    color: #fff;
}

.btn-primary:hover {
    background-color: #ff6b6b;
}

.btn-secondary {
    background-color: #00ff88;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background-color: #00cc6a;
}

/* 游戏界面 */
#game-screen {
    padding: 10px;
}

/* HUD */
.hud {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #e94560;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
}

.hud-value {
    font-size: 20px;
    font-weight: bold;
    color: #00ff88;
}

/* 连消显示 */
.combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: bold;
    color: #e94560;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.combo-display.active {
    opacity: 1;
    animation: comboPop 0.5s ease-out;
}

@keyframes comboPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* 游戏容器 */
.game-container {
    position: relative;
    margin: 10px 0;
    border: 4px solid #e94560;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

#game-canvas {
    display: block;
    background-color: #0f0f23;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.btn-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #e94560;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
}

.btn-control:active {
    transform: scale(0.95);
    background: rgba(233, 69, 96, 0.3);
}

.btn-control .icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.btn-control .btn-text {
    font-size: 11px;
    color: #aaa;
}

/* 分数信息 */
.score-info {
    text-align: center;
    margin: 20px 0;
    color: #eee;
}

.score-info p {
    margin: 10px 0;
    font-size: 16px;
}

.score-info span {
    color: #00ff88;
    font-weight: bold;
}

/* 标题样式 */
.screen h2 {
    font-size: 36px;
    color: #e94560;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 20px;
}

.screen p {
    font-size: 18px;
    color: #ccc;
    margin: 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 32px;
    }

    .game-subtitle {
        font-size: 14px;
        letter-spacing: 4px;
    }

    .hud {
        padding: 5px;
    }

    .hud-label {
        font-size: 10px;
    }

    .hud-value {
        font-size: 16px;
    }

    .btn-control {
        width: 60px;
        height: 60px;
    }

    .btn-control .icon {
        font-size: 20px;
    }

    .btn-control .btn-text {
        font-size: 10px;
    }

    .screen h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    #game-screen {
        padding: 5px;
    }

    .hud {
        margin-bottom: 5px;
    }

    .game-container {
        margin: 5px 0;
    }

    .control-buttons {
        gap: 10px;
        margin-top: 5px;
    }

    .btn-control {
        width: 55px;
        height: 55px;
    }
}

/* 禁用双击缩放 */
button {
    touch-action: manipulation;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
