/* 투게더튜브(가칭) — 공용 스타일. 극장처럼 어두운 화면이 기본. */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f232c;
  --line: #2a2f3a;
  --text: #eef0f4;
  --muted: #9aa1ae;
  --accent: #8b5cf6;
  --accent-ink: #ffffff;
  --ok: #3ecf8e;
  --warn: #f5b041;
  --radius: 12px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f0f1f4;
  --line: #e1e4ea;
  --text: #15171c;
  --muted: #5f6673;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.danger { color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.input {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--accent); }
.muted { color: var(--muted); }
.err { color: var(--accent); font-size: 14px; min-height: 1.3em; }

/* 머리 줄 */
.top {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.3px; }
.logo b { color: var(--accent); }
.logo small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.top .grow { flex: 1; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--panel-2); cursor: pointer; }

/* 대기실 */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.lobby-head { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.lobby-head .input { max-width: 420px; }
.lobby-head h1 { font-size: 20px; margin: 0 auto 0 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; text-align: left; padding: 0;
}
.card:hover { transform: translateY(-2px); border-color: var(--muted); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.72); color: #fff;
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
}
.badge.right { left: auto; right: 8px; }
.card .body { padding: 10px 12px 12px; }
.card .title { font-weight: 700; font-size: 15px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .vtitle { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 60px 10px; color: var(--muted); }

/* 창(다이얼로그) */
dialog {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text);
  padding: 22px; width: min(440px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.preview { display: flex; gap: 10px; align-items: center; font-size: 13px; min-height: 20px; }
.preview img { width: 96px; border-radius: 6px; }

/* 방 */
.room { display: grid; grid-template-columns: 1fr 340px; height: calc(100vh - 57px); }
.stage { padding: 16px; overflow-y: auto; }
.player-box { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box iframe, .player-box > div { width: 100%; height: 100%; display: block; }
.no-video { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.now { margin: 12px 0 4px; font-size: 17px; font-weight: 700; }
.now-sub { color: var(--muted); font-size: 13px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.bar .input { flex: 1; min-width: 200px; }
.notice { margin-top: 10px; font-size: 14px; color: var(--warn); min-height: 1.3em; }
.vol { width: 110px; accent-color: var(--accent); }

.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.side-head .rtitle { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); max-height: 110px; overflow-y: auto; }
.user { font-size: 12px; background: var(--panel-2); border-radius: 999px; padding: 4px 10px; display: inline-flex; gap: 6px; align-items: center; }
.user.host { border: 1px solid var(--accent); }
.user button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0; }
.user button:hover { color: var(--accent); }
.chat { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
/* 글은 아래(입력창 쪽)부터 쌓여 위로 자람 — 첫 글을 아래로 밀어 둠(스크롤은 그대로) */
.chat > :first-child { margin-top: auto; }
.msg { font-size: 14px; line-height: 1.45; word-break: break-word; }
.msg .who { font-weight: 700; margin-right: 6px; }
.msg .who.host { color: var(--accent); }
.msg .time { font-size: 11px; color: var(--muted); margin-left: 6px; }
.msg.sys { color: var(--muted); font-size: 12px; text-align: center; }
.chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ephemeral { font-size: 11px; color: var(--muted); padding: 0 14px 10px; }

/* 입장 · 종료 가림막 */
.gate {
  position: fixed; inset: 0; background: rgba(10,11,14,.92); display: grid; place-items: center; z-index: 20; padding: 16px;
}
.gate .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(400px, 100%); text-align: center; }
.gate h2 { margin: 0 0 6px; }
.gate p { color: var(--muted); margin: 0 0 16px; }
.gate .input { margin-bottom: 10px; text-align: center; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; height: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); height: 60vh; }
  .stage { padding: 0 0 12px; }
  .player-box { border-radius: 0; }
  .now, .now-sub, .bar, .notice { padding: 0 16px; }
  .top { padding: 10px 16px; }
  .lobby-head { flex-wrap: wrap; }
  .lobby-head h1 { flex-basis: 100%; font-size: 18px; }
  .lobby-head .input { flex: 1; max-width: none; }
  .logo small { display: none; }
}

/* ===== 첫 화면(10-11) ===== */
.hero {
  background: radial-gradient(900px 340px at 50% -80px, rgba(139, 92, 246, .35), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-in { max-width: 760px; margin: 0 auto; padding: 56px 20px 40px; text-align: center; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 10px; letter-spacing: .2px; }
.hero h1 { font-size: 44px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -1px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); font-size: 17px; line-height: 1.6; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.stats { margin: 18px 0 0; color: var(--muted); font-size: 14px; min-height: 1.3em; }

.lobby-head h2 { font-size: 20px; margin: 0 auto 0 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; }
.tchip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; color: var(--muted); }
.tchip:hover { border-color: var(--muted); }
.tchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.chatpv { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.chatpv div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatpv b { color: var(--text); margin-right: 4px; font-weight: 600; }
.chatpv.quiet { font-style: italic; opacity: .75; }
.badge.hot { background: var(--accent); }

.empty { padding: 28px 0 10px; }
.empty-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.empty .muted { margin: 0 0 20px; }
.empty .btn.big { margin-top: 22px; }
.samples { text-align: left; }
.card.sample { cursor: default; opacity: .9; }
.card.sample:hover { transform: none; border-color: var(--line); }
.sample .thumb { display: grid; place-items: center; }
.sample-ico { font-size: 44px; }
.thumb.s1 { background: linear-gradient(135deg, #3b2a6b, #1c1f3a); }
.thumb.s2 { background: linear-gradient(135deg, #6b2a52, #2a1c3a); }
.thumb.s3 { background: linear-gradient(135deg, #1f4a6b, #1c1f3a); }

.how { margin-top: 36px; }
.how h2 { font-size: 20px; margin: 0 0 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step b { display: block; font-size: 16px; margin: 8px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; }
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; padding-top: 0; padding-bottom: 0; }
.track { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.track b { font-size: 16px; }
.track p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.foot { margin-top: 30px; padding-top: 10px; padding-bottom: 50px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.foot p { margin: 0 0 6px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--muted); min-height: 1.3em; }
select.input { appearance: auto; }
.pc { display: inline; }

@media (max-width: 860px) {
  .hero-in { padding: 36px 18px 28px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 15px; }
  .pc { display: none; }
  .btn.big { flex: 1; }
}

/* ===== 첫 화면 개편 2(10-11): 한 줄 소개 + 링크 칸, 바로 아래 썸네일 ===== */
.banner {
  background: radial-gradient(800px 260px at 50% -60px, rgba(139, 92, 246, .38), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
}
.banner-in { max-width: 820px; margin: 0 auto; padding: 34px 16px 26px; text-align: center; }
.banner h1 { font-size: 40px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -1px; font-weight: 800; }
.banner h1 em { font-style: normal; color: var(--accent); }
.paste { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.paste .input { flex: 1; font-size: 16px; padding: 14px 16px; border-radius: 12px; border-width: 2px; border-color: var(--accent); background: var(--panel); }
.paste .btn { padding: 0 22px; font-size: 16px; border-radius: 12px; }
.paste-msg { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 1.3em; }
.paste-msg.bad { color: #ff7a7a; }

.lobby-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.lobby-bar .chips { margin: 0; flex: 1; }
.lobby-bar .search { width: 200px; flex: none; padding: 8px 12px; }
.live-line { margin: 0 0 12px; font-size: 13px; color: var(--accent); min-height: 1.2em; }
.wrap#lobby { padding-top: 16px; }

.thumb .live-chat {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  color: #fff; font-size: 13px; display: flex; flex-direction: column; gap: 2px;
}
.thumb .live-chat div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .live-chat b { color: #c9b5ff; margin-right: 4px; }
.badge.live { color: #fff; background: rgba(139, 92, 246, .9); }
.card .vtitle { margin-top: 2px; }
.sample { padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer !important; }
.sample .thumb { display: grid; place-items: center; }
.empty-msg { text-align: center; color: var(--muted); margin: 18px 0 0; }
.chips.small .tchip { font-size: 13px; padding: 5px 10px; }
.preview.big { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; font-size: 14px; line-height: 1.4; }
.preview.big img { width: 132px; border-radius: 8px; flex: none; }
.foot { text-align: center; }

@media (max-width: 860px) {
  .banner-in { padding: 24px 16px 20px; }
  .banner h1 { font-size: 27px; margin-bottom: 14px; }
  .lobby-bar { flex-direction: column; align-items: stretch; }
  .lobby-bar .search { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .tchip { flex: none; }
  .chips.small { flex-wrap: wrap; }
}


/* ===== 장면 메모 · 다시 볼 장면(10-11) ===== */
.tc { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--accent); margin-right: 6px; }
.msg.mine { cursor: pointer; border-radius: 6px; margin: 0 -6px; padding: 0 6px; }
.msg.mine:hover { background: var(--panel-2); }
.msg.hl { background: rgba(139, 92, 246, .16); border-left: 3px solid var(--accent); border-radius: 6px; margin: 0 -6px; padding: 2px 6px 2px 8px; }
.msg.hl::after { content: " ★"; color: var(--accent); }
.msg.chapter { color: var(--accent); font-weight: 700; font-size: 13px; padding: 4px 0; }
.scenes { border-bottom: 1px solid var(--line); padding: 8px 14px; }
.scenes-head { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.scenes-head .muted { font-weight: 400; margin-left: 4px; }
.scene-list { display: flex; flex-direction: column; gap: 2px; max-height: 128px; overflow-y: auto; }
.scene { display: flex; gap: 2px; align-items: baseline; text-align: left; border: 0; background: transparent; padding: 3px 6px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: default; }
.scene .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene.hl .label { color: var(--muted); }
.scene.can { cursor: pointer; }
.scene.can:hover { background: var(--panel-2); }
.chat-form.marking .input { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139, 92, 246, .25); }


/* ===== 타임라인 · 메모 마커(10-11) ===== */
.timeline { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tl-track { position: relative; flex: 1; height: 6px; background: var(--panel-2); border-radius: 999px; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; opacity: .55; }
.tl-marks { position: absolute; inset: 0; }
.tl-mark {
  position: absolute; top: 50%; width: 14px; height: 14px; margin-left: -7px; transform: translateY(-50%);
  border-radius: 50%; border: 2px solid var(--bg); background: #ffd166; cursor: pointer; padding: 0;
}
.tl-mark:hover { transform: translateY(-50%) scale(1.3); }
.tl-time { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg.chapter { cursor: pointer; background: rgba(255, 209, 102, .12); border-left: 3px solid #ffd166; color: #ffd166; border-radius: 6px; margin: 2px -6px; padding: 4px 6px 4px 8px; }
.msg.chapter:hover { background: rgba(255, 209, 102, .2); }
.scene.chapter .label { color: #ffd166; }
@media (max-width: 860px) { .timeline { padding: 0 16px; } }


/* ===== 장면 메모 시각 고치기(10-11) ===== */
.mark-adj { display: flex; gap: 4px; }
.mark-adj button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 0 8px; cursor: pointer; font-size: 12px; color: var(--text); white-space: nowrap; }
.mark-adj button:hover { border-color: var(--accent); }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; color: var(--muted); }


/* ===== 마커 줄(10-11) ===== */
.msg.chapter { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.msg.chapter .ch-main { flex: 1; cursor: pointer; overflow-wrap: anywhere; }
.ch-tools { display: flex; gap: 3px; flex: none; opacity: .55; }
.msg.chapter:hover .ch-tools { opacity: 1; }
.ch-tools button { border: 1px solid rgba(255, 209, 102, .4); background: transparent; color: #ffd166; border-radius: 6px; font-size: 11px; padding: 1px 5px; cursor: pointer; }
.ch-tools button:hover { background: rgba(255, 209, 102, .2); }
.ch-edit { padding: 4px 8px; font-size: 13px; }


/* ===== 마커 · 리액션 개편 3(10-11) ===== */
.msg.chapter { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.ch-main { flex: 1; overflow-wrap: anywhere; }
.ch-tc { font-weight: 700; margin-right: 6px; cursor: pointer; }
.ch-tc:hover { text-decoration: underline; }
.ch-text { font-weight: 600; }
.ch-x { border: 0; background: transparent; color: #ffd166; opacity: 0; cursor: pointer; font-size: 12px; padding: 0 4px; }
.msg.chapter:hover .ch-x { opacity: .8; }
.msg.chapter .ch-tools, .mark-adj { display: none; }

.react-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 14px 0; border-top: 1px solid var(--line); }
.react-bar button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; width: 38px; height: 34px; font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }
.react-bar button:hover { border-color: var(--accent); transform: translateY(-1px); }
.chat-form { border-top: 0; }
.msg.react { display: flex; align-items: center; gap: 6px; }
.msg.react .re-e { font-size: 26px; line-height: 1; }
.msg.react .re-l { font-size: 12px; color: var(--muted); }

.my-marks { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.my-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.my-head .muted { font-weight: 400; font-size: 12px; margin-left: 6px; }
.my-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.my-row { display: flex; gap: 8px; align-items: center; }
.my-lab { flex: none; font-size: 13px; font-weight: 700; color: var(--accent); min-width: 108px; }
.my-note { flex: 1; padding: 5px 9px; font-size: 13px; }
.my-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 4px; }
.my-x:hover { color: var(--accent); }
@media (max-width: 860px) { .my-marks { margin: 10px 16px 0; } }
.react-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.react-bar button { width: 100%; min-width: 0; }


/* ===== 지난 영상 마커 · 돌아가기(10-11) ===== */
.back-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--radius); background: rgba(139, 92, 246, .16); border: 1px solid var(--accent); font-size: 14px; }
.msg.chapter.old { opacity: .78; }
.ch-old { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.scene.old .label { color: var(--muted); }
.msg.back-line { text-align: center; padding: 6px 0; font-size: 13px; color: var(--muted); }
.msg.back-line .btn { margin-left: 6px; padding: 5px 10px; font-size: 13px; }
@media (max-width: 860px) { .back-bar { margin: 0 16px 10px; } }


/* ===== 리액션 쿨다운 · 손님 마커 지난 영상(10-11) ===== */
.react-bar.cooling button { opacity: .4; cursor: default; }
.react-bar.cooling button:hover { border-color: var(--line); transform: none; }
.react-cd { padding: 4px 14px 0; font-size: 12px; color: var(--muted); }
.my-row.old { opacity: .7; }
.my-lab { display: flex; flex-direction: column; line-height: 1.25; }
.my-old { font-weight: 400; font-size: 11px; color: var(--muted); }


/* ===== 손님 마커 5개 + 스크롤 · 복사 · 상영 목록(10-11) ===== */
.my-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.my-row { height: 34px; }
.my-lab { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; flex: none; width: 190px; white-space: nowrap; overflow: hidden; }
.my-old { overflow: hidden; text-overflow: ellipsis; }
.my-list { max-height: 194px; overflow-y: auto; padding-right: 2px; }
@media (max-width: 860px) { .my-lab { width: 150px; } }

.hist { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.hist summary { cursor: pointer; font-size: 13px; font-weight: 700; list-style-position: inside; }
.hist summary .muted { font-weight: 400; margin-left: 4px; }
.hist-list { margin: 8px 0 2px; padding-left: 22px; max-height: 200px; overflow-y: auto; font-size: 13px; }
.hist-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.hist-list li:last-child { border-bottom: 0; }
.h-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.h-meta { display: block; font-size: 12px; color: var(--muted); }
.h-now { display: inline-block; margin-top: 2px; font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; }
@media (max-width: 860px) { .hist { margin: 10px 16px 0; } }
#copyDlg textarea { margin-bottom: 10px; resize: none; font-size: 13px; }
.my-row { flex: none; }


/* ===== 왼쪽 서랍: 상영 목록(10-11) ===== */
.room { grid-template-columns: auto minmax(0, 1fr) 340px; }
.hist-side { display: flex; flex-direction: column; width: 262px; background: var(--panel); border-right: 1px solid var(--line); transition: width .18s ease; min-height: 0; overflow: hidden; }
.hist-side.collapsed { width: 44px; }
.hist-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 700; text-align: left; flex: none; }
.hist-toggle:hover { background: var(--panel-2); }
.hist-label { flex: 1; white-space: nowrap; }
.hist-label .muted { font-weight: 400; }
.hist-arrow { font-size: 18px; color: var(--muted); }
.hist-body { padding: 10px 14px 14px; overflow-y: auto; min-height: 0; flex: 1; width: 262px; }
.hist-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hist-list { margin: 0; padding-left: 20px; font-size: 13px; }
.hist-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist-list li:last-child { border-bottom: 0; }
/* 접히면: 얇은 띠에 세로 글씨 */
.hist-side.collapsed .hist-toggle { flex-direction: column; padding: 12px 0; gap: 10px; align-items: center; justify-content: flex-start; flex: 1; border-bottom: 0; }
.hist-side.collapsed .hist-label { flex: none; writing-mode: vertical-rl; letter-spacing: 1px; }
.hist-side.collapsed .hist-body { display: none; }
.hist-side.collapsed .hist-arrow { order: -1; }
@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; }
  .hist-side, .hist-side.collapsed { width: auto; border-right: 0; border-bottom: 1px solid var(--line); transition: none; }
  .hist-side.collapsed .hist-toggle { flex-direction: row; padding: 10px 16px; border-bottom: 0; flex: none; }
  .hist-side.collapsed .hist-label { writing-mode: horizontal-tb; flex: 1; }
  .hist-side.collapsed .hist-arrow { order: 0; transform: rotate(90deg); }
  .hist-side:not(.collapsed) .hist-arrow { transform: rotate(90deg); }
  .hist-body { width: auto; max-height: 220px; }
}


/* ===== 접힌 서랍은 아이콘만(10-11) ===== */
.hist-ico { display: inline-flex; color: var(--text); }
.hist-side.collapsed .hist-toggle { flex-direction: column; align-items: center; justify-content: flex-start; padding: 14px 0; }
.hist-side.collapsed .hist-label, .hist-side.collapsed .hist-arrow { display: none; }
@media (max-width: 860px) {
  .hist-side.collapsed .hist-label { display: inline; }
  .hist-side.collapsed .hist-arrow { display: inline; }
  .hist-side.collapsed .hist-toggle { flex-direction: row; padding: 10px 16px; }
}

/* ===== 링크 글 · 영상 추천 카드(10-11) ===== */
.msg { overflow-wrap: anywhere; }
.chat-link { color: #9ec5ff; text-decoration: underline; word-break: break-all; }
.link-warn { margin-top: 3px; font-size: 11px; color: #f5b041; }
.rep-btn { margin-left: 6px; border: 1px solid #f5b041; background: transparent; color: #f5b041; border-radius: 6px; font-size: 11px; padding: 0 6px; cursor: pointer; }
.rep-btn:hover:not(:disabled) { background: rgba(245, 176, 65, .18); }
.rep-btn:disabled { opacity: .6; cursor: default; }
.sug-card { display: flex; gap: 10px; background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px; margin: 4px 0; }
.sug-card img { width: 92px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.sug-body { min-width: 0; flex: 1; font-size: 12px; }
.sug-from { color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.sug-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sug-ch { color: var(--muted); }
.sug-btns { display: flex; gap: 6px; margin-top: 6px; }
#sugDlg .err { min-height: 1.3em; margin-bottom: 4px; }


/* ===== 방장 글 삭제 · 조치 안내(10-11) ===== */
.msg { position: relative; }
.mod-btn { margin-left: 6px; border: 0; background: transparent; cursor: pointer; font-size: 12px; opacity: 0; padding: 0 2px; }
.msg:hover .mod-btn, .mod-btn:focus { opacity: .8; }
.mod-menu { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.4); display: flex; flex-direction: column; min-width: 190px; }
.mod-head { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; }
.mod-menu button { border: 0; background: transparent; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.mod-menu button:hover { background: var(--panel-2); }
.mod-menu button.warn { color: #ff9b9b; }
.msg.sys.mod { color: #ffb4b4; }
@media (hover: none) { .mod-btn { opacity: .7; } }


/* ===== 보라봇 · 신뢰(10-11) ===== */
.msg.bot { background: rgba(139, 92, 246, .1); border-radius: 8px; padding: 6px 8px; font-size: 13px; color: var(--text); }
.bot-name { color: var(--accent) !important; }
.trust-btn { border: 1px solid var(--ok); color: var(--ok) !important; background: transparent; border-radius: 999px; font-size: 11px; padding: 0 6px !important; margin-left: 2px; cursor: pointer; }
.trust-btn:hover { background: rgba(62, 207, 142, .15); }


/* ===== 영상 신고(10-11) ===== */
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.radio { display: block; padding: 8px 0; font-size: 14px; cursor: pointer; }
.radio input { margin-right: 6px; accent-color: var(--accent); }
.radio .muted { font-size: 12px; }

/* 언어 바꾸기 단추(한 · EN) */
.lang-chip { font-size: 12px; font-weight: 700; min-width: 40px; padding: 6px 10px; text-align: center; color: inherit; font-family: inherit; }

.foot-link { color: var(--muted); text-decoration: underline; }
.foot-link:hover { color: var(--text); }


/* ===== 시사회(10-11) ===== */
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text) !important; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
#premiereWhen { margin-top: 8px; }
#premiereWhen .input { color-scheme: dark; }
.badge.premiere { background: #c2185b !important; }
.premiere { position: absolute; inset: 0; display: grid; place-items: center; background: #000; overflow: hidden; }
.premiere img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(6px) brightness(.35); transform: scale(1.05); }
.pm-in { position: relative; text-align: center; padding: 16px; color: #fff; }
.pm-badge { display: inline-block; background: #c2185b; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.pm-title { margin-top: 12px; font-size: 18px; font-weight: 700; max-width: 560px; }
.pm-when { margin-top: 8px; color: #ddd; }
.pm-count { margin-top: 10px; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.pm-btns { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 860px) { .pm-count { font-size: 30px; } .pm-title { font-size: 15px; } }

/* ===== 크게 보기: 영상 + 옆 채팅(10-11) ===== */
.fs-tools, .fs-rail { display: none; }
.room.fs { position: fixed; inset: 0; z-index: 40; height: 100vh; width: 100vw; background: #000; grid-template-columns: minmax(0, 1fr) 330px; }
.room.fs .hist-side { display: none; }
.room.fs .stage { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.room.fs .player-box { flex: 1; aspect-ratio: auto; border-radius: 0; min-height: 0; }
.room.fs .stage > :not(.player-box):not(.timeline):not(.back-bar) { display: none !important; }
.room.fs .timeline { padding: 6px 12px; margin: 0; background: #000; }
.room.fs .side { background: rgba(15, 17, 21, .92); border-left: 1px solid var(--line); }
.room.fs .fs-tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.room.fs.fs-nochat { grid-template-columns: minmax(0, 1fr) 40px; }
.room.fs.fs-nochat .side { display: none; }
.room.fs.fs-nochat .fs-rail { display: block; border: 0; border-left: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; }
body.pseudo-fs { overflow: hidden; }
body.pseudo-fs .top { display: none; }
/* 세로 화면(휴대폰)에서 크게 보기: 위 영상 · 아래 채팅 */
@media (max-aspect-ratio: 1/1) {
  .room.fs { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .room.fs .player-box { flex: none; aspect-ratio: 16 / 9; }
  .room.fs .side { height: auto; min-height: 0; }
  .room.fs.fs-nochat { grid-template-columns: 1fr; grid-template-rows: 1fr 40px; }
  .room.fs.fs-nochat .player-box { flex: 1; aspect-ratio: auto; }
  .room.fs.fs-nochat .fs-rail { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- 게임 모드(10-11) — 밝은 게임방, 채팅은 오른쪽 그대로 ---------- */
/* 게임 색: 기본은 밝은 게임방, 🌙 를 누르면 영상 보기와 같은 어두운 색(보는 사람마다 따로 · 브라우저에 기억) */
body.gm-body {
  --g-bg: #fff8ec; --g-panel: #fffdf8; --g-card: #fff; --g-text: #2b2238; --g-muted: #8a7d95;
  --g-line: #f1e3cc; --g-line2: #eadcc6; --g-soft: #fffaf2; --g-soft2: #f6efe3; --g-sel: #f3edff;
  --g-ok: #e3f8f1; --g-tgt: #fff8d6; --g-rail: #d8c9b2;
}
body.gm-body.gm-dark {
  --g-bg: var(--bg); --g-panel: var(--panel); --g-card: var(--panel-2); --g-text: var(--text); --g-muted: var(--muted);
  --g-line: var(--line); --g-line2: var(--line); --g-soft: var(--panel); --g-soft2: var(--bg); --g-sel: rgba(139, 92, 246, .22);
  --g-ok: rgba(60, 207, 165, .2); --g-tgt: rgba(255, 207, 63, .16); --g-rail: #4a5160;
}
.gm-theme { display: none; }
body.gm-body .gm-theme { display: inline-flex; }
.wheel .pin { fill: var(--g-text); }
.mode-sw { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin-left: 4px; }
.mode-sw button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.mode-sw button.on { background: var(--accent); color: #fff; }
.mode-sw.game button.on { background: #ff6fa5; }
.mode-sw.ro button { cursor: default; }
.mode-sw.ro button:not(.on) { opacity: .45; }
.mode-sw button:disabled { color: var(--muted); }
.mode-sw button.on:disabled { color: #fff; }

.game-stage { display: none; }
.room.gm .stage > :not(.game-stage) { display: none !important; }
/* 게임 화면은 세로 가운데(내용이 길면 위에서부터 스크롤) */
.room.gm .stage { display: flex; flex-direction: column; }
.room.gm .game-stage { display: block; width: 100%; margin: auto 0; }
.room.gm .stage { background: var(--g-bg); color: var(--g-text); }
.room.gm .hist-side { display: none; }
.room.gm { grid-template-columns: minmax(0, 1fr) 340px; }
.room.gm .side { background: var(--g-panel); color: var(--g-text); border-left-color: var(--g-line); }
.room.gm .side .muted, .room.gm .side .ephemeral { color: var(--g-muted); }
.room.gm .side .input { background: var(--g-card); color: var(--g-text); border-color: var(--g-line2); }
.room.gm .msg.bot { background: var(--g-sel); color: var(--g-text); }
.room.gm .msg.sys { color: var(--g-muted); }
.room.gm .users { border-bottom-color: var(--g-line); }
.room.gm .users .user { color: var(--g-text); background: var(--g-soft2); }
.room.gm .side-head, .room.gm .chat-form, .room.gm .react-bar { border-color: var(--g-line); }
body.gm-body .top { background: var(--g-panel); color: var(--g-text); border-bottom-color: var(--g-line); }
body.gm-body .top .btn, body.gm-body .top .chip { background: var(--g-card); color: var(--g-text); border-color: var(--g-line2); }
body.gm-body .mode-sw { background: var(--g-card); border-color: var(--g-line2); }
@media (max-width: 900px) { .room.gm { grid-template-columns: 1fr; } }

.g-wrap { max-width: 760px; margin: 0 auto; padding: 8px 4px 24px; }
.g-wrap h2 { margin: 6px 0 2px; font-size: 24px; }
.g-sub, .g-hint { color: var(--g-muted); font-size: 13px; margin: 6px 0; }
.game-stage .center { text-align: center; }
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.gcard { position: relative; text-align: left; background: var(--g-card); border: 2px solid var(--g-line); border-radius: 18px; padding: 16px; cursor: pointer; font: inherit; color: var(--g-text); box-shadow: 0 4px 0 var(--g-line); transition: transform .12s; }
.gcard:hover:not(:disabled) { transform: translateY(-3px); border-color: #ff6fa5; }
.gcard .ico { font-size: 34px; }
.gcard b { display: block; font-size: 17px; margin: 6px 0 4px; }
.gcard p { margin: 0; font-size: 12.5px; color: var(--g-muted); }
.gcard.soon { opacity: .45; cursor: default; }
.gcard .tag { position: absolute; top: 10px; right: 10px; font-size: 11px; background: var(--g-sel); color: #8b5cf6; border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.gcard:disabled:not(.soon) { cursor: default; }
@media (max-width: 640px) { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.g-card { background: var(--g-card); border: 2px solid var(--g-line); border-radius: 20px; padding: 16px 18px; box-shadow: 0 5px 0 var(--g-line); }
.g-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.g-row.end { justify-content: flex-end; }
.g-row.center { justify-content: center; }
.g-row .grow { flex: 1; }
.g-title { font-size: 18px; }
.g-count { font-weight: 800; color: #ff6fa5; font-size: 18px; }
.g-ok { font-weight: 700; color: #1e9e78; }
.g-seg { display: inline-flex; background: var(--g-soft2); border-radius: 999px; padding: 3px; gap: 2px; }
.g-seg button { border: 0; background: transparent; font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; cursor: pointer; color: var(--g-muted); }
.g-seg button.on { background: #ff6fa5; color: #fff; font-weight: 700; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chips button { border: 2px solid var(--g-line); background: var(--g-card); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--g-text); }
.g-chips button.on { border-color: #8b5cf6; background: var(--g-sel); color: #6a3fd6; font-weight: 700; }
.g-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.g-res { display: flex; flex-direction: column; gap: 2px; }
.g-res small { font-size: 11px; color: #8b5cf6; font-weight: 700; }
.g-res .input, .g-card .input { background: var(--g-soft); color: var(--g-text); border: 2px solid var(--g-line); border-radius: 12px; width: 100%; box-sizing: border-box; }
.g-res.target .input { border-color: #ffcf3f; background: var(--g-tgt); }
.g-results.ro .res { background: var(--g-soft); border: 2px solid var(--g-line); border-radius: 12px; padding: 7px 10px; font-size: 13px; text-align: center; }
.g-results.ro .res.target { border-color: #ffcf3f; background: var(--g-tgt); font-weight: 700; }
.g-btn { border: 2px solid var(--g-line2); background: var(--g-card); color: var(--g-text); font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 14px; cursor: pointer; box-shadow: 0 3px 0 var(--g-line2); }
.g-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--g-line2); }
.g-btn.ghost { box-shadow: none; }
.g-btn.pink { background: #ff6fa5; border-color: #e85590; color: #fff; box-shadow: 0 3px 0 #d94784; }
.g-btn.primary { background: #8b5cf6; border-color: #7444e6; color: #fff; box-shadow: 0 3px 0 #6436d0; }
.g-btn.big { font-size: 18px; padding: 12px 26px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.slot { background: var(--g-soft2); color: var(--g-muted); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.slot.in { background: var(--g-ok); color: #137a5c; font-weight: 700; }


.qtop { display: flex; justify-content: space-between; align-items: center; }
.qnum { font-size: 13px; color: var(--g-muted); font-weight: 700; }
.timer { display: flex; align-items: baseline; justify-content: center; gap: 1px; min-width: 64px; height: 64px; padding: 0 10px; box-sizing: border-box; line-height: 64px; border-radius: 999px; background: #ffcf3f; font-weight: 900; font-size: 34px; color: #2b2238; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.timer small { font-size: 14px; font-weight: 800; }
.timer.hurry { background: #ff4d6d; color: #fff; animation: hurry .5s ease-in-out infinite alternate; }
@keyframes hurry { from { transform: scale(1); } to { transform: scale(1.12); } }
.qbar { height: 10px; border-radius: 999px; background: var(--g-soft2); overflow: hidden; margin: 10px 0 0; }
.qbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff6fa5, #ffcf3f); border-radius: 999px; transition: width .1s linear; }
.timer.ok { background: #3ccfa5; color: #fff; }
.question { font-size: 21px; font-weight: 800; margin: 12px 0 14px; line-height: 1.45; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 58px; border: 2px solid var(--g-line); background: var(--g-card); border-radius: 16px; padding: 10px 14px; font: inherit; font-size: 15px; font-weight: 700; color: var(--g-text); cursor: pointer; box-shadow: 0 3px 0 var(--g-line); }
.opt i { font-style: normal; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--g-soft2); font-size: 13px; }
.opt small { margin-left: auto; font-size: 12px; color: var(--g-muted); }
.opt.mine { border-color: #8b5cf6; background: var(--g-sel); }
.opt.mine i { background: #8b5cf6; color: #fff; }
.opt.right { border-color: #3ccfa5; background: var(--g-ok); }
.opt.right i { background: #3ccfa5; color: #fff; }
.opt.wrong { opacity: .5; }
.opt:disabled { cursor: default; }
@media (max-width: 640px) { .opts { grid-template-columns: 1fr; } .question { font-size: 18px; } }
.score { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.score div { background: var(--g-card); border: 2px solid var(--g-line); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.score b { margin-left: 6px; color: #ff6fa5; }

.ladder { background: var(--g-card); border: 2px solid var(--g-line); border-radius: 20px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ladder svg { flex: 1 1 360px; max-height: 420px; }
.ladder .lrails line { stroke: var(--g-rail); stroke-width: 4; stroke-linecap: round; }
.ladder .lpath { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.ladder text { font-size: 14px; font-weight: 700; text-anchor: middle; fill: var(--g-text); }
.ladder .lres text.tgt { fill: #e85590; }
.ladder .board { flex: 0 0 180px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ladder .board div { display: flex; justify-content: space-between; background: var(--g-soft); border-radius: 10px; padding: 6px 10px; }
.ladder .board div.hot { background: #fff3b0; color: #2b2238; font-weight: 800; }
.g-banner { margin: 14px auto 6px; text-align: center; font-size: 20px; font-weight: 800; background: linear-gradient(90deg, #fff3b0, #ffd9ea); border-radius: 16px; padding: 12px 16px; color: #2b2238; }
.confetti { text-align: center; font-size: 26px; letter-spacing: 6px; animation: gpop .6s ease; }
@keyframes gpop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.g-wheelbox { display: flex; justify-content: center; margin: 8px 0; }
.g-wheelbox .wheel { width: 220px; height: 230px; }
.g-wheelbox.big .wheel { width: 300px; height: 315px; }
.wheel text { font-size: 10px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
#gWheel { transform-origin: 0 0; }

/* 대기실: 최근 30분에 게임을 더 많이 한 방 */
.thumb.game { background: linear-gradient(135deg, #fff3b0, #ffd9ea 55%, #d9ccff); display: grid; place-items: center; }
.thumb.game .g-ico { font-size: 54px; }
.badge.live.game { background: #ffcf3f; color: #2b2238; font-weight: 800; }

/* 메인: 링크 없이 여는 방(게임 · 퀴즈 · 대화) */
.type-open { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 12px auto 0; font-size: 13px; }
.type-open button { border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.type-open button:hover { border-color: var(--accent); }
.thumb.talk { background: linear-gradient(135deg, #1f4a6b, #1c1f3a); display: grid; place-items: center; }
.thumb.talk .g-ico { font-size: 54px; }
.preview .game-art { width: 132px; flex: none; display: grid; place-items: center; font-size: 46px; background: linear-gradient(135deg, #3b2a6b, #1c1f3a); border-radius: 10px; aspect-ratio: 16 / 9; }

/* 넓게 보기 끄기: 영상 오른쪽 위(창 닫기 자리), 채팅을 숨겨도 그대로 */
.fs-close { display: none; }
.room.fs .player-box .fs-close { display: inline-flex; align-items: center; gap: 6px; position: absolute; top: 12px; right: 12px; z-index: 5; width: auto; height: auto; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .65); color: #fff; font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.room.fs .player-box .fs-close:hover { background: rgba(0, 0, 0, .85); border-color: #fff; }
.fs-close kbd { font-size: 11px; opacity: .7; }
/* 방 나가기: 상단 맨 오른쪽, 눈에 띄게 */
.btn.leave { border-color: #ff7a7a; color: #ff9a9a; font-weight: 700; }
.btn.leave:hover { background: rgba(255, 122, 122, .12); }
body.gm-body .top .btn.leave { border-color: #e85590; color: #e85590; }

.g-wrap > h2, .g-wrap > .g-sub { text-align: center; }

/* ---------- 휴대폰 상단(10-11) — 로고 · 영상/게임 · ⋯ · 나가기만 한 줄, 나머지는 ⋯ 안으로 ---------- */
.top-more { display: contents; }
.more-btn { display: none; }
.logo { white-space: nowrap; }
@media (max-width: 640px) {
  .top { gap: 8px; padding: 10px 12px; }
  .logo { font-size: 17px; }
  .logo small { display: none; }
  .mode-sw { margin-left: 0; }
  .mode-sw button { font-size: 12px; padding: 6px 9px; white-space: nowrap; }
  .btn.leave { font-size: 13px; padding: 7px 10px; white-space: nowrap; }
  .more-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; padding: 0; font-size: 18px; font-weight: 800; }
  .top-more { display: none; }
  .top-more.open {
    display: flex; flex-direction: column; gap: 6px; position: absolute; top: calc(100% + 6px); right: 12px; z-index: 30;
    min-width: 190px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
  .top-more.open > * { width: 100%; justify-content: flex-start; text-align: left; white-space: nowrap; }
  .top-more.open .hidden { display: none; }
  body.gm-body .top-more.open { background: var(--g-panel); border-color: var(--g-line); }
}
@media (max-width: 360px) {
  .mode-sw button { padding: 6px 7px; }
  .btn.leave { padding: 7px 8px; }
}
@media (max-width: 640px) {
  .room.gm .game-stage { padding: 12px 12px 4px; box-sizing: border-box; }
  .top-more.open .lang-chip::before { content: "🌐 "; }
}

/* 게임 중 리액션: 게임 화면 위로 떠올랐다 사라짐 */
.room.gm .stage { position: relative; }
.g-fly { position: absolute; bottom: 12%; z-index: 20; display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: gfly 2.6s ease-out forwards; }
.g-fly b { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25)); }
.g-fly span { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--g-text); background: var(--g-card); border-radius: 999px; padding: 1px 8px; }
@keyframes gfly { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { transform: translateY(-20px) scale(1.1); opacity: 1; } 100% { transform: translateY(-220px) scale(1); opacity: 0; } }
.g-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.g-check input { width: 18px; height: 18px; accent-color: #ff6fa5; }

/* 사다리 긴장감: 두구두구 · 도착하면 이름 */
.ladder { position: relative; }
.drum { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 3; font-size: 26px; font-weight: 800; color: #2b2238; background: #ffcf3f; border-radius: 999px; padding: 10px 22px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); animation: drum .12s linear infinite alternate; white-space: nowrap; }
@keyframes drum { from { transform: translate(-50%, -50%) rotate(-2deg) scale(1); } to { transform: translate(-50%, -50%) rotate(2deg) scale(1.04); } }
.ladder .lwho { font-size: 15px; font-weight: 900; text-anchor: middle; opacity: .35; transition: opacity .3s; }
.ladder .lwho.on { opacity: 1; }

/* 짧은 알림(링크 복사 등) */
.toast { position: fixed; left: 50%; top: 70px; transform: translate(-50%, -10px); z-index: 60; background: rgba(20, 22, 28, .92); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.g-btn.small { font-size: 13px; padding: 6px 12px; }

/* 룰렛 설정: 항목 제목 · ＋/－ · 항목마다 ✕ */
.g-label { display: block; font-size: 15px; font-weight: 800; margin: 12px 0 6px; color: var(--g-text); }
.g-label small { font-size: 12px; font-weight: 600; color: var(--g-muted); margin-left: 4px; }
.g-items-head { margin: 12px 0 6px; }
.g-items-head .g-label { margin: 0; }
.g-pm { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--g-line2); background: var(--g-card); color: var(--g-text); font-size: 24px; font-weight: 900; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--g-line2); }
.g-pm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--g-line2); }
.g-pm:disabled, .g-x:disabled { opacity: .35; cursor: default; }
.g-item { flex-direction: row; align-items: center; gap: 4px; }
.g-item .input { flex: 1; min-width: 0; }
.g-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--g-soft2); color: var(--g-muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.g-x:hover:not(:disabled) { background: #ff4d6d; color: #fff; }

/* 룰렛 제안 받기 */
.g-label.inline { display: inline; margin: 0 6px 0 0; }
.g-wheel-empty { margin: 14px auto; width: 220px; height: 150px; display: grid; place-items: center; border: 2px dashed var(--g-line2); border-radius: 20px; color: var(--g-muted); font-size: 13px; padding: 0 16px; }
.sug-box { text-align: left; margin-top: 8px; border-top: 2px dashed var(--g-line); padding-top: 10px; }
.sug-box h3 { margin: 4px 0 8px; font-size: 16px; }
.sug-box h3 small { font-size: 12px; font-weight: 600; color: var(--g-muted); margin-left: 6px; }
.sug-form { display: flex; gap: 8px; }
.sug-form .input { flex: 1; min-width: 0; }
.sugs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.sug { display: inline-flex; align-items: center; gap: 6px; background: var(--g-card); border: 2px solid var(--g-line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; color: var(--g-text); }
.sug small { font-size: 11px; font-weight: 600; color: var(--g-muted); }
.sug.pick { cursor: pointer; }
.sug.pick:hover { border-color: #8b5cf6; }
.sug.on { border-color: #3ccfa5; background: var(--g-ok); }
.sug .sx { font-style: normal; font-size: 11px; color: var(--g-muted); cursor: pointer; padding: 0 2px; }
.sug .sx:hover { color: #ff4d6d; }
.g-btn:disabled { opacity: .45; cursor: default; }

/* 방장: 진행 중인 게임 닫기(오른쪽 위) */
.g-close { position: absolute; top: 0; right: 4px; z-index: 6; border: 2px solid var(--g-line2); background: var(--g-card); color: var(--g-text); font: inherit; font-size: 13px; font-weight: 800; padding: 7px 14px; border-radius: 999px; cursor: pointer; box-shadow: 0 2px 0 var(--g-line2); }
.g-close:hover { border-color: #ff4d6d; color: #ff4d6d; }
.g-close.armed { background: #ff4d6d; border-color: #ff4d6d; color: #fff; }
/* 닫기 단추는 게임 창 바로 바깥 오른쪽 위에 붙음 */
.g-wrap.has-close { position: relative; padding-top: 46px; }
/* 손님 안내: 게임은 방장만 */
.g-hostonly { text-align: center; margin: 4px auto 14px; font-size: 13px; font-weight: 700; color: var(--g-muted); }
.gcard[data-locked] { cursor: not-allowed; }
.gcard[data-locked]:hover { transform: none; border-color: var(--g-line); }
