* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.container {
    text-align: center;
    padding: 20px;
}

h1 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.game-info span {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
}

#gameCanvas {
    border: 3px solid #4ecca3;
    border-radius: 10px;
    background: #0f0f23;
    box-shadow: 0 0 30px rgba(78, 204, 163, 0.3);
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 12px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#startBtn {
    background: linear-gradient(135deg, #4ecca3, #38a583);
    color: #1a1a2e;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 204, 163, 0.4);
}

#pipBtn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

#pipBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

#pauseBtn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

#pauseBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    margin-top: 15px;
    opacity: 0.8;
}

.instructions p {
    margin: 8px 0;
}

kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 设置区域 */
.settings {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-switch input:checked+.slider {
    background: #4ecca3;
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 倒计时秒数设置 */
.countdown-setting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.countdown-setting input {
    width: 50px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.countdown-setting input:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 8px rgba(78, 204, 163, 0.3);
}

.countdown-setting input::-webkit-inner-spin-button,
.countdown-setting input::-webkit-outer-spin-button {
    opacity: 1;
}

/* 倒计时提示 */
.countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #4ecca3;
    text-shadow: 0 0 20px rgba(78, 204, 163, 0.5);
    z-index: 10;
    pointer-events: none;
}