:root {
    --dark-bg: #121826;
    --dark-card: #0f172a;
    --dark-border: #1e293b;
    --primary-color: #22d3ee;
    --primary-light: rgba(34, 211, 238, 0.25);
    --secondary-color: #0ea5e9;
    --accent-color: #facc15;
    --text-primary: #e0e6f0;
    --text-secondary: #94a3b8;
    --text-muted: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--dark-bg), var(--dark-card), #1a1e33);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-attachment: fixed;
}

.game-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 1s ease;
}

.game-title {
    font-size: 42px;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-light), 0 0 40px rgba(34, 211, 238, 0.3);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.game-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.start-panel {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    margin-bottom: 15px;
    border: 1px solid var(--primary-light);
    animation: slideUp 0.8s ease;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.start-title {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-select {
    text-align: center;
    margin-bottom: 20px;
}

.mode-title {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn {
    padding: 10px 28px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 25px;
    margin: 0 8px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.mode-btn-default {
    background: var(--dark-border);
    color: var(--text-secondary);
    border: 1px solid #334155;
}

.mode-btn.active {
    background: var(--secondary-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

.info-group {
    margin-bottom: 20px;
}

.info-group h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-group p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 6px;
}

.start-btn-box {
    text-align: center;
    margin-top: 25px;
}

#startBtn {
    background: var(--secondary-color) !important;
    box-shadow: 0 5px 15px rgba(14, 165, 238, 0.4);
    transition: all 0.3s;
    padding: 12px 35px;
    border-radius: 30px;
    border: none;
    font-weight: bold;
    font-size: 16px;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(14, 165, 238, 0.6);
}

.game-main {
    display: none;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary-light);
    animation: fadeIn 0.6s ease;
}

.status-card {
    background: linear-gradient(135deg, var(--dark-border), #273449);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.status-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.status-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.4);
    display: block;
}

.preview-box {
    background: linear-gradient(135deg, var(--dark-border), #273449);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.preview-title {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: bold;
}

.control-group {
    text-align: center;
    margin-top: 8px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 6px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: none;
}

.control-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.control-btn:active {
    transform: scale(0.95);
}

.canvas-container {
    position: relative;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

#pauseOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 10;
}

.pause-text {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 12px var(--primary-color);
    animation: pulse 1s infinite alternate;
}

#gameCanvas {
    border: 4px solid var(--secondary-color);
    border-radius: 8px;
    background: #000;
    box-shadow: 0 0 25px var(--primary-light);
    /*width: 100%;*/
    /*height: auto;*/
    display: block;
}

#previewCanvas {
    border: 2px solid var(--secondary-color);
    border-radius: 6px;
    background: #000;
    box-shadow: 0 0 10px var(--primary-light);
}

.game-tip {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-content {
    background-color: var(--dark-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.modal-header, .modal-footer {
    border-color: var(--primary-light);
}

.modal-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 20px;
}

.modal-body p {
    color: var(--accent-color);
    font-size: 16px;
    margin: 10px 0;
    text-align: center;
}

.final-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(250, 204, 21, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    from {
        opacity: 0.7;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 32px;
    }

    .status-value {
        font-size: 20px;
    }

    .status-card {
        padding: 10px;
    }

    .control-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .game-main {
        padding: 15px 10px;
    }
}

@media (max-width: 576px) {
    .game-title {
        font-size: 26px;
    }

    .status-value {
        font-size: 18px;
    }
}