/* ⛔ iOS 는 «16px 미만» 입력창에 포커스하면 화면을 «확대»하고 «되돌리지 않는다».
   user-scalable=no·maximum-scale 은 iOS 10 이후 무시된다 — 폰트로만 막힌다.
   ⇒ 채팅을 한 번 누르면 화면이 확대된 채 «고정»됐다 (2026-09-08 사용자 신고).
   ⚠️ 16px 아래로 내리지 마라. 작게 보이고 싶으면 «칸»을 줄여라. */
:root {
  --sky-1: #7ed6f2;
  --sky-2: #a9e6ff;
  --turf-1: #7bc94a;
  --turf-2: #5faa33;
  --cream: #fff7e6;
  --ink: #2a1a0f;
  --accent: #ff5a3c;
  --accent-2: #ffc300;
  --pink: #ff4d94;
  --shadow: 0 6px 0 rgba(0,0,0,.22);
  --shadow-lg: 0 10px 0 rgba(0,0,0,.22);
  --radius: 20px;
  --border: 4px solid var(--ink);
  --font-disp: 'Jua', 'Pretendard Variable', sans-serif;
  --font-num: 'Fredoka', 'Pretendard Variable', sans-serif;
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* [hidden] 속성이 항상 우선하도록 (author display 규칙에 덮이는 문제 방지) */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, #cdeeff 100%);
  overflow: hidden;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen { position: fixed; inset: 0; display: none; overflow-y: auto; }
.screen.active { display: block; }

/* 버튼 */
.btn {
  font-family: var(--font-disp); font-size: 18px; color: var(--ink);
  border: var(--border); border-radius: 999px; padding: 12px 22px; cursor: pointer;
  background: #fff; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }
.btn.big { font-size: 22px; padding: 16px 28px; width: 100%; }
.btn.small { font-size: 15px; padding: 8px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-accent { background: var(--accent-2); }
.btn-ghost { background: var(--cream); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }

/* 카드 */
.card {
  background: var(--cream); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 22px;
}

/* ===== 홈 ===== */
.home-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px; padding: 32px 20px; }
.title-block { text-align: center; }
.galloping { font-size: 54px; animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateX(-6px) rotate(-3deg)} 50%{transform:translateX(6px) rotate(3deg)} }
.game-title {
  font-family: var(--font-disp); font-size: clamp(40px, 11vw, 76px); line-height: .95;
  color: #fff; text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 rgba(0,0,0,.15); margin-top: 6px;
}
.game-title span { color: var(--accent-2); }
.subtitle { margin-top: 14px; font-size: 17px; color: var(--ink); background: rgba(255,255,255,.6);
  display: inline-block; padding: 6px 16px; border-radius: 999px; border: 2px solid rgba(0,0,0,.15); }

.home-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-disp); font-size: 16px; }
.fld input, .join-row input, .add-row input {
  font-family: var(--font-body); font-size: 18px; font-weight: 600;
  border: 3px solid var(--ink); border-radius: 14px; padding: 13px 16px; background: #fff; color: var(--ink);
  outline: none; width: 100%;
}
.fld input:focus, .join-row input:focus, .add-row input:focus { border-color: var(--accent); }
.divider { display: flex; align-items: center; gap: 10px; color: #8a7a66; font-size: 14px; }
.divider::before, .divider::after { content:''; flex:1; height: 2px; background: rgba(0,0,0,.12); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-align: center; letter-spacing: 6px; font-family: var(--font-num); text-transform: uppercase; }
.err-msg { color: #d3341d; font-weight: 700; min-height: 18px; font-size: 14px; text-align: center; }
.foot { color: rgba(0,0,0,.5); font-size: 13px; text-align: center; }

/* ===== 로비 ===== */
.lobby-wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 40px; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; }
.room-badge { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 8px 18px; box-shadow: var(--shadow); }
.rb-label { font-size: 13px; opacity: .7; }
.rb-code { font-family: var(--font-num); font-size: 28px; font-weight: 700; letter-spacing: 4px; color: var(--accent-2); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-count { font-family: var(--font-disp); background: #fff; border: 2px solid var(--ink);
  padding: 6px 12px; border-radius: 999px; font-size: 14px; }

.lobby-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 780px) { .lobby-grid { grid-template-columns: 1fr; } }

.panel-title { font-family: var(--font-disp); font-size: 20px; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px; }
.host-tag { font-size: 12px; background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 999px; display: none; }
body.is-host .host-tag { display: inline-block; }

.add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.participant-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 46vh; overflow-y: auto; }
.p-chip { display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid var(--ink);
  border-radius: 999px; padding: 6px 8px 6px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.18); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.p-chip .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.p-chip .p-emoji { font-size: 18px; }
.p-chip .p-name { font-weight: 700; font-size: 15px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-chip .p-weight { font-family: var(--font-num); font-size: 13px; background: var(--accent-2);
  border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; display: none; }
body.use-weights .p-chip .p-weight { display: inline-block; }
.p-chip .wbtn { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink);
  background: #fff; font-weight: 800; cursor: pointer; line-height: 1; padding: 0; }
body.use-weights.is-host .p-chip .wbtn { display: inline-flex; align-items: center; justify-content: center; }
.p-chip .x { border: none; background: none; cursor: pointer; font-size: 16px; color: #b33; padding: 0 4px; font-weight: 800; }

/* 설정 */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-bottom: 2px dashed rgba(0,0,0,.12); flex-wrap: wrap; }
.setting:last-of-type { border-bottom: none; }
.s-label { font-family: var(--font-disp); font-size: 16px; }
.seg { display: flex; background: #fff; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg-btn { font-family: var(--font-disp); border: none; background: none; padding: 8px 14px; cursor: pointer; font-size: 15px; }
.seg-btn.active { background: var(--accent); color: #fff; }
.stepper { display: flex; align-items: center; gap: 10px; font-family: var(--font-num); font-size: 20px; }
.st-btn { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ink); background: #fff;
  font-size: 20px; font-weight: 800; cursor: pointer; line-height: 1; }
.st-suffix { font-size: 15px; }
body:not(.is-host) .seg-btn, body:not(.is-host) .st-btn,
body:not(.is-host) .switch input { pointer-events: none; opacity: .8; }

.switch { position: relative; width: 54px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #ccc; border: 3px solid var(--ink); border-radius: 999px; transition: .2s; }
.slider::before { content:''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  box-sizing: content-box; background: #fff; border: 2px solid var(--ink); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--turf-1); }
/* 안쪽 폭 48 − 손잡이 22 − 좌우 여백 3·3 = 이동 20px. 24 로 두면 오른쪽 테두리에 붙는다 */
.switch input:checked + .slider::before { transform: translateX(20px); }

.hint { font-size: 13px; color: #8a7a66; margin-top: 8px; }
.hint.center { text-align: center; }
.setting-desc { font-size: 12.5px; color: #8a7a66; line-height: 1.5; margin-top: 12px;
  background: #fff3d6; border: 2px solid rgba(0,0,0,.12); border-radius: 12px; padding: 9px 12px; }
.setting-desc b { color: var(--ink); }
.start-btn, .ready-btn { margin-top: 16px; }
.ready-btn.is-ready { background: var(--turf-1); color: #fff; }

/* 링크 입장 뷰 */
.join-room-badge { font-family: var(--font-disp); font-size: 20px; text-align: center;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 10px; margin-bottom: 4px; }
.join-room-badge b { color: var(--accent-2); font-family: var(--font-num); letter-spacing: 3px; }
#btn-back-home { align-self: center; }

/* 방장 전용 안내 + 잠금 */
.notice { background: #fff3d6; border: 2px solid var(--ink); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.settings-body.locked { opacity: .65; pointer-events: none; filter: grayscale(.2); }

/* 참가자 태그 */
.ready-count { font-size: 13px; background: var(--ink); color: #fff; padding: 3px 10px; border-radius: 999px; }
.p-chip.me { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,90,60,.25), 0 3px 0 rgba(0,0,0,.18); }
.p-chip.ready { background: #eafbe6; }
.tag-host { font-size: 11px; background: var(--accent); color: #fff; padding: 1px 7px; border-radius: 999px; }
.tag-me { font-size: 11px; background: var(--accent-2); padding: 1px 7px; border-radius: 999px; }
.ready-badge { font-size: 14px; }
.w-rank { margin-left: auto; font-family: var(--font-num); color: #8a7a66; }
.fr-title { font-family: var(--font-disp); }

/* ===== 레이스 ===== */
#screen-race { background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); }
.race-topbar { position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: rgba(42,26,15,.85); color: #fff; font-family: var(--font-disp); }
.race-status { font-size: 17px; }
.race-timer { font-family: var(--font-num); font-size: 20px; color: var(--accent-2); }
#race-canvas { position: fixed; top: 52px; left: 0; width: 100vw; height: calc(100vh - 52px); display: block; }

.countdown { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); }
.countdown span { font-family: var(--font-disp); font-size: 30vh; color: #fff;
  text-shadow: 6px 6px 0 var(--accent); animation: cd .95s ease-in-out; }
@keyframes cd { 0% { transform: scale(2.4); opacity: 0; } 40% { transform: scale(1); opacity: 1; } 100% { transform: scale(.4); opacity: 0; } }

/* 결과 */
.result-modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); padding: 20px; }
.result-card { position: relative; background: var(--cream); border: var(--border); border-radius: 26px;
  box-shadow: var(--shadow-lg); padding: 26px 24px; width: min(460px, 100%); text-align: center; overflow: hidden;
  animation: pop .3s ease; max-height: 92vh; display: flex; flex-direction: column; }
.trophy { font-size: 66px; animation: bob 1s ease-in-out infinite; }
.result-title { font-family: var(--font-disp); font-size: 34px; margin: 4px 0 16px; color: var(--accent); }
.winner-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 34vh; overflow-y: auto; }
.winner-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--ink);
  border-radius: 16px; padding: 12px 16px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.winner-item .medal { font-size: 26px; }
.winner-item .w-emoji { font-size: 26px; }
.winner-item .w-name { font-family: var(--font-disp); font-size: 22px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.full-rank { margin-top: 12px; text-align: left; border-top: 2px dashed rgba(0,0,0,.2); padding-top: 12px;
  max-height: 32vh; overflow-y: auto; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 15px; }
.rank-row .rank-no { font-family: var(--font-num); font-weight: 700; width: 30px; }
.rank-row .rank-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 31; overflow: hidden; }
.confetti i { position: absolute; width: 10px; height: 14px; top: -20px; opacity: .9;
  animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(120vh) rotate(720deg); } }

/* 토스트 */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow); animation: pop .2s ease; }

/* ===== 채팅 ===== */
.chat { position: fixed; left: 12px; bottom: 12px; z-index: 25; width: 280px; max-width: calc(100vw - 24px);
  background: rgba(255,247,230,.62); border: 3px solid rgba(42,26,15,.7); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; font-family: var(--font-body);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.chat-head { background: rgba(42,26,15,.82); color: #fff; font-family: var(--font-disp); padding: 6px 12px;
  cursor: grab; font-size: 15px; display: flex; justify-content: space-between; align-items: center;
  touch-action: none; user-select: none; }
.chat-head:active { cursor: grabbing; }
.chat.collapsed .chat-body { display: none; }
/* 게임 중: 반투명(뒤 캐릭터 비침). 마우스 올리거나 입력창 포커스 시 불투명 복원 */
.chat.ingame { opacity: .48; transition: opacity .18s; }
.chat.ingame:hover, .chat.ingame:focus-within { opacity: 1; }
.chat-log { height: 150px; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column;
  gap: 4px; font-size: 13px; }
.chat-msg { line-height: 1.35; word-break: break-word; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 2px solid rgba(0,0,0,.1); }
.chat-form input { flex: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 10px;
  padding: 7px 10px; font-size: 16px; font-family: var(--font-body); outline: none; }
.chat-form input:focus { border-color: var(--accent); }
.chat-send { border: 2px solid var(--ink); background: var(--accent-2); border-radius: 10px;
  padding: 0 12px; font-family: var(--font-disp); cursor: pointer; font-size: 13px; }

/* ===== 아이템 버튼 ===== */
.btn-item { position: fixed; right: 18px; bottom: 18px; z-index: 24; font-family: var(--font-disp);
  font-size: 22px; color: #fff; background: var(--pink); border: 4px solid var(--ink);
  border-radius: 999px; padding: 12px 24px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px; animation: itembob .8s ease-in-out infinite; }
.btn-item span { font-size: 17px; }
.btn-item:disabled { opacity: .6; }
@keyframes itembob { 0%,100% { transform: translateY(0) scale(1) rotate(-3deg); } 50% { transform: translateY(-6px) scale(1.06) rotate(3deg); } }


/* ⛔ 모바일에서 채팅이 «화면 절반»을 덮는다 — 440px 폭에서 280px = 64%.
   실측(2026-09-03): 로비 설정 패널이 통째로 가려져 조작이 안 됐다.
   ⭐ 폭을 줄이는 것만으론 부족해서 «터치 기기는 접힌 채로» 시작한다(app.js). */
@media (max-width: 620px) {
  .chat { width: 158px; }
  .chat-log { height: 88px; }
  .chat-head { padding: 6px 9px; font-size: 12px; }
  .chat-form input { padding: 6px 9px; font-size: 16px; }
  .chat-send { padding: 0 9px; font-size: 12px; }
}


/* ── 뽑기 방식 (2026-09-03) */
.mode-note { margin: -2px 0 10px; font-size: 12.5px; line-height: 1.5; opacity: .9; }
.howto-list .hint { display:block; margin-top:3px; font-size:11.5px; opacity:.62; }
.howto-list i { font-style:normal; opacity:.72; }

/* ===== 뽑기 방식 안내 카드 — 무궁화·다리와 같은 꼴 (2026-09-04, 스타일이 없어 기본 ol 로 깨져 보였다) ===== */
.howto { margin-top: 14px; background: #fff8ef; border: 3px solid var(--ink);
  border-radius: 16px; padding: 14px 16px 16px; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.howto-title { font-family: var(--font-disp); font-size: 18px; margin-bottom: 10px; letter-spacing: .5px; color: var(--ink); }
.howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; counter-reset: step; }
.howto-list li { position: relative; font-size: 14.5px; line-height: 1.55; color: #3a3330; padding-left: 30px; }
.howto-list li::before { counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff; font-family: var(--font-num); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.howto-list b { color: var(--ink); }
.howto-list i { font-style: normal; color: #6f6254; }
.howto-list .hint { display: block; margin-top: 4px; font-size: 12.5px; color: #8a7a66; }

/* ===== 모바일: 버튼 홀드 시 선택·복사 팝업 방지 + 채팅 스크롤 허용 (2026-09-04) ===== */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, canvas, .ct-btn, .seg-btn, .switch, .stepper, .tab, [role="button"] {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
canvas, .ct-btn { touch-action: none; }               /* 게임 조작은 스크롤 제스처를 먹지 않게 */
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.chat-log, .chat-body, #chat-log { touch-action: pan-y; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ⭐ 연습시간 배너 (2026-09-04) */
.practice-bar { position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.96); border: 2px solid var(--ink); box-shadow: var(--shadow);
  font-size: 13px; color: #3a3330; max-width: calc(100vw - 20px); }
.pb-tag { font-family: var(--font-disp); font-weight: 800; color: #e07b1f; }
.pb-msg { opacity: .7; }
.pb-left { font-variant-numeric: tabular-nums; font-weight: 800; color: #111; }
.pb-skip { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: var(--ink); border: none; color: #fff; }
.pb-vote { font-size: 11.5px; opacity: .65; }
@media (max-width: 620px) {
  .practice-bar { font-size: 12px; gap: 7px; padding: 6px 11px; white-space: nowrap; top: 42px; }
  .pb-msg { display: none; }            /* 좁은 화면은 «연습 · 남은시간 · 건너뛰기» 만 */
  .pb-vote { display: none; }
  .pb-skip { padding: 4px 10px; }
}

/* ⭐ 연습 종료 카운트다운 — 화면 «정중앙»에 크게 (2026-09-04) */
.practice-cd { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; pointer-events: none; }
.pc-tx { font-family: var(--font-disp, inherit); font-size: clamp(15px, 4.5vw, 22px); font-weight: 800;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.75), 0 0 22px rgba(0,0,0,.6); letter-spacing: .5px; }
.pc-num { font-family: var(--font-disp, inherit); font-size: clamp(76px, 26vw, 168px); font-weight: 900; line-height: 1;
  color: #ffd35f; text-shadow: 0 6px 26px rgba(0,0,0,.8), 0 0 40px rgba(255,180,60,.45);
  animation: pc-pop .42s cubic-bezier(.2,1.5,.4,1); }
@keyframes pc-pop { 0% { transform: scale(.55); opacity: 0; } 55% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ⛔ 내용이 없는 안내 상자는 «빈 칸»으로 보인다 — 테두리·배경만 남아 설정 사이에 구멍이 생겼다 (2026-09-04) */
.notice:empty, .mode-note:empty { display: none; }

/* ── 봇 추가 바 (참가자 목록 위) — ⭐ 톤 중립: currentColor·rgba 만 써서 6게임 어디서나 뜬다 */
.botbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.botbar select, .botbar button { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(128,128,128,.45); background: rgba(128,128,128,.14); color: inherit; cursor: pointer; }
.botbar button { font-weight: 700; }
.botbar button:hover:not(:disabled) { background: rgba(128,128,128,.28); }
.botbar button:disabled, .botbar select:disabled { opacity: .4; cursor: default; }
.bot-note { font-size: 11px; opacity: .55; }
@media (max-width: 640px) { .bot-note { display: none; } }
/* ⭐ 혼자일 때 — 봇 추가 버튼이 «먼저 눈에 띈다». 권하는 것이지 막는 것이 아니다 */
.botbar.suggest button { border-color: rgba(255,190,90,.75); background: rgba(255,190,90,.2); animation: botpulse 1.9s ease-in-out infinite; }
.botbar.suggest .bot-note { opacity: .8; }
@keyframes botpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,190,90,.42); } 50% { box-shadow: 0 0 0 7px rgba(255,190,90,0); } }

/* ⭐ 접힌 채팅은 «머리만큼만» 좁게 (2026-09-06 사용자: 「닫힌 상태는 가로 폭을 줄여서」).
   ⛔ 예전엔 접혀도 폭이 158~270px 그대로라, 접어도 화면을 그만큼 먹었다. */
.chat.collapsed { width: auto; min-width: 0; }
.chat.collapsed .chat-head { white-space: nowrap; }

/* ⭐ 모달 스크롤 (2026-09-06 사용자: 「모바일에서 팝업에 스크롤이 없어서 동작이 안 된다」)
   ⛔ 30명 순위가 화면을 넘치는데 .result-card 가 overflow:hidden 이라 «버튼을 못 눌러»
      게임 진행이 막혔다. 카드를 자르지 말고 «덮개»를 스크롤시킨다.
   ⭐ margin:auto + align-items:flex-start — 짧으면 가운데, 길면 위부터 스크롤. */
.result-modal { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.result-card { margin: auto; max-height: none; overflow: visible; }
.full-rank, .winner-list { max-height: none; overflow: visible; }

/* ⭐ 로비 헤더 — 8게임 «한 줄»로 통일 (2026-09-06 사용자 지시, 기준: 다리 건너기)
     방 코드 · 인원 · 링크 복사 · 나가기
   ⛔ 좁은 화면에서 로고까지 넣으면 줄이 접혀 헤더가 세 줄이 된다 (무궁화가 그랬다).
      로고는 폰에서 «뺀다» — 게임 화면 상단바에 이미 마크가 있다. */
@media (max-width: 620px) {
  .lobby-head { flex-wrap: nowrap; gap: 8px; }
  .lobby-head .tp-lobby-brand { display: none; }
  .room-badge { padding: 6px 12px; gap: 6px; flex: 0 1 auto; min-width: 0; }
  .rb-label { font-size: 10px; }
  .rb-code { font-size: 21px; letter-spacing: .10em; }
  .head-actions { gap: 6px; flex-wrap: nowrap; margin-left: auto; }
  .head-actions .btn { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
  .member-count { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
}
