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

:root {
    --red-team: #ff4444;
    --blue-team: #4444ff;
    --game-width: 1200px;
    --game-min-width: 1000px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.screen-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.warning-content {
    background: #333;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.warning-content h2 {
    color: #ffdd44;
    margin-bottom: 1rem;
}

@media (max-width: 1000px) {
    .screen-warning {
        display: flex;
    }
    .game-wrapper {
        display: none;
    }
}

.game-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    width: var(--game-width);
    min-width: var(--game-min-width);
    background: #2a2a2a;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #333;
    border-bottom: 2px solid #444;
}

.header-left {
    text-align: left;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.bet-info {
    color: #aaa;
    font-size: 1rem;
}

.bet-result {
    font-weight: bold;
    color: #fff;
}

.game-description {
    color: #aaa;
    font-size: 1.1rem;
}

.container {
    display: flex;
    padding: 20px;
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
}

.game-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
}

.game-side.left::after,
.game-side.right::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.game-side.left::after {
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.1) 0%, transparent 100%);
}

.game-side.right::after {
    background: linear-gradient(90deg, transparent 0%, rgba(68, 68, 255, 0.1) 100%);
}

.player {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-side.left .player {
    color: var(--red-team);
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.game-side.right .player {
    color: var(--blue-team);
    text-shadow: 0 0 10px rgba(68, 68, 255, 0.3);
}

.vars {
    margin-bottom: 20px;
}

.varA {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.game-board {
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.game-board td {
    border: 1px solid #444;
    width: 40px;
    height: 40px;
    text-align: center;
    position: relative;
    color: #fff;
}

.divider {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #fff, transparent);
    margin: 0 30px;
    opacity: 0.3;
}

/* 左侧红色小球 */
.game-side.left .ball {
    background-color: var(--red-team);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

/* 右侧蓝色小球 */
.game-side.right .ball {
    background-color: var(--blue-team);
    box-shadow: 0 0 10px rgba(68, 68, 255, 0.5);
}

.ball {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.battlefield {
    width: 100%;
    height: 180px;
    border-top: 2px solid #444;
    display: flex;
    position: relative;
    background: linear-gradient(to bottom, #2a2a2a, #222);
    padding: 20px;
}

.tower {
    width: 70px;
    height: 100px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
}

.tower-body {
    width: 50px;
    height: 70px;
    background: linear-gradient(135deg, #444 0%, #333 100%);
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.left-tower .tower-body::after,
.right-tower .tower-body::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 25px;
    height: 12px;
    background: linear-gradient(to bottom, #555, #333);
    transform: translateY(-50%);
    border-radius: 3px;
}

.left-tower .tower-body::after {
    right: -25px;
}

.right-tower .tower-body::after {
    left: -25px;
}

.health {
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.var-b {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #aaa;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 15px;
}

.battlefield-area {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin: 0 20px;
}

/* 左侧红色炮弹 */
.battlefield .projectile[data-side="left"] {
    background-color: var(--red-team);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

/* 右侧蓝色炮弹 */
.battlefield .projectile[data-side="right"] {
    background-color: var(--blue-team);
    box-shadow: 0 0 10px rgba(68, 68, 255, 0.5);
}

.projectile {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.016s linear;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
}

.modal h2 {
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #aaa;
    font-size: 1.1rem;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    background: #333;
    border: 2px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 1.1rem;
}

.form-group input[type="number"]:focus {
    border-color: #666;
    outline: none;
}

.bet-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.bet-button {
    flex: 1;
    padding: 15px;
    border: 2px solid #444;
    background: #333;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bet-button:hover {
    background: #444;
}

.bet-button.selected {
    border-color: #666;
    background: #444;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.team-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.team-color.red {
    background: var(--red-team);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.team-color.blue {
    background: var(--blue-team);
    box-shadow: 0 0 10px rgba(68, 68, 255, 0.5);
}

.start-button, .restart-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.start-button:hover, .restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.result-message {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #333;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #fff;
}