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

body {
    background: #1a1a2e;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

/* ==================== 像素风格弹窗 ==================== */
#pixel-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #0f0f23;
    border: 4px solid #e94560;
    padding: 0;
    z-index: 100000;
    min-width: 300px;
    max-width: 450px;
    box-shadow: 8px 8px 0 #533483, 0 0 30px rgba(233, 69, 96, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

#pixel-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

#pixel-toast.success {
    border-color: #4ade80;
    box-shadow: 8px 8px 0 #22c55e, 0 0 30px rgba(74, 222, 128, 0.4);
}

#pixel-toast.error {
    border-color: #ff4444;
    box-shadow: 8px 8px 0 #cc0000, 0 0 30px rgba(255, 68, 68, 0.4);
}

#pixel-toast.warning {
    border-color: #fbbf24;
    box-shadow: 8px 8px 0 #d97706, 0 0 30px rgba(251, 191, 36, 0.4);
}

.pixel-toast-header {
    background: linear-gradient(90deg, #e94560 0%, #533483 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#pixel-toast.success .pixel-toast-header {
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
}

#pixel-toast.error .pixel-toast-header {
    background: linear-gradient(90deg, #ff4444 0%, #cc0000 100%);
}

#pixel-toast.warning .pixel-toast-header {
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.pixel-toast-icon {
    font-size: 20px;
}

.pixel-toast-title {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    flex: 1;
}

.pixel-toast-body {
    padding: 20px;
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.pixel-toast-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 12px 20px;
    background: #e94560;
    border: 3px solid #fff;
    color: #fff;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 4px 4px 0 #533483;
}

#pixel-toast.success .pixel-toast-btn {
    background: #4ade80;
    box-shadow: 4px 4px 0 #22c55e;
}

#pixel-toast.error .pixel-toast-btn {
    background: #ff4444;
    box-shadow: 4px 4px 0 #cc0000;
}

#pixel-toast.warning .pixel-toast-btn {
    background: #fbbf24;
    color: #000;
    box-shadow: 4px 4px 0 #d97706;
}

.pixel-toast-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #533483;
}

.pixel-toast-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* 弹窗背景遮罩 */
#pixel-toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#pixel-toast-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== iOS PWA 添加到主屏幕引导 ==================== */
#ios-pwa-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-prompt-content {
    background: linear-gradient(145deg, #2a2a4a, #1a1a2e);
    border: 3px solid #e94560;
    border-radius: 16px;
    padding: 30px;
    max-width: 340px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

.ios-prompt-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.ios-prompt-close:hover {
    color: #e94560;
}

.ios-prompt-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ios-prompt-title {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.ios-prompt-text {
    font-size: 15px;
    color: #ddd;
    margin-bottom: 20px;
    line-height: 1.8;
}

.ios-prompt-text b {
    color: #4ade80;
}

.ios-prompt-btn {
    background: linear-gradient(145deg, #e94560, #c73e54);
    border: none;
    color: #fff;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ios-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.ios-prompt-btn:active {
    transform: translateY(0);
}

/* ==================== 像素风格背景动画 ==================== */
#pixel-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#pixel-canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* 背景音乐控制按钮 */
#music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-btn {
    width: 50px;
    height: 50px;
    background: rgba(15, 15, 35, 0.9);
    border: 3px solid #e94560;
    color: #e94560;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 #533483;
}

/* 地图编辑器入口按钮 */
#editor-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.editor-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: rgba(15, 15, 35, 0.9);
    border: 3px solid #4ade80;
    color: #4ade80;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 #22c55e;
    text-decoration: none;
}

.editor-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #22c55e;
    background: rgba(74, 222, 128, 0.2);
}
.music-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #533483;
}

.music-btn.muted {
    color: #666;
    border-color: #666;
}

#menu {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.menu-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 25px;
    width: max-content;
    padding: 20px;
    transform-origin: center center;
}

.info-card {
    background: #0f0f2300;
    border: 4px solid #533483;
    padding: 20px;
    width: 260px;
    box-shadow: 6px 6px 0 #533483;
    flex-shrink: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.info-card h3 {
    color: #e94560;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 0 #533483;
}

/* 游戏玩法卡片 */
.gameplay-card {
    border-color: #4ade80;
    box-shadow: 6px 6px 0 #4ade80;
}

.gameplay-card h3 {
    color: #4ade80;
}

.gameplay-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-section h4 {
    color: #fbbf24;
    font-size: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.control-section p {
    color: #fff;
    font-size: 13px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.key {
    background: #1a1a2e;
    color: #60a5fa;
    padding: 3px 8px;
    border: 2px solid #60a5fa;
    font-size: 11px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

/* 公告卡片 */
.announcement-card {
    border-color: #f59e0b;
    box-shadow: 6px 6px 0 #f59e0b;
}

.announcement-card h3 {
    color: #f59e0b;
}

.announcement-content {
    max-height: 550px;
    overflow-y: auto;
}

.announcement-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #333;
}

.announcement-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.announcement-date {
    color: #888;
    font-size: 11px;
    display: block;
    margin-bottom: 5px;
}

.announcement-text {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
}

.loading-text {
    color: #888;
    font-size: 13px;
    text-align: center;
}

.menu-container {
    background: #0f0f23d4;
    border: 4px solid #e94560;
    padding: clamp(20px, 2.5vw, 40px);
    text-align: center;
    box-shadow: 8px 8px 0 #e94560;
    width: clamp(300px, 28vw, 450px);
    flex-shrink: 0;
}

.pixel-title {
    font-size: clamp(32px, 3vw, 48px);
    color: #e94560;
    text-shadow: 4px 4px 0 #533483;
    margin-bottom: 10px;
}

.pixel-subtitle {
    font-size: clamp(16px, 1.5vw, 24px);
    color: #0f3460;
    background: #e94560;
    padding: 5px 20px;
    margin-bottom: 15px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    color: #888;
    border: 2px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #533483;
    color: #fff;
    border-color: #e94560;
}

.tab-btn:hover {
    border-color: #e94560;
}

.input-group {
    margin: 15px 0;
    text-align: left;
}

.input-group label {
    display: block;
    color: #e94560;
    margin-bottom: 8px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    border: 3px solid #533483;
    color: #fff;
    outline: none;
}

.input-group input:focus, .input-group select:focus {
    border-color: #e94560;
}

.input-group select option {
    background: #1a1a2e;
    color: #fff;
}

.team-select {
    display: flex;
    gap: 10px;
}

.team-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    border: 3px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
}

.ct-btn {
    background: #1a3050;
    color: #60a5fa;
}

.t-btn {
    background: #3d2817;
    color: #fbbf24;
}

.team-btn.active {
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.team-btn:hover {
    transform: scale(1.02);
}

/* 服务器配置样式 */
.server-config {
    border-top: 1px dashed #533483;
    padding-top: 15px;
    margin-top: 15px;
}

.server-config label .optional {
    color: #888;
    font-size: 12px;
}

.server-input-group {
    display: flex;
    gap: 10px;
}

.server-input-group input {
    flex: 1;
}

.server-hint {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #4ade80;
}

.pixel-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    background: #e94560;
    color: #fff;
    border: none;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 4px 4px 0 #533483;
}

.pixel-btn.small {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    margin-top: 0;
}

.pixel-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #533483;
}

#game {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#game canvas {
    display: block;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f0;
    font-size: 30px;
    font-weight: bold;
    text-shadow: 0 0 5px #0f0;
    pointer-events: none;
    z-index: 100;
    transition: transform 0.05s ease-out;
}

#scope {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 28%, rgba(0,0,0,0.95) 29%);
    pointer-events: none;
    z-index: 99;
}

/* 狙击镜十字线 */
#scope::before, #scope::after {
    content: '';
    position: absolute;
    background: rgba(0,0,0,0.8);
}

#scope::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

#scope::after {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

/* 狙击镜中心红点 */
#scope-red-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #ff0000;
    border-radius: 50%;
    z-index: 100;
    box-shadow: 0 0 4px #ff0000, 0 0 8px rgba(255, 0, 0, 0.5);
    pointer-events: none;
}

#top-hud {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    align-items: center;
    z-index: 100;
}

.team-score {
    padding: 8px 20px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid;
}

.team-score.ct {
    background: rgba(30, 64, 175, 0.8);
    border-color: #60a5fa;
    color: #60a5fa;
}

.team-score.t {
    background: rgba(139, 69, 19, 0.8);
    border-color: #fbbf24;
    color: #fbbf24;
}

#game-info {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    font-size: 14px;
    border: 2px solid #e94560;
}

#hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 20px;
    z-index: 100;
}

#hud > div {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid #e94560;
}

#health { color: #4ade80; }
#weapon { color: #fbbf24; }
#score { color: #60a5fa; }

/* FPS计数器 - 右上角 */
#fps-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #a855f7;
    padding: 8px 15px;
    font-size: 14px;
    border: 2px solid #a855f7;
    z-index: 100;
}

/* 延迟显示 - 与FPS合并显示 */
#ping-counter {
    display: none;
}

/* 小地图样式 */
#minimap-container {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 180px;
    height: 180px;
    z-index: 100;
    border-radius: 5px;
    overflow: hidden;
}

#minimap-canvas {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

#minimap-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.site-label {
    position: absolute;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
    display: none;
}

#killfeed {
    position: absolute;
    top: 60px;
    right: 20px;
    text-align: right;
    z-index: 100;
    max-width: 350px;
}

.kill-msg {
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.8) 20%, rgba(0, 0, 0, 0.8) 100%);
    color: #fff;
    padding: 8px 15px;
    margin-bottom: 4px;
    font-size: 13px;
    border-right: 3px solid #e94560;
    animation: killMsgSlide 3.5s forwards;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    border-radius: 3px 0 0 3px;
}

.kill-msg .hs-icon {
    font-size: 14px;
    margin-right: 4px;
}

.kill-msg .killer-name {
    color: #60a5fa;
    font-weight: bold;
}

.kill-msg .killer-name.t-team {
    color: #fbbf24;
}

.kill-msg .weapon-text {
    color: #aaa;
    font-size: 12px;
    margin: 0 8px;
}

.kill-msg .victim-name {
    color: #ff6b6b;
    font-weight: bold;
}

.kill-msg.kill-event {
    border-right-color: #ff4444;
    background: linear-gradient(90deg, transparent 0%, rgba(80, 0, 0, 0.8) 20%, rgba(60, 0, 0, 0.9) 100%);
}

.kill-msg.headshot-event {
    border-right-color: #ff0000;
    background: linear-gradient(90deg, transparent 0%, rgba(100, 0, 0, 0.9) 20%, rgba(80, 0, 0, 0.95) 100%);
}

.kill-msg.system-event {
    border-right-color: #4ade80;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 60, 30, 0.8) 20%, rgba(0, 40, 20, 0.9) 100%);
}

.kill-msg.system-event::before {
    content: '📢';
    font-size: 12px;
}

.kill-msg.bomb-event {
    border-right-color: #ff6600;
    background: linear-gradient(90deg, transparent 0%, rgba(80, 40, 0, 0.8) 20%, rgba(60, 30, 0, 0.9) 100%);
}

@keyframes killMsgSlide {
    0% { 
        transform: translateX(100px);
        opacity: 0;
    }
    10% {
        transform: translateX(0);
        opacity: 1;
    }
    80% {
        transform: translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(20px);
        opacity: 0;
    }
}

/* 准星瞄准目标名字显示 */
#crosshair-target {
    position: absolute;
    top: calc(50% + 30px);
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 150;
    padding: 4px 12px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}

#crosshair-target.visible {
    opacity: 1;
}

#crosshair-target.enemy {
    color: #ff6b6b;
    border: 1px solid rgba(255, 100, 100, 0.5);
}

#crosshair-target.friendly {
    color: #60a5fa;
    border: 1px solid rgba(100, 150, 255, 0.5);
}

/* 开镜时目标名字位置调整 */
#scope:not([style*="display: none"]) ~ #crosshair-target {
    top: calc(50% + 50px);
}

#death-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 0, 0, 0.8);
    padding: 40px 60px;
    text-align: center;
    border: 4px solid #e94560;
    z-index: 200;
}

#death-screen p {
    color: #fff;
    font-size: 24px;
    margin: 10px 0;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 50px 80px;
    text-align: center;
    border: 4px solid #e94560;
    z-index: 300;
}

#game-over h2 {
    color: #e94560;
    font-size: 36px;
    margin-bottom: 20px;
}

#game-over p {
    color: #fff;
    font-size: 20px;
    margin-bottom: 30px;
}

#game-over .pixel-btn {
    width: auto;
    padding: 15px 40px;
}

.hit-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-size: 40px;
    font-weight: bold;
    pointer-events: none;
    z-index: 150;
    text-shadow: 0 0 10px #ff0000;
    animation: hitPulse 0.2s ease-out;
}

@keyframes hitPulse {
    0% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* 购买菜单 - 像素风格 */
#buy-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    text-align: center;
    border: 4px solid #e94560;
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#buy-menu h3 {
    color: #e94560;
    font-size: 20px;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0 #533483;
}

.buy-options {
    display: flex;
    gap: 20px;
}

.buy-btn {
    width: 140px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    color: #fff;
    border: 3px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.buy-btn:hover {
    background: #533483;
    border-color: #e94560;
    transform: scale(1.05);
}

.weapon-icon {
    width: 100px;
    height: 40px;
    image-rendering: pixelated;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 像素风格枪械图标 - 使用CSS绘制 */
.ak47-icon {
    background: linear-gradient(90deg, 
        transparent 0%, transparent 5%,
        #5c4033 5%, #5c4033 15%,
        #2a2a2a 15%, #2a2a2a 20%,
        #5c4033 20%, #5c4033 60%,
        #2a2a2a 60%, #2a2a2a 100%
    );
    position: relative;
}
.ak47-icon::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 35%;
    width: 15px;
    height: 20px;
    background: #4a3a2a;
    transform: rotate(15deg);
}
.ak47-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 20px;
    height: 8px;
    background: #5c4033;
    transform: translateY(-50%);
}

.m4a1-icon {
    background: linear-gradient(90deg,
        transparent 0%, transparent 5%,
        #1a1a1a 5%, #1a1a1a 15%,
        #333 15%, #333 20%,
        #1a1a1a 20%, #1a1a1a 55%,
        #2a2a2a 55%, #2a2a2a 70%,
        #333 70%, #333 100%
    );
    position: relative;
}
.m4a1-icon::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 35%;
    width: 12px;
    height: 18px;
    background: #1a1a1a;
}
.m4a1-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 30%;
    width: 20px;
    height: 6px;
    background: #1a1a1a;
}

.awp-icon {
    background: linear-gradient(90deg,
        transparent 0%, transparent 5%,
        #2d4a2d 5%, #2d4a2d 20%,
        #2a2a2a 20%, #2a2a2a 25%,
        #2d4a2d 25%, #2d4a2d 60%,
        #2a2a2a 60%, #2a2a2a 100%
    );
    position: relative;
}
.awp-icon::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 25%;
    width: 25px;
    height: 10px;
    background: #2a2a2a;
    border-radius: 2px;
}
.awp-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 35%;
    width: 12px;
    height: 15px;
    background: #2d4a2d;
}

.weapon-name {
    font-size: 14px;
    font-weight: bold;
    color: #e94560;
}

.weapon-desc {
    font-size: 10px;
    color: #888;
}


/* 设置菜单 */
#settings-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px 40px;
    text-align: center;
    border: 4px solid #e94560;
    z-index: 260;
    min-width: 350px;
}

#settings-menu h3 {
    color: #e94560;
    font-size: 20px;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0 #533483;
}

.settings-group {
    margin: 20px 0;
    text-align: left;
}

.settings-group label {
    display: block;
    color: #fff;
    margin-bottom: 10px;
    font-size: 14px;
}

.settings-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #1a1a2e;
    border: 2px solid #533483;
    border-radius: 0;
    outline: none;
    cursor: pointer;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #e94560;
    border: 2px solid #fff;
    cursor: pointer;
}

.settings-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #e94560;
    border: 2px solid #fff;
    cursor: pointer;
    border-radius: 0;
}

.settings-group input[type="range"]:hover {
    border-color: #e94560;
}


/* 设置菜单按钮 */
.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.settings-btn {
    padding: 12px 25px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    color: #fff;
    border: 3px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn:hover {
    background: #533483;
    border-color: #e94560;
}

.settings-btn.exit-btn {
    background: #5c1a1a;
    border-color: #e94560;
}

.settings-btn.exit-btn:hover {
    background: #8b0000;
}

/* 武器图片样式 */
.weapon-img {
    width: 120px;
    height: 60px;
    object-fit: contain;
    image-rendering: pixelated;
    background: #0a0a15;
    border: 2px solid #333;
}


/* 死亡黑白效果 */
#death-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    transition: all 0.5s ease;
}

#death-overlay.active {
    background: rgba(0, 0, 0, 0.3);
}

#game.dead-effect canvas {
    filter: grayscale(100%) brightness(0.7);
    transition: filter 0.5s ease;
}

#game canvas {
    transition: filter 0.3s ease;
}

/* 击杀反馈图标 */
#kill-feedback {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 150;
    pointer-events: none;
}

#kill-icon, #kill-streak-icon {
    display: none;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
    animation: killFeedbackPop 0.3s ease-out;
    image-rendering: pixelated;
}

/* 爆头图标 - 像素风格 */
#kill-icon.headshot {
    display: block;
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    border: 3px solid #ff6666;
    color: #fff;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

#kill-icon.headshot::before {
    content: '💀 爆头 ';
}

#kill-icon.headshot::after {
    content: ' 💀';
}

/* 普通击杀图标 */
#kill-icon.kill {
    display: block;
    background: linear-gradient(180deg, #ffaa00 0%, #cc8800 100%);
    border: 3px solid #ffcc44;
    color: #fff;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.5);
}

#kill-icon.kill::before {
    content: '⚔️ 击杀 ';
}

/* 刀杀图标 */
#kill-icon.knife {
    display: block;
    background: linear-gradient(180deg, #aa44ff 0%, #7700cc 100%);
    border: 3px solid #cc66ff;
    color: #fff;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 0 20px rgba(170, 68, 255, 0.6);
}

#kill-icon.knife::before {
    content: '🔪 刀杀 ';
}

/* 连杀图标 */
#kill-streak-icon.active {
    display: block;
    background: linear-gradient(180deg, #00ccff 0%, #0088cc 100%);
    border: 3px solid #44ddff;
    color: #fff;
    font-size: 20px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.3);
}

#kill-streak-icon.streak-3 {
    background: linear-gradient(180deg, #44ff44 0%, #00cc00 100%);
    border-color: #66ff66;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.7);
}

#kill-streak-icon.streak-4 {
    background: linear-gradient(180deg, #ffff00 0%, #cccc00 100%);
    border-color: #ffff66;
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.7);
}

#kill-streak-icon.streak-5 {
    background: linear-gradient(180deg, #ff8800 0%, #cc6600 100%);
    border-color: #ffaa44;
    box-shadow: 0 0 30px rgba(255, 136, 0, 0.8);
}

#kill-streak-icon.streak-6 {
    background: linear-gradient(180deg, #ff0000 0%, #cc0000 100%);
    border-color: #ff4444;
    box-shadow: 0 0 35px rgba(255, 0, 0, 0.9);
    animation: killFeedbackPop 0.3s ease-out, streakGlow 0.5s ease-in-out infinite alternate;
}

@keyframes killFeedbackPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes streakGlow {
    0% {
        box-shadow: 0 0 35px rgba(255, 0, 0, 0.9);
    }
    100% {
        box-shadow: 0 0 50px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 0.5);
    }
}


/* ==================== 爆破模式样式 ==================== */

/* 爆破模式HUD */
#defuse-hud {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
}

#c4-status {
    color: #ff6600;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 10px;
}

#c4-timer-display {
    background: rgba(255, 0, 0, 0.8);
    padding: 10px 30px;
    border-radius: 5px;
    border: 3px solid #ff0000;
    animation: c4-pulse 0.5s infinite;
}

#c4-timer-display .c4-icon {
    font-size: 24px;
    margin-right: 10px;
}

#c4-countdown {
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

@keyframes c4-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 拆弹进度条 */
#defuse-progress-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 8px;
    border: 3px solid #00ff00;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
}

#defuse-progress-bar {
    width: 300px;
    height: 25px;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

#defuse-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #00cc00, #00ff00);
    transition: width 0.05s linear;
    box-shadow: 0 0 10px #00ff00;
}

#defuse-text {
    color: #00ff00;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

/* 下包进度条 */
#plant-progress-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 8px;
    border: 3px solid #ff6600;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
}

#plant-progress-bar {
    width: 300px;
    height: 25px;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

#plant-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6600, #ff3300, #ff6600);
    transition: width 0.05s linear;
    box-shadow: 0 0 10px #ff6600;
}

#plant-text {
    color: #ff6600;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px #ff6600;
}

/* 安放/拆弹提示 */
#plant-hint, #defuse-hint {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffff00;
    padding: 15px 30px;
    border-radius: 5px;
    border: 2px solid #ffff00;
    font-size: 18px;
    animation: hint-blink 1s infinite;
}

@keyframes hint-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 包点标记 */
.bomb-site-marker {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 100, 0, 0.3);
    border: 3px solid #ff6600;
    color: #ff6600;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 50;
}

/* 回合结束屏幕 */
#round-end-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#round-winner {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
}

#round-winner.ct-win {
    color: #4a9eff;
}

#round-winner.t-win {
    color: #ff6600;
}

#round-reason {
    font-size: 24px;
    color: #ccc;
    margin-bottom: 30px;
}

#round-score {
    font-size: 36px;
    color: #fff;
}

/* 冻结时间覆盖层 */
#freeze-time-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 100, 200, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    pointer-events: none;
}

#freeze-countdown {
    font-size: 48px;
    color: #00ccff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    animation: freeze-pulse 1s infinite;
}

@keyframes freeze-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* 回合信息 */
#round-info {
    color: #ffcc00;
    margin-right: 10px;
}

/* 爆破模式比分显示调整 */
.defuse-mode #ct-score,
.defuse-mode #t-score {
    font-size: 24px;
    padding: 10px 20px;
}

/* ==================== 观战模式样式 ==================== */
#spectator-ui {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 200;
}

#spectator-info {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 8px;
    border: 3px solid #00ccff;
    margin-bottom: 10px;
}

#spectator-label {
    color: #00ccff;
    font-size: 16px;
    margin-right: 15px;
}

#spectator-name {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px #00ccff;
}

#spectator-hint {
    color: #888;
    font-size: 14px;
    animation: hint-blink 1.5s infinite;
}


/* ==================== 手机端虚拟控制器 ==================== */
#mobile-controls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

#mobile-controls > * {
    pointer-events: auto;
}

/* 左侧移动摇杆 - 向右上方移动并放大 */
#joystick-container {
    position: absolute;
    bottom: 60px;
    left: 50px;
    z-index: 600;
}

#joystick-base {
    width: 166px;
    height: 166px;
    background: rgba(255, 255, 255, 0.15);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#joystick-stick {
    width: 75px;
    height: 75px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: transform 0.05s;
}

/* 右侧按钮 - 扇形分布围绕射击键 */
#mobile-buttons {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 220px;
    height: 220px;
}

.mobile-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* 射击按钮 - 放大并居中 */
.mobile-btn.shoot-btn {
    width: 116px;
    height: 116px;
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 100, 100, 0.5);
    border-width: 3px;
    font-size: 36px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.mobile-btn.shoot-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* 开镜按钮 - 左侧 */
.mobile-btn.scope-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 100, 255, 0.4);
    border-color: rgba(100, 150, 255, 0.5);
    font-size: 18px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* 扇形分布的按钮位置 */
#mobile-reload { left: 20px; top: 15px; }
#mobile-jump { left: 85px; top: -15px; }
#mobile-crouch { right: 0; top: 50%; transform: translateY(-50%); }
#mobile-switch { right: 20px; top: 15px; }
#mobile-buy { left: 20px; bottom: 15px; top: auto; }
#mobile-settings { right: 20px; bottom: 15px; top: auto; font-size: 20px; }
#mobile-scoreboard { left: 85px; bottom: -15px; top: auto; font-size: 12px; }

/* 拆包按钮 - 屏幕中央显示 */
.mobile-btn.defuse-btn {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 200, 0, 0.6);
    border: 3px solid rgba(0, 255, 0, 0.8);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    z-index: 600;
    animation: defuse-pulse 1s infinite;
}

.mobile-btn.defuse-btn:active {
    background: rgba(0, 255, 0, 0.8);
    transform: translate(-50%, -50%) scale(0.95);
}

@keyframes defuse-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 0, 0.8); }
}

/* 武器快捷栏 */
#mobile-weapon-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.weapon-slot {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
}

.weapon-slot:active {
    background: rgba(255, 255, 255, 0.3);
}

.weapon-slot.active {
    border-color: #ff6600;
    background: rgba(255, 102, 0, 0.3);
}

/* C4武器槽 - 默认隐藏，只在爆破模式携带C4时显示 */
.weapon-slot[data-slot="5"] {
    display: none;
}

.weapon-slot[data-slot="5"].show-c4 {
    display: block;
}

/* ==================== 战绩面板样式 ==================== */
#scoreboard-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #e94560;
    border-radius: 10px;
    padding: 20px;
    z-index: 800;
    min-width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

#scoreboard-panel.visible {
    display: block;
}

#scoreboard-panel h3 {
    color: #e94560;
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
}

.scoreboard-teams {
    display: flex;
    gap: 20px;
}

.scoreboard-team {
    flex: 1;
    min-width: 200px;
}

.scoreboard-team-header {
    padding: 8px 12px;
    font-weight: bold;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
}

.scoreboard-team-header.ct {
    background: rgba(30, 64, 175, 0.8);
    color: #60a5fa;
}

.scoreboard-team-header.t {
    background: rgba(139, 69, 19, 0.8);
    color: #fbbf24;
}

.scoreboard-player {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.scoreboard-player:last-child {
    border-bottom: none;
}

.scoreboard-player.dead {
    opacity: 0.5;
}

.scoreboard-player.self {
    background: rgba(233, 69, 96, 0.2);
}

.scoreboard-player-name {
    color: #fff;
    flex: 1;
}

.scoreboard-player-stats {
    display: flex;
    gap: 15px;
    color: #aaa;
}

.scoreboard-player-stats span {
    min-width: 30px;
    text-align: center;
}

.scoreboard-stats-header {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px;
    font-size: 11px;
    color: #888;
    background: rgba(0, 0, 0, 0.3);
}

.scoreboard-stats-header span {
    min-width: 30px;
    text-align: center;
}

/* 手机端战绩面板缩小 */
@media (max-width: 768px), (pointer: coarse) {
    #scoreboard-panel {
        min-width: auto;
        width: 95vw;
        padding: 10px;
        transform: translate(-50%, -50%) scale(0.85);
    }
    
    #scoreboard-panel h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .scoreboard-teams {
        flex-direction: column;
        gap: 10px;
    }
    
    .scoreboard-team-header {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .scoreboard-player {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .scoreboard-player-stats {
        gap: 10px;
    }
}

/* 手机端媒体查询 */
@media (max-width: 768px), (pointer: coarse) {
    #mobile-controls {
        display: block !important;
    }
    
    /* 隐藏桌面端的一些元素 */
    #editor-link {
        display: none;
    }
    
    /* 缩小小地图 */
    #minimap-container {
        width: 80px;
        height: 80px;
        top: 5px;
        left: 5px;
    }
    
    /* 缩小顶部游戏信息 */
    #game-info {
        font-size: 10px;
        padding: 4px 8px;
        max-width: 200px;
    }
    
    /* 调整HUD位置和大小 - 贴底部显示 */
    #hud {
        bottom: 8px;
        left: 98px;
        right: auto;
        top: auto;
        gap: 5px;
        flex-direction: row;
        position: absolute;
        transform: none;
    }
    
    #hud > div {
        padding: 3px 6px;
        font-size: 10px;
        border-width: 1px;
    }
    
    /* 缩小FPS计数器 */
    #fps-counter {
        font-size: 10px;
        padding: 3px 6px;
        top: 5px;
        right: 5px;
    }
    
    /* 缩小击杀信息 */
    #killfeed {
        top: 30px;
        right: 5px;
        font-size: 9px;
    }
    
    /* 购买菜单手机端适配 - 按比例缩小 */
    #buy-menu {
        width: 85%;
        max-width: 400px;
        padding: 15px;
        transform: translate(-50%, -50%) scale(0.85);
    }
    
    #buy-menu h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .buy-options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .buy-btn {
        width: 100px;
        padding: 10px;
    }
    
    .weapon-img {
        width: 80px;
        height: 40px;
    }
    
    .weapon-name {
        font-size: 11px;
    }
    
    .weapon-desc {
        font-size: 9px;
    }
    
    /* 手机端C4倒计时弹框 - 更小并移到左下角 */
    #c4-timer-display {
        padding: 3px 10px;
        position: fixed;
        top: auto;
        bottom: 85px;
        left: 15px;
        transform: none;
        border-radius: 5px;
        border-width: 2px;
    }
    
    #c4-timer-display .c4-icon {
        font-size: 12px;
        margin-right: 3px;
    }
    
    #c4-countdown {
        font-size: 16px;
    }
    
    #defuse-hud {
        top: auto;
        bottom: 70px;
        left: 15px;
        transform: none;
    }
    
    #c4-status {
        font-size: 10px;
        display: none;
    }
    
    /* 手机端FPS和延迟框缩小 */
    #fps-counter {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* 设置菜单手机端适配 - 更紧凑，提高z-index */
    #settings-menu {
        width: 85%;
        max-width: 300px;
        padding: 15px 18px;
        transform: translate(-50%, -50%);
        min-width: auto;
        max-height: 85vh;
        overflow-y: auto;
        z-index: 1000;
    }
    
    #settings-menu h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .settings-group {
        margin: 8px 0;
    }
    
    .settings-group label {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .settings-group input[type="range"] {
        height: 6px;
    }
    
    .settings-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .settings-buttons {
        gap: 6px;
        margin-top: 12px;
    }
    
    /* 缩小比分显示 */
    .team-score {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }
    
    /* 手机端开镜圆圈更大 */
    #scope {
        background: radial-gradient(circle, transparent 35%, rgba(0,0,0,0.95) 36%);
    }
    
    /* 调整菜单适配 */
    .menu-wrapper {
        flex-direction: column;
        padding: 10px;
        align-items: center;
    }
    
    .info-card {
        display: none;
    }
    
    .menu-container {
        width: 100%;
        max-width: 350px;
        padding: 15px;
    }
    
    .pixel-title {
        font-size: 36px;
    }
    
    .pixel-subtitle {
        font-size: 16px;
    }
}

/* 手机横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    #menu {
        overflow-y: hidden;
        align-items: center;
        padding: 0;
    }

    .menu-wrapper {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        padding: 5px;
        min-height: auto;
        height: 100vh;
        align-items: center;
    }

    .menu-container {
        max-width: 280px;
        padding: 6px 10px;
        max-height: calc(100vh - 10px);
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
    }

    .pixel-title {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .pixel-subtitle {
        font-size: 10px;
        margin-bottom: 4px;
        padding: 2px 8px;
    }

    .tab-buttons {
        margin-bottom: 4px;
    }

    .tab-btn {
        padding: 3px 6px;
        font-size: 10px;
        min-height: 24px;
    }

    .input-group {
        margin: 3px 0;
    }

    .input-group label {
        font-size: 10px;
        margin-bottom: 1px;
    }

    .input-group input,
    .input-group select {
        padding: 3px 6px;
        font-size: 10px;
        min-height: 24px;
    }

    .pixel-btn {
        padding: 4px 10px;
        font-size: 11px;
        margin-top: 4px;
        min-height: 28px;
    }

    .pixel-btn.small {
        padding: 2px 6px;
        font-size: 9px;
        min-height: 20px;
    }

    /* 团队选择适配 - 横向排列更紧凑 */
    .team-select {
        gap: 4px;
        flex-direction: row;
    }

    .team-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-height: 24px;
        flex: 1;
    }

    /* 服务器配置隐藏或极简 */
    .server-config {
        display: none;
    }

    /* 创建选项紧凑 */
    #createOptions .input-group {
        margin: 2px 0;
    }
}

/* 触摸设备优化 */
@media (pointer: coarse) {
    .pixel-btn, .buy-btn, .tab-btn {
        min-height: 44px;
    }
    
    input, select {
        min-height: 44px;
        font-size: 16px;
    }
}


/* 横屏提示 - 只在游戏中竖屏时显示 */
#rotate-screen-hint {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    font-size: 24px;
    text-align: center;
}

#rotate-screen-hint .rotate-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate-hint 1.5s ease-in-out infinite;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

/* 首页竖屏适配 */
@media (orientation: portrait) and (max-width: 768px) {
    /* 首页菜单竖屏布局 */
    #menu {
        display: flex !important;
        padding: 20px 10px;
        overflow-y: auto;
    }
    
    .menu-wrapper {
        flex-direction: column;
        padding: 10px;
    }
    
    .menu-container {
        width: 100%;
        max-width: 350px;
        padding: 20px;
        max-height: none;
        overflow-y: visible;
    }
    
    .pixel-title {
        font-size: 32px;
    }
    
    .pixel-subtitle {
        font-size: 14px;
    }
    
    .input-group {
        margin: 10px 0;
    }
    
    .input-group label {
        font-size: 13px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    .pixel-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .team-btn {
        padding: 10px;
        font-size: 13px;
    }
    
    /* 服务器配置在竖屏时显示 */
    .server-config {
        display: block;
    }
}

/* 游戏中竖屏时显示横屏提示 */
@media (orientation: portrait) and (max-width: 768px) {
    /* 只有游戏界面需要横屏 */
    #game:not([style*="display: none"]) ~ #rotate-screen-hint,
    body.in-game #rotate-screen-hint {
        display: flex !important;
    }
    
    body.in-game #menu {
        display: none !important;
    }
    
    body.in-game #game {
        display: none !important;
    }
}

/* 横屏时隐藏提示 */
@media (orientation: landscape) {
    #rotate-screen-hint {
        display: none !important;
    }
}


/* 重连覆盖层 */
#reconnect-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.reconnect-content {
    text-align: center;
    color: white;
}

.reconnect-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #e94560;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reconnect-text {
    font-size: 20px;
    margin-bottom: 10px;
    color: #e94560;
}

.reconnect-attempt {
    font-size: 14px;
    color: #888;
}

.reconnect-attempt button {
    margin-top: 15px;
    padding: 10px 30px;
    background: #e94560;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}

.reconnect-attempt button:hover {
    background: #ff6b8a;
}


/* 连接中覆盖层 */
#connecting-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.connecting-content {
    text-align: center;
    color: white;
}

.connecting-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #4ade80;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.connecting-text {
    font-size: 18px;
    color: #4ade80;
}

/* 菜单错误提示 */
#menu-error {
    display: none;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff4444;
    color: #ff6b6b;
    padding: 10px 15px;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    border-radius: 5px;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}


/* 云端地图相关样式 */
.custom-map-options {
    display: flex;
    gap: 10px;
}

.custom-map-options .pixel-btn {
    flex: 1;
}

/* 云端地图弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: 25px;
    width: 450px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

.modal-box h3 {
    color: #e94560;
    margin-bottom: 15px;
    font-size: 20px;
    text-align: center;
}

.modal-status {
    padding: 20px;
    text-align: center;
    color: #888;
}

.modal-status.error {
    color: #e74c3c;
}

.cloud-map-list {
    max-height: 300px;
    overflow-y: auto;
}

.cloud-map-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.cloud-map-item:hover {
    background: rgba(233, 69, 96, 0.2);
}

.cloud-map-thumb {
    width: 70px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cloud-map-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cloud-map-thumb.no-thumb {
    font-size: 10px;
    color: #666;
}

.cloud-map-item-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.cloud-map-item-name {
    font-size: 15px;
    font-weight: bold;
    color: #eee;
    margin-bottom: 4px;
}

.cloud-map-item-id {
    font-size: 12px;
    color: #888;
    font-family: monospace;
}

.cloud-map-item-actions {
    flex-shrink: 0;
    margin-left: 10px;
}

.cloud-like-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}


/* 缩略图预览弹窗 */
#thumbnail-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#thumbnail-preview.active {
    display: flex;
}

.thumb-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.thumb-preview-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.thumb-preview-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e94560;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-preview-close:hover {
    background: #ff6b6b;
}

/* 云端地图缩略图悬停效果 */
.cloud-map-thumb[data-thumb]:hover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s;
}


/* 已点赞按钮样式 */
.cloud-like-btn.liked {
    background: #27ae60 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ==================== 公开房间样式 ==================== */
.public-rooms-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #533483;
}

.public-rooms-section h4 {
    color: #e94560;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.public-rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.public-room-btn {
    padding: 10px 8px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    background: rgba(26, 26, 46, 0.9);
    color: #fff;
    border: 2px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border-radius: 5px;
}

.public-room-btn:hover {
    background: #533483;
    border-color: #e94560;
    transform: scale(1.02);
}

.public-room-btn.defuse {
    border-color: #ff6600;
}

.public-room-btn.defuse:hover {
    background: rgba(255, 102, 0, 0.3);
    border-color: #ff8800;
}

.public-room-btn.deathmatch {
    border-color: #4ade80;
}

.public-room-btn.deathmatch:hover {
    background: rgba(74, 222, 128, 0.3);
    border-color: #66ff99;
}

.public-room-mode {
    font-size: 10px;
    color: #888;
    margin-top: 3px;
}

.public-room-players {
    font-size: 9px;
    color: #4ade80;
    margin-top: 2px;
}

/* 手机端公开房间适配 */
@media (max-width: 768px), (pointer: coarse) {
    .public-rooms-section {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .public-rooms-section h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .public-rooms-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .public-room-btn {
        padding: 6px 4px;
        font-size: 9px;
    }
    
    .public-room-mode {
        font-size: 8px;
    }
    
    .public-room-players {
        font-size: 8px;
    }
}

/* 手机横屏公开房间 */
@media (max-height: 500px) and (orientation: landscape) {
    .public-rooms-section {
        margin-top: 4px;
        padding-top: 4px;
    }
    
    .public-rooms-section h4 {
        font-size: 9px;
        margin-bottom: 4px;
    }
    
    .public-rooms-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    
    .public-room-btn {
        padding: 3px 2px;
        font-size: 8px;
    }
    
    .public-room-mode,
    .public-room-players {
        display: none;
    }
}

/* ==================== 像素风格下拉框 ==================== */
.pixel-select-wrapper {
    position: relative;
    width: 100%;
}

.pixel-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #e94560;
    font-size: 10px;
    pointer-events: none;
    text-shadow: 1px 1px 0 #000;
    z-index: 2;
}

.pixel-select {
    width: 100%;
    padding: 12px 35px 12px 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #0a0a18 !important;
    border: 3px solid #533483 !important;
    border-radius: 0 !important;
    color: #fff !important;
    outline: none !important;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.1),
        inset -2px -2px 0 rgba(0,0,0,0.3),
        3px 3px 0 #2a1a4a;
    transition: all 0.15s;
    text-overflow: ellipsis;
}

.pixel-select:hover {
    border-color: #e94560 !important;
    background: #0f0f23 !important;
}

.pixel-select:focus {
    border-color: #e94560 !important;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.1),
        inset -2px -2px 0 rgba(0,0,0,0.3),
        3px 3px 0 #e94560,
        0 0 15px rgba(233, 69, 96, 0.3);
}

.pixel-select option {
    background: #0a0a18 !important;
    color: #fff !important;
    padding: 10px;
    font-family: 'Courier New', monospace;
}

.pixel-select option:hover,
.pixel-select option:checked {
    background: #533483 !important;
    color: #fff !important;
}

/* ==================== 右侧卡片容器 ==================== */
.right-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 260px;
    flex-shrink: 0;
}

/* ==================== 公开房间卡片样式 ==================== */
.public-rooms-card {
    border-color: #00ccff;
    box-shadow: 6px 6px 0 #0088aa;
}

.public-rooms-card h3 {
    color: #00ccff;
}

.public-rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(6px, 0.5vw, 10px);
}

.public-room-btn {
    padding: 12px 8px;
    font-family: 'Courier New', monospace;
    background: rgba(26, 26, 46, 0.9);
    color: #fff;
    border: 3px solid #533483;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 3px 3px 0 #333;
}

.public-room-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #333;
}

.public-room-btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.public-room-btn .room-name {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.public-room-btn .room-map {
    font-size: 10px;
    color: #888;
}

.public-room-btn .room-players {
    font-size: 11px;
    color: #4ade80;
    font-weight: bold;
}

.public-room-btn.defuse {
    border-color: #ff6600;
    box-shadow: 3px 3px 0 #aa4400;
}

.public-room-btn.defuse:hover {
    background: rgba(255, 102, 0, 0.2);
}

.public-room-btn.defuse .room-name {
    color: #ffaa66;
}

.public-room-btn.deathmatch {
    border-color: #4ade80;
    box-shadow: 3px 3px 0 #228844;
}

.public-room-btn.deathmatch:hover {
    background: rgba(74, 222, 128, 0.2);
}

.public-room-btn.deathmatch .room-name {
    color: #88ffaa;
}

/* ==================== 公告卡片优化 ==================== */
.announcement-content {
    max-height: none;
    overflow-y: visible;
}

.announcement-item {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #f59e0b;
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-date {
    color: #f59e0b;
    font-size: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.announcement-text {
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
}

/* ==================== 手机端抽屉菜单 ==================== */
#mobile-drawer-btns {
    display: none;
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 10px));
    left: 10px;
    z-index: 1001;
    gap: 8px;
}

.drawer-toggle-btn {
    width: 40px;
    height: 40px;
    background: rgba(15, 15, 35, 0.95);
    border: 2px solid #e94560;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #533483;
    transition: all 0.2s;
}

.drawer-toggle-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #533483;
}

#mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: rgba(15, 15, 35, 0.98);
    border-right: 4px solid #e94560;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#mobile-drawer.drawer-visible {
    transform: translateX(0);
}

#mobile-drawer.drawer-hidden {
    transform: translateX(-100%);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, #e94560, #533483);
    flex-shrink: 0;
}

#drawer-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.drawer-close-btn {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

#drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

#drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 抽屉内的公开房间样式 */
.drawer-rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.drawer-room-btn {
    padding: 12px 10px;
    font-family: 'Courier New', monospace;
    background: rgba(26, 26, 46, 0.9);
    color: #fff;
    border: 3px solid #533483;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 3px 3px 0 #333;
    transition: all 0.2s;
}

.drawer-room-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #333;
}

.drawer-room-btn.defuse {
    border-color: #ff6600;
    box-shadow: 3px 3px 0 #aa4400;
}

.drawer-room-btn.defuse:active {
    background: rgba(255, 102, 0, 0.2);
}

.drawer-room-btn.deathmatch {
    border-color: #4ade80;
    box-shadow: 3px 3px 0 #228844;
}

.drawer-room-btn.deathmatch:active {
    background: rgba(74, 222, 128, 0.2);
}

.drawer-room-btn .room-name {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.drawer-room-btn.defuse .room-name {
    color: #ffaa66;
}

.drawer-room-btn.deathmatch .room-name {
    color: #88ffaa;
}

.drawer-room-btn .room-map {
    font-size: 10px;
    color: #888;
}

.drawer-room-btn .room-players {
    font-size: 11px;
    color: #4ade80;
    font-weight: bold;
}

/* 抽屉内的公告样式 */
.drawer-announcement-item {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #f59e0b;
}

.drawer-announcement-date {
    color: #f59e0b;
    font-size: 10px;
    margin-bottom: 5px;
}

.drawer-announcement-text {
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
}

/* 抽屉内的玩法说明样式 */
.drawer-help-section {
    margin-bottom: 15px;
}

.drawer-help-section h4 {
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.drawer-help-section p {
    color: #fff;
    font-size: 11px;
    margin: 4px 0;
    display: flex;
    gap: 8px;
}

.drawer-help-section .key {
    background: #1a1a2e;
    color: #60a5fa;
    padding: 2px 6px;
    border: 1px solid #60a5fa;
    font-size: 10px;
    min-width: 40px;
    text-align: center;
}

/* ==================== 响应式布局优化 - 以2K屏幕为基准自适应 ==================== */

/* 基础样式 - 2K屏幕为基准 (scale 1.0) */
.menu-wrapper {
    transform-origin: center center;
}

/* 4K分辨率 (高度 >= 1800px) - 放大 */
@media (min-height: 1800px) {
    .menu-wrapper {
        transform: scale(1.35);
    }
}

/* 4K较小 (高度 1600px - 1799px) - 放大 */
@media (min-height: 1600px) and (max-height: 1799px) {
    .menu-wrapper {
        transform: scale(1.2);
    }
}

/* 2K分辨率 (高度 1300px - 1599px) - 基准1.1 */
@media (min-height: 1300px) and (max-height: 1599px) {
    .menu-wrapper {
        transform: scale(1.1);
    }
}

/* 2K较小/1080p大窗口 (高度 1080px - 1299px) - 缩小 */
@media (min-height: 1080px) and (max-height: 1299px) {
    .menu-wrapper {
        transform: scale(1.0);
    }
}

/* 1080p全屏 (高度 900px - 1079px) - 缩小 */
@media (min-height: 900px) and (max-height: 1079px) {
    .menu-wrapper {
        transform: scale(0.78);
    }
}

/* 1080p浏览器窗口 (高度 750px - 899px) - 缩小 */
@media (min-height: 750px) and (max-height: 899px) {
    .menu-wrapper {
        transform: scale(0.68);
    }
}

/* 小屏幕 (高度 650px - 749px) - 缩小 */
@media (min-height: 650px) and (max-height: 749px) {
    .menu-wrapper {
        transform: scale(0.6);
    }
}

/* 更小屏幕 (高度 550px - 649px) - 缩小 */
@media (min-height: 550px) and (max-height: 649px) {
    .menu-wrapper {
        transform: scale(0.52);
    }
}

/* 非常小的屏幕 (高度 < 550px) */
@media (max-height: 549px) {
    .menu-wrapper {
        transform: scale(0.45);
    }
}

@media (max-width: 1023px) {
    .menu-wrapper {
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px;
        gap: 15px;
    }
    
    .gameplay-card {
        display: none;
    }
    
    .right-cards {
        flex-direction: row;
        width: 100%;
        max-width: 800px;
    }
    
    .right-cards .info-card {
        flex: 1;
        width: auto;
    }
}

@media (max-width: 768px), (pointer: coarse) {
    #mobile-drawer-btns {
        display: flex;
    }
    
    .menu-wrapper {
        padding: 10px;
        transform: scale(1) !important;
    }
    
    .gameplay-card,
    .right-cards {
        display: none;
    }
    
    .menu-container {
        width: 100%;
        max-width: 100%;
        padding: 20px 15px;
        margin: 0;
        border-width: 3px;
        box-shadow: 5px 5px 0 #e94560;
    }
    
    .pixel-title {
        font-size: 32px;
    }
    
    .pixel-subtitle {
        font-size: 16px;
        padding: 4px 15px;
        margin-bottom: 15px;
    }
    
    .tab-buttons {
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 8px;
        font-size: 12px;
    }
    
    .input-group {
        margin: 10px 0;
    }
    
    .input-group label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .input-group input,
    .pixel-select {
        padding: 10px;
        font-size: 14px;
    }
    
    .team-btn {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .server-config {
        padding-top: 10px;
        margin-top: 10px;
    }
    
    .pixel-btn {
        padding: 12px 20px;
        font-size: 14px;
        margin-top: 10px;
    }
    
    .pixel-btn.small {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* 手机横屏 */
@media (max-height: 500px) and (orientation: landscape) {
    #mobile-drawer-btns {
        top: 5px;
        left: 5px;
    }
    
    .drawer-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .menu-wrapper {
        transform: scale(0.9);
    }
    
    .menu-container {
        padding: 10px;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .pixel-title {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .pixel-subtitle {
        font-size: 12px;
        padding: 3px 10px;
        margin-bottom: 8px;
    }
    
    .tab-buttons {
        margin-bottom: 8px;
    }
    
    .tab-btn {
        padding: 5px;
        font-size: 10px;
    }
    
    .input-group {
        margin: 6px 0;
    }
    
    .input-group label {
        font-size: 10px;
        margin-bottom: 3px;
    }
    
    .input-group input,
    .pixel-select {
        padding: 6px 8px;
        font-size: 11px;
        border-width: 2px;
    }
    
    .pixel-select-wrapper::after {
        right: 8px;
        font-size: 8px;
    }
    
    .team-select {
        gap: 5px;
    }
    
    .team-btn {
        padding: 6px 4px;
        font-size: 9px;
        border-width: 2px;
    }
    
    .server-config {
        padding-top: 6px;
        margin-top: 6px;
    }
    
    .server-input-group {
        gap: 5px;
    }
    
    .server-hint {
        font-size: 9px;
    }
    
    .pixel-btn {
        padding: 8px 15px;
        font-size: 11px;
        margin-top: 6px;
        box-shadow: 3px 3px 0 #533483;
    }
    
    .pixel-btn.small {
        padding: 4px 8px;
        font-size: 9px;
    }
}


/* ==================== 欢迎横幅样式 - 像素风格 ==================== */
.welcome-banner {
    margin-top: 60px;
    padding: 30px 15px;
    background: #0a0a18;
    border: 4px solid #e94560;
    position: relative;
    box-shadow: 
        6px 6px 0 #533483,
        inset 0 0 20px rgba(233, 69, 96, 0.1);
    image-rendering: pixelated;
}

/* 像素角落装饰 */
.welcome-banner::before,
.welcome-banner::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e94560;
}

.welcome-banner::before {
    top: -4px;
    left: -4px;
    box-shadow: 
        calc(100% + 0px) 0 0 #e94560,
        0 calc(100% + 0px) 0 #e94560,
        calc(100% + 0px) calc(100% + 0px) 0 #e94560;
}

.welcome-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.welcome-line1 {
    font-size: 18px;
    color: #4ade80;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
}

.welcome-line2 {
    font-size: 25px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 
        2px 0 0 #e94560,
        -2px 0 0 #e94560,
        0 2px 0 #e94560,
        0 -2px 0 #e94560,
        3px 3px 0 #533483;
    animation: pixel-bounce 0.8s ease-in-out infinite;
}

@keyframes pixel-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.welcome-line3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #fbbf24;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    animation: pixel-flash 1s steps(2) infinite;
}

.welcome-line3 .pixel-star {
    display: inline-block;
    animation: pixel-spin 2s linear infinite;
}

@keyframes pixel-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pixel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 扫描线效果 */
.welcome-banner .scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: scanline-move 2s linear infinite;
    pointer-events: none;
}

@keyframes scanline-move {
    0% { top: 0; }
    100% { top: 100%; }
}

/* 创建房间tab时隐藏欢迎横幅 */
#welcome-banner {
    display: block;
}

/* ==================== 快速加入弹窗样式 ==================== */
#quick-join-modal .modal-box {
    max-width: 350px;
}

.quick-join-box h3 {
    color: #4ade80;
    margin-bottom: 15px;
}

.quick-join-room-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#quick-join-room-name {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

#quick-join-room-mode {
    color: #888;
    font-size: 14px;
}

#quick-join-modal .input-group {
    margin: 15px 0;
}

#quick-join-modal .input-group label {
    color: #4ade80;
}

#quick-join-modal .input-group input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    border: 3px solid #4ade80;
    color: #fff;
    outline: none;
    text-align: center;
}

#quick-join-modal .input-group input:focus {
    border-color: #66ff99;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

#quick-join-modal .modal-actions {
    flex-direction: column;
    gap: 10px;
}

#quick-join-confirm {
    background: #4ade80;
    box-shadow: 4px 4px 0 #22c55e;
}

#quick-join-confirm:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #22c55e;
}

/* 快速加入弹窗阵营选择 */
.quick-join-team {
    display: flex;
    gap: 8px;
}

.quick-join-team .team-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
}

/* ==================== 游戏玩法卡片优化 ==================== */
.gameplay-card {
    max-height: calc(200vh);
    overflow-y: auto;
}

.gameplay-card .control-section h4 {
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gameplay-card .control-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.gameplay-card .control-section:last-child p {
    color: #fbbf24;
    font-size: 11px;
}

/* 响应式欢迎横幅 */
@media (max-width: 768px), (pointer: coarse) {
    .welcome-banner {
        margin-top: 12px;
        padding: 8px 10px;
        border-width: 3px;
        box-shadow: 4px 4px 0 #533483;
    }
    
    .welcome-line1 {
        font-size: 9px;
        letter-spacing: 2px;
    }
    
    .welcome-line2 {
        font-size: 14px;
        letter-spacing: 1px;
    }
    
    .welcome-line3 {
        font-size: 10px;
        gap: 5px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .welcome-banner {
        display: none !important;
    }
}
