/* Net-Games 斗地主 - 客户端样式 */ /* 基于 happy-games 斗地主风格 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: linear-gradient(135deg, #0d2847 0%, #1a3a5c 50%, #0d2847 100%); min-height: 100vh; overflow: hidden; color: white; } /* ========== 连接状态栏 ========== */ .connection-bar { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; gap: 15px; padding: 0 20px; z-index: 10000; border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .connection-status { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 15px; font-size: 14px; font-weight: bold; } .connection-status.connected { background: rgba(46, 204, 113, 0.2); color: #2ecc71; } .connection-status.disconnected { background: rgba(231, 76, 60, 0.2); color: #e74c3c; } .connection-status.connecting { background: rgba(52, 152, 219, 0.2); color: #3498db; animation: pulse 1.5s infinite; } .connection-status.reconnecting { background: rgba(241, 196, 15, 0.2); color: #f1c40f; animation: pulse 1s infinite; } .connection-status.failed { background: rgba(155, 89, 182, 0.2); color: #9b59b6; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.5s infinite; } @keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .connection-bar input { padding: 8px 12px; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; background: rgba(255,255,255,0.1); color: white; width: 200px; font-size: 13px; } .connection-bar input::placeholder { color: rgba(255,255,255,0.5); } /* ========== 按钮基础样式 ========== */ .btn { padding: 10px 25px; border: none; border-radius: 25px; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 8px rgba(0,0,0,0.3); color: white; } .btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.4); } .btn:active:not(:disabled) { transform: translateY(0); } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn-small { padding: 6px 15px; font-size: 12px; } .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); } .btn-secondary { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); } .btn-hint { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); } .btn-start { padding: 15px 50px; font-size: 18px; background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%); color: #333; width: 100%; margin-top: 10px; } /* ========== 欢迎界面 ========== */ .welcome-screen { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; padding: 20px; } .welcome-content { background: linear-gradient(135deg, rgba(26,58,92,0.9) 0%, rgba(13,40,71,0.9) 100%); padding: 40px 50px; border-radius: 20px; border: 2px solid rgba(255,215,0,0.3); max-width: 450px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); } .welcome-content h1 { font-size: 32px; margin-bottom: 10px; background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .subtitle { color: rgba(255,255,255,0.6); margin-bottom: 30px; } .name-input-area { margin-bottom: 25px; text-align: left; } .name-input-area label { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.8); font-size: 14px; } .name-input-area input { width: 100%; padding: 12px 15px; border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; background: rgba(255,255,255,0.1); color: white; font-size: 16px; text-align: center; } /* 用户积分显示 */ .user-score-area { margin: 15px 0; padding: 12px 20px; background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 25px; display: inline-block; } .score-display { display: flex; align-items: center; gap: 8px; font-size: 15px; } .score-label { color: #fbbf24; } .score-value { font-weight: bold; color: #f59e0b; font-size: 18px; } .game-options { background: rgba(0,0,0,0.2); padding: 20px; border-radius: 15px; margin-bottom: 20px; text-align: left; } .game-options h3 { text-align: center; margin-bottom: 15px; color: #ffd700; } .option-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; } .option-row label { color: rgba(255,255,255,0.8); font-size: 14px; } .option-row select { padding: 8px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3); color: white; min-width: 120px; } .option-row select option { background: #1a3a5c; color: white; } .divider { margin: 20px 0; color: rgba(255,255,255,0.4); position: relative; } .divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 80px; height: 1px; background: rgba(255,255,255,0.2); } .divider::before { left: 20px; } .divider::after { right: 20px; } .join-area { display: flex; gap: 10px; } .join-area input { flex: 1; padding: 12px 15px; border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; background: rgba(255,255,255,0.1); color: white; font-size: 16px; text-align: center; text-transform: uppercase; } /* ========== 游戏容器 ========== */ .game-container { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; max-width: 1200px; margin: 0 auto; } /* 房间信息 */ .room-info { position: absolute; top: 10px; right: 20px; display: flex; gap: 15px; align-items: center; background: rgba(0,0,0,0.4); padding: 8px 16px; border-radius: 20px; font-size: 14px; } .room-code { color: #ffd700; font-weight: bold; } .game-status-text { color: rgba(255,255,255,0.8); } /* ========== 扑克牌样式 ========== */ .card { width: 80px; height: 112px; background: white; border-radius: 8px; border: 1px solid #ccc; display: flex; flex-direction: column; justify-content: space-between; padding: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; user-select: none; position: relative; overflow: hidden; color: #2c3e50; } .card:hover { transform: translateY(-5px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); } .card.selected { transform: translateY(-15px); box-shadow: 0 6px 16px rgba(255,215,0,0.4); border-color: #ffd700; } .card.back { background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8f 50%, #1e3a5f 100%); border: 2px solid #4a7ab8; display: flex; align-items: center; justify-content: center; } .card.back::after { content: '♠'; font-size: 32px; color: rgba(255,255,255,0.3); } .card-small { width: 40px; height: 56px; border-radius: 4px; } .card-top, .card-bottom { font-size: 14px; font-weight: bold; line-height: 1; } .card-bottom { transform: rotate(180deg); } .card-center { font-size: 36px; text-align: center; line-height: 1; } .card .red { color: #e74c3c; } .card .black { color: #2c3e50; } /* ========== 顶牌区 ========== */ .deck-area { position: absolute; top: 60px; left: 20px; display: flex; flex-direction: column; align-items: center; gap: 5px; } .deck-label { color: #ffd700; font-size: 14px; font-weight: bold; } .deck-cards { display: flex; } .deck-cards .card { width: 50px; height: 70px; margin-left: -15px; } .deck-cards .card:first-child { margin-left: 0; } /* ========== 玩家样式 ========== */ .avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; } .avatar-img { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 18px; border: 3px solid rgba(255,255,255,0.3); box-shadow: 0 2px 8px rgba(0,0,0,0.3); } .avatar-img.me { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); } .avatar-img.landlord { border-color: #ffd700; box-shadow: 0 0 15px rgba(255,215,0,0.5); } /* 倒计时显示 */ .countdown { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #3498db, #2980b9); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; color: white; border: 2px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.3); opacity: 0; transition: all 0.3s; } .countdown.active { opacity: 1; } .countdown.warning { background: linear-gradient(135deg, #e74c3c, #c0392b); animation: pulse-countdown 1s infinite; } @keyframes pulse-countdown { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } } /* 托管标识 */ .trustee-badge { position: absolute; top: -5px; left: 50%; transform: translateX(-50%); padding: 2px 8px; background: linear-gradient(135deg, #9b59b6, #8e44ad); color: white; font-size: 10px; font-weight: bold; border-radius: 10px; border: 2px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.3); white-space: nowrap; opacity: 0; transition: all 0.3s; z-index: 10; } .trustee-badge.active { opacity: 1; } /* 托管按钮样式 */ .btn-trustee { background: linear-gradient(135deg, #9b59b6, #8e44ad); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.3s; } .btn-trustee:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4); } .btn-trustee.active { background: linear-gradient(135deg, #e74c3c, #c0392b); } .btn-trustee:disabled { opacity: 0.5; cursor: not-allowed; } .avatar { position: relative; } .player-name { color: white; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); } .player-role { color: #ffd700; font-size: 11px; background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 10px; } /* 左侧玩家 */ .left-player { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; } .left-player .card-count { color: #ffd700; font-size: 14px; font-weight: bold; } /* 右侧玩家 */ .right-player { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; } .right-player .card-count { color: #ffd700; font-size: 14px; font-weight: bold; } /* 牌背堆叠 */ .card-stack { position: relative; width: 40px; height: 56px; } .card-stack .card-small { position: absolute; top: 0; left: 0; } .card-stack .card-small:nth-child(1) { transform: translate(0, 0); } .card-stack .card-small:nth-child(2) { transform: translate(2px, -2px); } .card-stack .card-small:nth-child(3) { transform: translate(4px, -4px); } /* ========== 桌面出牌区 ========== */ .table-area { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; height: 200px; display: flex; align-items: center; justify-content: center; } .last-played { text-align: center; } .played-by { color: #ffd700; font-size: 16px; font-weight: bold; margin-bottom: 15px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); background: rgba(0,0,0,0.3); padding: 5px 15px; border-radius: 15px; display: inline-block; } .played-cards { display: flex; justify-content: center; gap: 5px; min-height: 112px; } /* ========== 底部玩家 ========== */ .player-self { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; max-width: 800px; } .self-info { display: flex; align-items: center; gap: 15px; } /* 手牌区 */ .hand-cards { display: flex; justify-content: center; padding: 20px; min-height: 140px; } .hand-cards .card { margin-left: -30px; } .hand-cards .card:first-child { margin-left: 0; } /* 操作按钮 */ .action-buttons { display: flex; gap: 15px; } /* ========== 弹窗 ========== */ .call-lord-modal, .game-over-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 9999; } .modal-content { background: linear-gradient(135deg, #1a3a5c 0%, #0d2847 100%); padding: 40px 60px; border-radius: 20px; border: 2px solid #4a7ab8; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); } .modal-content h3 { color: white; margin-bottom: 25px; font-size: 24px; } .modal-buttons { display: flex; gap: 20px; justify-content: center; } .game-result { margin: 20px 0; padding: 20px; background: rgba(0,0,0,0.3); border-radius: 10px; font-size: 18px; max-height: 400px; overflow-y: auto; } .game-result .winner { font-size: 22px; font-weight: bold; color: #ffd700; margin-bottom: 8px; } .game-result .winner-identity { font-size: 16px; color: #aaa; margin-bottom: 10px; } .game-result .my-result { font-size: 20px; margin: 15px 0; padding: 10px; border-radius: 8px; } .game-result .score-changes { margin-top: 20px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.2); } .game-result .score-title { font-size: 16px; font-weight: bold; margin-bottom: 10px; color: #4a7ab8; } .game-result .score-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0; font-size: 15px; } .game-result .score-me { background: rgba(74, 122, 184, 0.3); border-radius: 6px; padding: 8px 12px; } .game-result .score-identity { font-size: 16px; } .game-result .score-name { min-width: 80px; text-align: left; } .game-result .score-change { font-weight: bold; min-width: 40px; } .game-result .score-up { color: #4ade80; } .game-result .score-down { color: #f87171; } .game-result .score-zero { color: #9ca3af; } .game-result .score-total { font-size: 13px; color: #888; } .game-result .score-guest { font-size: 12px; color: #666; font-style: italic; } /* ========== 日志面板 ========== */ .log-panel { position: fixed; bottom: 10px; left: 10px; width: 300px; max-height: 200px; background: rgba(0,0,0,0.7); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; z-index: 1000; } .log-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); } .log-header button { background: none; border: none; color: #ffd700; cursor: pointer; font-size: 11px; } .log-content { padding: 10px; overflow-y: auto; max-height: 150px; } .log-entry { margin-bottom: 5px; padding: 4px 8px; border-radius: 4px; background: rgba(255,255,255,0.05); } .log-entry.system { color: #aaa; } .log-entry.action { color: #4facfe; } .log-entry.card { color: #ffd700; } .log-entry.error { color: #e74c3c; } .log-entry.success { color: #2ecc71; } /* ========== 当前玩家指示器 ========== */ .turn-indicator { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 3px solid #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); animation: pulse-ring 1.5s infinite; pointer-events: none; display: none; } .turn-indicator.active { display: block; } @keyframes pulse-ring { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } } /* ========== 响应式适配 ========== */ @media (max-width: 768px) { .card { width: 60px; height: 84px; } .card-small { width: 30px; height: 42px; } .avatar-img { width: 50px; height: 50px; font-size: 14px; } .hand-cards .card { margin-left: -20px; } .btn { padding: 8px 20px; font-size: 14px; } .welcome-content { padding: 30px; margin: 10px; } .table-area { width: 280px; } .log-panel { width: calc(100% - 20px); max-height: 150px; } } @media (max-width: 480px) { .connection-bar { flex-wrap: wrap; height: auto; padding: 10px; gap: 8px; } .connection-bar input { width: 150px; } .welcome-content h1 { font-size: 24px; } .game-container { top: 80px; } } /* ========== 竖屏手机适配 ========== */ @media (max-width: 480px) and (orientation: portrait) { .game-container { min-width: 100vw; min-height: calc(100vh - 50px); } /* 手牌区 - 更紧凑,可横向滚动 */ .hand-cards { padding: 10px 5px; min-height: 100px; max-width: 100vw; overflow-x: auto; -webkit-overflow-scrolling: touch; } .hand-cards .card { margin-left: -35px; transform: scale(0.85); } .hand-cards .card:first-child { margin-left: 5px; } .hand-cards .card:last-child { margin-right: 10px; } /* 牌选中效果调整 */ .hand-cards .card.selected { transform: scale(0.85) translateY(-15px); } /* 左右玩家位置调整 */ .left-player { left: 5px; } .right-player { right: 5px; } .left-player .avatar, .right-player .avatar { transform: scale(0.8); } /* 中央区域调整 */ .table-area { width: 200px; height: 150px; } .played-cards { min-height: 80px; } .played-cards .card { transform: scale(0.7); } /* 按钮调整 */ .action-buttons { gap: 8px; padding: 0 10px; } .btn { padding: 8px 15px; font-size: 13px; border-radius: 20px; } /* 顶牌区域调整 */ .deck-area { top: 60px; left: 10px; } .deck-cards .card { transform: scale(0.6); } /* 叫地主弹窗调整 */ .modal-content { padding: 30px 20px; width: 85%; max-width: 300px; } .modal-content h3 { font-size: 20px; } .modal-buttons { gap: 15px; } /* 房间信息 */ .room-info { top: 5px; right: 5px; padding: 5px 10px; font-size: 12px; flex-wrap: wrap; max-width: 150px; justify-content: flex-end; } /* 日志面板 */ .log-panel { width: calc(100% - 20px); left: 10px; right: 10px; bottom: 5px; } } /* ========== 横屏手机适配 ========== */ @media (max-height: 500px) and (orientation: landscape) { .game-container { min-height: calc(100vh - 50px); transform: scale(0.9); transform-origin: center top; } /* 顶部底牌区上移 */ .deck-area { top: 5px; left: 10px; } .deck-cards .card { transform: scale(0.5); } /* 左右玩家位置上移 */ .left-player, .right-player { top: 25%; } .avatar-img { width: 40px; height: 40px; font-size: 12px; } .player-name { font-size: 10px; } .player-role { font-size: 9px; padding: 1px 5px; } /* 手牌区 - 整体下移,确保最高点击层级 */ .player-self { bottom: 10px; max-width: 98%; z-index: 1000; } .self-info { display: none; } .hand-cards { padding: 2px; min-height: 60px; margin-bottom: 5px; z-index: 1001; position: relative; } .hand-cards .card { margin-left: -40px; transform: scale(0.44); } .hand-cards .card.selected { transform: scale(0.44) translateY(-6px); } /* 按钮位置调整 */ .action-buttons { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); gap: 10px; margin: 0; } .btn { padding: 5px 15px; font-size: 12px; } /* 中央区域 - 居中显示 */ .table-area { width: 200px; height: 100px; top: 50%; transform: translate(-50%, -50%); } .played-cards { min-height: 50px; } .played-cards .card { transform: scale(0.5); } .played-by { font-size: 11px; margin-bottom: 5px; padding: 4px 12px; } .last-played { margin-top: 5px; } /* 房间信息 */ .room-info { top: 5px; right: 5px; padding: 4px 8px; font-size: 11px; gap: 8px; } /* 叫地主弹窗 */ .modal-content { padding: 20px 30px; transform: scale(0.9); } .modal-content h3 { font-size: 18px; margin-bottom: 15px; } .btn { padding: 8px 20px; font-size: 14px; } /* 日志面板 - 移到右上角,避免遮挡手牌 */ .log-panel { width: 180px; max-height: 100px; font-size: 10px; left: auto; right: 5px; bottom: auto; top: 5px; z-index: 100; /* 低于手牌的1001 */ pointer-events: none; /* 让点击穿透到下方元素 */ } .log-panel:hover { pointer-events: auto; /* 悬停时可交互 */ } .log-header, .log-content { pointer-events: auto; /* 日志内容本身可点击 */ } .log-header { padding: 4px 8px; } .log-content { padding: 4px; max-height: 70px; } } /* ========== 不要 弹出提示 ========== */ .pass-popup { position: absolute; top: -30px; left: 50%; transform: translateX(-50%) scale(0); background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; padding: 8px 16px; border-radius: 20px; font-size: 16px; font-weight: bold; box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5); z-index: 100; opacity: 0; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); white-space: nowrap; pointer-events: none; } .pass-popup.show { transform: translateX(-50%) scale(1); opacity: 1; top: -45px; } /* 左侧玩家的弹出位置 */ .left-player .pass-popup { left: auto; right: -20px; transform: translateX(0) scale(0); } .left-player .pass-popup.show { transform: translateX(0) scale(1); } /* 右侧玩家的弹出位置 */ .right-player .pass-popup { left: -20px; transform: translateX(0) scale(0); } .right-player .pass-popup.show { transform: translateX(0) scale(1); } /* 自己(底部)的弹出位置 */ .player-self .pass-popup { top: -50px; left: 50%; transform: translateX(-50%) scale(0); } .player-self .pass-popup.show { transform: translateX(-50%) scale(1); top: -65px; }