:root {
  --navy:    #0D1B2A;
  --blue:    #1A5276;
  --mid:     #2471A3;
  --sky:     #3498DB;
  --light:   #EBF5FB;
  --teal:    #0E9488;
  --green:   #16A34A;
  --green-l: #DCFCE7;
  --amber:   #D97706;
  --amber-l: #FEF3C7;
  --red:     #DC2626;
  --gray-l:  #F7F9FC;
  --gray-1:  #F1F4F8;
  --gray-2:  #E2E8F0;
  --gray-3:  #CBD5E1;
  --gray-4:  #94A3B8;
  --gray-5:  #64748B;
  --gray-7:  #334155;
  --white:   #FFFFFF;
  --font-d:  'Gmarket Sans', 'Noto Sans KR', sans-serif;
  --font-b:  'Noto Sans KR', sans-serif;
}

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

body {
  font-family: var(--font-b);
  background: #0A0F14;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── 상단 바 ── */
.video-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.vt-left { display: flex; align-items: center; gap: 14px; }
.vt-logo { font-family: var(--font-d); font-size: 15px; font-weight: 700; color: #fff; }
.vt-sep { color: rgba(255, 255, 255, .2); font-size: 18px; }
.vt-title { font-size: 14px; color: rgba(255, 255, 255, .7); }
.vt-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 100px;
  background: rgba(239, 68, 68, .2); color: #FC8181;
  display: flex; align-items: center; gap: 5px;
}
.vt-dot { width: 7px; height: 7px; border-radius: 50%; background: #FC8181; animation: blinkVideo 1.2s infinite; }
@keyframes blinkVideo { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.vt-time { font-family: var(--font-d); font-size: 22px; font-weight: 700; color: #fff; }

/* ── 비디오 영역 ── */
.video-area {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.main-video {
  position: relative;
  background: linear-gradient(135deg, #1a2a3a, #0f1e2a);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mv-avatar { font-size: 80px; opacity: .6; }
.mv-name-badge {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px);
  color: #fff; font-size: 14px; font-weight: 700;
  padding: 8px 14px; border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
}
.mv-mic-icon { font-size: 16px; }
.mv-quality {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .6);
  background: rgba(0, 0, 0, .4); padding: 4px 10px; border-radius: 100px;
}

/* ── 사이드 패널 ── */
.side-panel { display: flex; flex-direction: column; gap: 10px; }
.my-video {
  background: linear-gradient(135deg, #162e1a, #0D1B2A);
  border-radius: 14px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative; overflow: hidden; flex-shrink: 0;
}
.my-name-badge {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px;
}

/* ── 채팅 사이드 ── */
.side-chat {
  flex: 1;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.sc-head { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.sc-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sc-msg { font-size: 13px; line-height: 1.6; }
.sc-msg-name { font-weight: 700; font-size: 11px; margin-bottom: 3px; }
.sc-msg.me .sc-msg-name { color: var(--sky); text-align: right; }
.sc-msg.you .sc-msg-name { color: rgba(255, 255, 255, .5); }
.sc-bubble { padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.sc-msg.me .sc-bubble { background: var(--blue); color: #fff; margin-left: auto; }
.sc-msg.you .sc-bubble { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .9); }
.sc-input-wrap { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sc-input { flex: 1; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 9px; padding: 8px 11px; color: #fff; font-family: var(--font-b); font-size: 13px; }
.sc-input::placeholder { color: rgba(255, 255, 255, .3); }
.sc-input:focus { outline: none; border-color: var(--sky); }
.sc-send { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); border: none; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; color: #fff; transition: background .18s; flex-shrink: 0; }

/* ── 하단 컨트롤 바 ── */
.control-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .07); flex-shrink: 0;
}
.ctrl-group { display: flex; align-items: center; gap: 10px; }
.ctrl-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transition: all .18s; }
.ctrl-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.ctrl-icon:hover { background: rgba(255, 255, 255, .18); }
.ctrl-icon.on { background: rgba(239, 68, 68, .2); border-color: rgba(239, 68, 68, .3); }
.ctrl-icon.blue { background: rgba(52, 152, 219, .25); border-color: rgba(52, 152, 219, .3); }
.ctrl-label { font-size: 11px; color: rgba(255, 255, 255, .5); }
.end-btn { background: rgba(239, 68, 68, .85); border: none; border-radius: 14px; width: 56px; height: 48px; cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .22s cubic-bezier(.34, 1.56, .64, 1); }
.end-btn:hover { background: var(--red); transform: scale(1.08); box-shadow: 0 4px 16px rgba(220, 38, 38, .4); }

/* ── 참가자 패널 ── */
.participants { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px 12px; }
.part-title { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .5); margin-bottom: 8px; }
.part-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.part-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.part-name { font-size: 13px; color: rgba(255, 255, 255, .8); }
.part-icons { margin-left: auto; display: flex; gap: 4px; font-size: 14px; color: rgba(255, 255, 255, .4); }

/* ── 공유 화면 오버레이 ── */
.share-overlay { position: absolute; inset: 0; background: rgba(13, 27, 42, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; display: none; }
.share-overlay.show { display: flex; }
.share-screen-mock { background: var(--white); border-radius: 12px; padding: 16px 20px; width: 80%; font-size: 13px; color: var(--navy); }

/* ── 종료 모달 ── */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: all; }
.modal { background: #1a2535; border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; width: 380px; max-width: 94vw; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); transform: scale(.95); transition: transform .28s cubic-bezier(.34, 1.56, .64, 1); overflow: hidden; }
.overlay.show .modal { transform: scale(1); }
.modal-head { padding: 22px 24px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.modal-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; color: #fff; }
.modal-sub { font-size: 13px; color: rgba(255, 255, 255, .5); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mstat { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px; text-align: center; }
.mstat-v { font-family: var(--font-d); font-size: 22px; font-weight: 700; color: #fff; }
.mstat-l { font-size: 11px; color: rgba(255, 255, 255, .4); margin-top: 3px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 24px; border-top: 1px solid rgba(255, 255, 255, .08); }
.modal-cont { flex: 1; padding: 13px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .15); background: transparent; font-family: var(--font-b); font-size: 14px; color: rgba(255, 255, 255, .7); cursor: pointer; transition: background .18s; }
.modal-end { flex: 1; padding: 13px; border-radius: 10px; border: none; background: var(--red); color: #fff; font-family: var(--font-b); font-size: 14px; font-weight: 700; cursor: pointer; }

#toastEl { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(70px); background: rgba(255, 255, 255, .15); backdrop-filter: blur(10px); color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 32px rgba(0, 0, 0, .3); opacity: 0; transition: all .35s cubic-bezier(.34, 1.56, .64, 1); z-index: 600; white-space: nowrap; }
.show-t { transform: translateX(-50%) translateY(0) !important; opacity: 1 !important; }
