/* CWTetris - 黑客主题俄罗斯方块游戏样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0c0c0c 0%, #16213e 100%);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
}

/* 游戏容器 */
#tetris-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

/* 游戏头部 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-radius: 5px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 2.5rem;
    text-shadow: 0 0 10px #00ff00;
}

.titles h1 {
    font-size: 2rem;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 5px;
}

.subtitle {
    color: #00ff88;
    font-size: 0.9rem;
    opacity: 0.8;
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ff00;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.credits-icon {
    font-size: 1.2rem;
}

.credits-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00ff00;
}

.credits-label {
    font-size: 0.9rem;
    color: #00ff88;
}

.user-stats {
    display: flex;
    gap: 15px;
}

.stat {
    text-align: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ff00;
    border-radius: 5px;
    min-width: 60px;
}

.stat span {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff00;
}

.stat label {
    font-size: 0.8rem;
    color: #00ff88;
    text-transform: uppercase;
}

/* 主游戏区域 */
.game-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 20px;
}

.game-left {
    display: flex;
    justify-content: center;
}

.game-canvas-container {
    position: relative;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#gameCanvas {
    display: block;
    background: #000;
    border: 1px solid #333;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.overlay-content {
    text-align: center;
    color: #00ff00;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00ff00;
}

.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* 右侧面板 */
.game-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.next-piece-panel,
.game-stats-panel,
.shop-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.next-piece-panel h3,
.game-stats-panel h3,
.shop-panel h3 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #00ff00;
}

#nextCanvas {
    display: block;
    margin: 0 auto;
    background: #000;
    border: 1px solid #333;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.stat-label {
    color: #00ff88;
    font-size: 0.9rem;
}

.stat-value {
    color: #00ff00;
    font-weight: bold;
}

/* 道具商店 */
.shop-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shop-item {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.shop-item:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.item-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.item-name {
    font-size: 0.8rem;
    color: #00ff00;
    margin-bottom: 3px;
}

.item-price {
    font-size: 0.7rem;
    color: #00ff88;
    margin-bottom: 8px;
}

/* 游戏控制面板 */
.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ff00;
    border-radius: 5px;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.game-modes h4,
.theme-selector h4 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 1rem;
}

.mode-buttons,
.theme-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mode-btn,
.theme-btn {
    font-size: 0.8rem;
    padding: 5px 10px;
    border: 1px solid #00ff00;
    background: transparent;
    color: #00ff00;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover,
.theme-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.mode-btn.active,
.theme-btn.active {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* 游戏说明 */
.game-instructions {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.game-instructions h3 {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #00ff00;
}

.instructions-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.instruction-section h4 {
    color: #00ff88;
    margin-bottom: 10px;
    font-size: 1rem;
}

.instruction-section ul {
    list-style: none;
    padding: 0;
}

.instruction-section li {
    padding: 3px 0;
    color: #00ff00;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

.instruction-section li:before {
    content: "▶ ";
    color: #00ff88;
    margin-right: 5px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: 2px solid #00ff00;
    background: transparent;
    color: #00ff00;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #00ff00;
}

.btn:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    border-color: #00ff00;
    color: #00ff00;
}

.btn-secondary {
    border-color: #00ff88;
    color: #00ff88;
}

.btn-warning {
    border-color: #ffaa00;
    color: #ffaa00;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* 主题样式 */
.theme-terminal {
    /* 经典终端主题 - 默认样式 */
}

.theme-matrix {
    color: #00ff00;
    background: linear-gradient(135deg, #000 0%, #001100 100%);
}

.theme-matrix .game-header,
.theme-matrix .next-piece-panel,
.theme-matrix .game-stats-panel,
.theme-matrix .shop-panel,
.theme-matrix .game-instructions {
    background: rgba(0, 17, 0, 0.8);
    border-color: #00ff00;
}

.theme-cyberpunk {
    color: #ff00ff;
    background: linear-gradient(135deg, #0c0c0c 0%, #2d1b69 100%);
}

.theme-cyberpunk .game-header,
.theme-cyberpunk .next-piece-panel,
.theme-cyberpunk .game-stats-panel,
.theme-cyberpunk .shop-panel,
.theme-cyberpunk .game-instructions {
    background: rgba(45, 27, 105, 0.8);
    border-color: #ff00ff;
}

.theme-future {
    color: #00aaff;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a237e 100%);
}

.theme-future .game-header,
.theme-future .next-piece-panel,
.theme-future .game-stats-panel,
.theme-future .shop-panel,
.theme-future .game-instructions {
    background: rgba(26, 35, 126, 0.8);
    border-color: #00aaff;
}

/* 游戏主区域布局 */
.game-main-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 虚拟键盘样式 */
.virtual-keyboard {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    border: 2px solid #00ff00;
    border-radius: 12px;
    padding: 15px;
    width: 200px;
    box-shadow: 0 6px 25px rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(8px);
}

.virtual-keyboard h4 {
    color: #00ff00;
    margin: 0 0 15px 0;
    font-size: 16px;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
    font-weight: bold;
}

.keyboard-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* D-Pad 区域 */
.dpad-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dpad-up {
    width: 70px;
    height: 50px;
    border-radius: 12px 12px 6px 6px;
}

.dpad-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dpad-left, .dpad-down, .dpad-right {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.dpad-left {
    border-radius: 12px 6px 6px 12px;
}

.dpad-right {
    border-radius: 6px 12px 12px 6px;
}

/* 功能键区域 */
.action-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.action-btn {
    width: 100%;
    height: 45px;
    border-radius: 10px;
    font-weight: bold;
}

.drop-btn {
    background: linear-gradient(145deg, #ff6b35, #f7931e);
    border: 2px solid #ff8c42;
    color: #fff;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
}

.drop-btn:hover {
    background: linear-gradient(145deg, #ff8c42, #ff6b35);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255, 107, 53, 0.5);
}

.pause-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border: 2px solid #ec7063;
    color: #fff;
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.4);
}

.pause-btn:hover {
    background: linear-gradient(145deg, #ec7063, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(231, 76, 60, 0.5);
}

/* 控制按钮基础样式 */
.control-btn {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border: 2px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.control-btn:hover {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    border-color: #00ff88;
    color: #00ff88;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
}

.control-btn:hover::before {
    opacity: 1;
}

.control-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 12px rgba(0, 255, 0, 0.5);
}

.control-btn.pressed {
    background: linear-gradient(145deg, #00ff00, #00cc00);
    color: #000;
    border-color: #00ff88;
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.6);
}

.btn-icon {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 2px;
    text-shadow: 0 0 4px currentColor;
}

.btn-text {
    font-size: 9px;
    line-height: 1;
    opacity: 0.9;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 按键按下动画 */
@keyframes keyPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.control-btn.pressed {
    animation: keyPress 0.15s ease;
}

/* 移动设备虚拟键盘优化 */
@media (max-width: 768px) {
    .game-main-area {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .virtual-keyboard {
        width: 100%;
        max-width: 300px;
        padding: 12px;
    }
    
    .dpad-up {
        width: 60px;
        height: 45px;
    }
    
    .dpad-left, .dpad-down, .dpad-right {
        width: 45px;
        height: 45px;
    }
    
    .action-btn {
        height: 40px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .btn-text {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .game-main-area {
        gap: 10px;
    }
    
    .virtual-keyboard {
        padding: 10px;
    }
    
    .dpad-up {
        width: 55px;
        height: 40px;
    }
    
    .dpad-left, .dpad-down, .dpad-right {
        width: 40px;
        height: 40px;
    }
    
    .action-btn {
        height: 35px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
    
    .btn-text {
        font-size: 7px;
    }
    
    .keyboard-layout {
        gap: 12px;
    }
}

/* 游戏费用提示样式 */
.game-fee-notice {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.fee-notice-content h4 {
    color: #ffc107;
    margin: 0 0 10px 0;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

.fee-notice-content p {
    color: #fff;
    margin: 5px 0;
    font-size: 14px;
}

.fee-notice-content strong {
    color: #ffc107;
    font-weight: bold;
}

.fee-warning {
    color: #ff6b6b !important;
    font-weight: bold;
    font-size: 14px;
    margin: 10px 0;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

.fee-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.fee-actions .btn {
    min-width: 120px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
    }
    
    .game-right {
        order: -1;
    }
    
    .game-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .instructions-content {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-stats {
        justify-content: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    #nextCanvas {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .brand {
        justify-content: center;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .mode-buttons,
    .theme-buttons {
        justify-content: center;
    }
}
