/* --- classic-cyber.css : 赛博朋克 (无边框沉浸版) --- */

/* ================== 1. 全局定义 ================== */
/* 引入科技感字体，如果没有网络则回退到系统字体 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

body {
    /* 赛博调色板 - 霓虹夜城 */
    --bg-base: #050510;          /* 深空黑蓝背景 */
    --primary: #00f3ff;          /* 霓虹青 (主色) */
    --primary-soft: #00f3ff80;   /* 半透明青 */
    --primary-dark: #008b94;     /* 深青 */
    --secondary: #ff2a6d;        /* 赛博粉 (强调色) */
    --secondary-soft: #ff2a6d80; /* 半透明粉 */
    --accent: #f7e700;           /* 警示黄 (高亮) */
    --text-main: #e0fbfc;        /* 荧光白文字 */
    
    background-color: var(--bg-base) !important;
    color: var(--text-main);      
    /* 优先使用科技字体 */
    font-family: 'Orbitron', 'Segoe UI', Roboto, sans-serif;
    
    margin: 0; padding: 0; width: 100vw; height: 100dvh; overflow: hidden;
    display: flex !important; justify-content: center !important; align-items: center !important;
}

.bg-orb { display: none !important; }

/* 表情包保持原样，增加发光滤镜 */
.big-emoji-fly {
    font-size: 100px !important; 
    line-height: 1 !important; 
    width: auto !important; 
    height: auto !important; 
    position: fixed; z-index: 9999 !important; pointer-events: none !important; 
    filter: drop-shadow(0 0 10px var(--primary)); /* 增加发光效果 */
}

/* ================== 2. 屏幕容器 ================== */
.screen {
    flex-direction: column !important;
    width: 100%; height: 100%; max-width: 480px;
    position: relative; overflow: hidden;
    
    /* 背景改为深色半透明 */
    background: rgba(5, 5, 16, 0.85); 
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-style: preserve-3d; 
    z-index: 1;
}
.screen.active-screen { display: flex !important; }

/* ★★★ 赛博风格背景层 (网格线) ★★★ */
.screen::before {
    content: ""; position: absolute; inset: 0; z-index: -2; 
    /* 绘制赛博网格 */
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px; /* 网格大小 */
    background-position: center top;
    opacity: 0.5; pointer-events: none;
}

/* ★★★ 赛博风格背景层 (暗角光晕) ★★★ */
.screen::after {
    content: ""; position: absolute; inset: 0; z-index: -1; 
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(5, 5, 16, 0.8) 90%);
    pointer-events: none;
}

/* ========= PC/平板横屏适配 ========= */
@media (min-width: 500px) {
    .screen {
        /* PC端增加发光边框 */
        border: 2px solid var(--primary); 
        border-radius: 20px;
        box-shadow: 0 0 30px rgba(0, 243, 255, 0.3); 
        height: 95vh; margin-top: 2vh;
        overflow: hidden; 
    }
}

/* ================== 3. 头部 Header ================== */
#gameHeader {
    width: 100%; height: 56px; min-height: 56px; flex-shrink: 0;
    display: flex; align-items: center; padding: 0 10px;
    
    /* 头部背景加深 */
    background: rgba(0, 0, 0, 0.8);
    /* 底部增加发光线 */
    border-bottom: 1px solid var(--primary); 
    box-shadow: 0 4px 10px rgba(0, 243, 255, 0.1);
    
    position: relative; gap: 0 !important; 
    z-index: 500;
}
#gameHeader::after {
    content: "⚡ 酒局大咖"; /* 修改文字为英文更符合科技风 */
    font-size: 16px; font-weight: 900; letter-spacing: 2px; 
    color: var(--primary); 
    text-shadow: 0 0 8px var(--primary); /* 文字霓虹发光 */
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); 
    pointer-events: none; z-index: 10; white-space: nowrap;
}

#headerRoomCode {
    font-family: 'Orbitron', monospace; /* 等宽字体 */
    font-weight: 800; font-size: 14px; 
    color: var(--primary); 
    background: rgba(0, 243, 255, 0.1); 
    border: 1px solid var(--primary); 
    border-radius: 4px; /* 稍微方一点 */
    height: auto; min-height: 32px; 
    padding: 2px 10px 4px 10px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    align-self: center; margin-right: auto; line-height: 1.1; 
    box-shadow: 0 0 5px var(--primary-soft);
}
#headerRoomCode::before {
    content: "房间号码"; font-size: 10px; color: var(--secondary); 
    margin-bottom: 0px; font-weight: bold; letter-spacing: 1px; line-height: 1;
    display: block; transform: scale(0.9); transform-origin: center bottom;
}

/* ================== 右侧：皮肤选择 (衣服图标) ================== */
#skinSelectWrapper { 
    position: relative; z-index: 200; 
    margin: 0 !important; margin-right: 6px !important; width: auto !important;
    align-self: center;
}
#skinSelectWrapper .custom-select-trigger {
    background: rgba(0, 0, 0, 0.5); 
    border: 1px solid var(--secondary); 
    border-radius: 50%; width: 32px; height: 32px; 
    padding: 0; color: transparent; font-size: 0; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 5px var(--secondary-soft); 
    transition: all 0.2s ease; position: relative;
}
#skinSelectWrapper .custom-select-trigger::after {
    content: "👕"; 
    font-size: 18px; line-height: 1; 
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); 
    opacity: 1 !important; color: #ffffff !important;
    filter: drop-shadow(0 0 2px var(--secondary));
}
#skinSelectWrapper .custom-select-trigger:active { transform: scale(0.95); background: var(--secondary); }
#skinSelectWrapper .custom-options { width: 110px; right: -35px; left: auto; margin-top: 8px; background: #000; border: 1px solid var(--primary); }

/* ================== 4. 头像栏 ================== */
#topAvatarBar { 
    width: 100%; padding: 10px 20px 0 20px; flex-shrink: 0; 
    display: flex; gap: 12px; align-items: flex-start; 
    overflow-x: auto; scrollbar-width: none;
}

.top-player-item { 
    display: flex; flex-direction: column; align-items: center; 
    width: 48px; min-width: 48px; opacity: 0.7; transition: all 0.3s; 
    position: relative; z-index: 1;
}
.top-player-item.active { opacity: 1; transform: translateY(2px) scale(1.05); }

.avatar-wrapper {
    position: relative; width: 42px; height: 42px; margin: 0 auto;
    border-radius: 50%; z-index: 10;
    /* 增加头像发光 */
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.top-p-img { 
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; 
    border-radius: 50%; 
    background: #000; 
    border: 2px solid var(--primary-dark); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 1; 
}
.top-player-item.active .top-p-img { 
    border-color: var(--primary); 
    box-shadow: 0 0 8px var(--primary); /* 激活状态强发光 */
}

/* 视频图层 */
.avatar-video-embed, .avatar-wrapper video {
    position: absolute !important; top: 0; left: 0; width: 100% !important; height: 100% !important;
    border-radius: 50% !important; object-fit: cover !important; transform: scaleX(-1);
    background: transparent !important; opacity: 0 !important; z-index: 5 !important;
    pointer-events: none; transition: opacity 0.3s;
}
.avatar-video-embed.video-active, .avatar-wrapper video.video-active {
    opacity: 1 !important; background: transparent !important; pointer-events: auto;
}

.kick-layer, .badge-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20 !important; }
.top-p-name { 
    font-size: 10px; color: var(--primary); font-weight: 700; margin-top: 4px; width: 100%; text-align: center; 
    text-shadow: 0 0 3px var(--primary); /* 名字发光 */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

/* 徽章样式：改为高对比度标签 */
.host-badge, .spectator-badge, .offline-badge { 
    position: absolute; 
    bottom: -2px; 
    right: -6px; 
    z-index: 30 !important;
    border-radius: 2px; 
    
    /* 1. 调整内边距：改小一点 */
    padding: 0px 2px; 
    
    /* 2. 字体设置：建议写稍微大一点（如10px），然后用缩放变小，这样字迹更清晰 */
    font-size: 10px; 
    line-height: 1.1;
    
    /* 3. ★★★ 核心修改：整体缩放为原来的 0.7 倍 (根据需要调整 0.6 - 0.9) ★★★ */
    transform: scale(0.8);
    
    /* 4. 缩放锚点：固定在右下角，这样缩放时不会跑偏 */
    transform-origin: bottom right;
    
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    
    /* 强制不换行 */
    white-space: nowrap;
}
.host-badge { background: var(--accent); color: #000; font-weight: bold; border-color: var(--accent); }
.spectator-badge { background: #000; color: #aaa; border: 1px solid #555; }
.offline-badge { background: #222; color: #555; }

.kick-btn-layer { 
    position: absolute; top: -2px; right: -2px; z-index: 100 !important; 
    width: 18px; height: 18px; border-radius: 50%;
    background-color: #000; color: var(--secondary); border: 1px solid var(--secondary); 
    display: flex; justify-content: center; align-items: center; 
    font-size: 10px; font-weight: 900; line-height: 1; cursor: pointer;
    box-shadow: 0 0 5px var(--secondary); pointer-events: auto;
}

.mic-icon-layer {
    position: absolute; bottom: -2px; left: -4px; z-index: 30;
    width: 20px; height: 20px; border-radius: 50%;
    background: #000; border: 1px solid #555; color: #555;
    display: flex; justify-content: center; align-items: center; font-size: 11px;
    opacity: 0; transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); pointer-events: none;
}
.mic-icon-layer.active { opacity: 1; background: #000; border-color: var(--primary); color: var(--primary); }
.mic-icon-layer.active::after { content: "🎤"; }
.mic-icon-layer.active.talking { background: var(--primary); border-color: #fff; color: #000; transform: scale(1.15); box-shadow: 0 0 10px var(--primary); }
.mic-icon-layer.muted { opacity: 1; background: #220; border-color: var(--secondary); color: var(--secondary); }
.mic-icon-layer.muted::after { content: "🚫"; font-size: 10px; }
.player-offline .mic-icon-layer { display: none !important; }

/* ================== 5. 玩法选择与媒体控制 ================== */
#gameModeSelectWrapper { 
    width: auto; max-width: 200px; margin: 10px auto 4px auto; position: relative; z-index: 100;
}
#gameModeSelectWrapper .custom-select-trigger {
    background-color: rgba(0,0,0,0.6) !important; 
    background-image: none !important;
    border: 1px solid var(--primary) !important; 
    border-radius: 4px; /* 改为硬朗的切角风格 */
    color: var(--primary) !important; 
    height: 32px; padding: 0 16px; 
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2) !important;
    white-space: nowrap; transition: all 0.3s;
    text-shadow: 0 0 2px var(--primary);
}

#gameModeSelectWrapper .custom-select-trigger::before { 
    display: none !important; 
}

#gameModeSelectWrapper .custom-select-trigger:active { 
    transform: translateY(1px) scale(0.98); 
    background: var(--primary) !important; 
    color: #000 !important;
    text-shadow: none;
}
#gameModeSelectWrapper .custom-options { width: 150px; left: 50%; margin-left: -75px; transform: none; margin-top: 6px; transform-origin: top center; animation: dropdownPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-options { 
    background: #0a0b16 !important; 
    border: 1px solid var(--primary); 
    border-radius: 4px; 
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2); 
    padding: 5px; overflow: hidden; 
}
.custom-option { 
    padding: 10px 10px; border-radius: 2px; 
    color: var(--primary) !important; 
    font-size: 12px; font-weight: 600; 
    border-bottom: 1px dashed #333; 
    transition: background 0.2s; text-align: center; 
}
.custom-option:last-child { border-bottom: none; }
.custom-option.selected, .custom-option:hover { background: var(--primary) !important; color: #000 !important; }

#mediaControls {
    display: flex; flex-direction: row; justify-content: center; align-items: center;
    gap: 12px; width: 100%; margin: 5px 0 10px 0; position: relative; z-index: 150;
    min-height: 40px; transition: opacity 0.3s;
}
#mediaControls.hidden { display: none !important; }

.media-btn {
    width: 38px; height: 38px; border-radius: 50%; 
    background: rgba(0,0,0,0.5); border: 1px solid var(--primary-dark);
    color: var(--primary-dark); 
    font-size: 16px; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.2s; box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.media-btn.active { 
    background: rgba(0, 243, 255, 0.2); 
    color: var(--primary); 
    border-color: var(--primary); 
    box-shadow: 0 0 10px var(--primary); 
    transform: translateY(-1px); 
    text-shadow: 0 0 5px var(--primary);
}
.media-btn.off { background: rgba(0,0,0,0.3); color: #555; border-color: #333; }
.media-btn:active { transform: scale(0.95); }

.btn-host-toggle {
    display: flex; align-items: center; justify-content: center;
    margin: 0 !important; height: 38px; padding: 0 16px; white-space: nowrap;
    border: 1px solid var(--accent); border-radius: 4px; font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: bold; cursor: pointer; transition: all 0.3s;
    background: transparent; color: var(--accent);
    text-shadow: 0 0 5px var(--accent);
}
.btn-host-toggle.active { 
    background: var(--accent); 
    color: #000; 
    box-shadow: 0 0 15px var(--accent); 
    text-shadow: none;
}
.btn-host-toggle.deactive { background: transparent; border: 1px solid #555; color: #555; text-shadow: none; }

/* ================== 6. 任务卡片 ================== */
#cardArea { 
    flex: 1; width: 100%; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    padding: 10px 0; perspective: 1000px; 
}

.card-box { 
    width: 85%; max-width: 320px; height: auto; max-height: 50vh; min-height: 180px; 
    padding: 30px; text-align: center; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    position: relative; 
    
    /* 科技感卡片背景 */
    background: rgba(10, 10, 20, 0.85);
    background-image: linear-gradient(0deg, transparent 95%, rgba(0, 243, 255, 0.1) 100%); /* 扫描线效果 */
    background-size: 100% 10px;
    
    border: 1px solid var(--primary); /* 细边框 */
    border-radius: 8px; /* 稍微方一点的圆角 */
    
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(0, 243, 255, 0.05); /* 内外发光 */
    transform-style: preserve-3d; transition: transform 0.6s; 
    color: #fff; 
    z-index: 2; 
}
.active-turn .card-box { 
    border-color: var(--secondary); 
    box-shadow: 0 0 30px rgba(255, 42, 109, 0.3), inset 0 0 10px rgba(255, 42, 109, 0.2); 
    background-image: linear-gradient(0deg, transparent 95%, rgba(255, 42, 109, 0.1) 100%);
}
.card-content { 
    font-size: 20px; font-weight: 800; line-height: 1.6; 
    width: 100%; flex-grow: 1; 
    display: flex; align-items: center; justify-content: center; overflow-y: auto; 
    text-shadow: 0 0 5px var(--primary); /* 文字常亮 */
}
.active-turn .card-content { text-shadow: 0 0 5px var(--secondary); }

.card-sub { 
    margin-top: 15px; font-size: 11px; font-weight: bold; 
    color: var(--primary-dark); 
    text-transform: uppercase; letter-spacing: 2px; 
}
.card-type { 
    position: absolute; top: 0; left: 0; 
    font-size: 10px; font-weight: 800; 
    padding: 4px 12px; 
    border-radius: 4px 0 8px 0; 
    background: var(--primary); 
    color: #000; 
    box-shadow: 0 0 10px var(--primary);
}

/* ================== 7. 底部区域 ================== */
#gameFooter { 
    width: 100%; flex-shrink: 0;
    background: transparent !important; border-top: none !important; 
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: center;
    gap: 15px; 
    /* ★★★ 新增：强制开启硬件加速，防止闪烁 ★★★ */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
}

#actionBtnContainer { 
    width: 85%; max-width: 320px; display: flex; justify-content: center;
    background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;
}

#drawBtn, #doneBtn, #joinBattleBtn { 
    width: 100%; height: 56px; font-size: 18px; font-weight: 800; letter-spacing: 3px; 
    border: none; border-radius: 4px; 
    /* 赛博渐变 */
    background: linear-gradient(90deg, var(--secondary), #d0004e); 
    color: #fff; 
    text-shadow: 0 0 5px #fff;
    box-shadow: 0 0 15px var(--secondary-soft); 
    transition: transform 0.1s; 
    font-family: 'Orbitron', sans-serif;
    /* 切角效果 */
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
#drawBtn:active { transform: scale(0.98); background: #fff; color: var(--secondary); }
.btn-green { 
    background: linear-gradient(90deg, var(--primary), #00bcd4) !important; 
    color: #000 !important; text-shadow: none !important;
    box-shadow: 0 0 15px var(--primary-soft) !important;
}
.btn-join { background: linear-gradient(90deg, var(--accent), #ff9800) !important; color: #000 !important; animation: none; }

.interaction-bar { 
    display: flex; gap: 18px; justify-content: center; width: 100%;
    margin-bottom: 5px;
}
.emoji-btn { 
    width: 48px; height: 48px; border-radius: 50%; font-size: 24px; 
    display: flex; justify-content: center; align-items: center; 
    background: rgba(0,0,0,0.6); 
    border: 1px solid var(--primary); 
    box-shadow: 0 0 8px var(--primary-soft); 
    transition: transform 0.1s; 
    color: #fff;
}
.emoji-btn:active { transform: scale(1.15); background: var(--primary); border-color: transparent; color: #000; box-shadow: 0 0 20px var(--primary); }

/* --- 极速五秒倒计时 --- */
#rf-timer-overlay {
    position: absolute; 
    top: -25px !important; 
    left: 50% !important; 
    transform: translateX(-50%) !important; 
    
    font-size: 60px !important; 
    font-weight: 900; font-family: 'Orbitron', sans-serif;
    pointer-events: none; z-index: 50;
    
    color: var(--secondary); 
    text-shadow: 0 0 15px var(--secondary); /* 强发光 */
    opacity: 0.9; transition: all 0.3s ease-out;
}
#rf-timer-overlay.warning { color: var(--accent); text-shadow: 0 0 15px var(--accent); transform: translateX(-50%) scale(1.1) !important; }
#rf-timer-overlay.danger { color: #ff0000; text-shadow: 0 0 20px #ff0000; transform: translateX(-50%) scale(1.2) !important; }
#rf-timer-overlay.ended {
    top: auto !important; bottom: 30px !important; left: auto !important; right: 20px !important; 
    transform: rotate(-15deg) scale(1) !important; font-size: 24px !important; 
    color: #000; background: var(--secondary); 
    padding: 5px 15px; border-radius: 2px; border: 1px solid #fff;
    opacity: 1; white-space: nowrap; 
    box-shadow: 0 0 20px var(--secondary); 
    text-shadow: none;
}
#videoGrid { display: none !important; }