/* ============================================================
   덕플레이 (DUCK PLAY) — 실시간 채팅 퀴즈
   시안(duck-play-mockup.png) 기준: 남색 배너 · 문제 카드 · 우측 320px(순위+채팅)
   ============================================================ */
.qp-page { max-width: 1180px; margin: 0 auto; padding: 14px 14px 40px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- 남색 배너 ---------- */
.qp-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(105deg, #123a7c 0%, #1b4fa0 55%, #1e5ab4 100%);
  border-radius: 16px; padding: 20px 26px; color: #fff;
  box-shadow: 0 6px 18px rgba(18, 58, 124, .25);
}
.qp-ban-kicker { font-size: 11.5px; font-weight: 900; letter-spacing: .18em; color: #9ec3f5; }
.qp-ban-title { font-size: 30px; font-weight: 900; line-height: 1.25; }
.qp-ban-desc { margin: 2px 0 0; font-size: 13px; color: #cfe1fa; font-weight: 700; }
.qp-ban-right { text-align: right; flex: none; }
.qp-ban-label { font-size: 11.5px; font-weight: 800; color: #cfe1fa; }
.qp-ban-progress { font-size: 26px; font-weight: 900; color: #ffd54d; line-height: 1.2; }
.qp-ban-sub { font-size: 12px; font-weight: 700; color: #cfe1fa; }

/* ---------- 로비 ---------- */
.qp-lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.qp-lobby-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.qp-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.qp-room { border: 1.5px solid var(--line, #dbe6f2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.qp-room-title { font-weight: 900; font-size: 14.5px; }
.qp-room-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--tx-sub, #5b7089); font-weight: 700; }
.qp-room-state.is-playing { color: #e05252; }
.qp-room-state.is-waiting { color: #1f9254; }
.qp-room-foot { margin-top: 4px; }
.qp-none { text-align: center; color: var(--tx-sub, #5b7089); font-weight: 700; padding: 34px 10px; line-height: 1.7; }

/* ---------- 방 만들기 폼 ---------- */
.qp-form { display: flex; flex-direction: column; gap: 8px; }
.qp-form label { font-size: 12.5px; font-weight: 800; color: var(--tx-sub, #5b7089); }
.qp-form input[type="text"], .qp-form input[type="password"], .qp-form select {
  width: 100%; box-sizing: border-box; border: 1.5px solid var(--line, #dbe6f2); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-weight: 700; }
.qp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qp-form-check { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: var(--tx, #1c2b3a); }
.qp-form-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.qp-cat-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qp-cat { border: 1.5px solid var(--line, #dbe6f2); background: #fff; border-radius: 10px; padding: 9px 8px;
  font-size: 13px; font-weight: 800; cursor: pointer; }
.qp-cat.is-on { border-color: #1b4fa0; background: #eaf2fd; color: #123a7c; }
.qp-cat-wide { grid-column: 1 / -1; }

/* ---------- 대기방 ---------- */
.qp-wait-grid { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
.qp-wait-rule { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: #1b4fa0; }
.qp-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.qp-seat { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1.5px solid var(--line, #dbe6f2);
  border-radius: 12px; padding: 12px 6px 10px; background: #f7fbff; }
.qp-seat.is-empty { justify-content: center; min-height: 120px; color: #b3c4d6; font-weight: 800; font-size: 12.5px; border-style: dashed; background: #fff; }
.qp-seat-name { font-size: 12.5px; font-weight: 900; display: flex; align-items: center; gap: 3px; max-width: 100%; overflow: hidden; }
.qp-seat-tag { font-size: 11px; font-weight: 900; border-radius: 8px; padding: 2px 8px; }
.qp-seat-tag.is-leader { background: #fff3d1; color: #9a6b00; }
.qp-seat-tag.is-ready { background: #dcf5e5; color: #1f9254; }
.qp-seat-tag.is-wait { background: #eef2f7; color: #8296ab; }
.qp-seat-kick { border: 0; background: none; color: #e05252; font-size: 11px; font-weight: 800; cursor: pointer; }
/*  주 버튼(시작/준비) + [게임 나가기] — 한 줄에 반반씩, 같은 크기로 나란히 (2026-08-30 정렬 수정)
    카드가 좁아도 두 버튼이 균등하게 줄을 나눠 가져서 어긋나 보이지 않는다 */
.qp-wait-btns { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.qp-wait-btns .gg-btn { flex: 1 1 0; min-width: 110px; padding: 13px 8px; font-size: 15px; border-radius: 12px; text-align: center; }
.qp-wait-btns .qp-wait-note { flex-basis: 100%; margin-top: 2px; }
.qp-wait-note { margin: 0; font-size: 12px; color: var(--tx-sub, #5b7089); font-weight: 700; line-height: 1.6; }

/* ---------- 게임 (시안 배치) ---------- */
.qp-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
.qp-main { display: flex; flex-direction: column; gap: 12px; }
.qp-main-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qp-cat-chip { font-size: 13px; font-weight: 900; color: #1b4fa0; }
.qp-time-wrap { display: flex; align-items: center; gap: 8px; }
.qp-time-label { font-size: 12.5px; font-weight: 800; color: var(--tx-sub, #5b7089); }
.qp-time { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  border-radius: 50%; background: #fdecec; color: #e05252; font-size: 17px; font-weight: 900; }
.qp-time.is-low { animation: qp-pulse .9s infinite; }
@keyframes qp-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.qp-qarea { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 18px 12px; }
.qp-q-meta { font-size: 12px; font-weight: 900; letter-spacing: .12em; color: #8296ab; }
.qp-q-text { font-size: 24px; font-weight: 900; line-height: 1.45; color: var(--tx, #1c2b3a); word-break: keep-all; }
.qp-q-hint { margin: 0; font-size: 13px; font-weight: 700; color: #8296ab; }
.qp-q-state { margin: 4px 0 0; font-size: 13.5px; font-weight: 900; color: #1b4fa0; }
.qp-q-state.is-solved { color: #1f9254; }
.qp-reveal-answer { font-size: 26px; font-weight: 900; color: #1f9254; }
.qp-reveal-exp { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--tx-sub, #5b7089); line-height: 1.6; }
.qp-reveal-solvers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.qp-solver { background: #eaf2fd; color: #123a7c; border-radius: 9px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; }
.qp-reveal-none { margin: 0; font-size: 13.5px; font-weight: 800; color: #8296ab; }
.qp-priv-note { margin: 0; font-size: 12px; color: #8296ab; font-weight: 700; }

/* 정답 입력 */
.qp-chat-form { display: flex; gap: 8px; }
.qp-chat-input { flex: 1; min-width: 0; border: 1.5px solid var(--line, #dbe6f2); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-weight: 700; }
.qp-chat-input:focus { outline: none; border-color: #1b4fa0; }
.qp-chat-form .gg-btn { background: #1b6ee0; }

/* ---------- 우측: 순위 + 채팅 ---------- */
.qp-side { display: flex; flex-direction: column; gap: 12px; }
.qp-rank-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qp-round-tag { font-size: 11.5px; font-weight: 900; letter-spacing: .1em; color: #8296ab; }
.qp-rank-list { display: flex; flex-direction: column; }
.qp-rank-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #eef3f9; }
.qp-rank-row:last-child { border-bottom: 0; }
.qp-rank-row.is-me { background: #f3f8ff; border-radius: 8px; }
.qp-rank-row.is-off { opacity: .5; }
.qp-rank-no { width: 18px; text-align: center; font-weight: 900; font-size: 13px; color: #8296ab; flex: none; }
.qp-rank-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 3px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qp-rank-score { font-weight: 900; font-size: 13.5px; color: #1b4fa0; flex: none; }

/* 채팅 */
.qp-chatcard { display: flex; flex-direction: column; }
.qp-chat-list { flex: 1; min-height: 140px; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 3px; padding: 2px 0 6px; }
.qp-chat-line { font-size: 12.5px; line-height: 1.5; display: flex; gap: 6px; align-items: baseline; }
.qp-chat-nick { font-weight: 900; flex: none; color: var(--tx, #1c2b3a); }
.qp-chat-text { min-width: 0; word-break: break-word; font-weight: 600; color: #40566d; }
.qp-chat-line.is-sys .qp-chat-nick { color: #8296ab; }
.qp-chat-line.is-sys .qp-chat-text { color: #8296ab; font-weight: 700; }
.qp-chat-line.is-solve .qp-chat-text { color: #1f9254; font-weight: 800; }

/* ---------- 하단 ---------- */
.qp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 700; color: #8296ab; padding: 0 4px; }

/* ---------- 결과 ---------- */
.qp-podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; padding: 16px 0 10px; }
.qp-pod { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 110px; }
.qp-pod-medal { font-size: 26px; }
.qp-pod.is-r1 .qp-pod-medal { font-size: 34px; }
.qp-pod-name { font-size: 13.5px; font-weight: 900; display: flex; align-items: center; gap: 3px; }
.qp-pod-score { font-size: 16px; font-weight: 900; color: #1b4fa0; }
.qp-pod-sub { font-size: 11.5px; font-weight: 700; color: #8296ab; }
.qp-rest { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid #eef3f9; }
.qp-rest-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #eef3f9; font-size: 13px; font-weight: 800; }
.qp-reward-box { margin-top: 14px; background: #fffaf0; border: 1.5px solid #f4dfae; border-radius: 12px; padding: 12px 16px; }
.qp-reward-title { font-weight: 900; font-size: 14px; margin-bottom: 6px; }
.qp-reward-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 800; padding: 3px 0; }
.qp-reward-row .is-plus { color: #1f9254; font-weight: 900; }
.qp-reward-note { margin: 6px 0 0; font-size: 11.5px; font-weight: 700; color: #a8946a; }
.qp-end-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.qp-end-btns .gg-btn { padding: 14px 30px; font-size: 15.5px; border-radius: 12px; min-width: 160px; }
.qp-review { display: flex; flex-direction: column; gap: 2px; }
.qp-review-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 2px; border-bottom: 1px solid #eef3f9; }
.qp-review-no { font-weight: 900; font-size: 12px; color: #8296ab; flex: none; }
.qp-review-q { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.qp-review-a { font-weight: 900; font-size: 13.5px; color: #1f9254; flex: none; }
.qp-review-exp { margin: 0 0 4px 30px; font-size: 12px; color: #8296ab; font-weight: 700; }

/* ---------- 모바일 — 세로로 쌓는다 (시안 구조 유지) ---------- */
@media (max-width: 860px) {
  .qp-page { padding: 10px 10px 30px; gap: 10px; }
  .qp-banner { padding: 14px 16px; border-radius: 13px; }
  .qp-ban-title { font-size: 22px; }
  .qp-ban-progress { font-size: 20px; }
  .qp-layout, .qp-wait-grid { grid-template-columns: 1fr; }
  .qp-q-text { font-size: 19px; }
  .qp-qarea { min-height: 140px; padding: 12px 6px; }
  .qp-chat-list { max-height: 180px; }
  .qp-podium { gap: 10px; }
}

/* ---------- 배경음악 버튼 (2026-08-30 · 하이로우와 동일한 모양) ---------- */
.qp-bgm {
  width: 40px; height: 40px; flex: none;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.qp-bgm:hover { background: rgba(255, 255, 255, .22); }
.qp-bgm.is-off { filter: grayscale(1); opacity: .6; }
