@charset "UTF-8";

/* ▼▼▼ Mugi Talk v7.5 - Defense Barrier Edition ▼▼▼ */
:root {
    --gaming-black: #0a0a0a;
    --gaming-green: #00ff41;
    --gaming-gold: #cea246;
    --gaming-red: #ff3333;
    --gaming-font: "Segoe UI", "Courier New", sans-serif;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
}

body { 
    background: var(--gaming-black);
    color: #eee;
    font-family: var(--gaming-font);
    margin: 0; 
    padding: 20px; 
    padding-bottom: 150px; 
    
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    
    transition: background 0.5s; 
    overflow-anchor: none;
    overflow-x: hidden; 
    width: 100%;
    max-width: 100%;
    position: relative;
    
    /* 背景：ゲーミンググリッド */
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

* { box-sizing: border-box; }

/* ▼ ロゴ周り ▼ */
.logo-area { text-align:center; margin: 20px 0 30px 0; }
h1 { margin:0; font-size:2.2em; font-weight:900; text-shadow: 0 0 10px rgba(206,162,70,0.5); letter-spacing: 1px; }
.catch-copy { font-size: 0.9em; color: #aaa; margin-top: 10px; font-weight: bold; line-height: 1.5; }
.beta-tag { font-size: 0.4em; color: var(--gaming-gold); vertical-align: super; margin-left: 3px; font-weight: normal; border: 1px solid var(--gaming-gold); padding: 2px 5px; border-radius: 4px; }

#login-screen, #chat-screen { max-width:600px; margin:0 auto; width: 100%; }
.hidden { display:none !important; }

/* ▼ 入力フォーム（ダーク仕様） ▼ */
.input-label { text-align:left; font-weight:bold; margin-bottom:5px; color: var(--gaming-gold); font-size:0.9em; }
input[type="text"], input[type="password"] { 
    width:100%; padding:15px; margin-bottom:20px; border-radius:4px; 
    border:1px solid #444; 
    font-size:18px; 
    background: #1a1a1a; 
    color: #00ff41; 
    font-family: monospace;
    text-align:center; outline:none; 
    transition: all 0.3s;
}
input:focus { border-color: var(--gaming-green); box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); }

/* ▼ ボタンのデザイン強化 ▼ */
button { width:100%; padding:15px; border:none; border-radius:4px; font-size:18px; font-weight:bold; cursor:pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.btn-accordion { background:#333; color:#fff; border: 1px solid #555; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.btn-join { 
    background: linear-gradient(135deg, var(--gaming-gold), #8a6d1c); 
    color:#000; 
    border: 1px solid var(--gaming-gold);
    box-shadow: 0 0 15px rgba(206,162,70,0.2); 
    font-weight:900; 
}
.btn-join:active { transform: scale(0.98); }

.btn-create { 
    background: transparent; 
    color: #fff; 
    border: 1px solid #555; 
}
.btn-create:hover { border-color: var(--gaming-gold); color: var(--gaming-gold); box-shadow: 0 0 10px rgba(206,162,70,0.2); }

button:disabled { background: #222 !important; color: #555 !important; border-color: #333 !important; cursor: not-allowed; box-shadow: none; transform: none !important; }

/* ▼ 設定ボックスなどをダーク化 ▼ */
.setting-box { background: #1a1a1a; padding:15px; border-radius:4px; margin-bottom:20px; border:1px solid #333; }
select { width:100%; padding:10px; border:1px solid #444; border-radius:4px; margin-bottom:15px; background: #000; color: #fff; }
.checkbox-label { display:flex; align-items:center; cursor:pointer; font-weight:bold; font-size:0.9em; margin-top: 10px; color: #ccc; }
.checkbox-label input { width:20px; height:20px; margin-right:10px; accent-color: var(--gaming-gold); }
.mic-load-btn { background: #333; color: #ccc; border: 1px solid #555; padding: 10px; border-radius: 4px; font-size: 0.9em; width: 100%; margin-bottom: 15px; }

/* ▼ アコーディオンの中身 ▼ */
.accordion-content { background: #1a1a1a; padding:20px; border-radius:4px; border: 1px solid var(--gaming-gold); margin-top:10px; margin-bottom:20px; animation: slideDown 0.3s ease; color: #eee; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* ▼ スライダー（音量） ▼ */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 0; touch-action: none; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #555; border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { height: 16px; width: 16px; border-radius: 50%; background: var(--gaming-gold); cursor: pointer; -webkit-appearance: none; margin-top: -6px; box-shadow: 0 0 5px rgba(206,162,70,0.8); transition: transform 0.1s; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); }
input[type=range]::-moz-range-track { width: 100%; height: 4px; cursor: pointer; background: #555; border-radius: 2px; }
input[type=range]::-moz-range-thumb { height: 16px; width: 16px; border: none; border-radius: 50%; background: var(--gaming-gold); cursor: pointer; box-shadow: 0 0 5px rgba(206,162,70,0.8); }

.volume-control { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 0.8em; color: #aaa; }
.volume-control input { width: 80px; margin: 0; cursor: pointer; }

/* ▼ チャット画面・カード (Gaming Edition) ▼ */
body.chat-mode { background:#050505; color:#eee; padding-bottom: 140px; }
body.chat-mode .user-card { background: rgba(20, 20, 20, 0.9); border: 1px solid #333; }
.chat-logo { font-weight: 900; font-size: 1.5em; letter-spacing: 2px; color: #fff; text-align:center; margin-bottom:20px; }
.chat-logo span { color: var(--gaming-gold); }
.chat-beta { font-size: 0.5em; color: #888; vertical-align: super; letter-spacing: 0; }

/* Gaming Status Monitor (HUD) */
#room-info-bar { 
    text-align:center; 
    margin-bottom:20px; 
    padding:10px; 
    background: #000; 
    border-radius:4px; 
    border: 1px solid var(--gaming-green); 
    position: relative; 
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}
/* ★ 巨大化したルームナンバー ★ */
.room-number { 
    font-size: 0.8em; 
    color: #555; 
    font-family: monospace; 
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 5px;
}
#display-room-id {
    font-size: 2.8em; /* 巨大化 */
    color: var(--gaming-gold);
    font-weight: 900;
    letter-spacing: 5px;
    line-height: 1;
    display: block;
    margin: 5px 0;
    text-shadow: 0 0 10px rgba(206,162,70,0.5);
}

.system-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.75em;
    color: var(--gaming-green);
    text-shadow: 0 0 5px rgba(0,255,65,0.5);
}
.status-label { font-weight: bold; }
.status-val { font-weight: bold; animation: pulseText 2s infinite; }

@keyframes pulseText { 0%{opacity:1;} 50%{opacity:0.6;} 100%{opacity:1;} }

#lonely-status { margin-top:10px; color:var(--gaming-gold); font-weight:bold; background:rgba(0,0,0,0.8); padding:5px; border-radius:4px; font-size:0.9em; border: 1px solid var(--gaming-gold); }

#local-user-box { margin-bottom: 5px; border-color:var(--gaming-gold); box-shadow: 0 0 15px rgba(206,162,70,0.1); transition: margin-bottom 0.3s; } 
#user-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; } 
.user-card { padding: 8px 5px; text-align: center; border-radius: 4px; transition: all 0.1s; position: relative; background: #151515; border: 1px solid #333; display: flex; flex-direction: column; justify-content: center; }

/* Speaking Indicator */
.speaking { border-color: var(--gaming-green) !important; box-shadow: 0 0 15px rgba(0,255,65,0.4); transform: scale(1.02); z-index: 10; }

.name-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 4px; width: 100%; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #555; display: inline-block; flex-shrink: 0; }
.dot-connected { background: var(--gaming-green); box-shadow: 0 0 5px var(--gaming-green); } 
.dot-warning { background: var(--gaming-gold); } 
.dot-offline { background: var(--gaming-red); animation: flash 1s infinite; }

.user-name { font-weight: bold; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 80%; color: #eee; font-family: monospace; }
.user-name.is-hd::after { content: " [HD]"; color: var(--gaming-gold); font-size: 0.8em; margin-left:3px; }

.meter-container { width: 90%; background: #111; height: 3px; border-radius: 2px; margin: 4px auto; overflow: hidden; border: 1px solid #333; }
.meter-bar { width:0%; height:100%; background: var(--gaming-green); transition:width 0.05s; box-shadow: 0 0 5px var(--gaming-green); }

.volume-control-compact { display: flex; justify-content: center; width: 100%; margin-top: 2px; }
.volume-control-compact input { width: 90% !important; height: 20px; margin: 0; cursor: pointer; }

/* ★ Mute Button (固定幅でレイアウト崩れ防止) ★ */
#mute-btn { 
    width: 80px; /* 固定幅 */
    padding: 6px 0; 
    font-size: 0.9em; 
    background: #222; 
    color: #fff; 
    border: 1px solid #555;
    border-radius: 4px; 
    text-align: center; 
    transition: all 0.2s; 
    font-family: monospace;
    font-weight: bold;
}
#mute-btn.defense-active {
    background: #8b0000;
    border-color: #ff3333;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

/* ★ 音声防御フィールド (バリア) ★ */
#voice-defense-barrier {
    background: repeating-linear-gradient(
        45deg,
        #220000,
        #220000 10px,
        #440000 10px,
        #440000 20px
    );
    border: 2px solid var(--gaming-red);
    color: var(--gaming-red);
    text-align: center;
    padding: 10px;
    margin: 15px 0;
    font-family: monospace;
    font-weight: 900;
    text-shadow: 0 0 5px #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
    animation: barrierExpand 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
#voice-defense-barrier::before {
    content: "🛡️ 音声防御フィールド展開中";
    display: block;
    font-size: 1em;
    margin-bottom: 2px;
}
#voice-defense-barrier::after {
    content: "AUDIO DATA BLOCKED";
    display: block;
    font-size: 0.7em;
    color: #fff;
    opacity: 0.7;
    letter-spacing: 2px;
}
@keyframes barrierExpand {
    from { transform: scaleY(0); opacity: 0; height: 0; margin: 0; }
    to { transform: scaleY(1); opacity: 1; height: auto; margin: 15px 0; }
}

.vc-btn { width: 35px; height: 35px; border-radius: 4px; border: 1px solid #555; background: #222; color: #fff; font-size: 1.2em; cursor: pointer; padding: 0; margin-left: 5px; transition: all 0.2s; filter: grayscale(100%); }
.vc-btn:active { transform: scale(0.95); }
.vc-btn.active { background: var(--gaming-gold); border-color: var(--gaming-gold); color: #000; box-shadow: 0 0 10px rgba(206,162,70,0.5); filter: none; }

#host-panel { background:#151515; padding:15px; border-radius:4px; border:1px solid var(--gaming-red); margin-bottom:20px; text-align:center; display:none; box-shadow: inset 0 0 20px rgba(255,0,0,0.1); }
.leave-btn-wide { width: 100%; background: #333; color: #ccc; padding: 12px; border-radius: 4px; font-weight: bold; margin-bottom: 25px; font-size: 1em; border: 1px solid #555; cursor: pointer; font-family: monospace; }
.leave-btn-wide:hover { background: #444; color: #fff; border-color: #fff; }

.footer-links { text-align:center; margin-top:50px; font-size:0.75em; color:#666; }
.footer-links a { color:#666; text-decoration:none; margin:0 10px; }
.full-alert { color: var(--gaming-red); font-weight:900; margin-bottom:5px; font-size:1.1em; letter-spacing:1px; animation: flash 2s infinite; font-family: monospace; }
@keyframes flash { 0%,100%{opacity:1;} 50%{opacity:0.7;} }

#news-ticker { position: fixed; top: 0; left: 0; width: 100%; height: 35px; background: #000; color: var(--gaming-gold); z-index: 99999; overflow: hidden; white-space: nowrap; display: flex; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.5); font-family: "Courier New", monospace; font-weight: bold; font-size: 1.1em; border-bottom: 1px solid var(--gaming-gold); }
.ticker-content { display: inline-block; padding-left: 100vw; animation: ticker-scroll 25s linear infinite; }
@keyframes ticker-scroll { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }
#ticker-close { position: absolute; right: 0; top: 0; height: 35px; width: 40px; background: rgba(0,0,0,0.8); color: #fff; border: none; font-size: 1.2em; cursor: pointer; z-index: 100000; }
#toast-container { position: fixed; bottom: 80px; right: 20px; z-index: 10000; pointer-events: none; }
.toast-msg { background: rgba(0, 0, 0, 0.9); color: var(--gaming-gold); padding: 10px 20px; border-radius: 4px; margin-top: 10px; font-size: 0.9em; box-shadow: 0 4px 10px rgba(0,0,0,0.5); border: 1px solid var(--gaming-gold); animation: slideInUp 0.3s ease, fadeOut 0.5s ease 3.5s forwards; font-family: monospace; }
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

#chat-container { position: fixed; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 600px; z-index: 9999; background: #111; border-top: 1px solid var(--gaming-green); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -5px 15px rgba(0,255,65,0.1); transform: translateY(100%); }
#chat-container.expanded { transform: translateY(0); }
#chat-container.collapsed { transform: translateY(calc(100% - 60px)); } 
#chat-tab { position: absolute; top: -30px; right: 20px; left: auto; width: 120px; height: 30px; background: #111; border: 1px solid var(--gaming-green); border-bottom: none; border-radius: 4px 4px 0 0; color: var(--gaming-green); font-weight: bold; font-size: 0.9em; display: flex; align-items: center; justify-content: center; cursor: pointer; font-family: monospace; text-shadow: 0 0 5px var(--gaming-green); }
#chat-tab:active { background: #222; }
#chat-history { height: 40vh; overflow-y: auto; background: rgba(0,0,0,0.95); border-bottom: 1px solid #333; display: flex; flex-direction: column; }
#chat-input-area { display: flex; padding: 10px; background: #111; align-items: center; justify-content: center; }
#chat-input { flex: 1; height: 40px !important; line-height: 20px; padding: 0 15px; margin: 0; border-radius: 4px; border: 1px solid #444; background: #222; color: #fff; font-size: 16px; outline: none; text-align: left; box-sizing: border-box; -webkit-appearance: none; appearance: none; font-family: sans-serif; }
#chat-input:focus { border-color: var(--gaming-green); } 
#chat-send-btn { width: 50px; height: 40px !important; margin: 0 0 0 10px; padding: 0; background: var(--gaming-green); color: #000; border-radius: 4px; border: none; cursor: pointer; font-weight: bold; box-sizing: border-box; display: flex; align-items: center; justify-content: center; -webkit-appearance: none; appearance: none; box-shadow: 0 0 10px rgba(0,255,65,0.3); }
#chat-send-btn:disabled { background: #333; cursor: not-allowed; box-shadow: none; }
.chat-msg { padding: 8px 12px; margin: 5px 10px; font-size: 0.9em; color: #eee; word-break: break-all; background: rgba(255,255,255,0.05); border-radius: 4px; animation: fadeIn 0.2s; border-left: 2px solid #444; }
.chat-msg .author { font-weight: bold; color: var(--gaming-gold); margin-right: 5px; font-size: 0.9em; font-family: monospace; }
.chat-msg .time { font-size: 0.7em; color: #666; float: right; margin-top: 2px; font-family: monospace; }
.chat-msg.mine { background: rgba(0, 255, 65, 0.05); border-left: 2px solid var(--gaming-green); text-align: right; }
.chat-msg.mine .author { display: none; }
.chat-msg.error { color: #ff4444; border: 1px solid #ff4444; }
@keyframes fadeIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }