/* 대화 사이트 공통 모양.
 *
 * 색은 토큰으로만 쓴다 — 밝은 테마는 값만 바꿔 끼우고,
 * 방 종류(.app[data-kind])가 강조색을 한 번 더 덮어쓴다.
 * 그래야 "지금 어느 방에 쓰고 있는지" 를 색으로 먼저 알아챈다.
 *
 * 화면은 셋으로 나뉜다. 좁아지면 순서대로 접힌다.
 *   1120px~ : 방 목록 | 대화 | 접속자        (3단)
 *   768px~  : 방 목록 | 대화                 (접속자는 옆에서 밀려 나온다)
 *   ~767px  : 대화                           (방 목록은 서랍, 접속자도 서랍)
 */

:root {
  --bg-base: #080a0f;
  --bg-panel: #0d121b;
  --bg-card: rgba(22, 29, 43, 0.6);
  --bg-card-hover: rgba(30, 39, 56, 0.85);
  --bg-input: rgba(12, 17, 26, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-main: #f3f5f8;
  --text-muted: #7e8b9b;
  --text-dim: #828ea4;
  --accent: #f5c042;
  --accent-glow: rgba(245, 192, 66, 0.12);
  --focus-ring: rgba(245, 192, 66, 0.7);
  --on-accent: #1b1300;      /* 강조색 위에 올라가는 글자 */
  --bubble-mine: rgba(245, 192, 66, 0.16);
  --bubble-other: rgba(255, 255, 255, 0.05);
  --danger: #ff8080;
  --veil: rgba(0, 0, 0, 0.55);
  /* 방 코드처럼 글자 폭이 같아야 읽히는 자리에만 쓴다 */
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* 밝은 테마 — 같은 토큰을 값만 바꿔 끼운다 */
:root[data-theme="light"] {
  --bg-base: #f5f7fb;
  --bg-panel: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #eef1f7;
  --bg-input: #ffffff;
  --border-subtle: rgba(17, 24, 39, 0.10);
  --border-strong: rgba(17, 24, 39, 0.22);
  --text-main: #131722;
  --text-muted: #515c73;
  --text-dim: #626a7a;
  --accent: #8a5f00;         /* 밝은 바탕에서도 읽히도록 진한 금색 */
  --accent-glow: rgba(154, 107, 0, 0.10);
  --focus-ring: rgba(154, 107, 0, 0.65);
  --on-accent: #ffffff;
  --bubble-mine: rgba(154, 107, 0, 0.14);
  --bubble-other: rgba(17, 24, 39, 0.05);
  --danger: #b42318;
  --veil: rgba(17, 24, 39, 0.35);
}

/* 휘발성 방은 강조색을 주황으로 바꾼다.
 * 테마(밝게/어둡게)는 사용자가 고른 것을 그대로 두고, 색만 갈아 끼운다 —
 * 방을 옮길 때마다 화면 전체가 뒤집히면 그게 더 헷갈린다. */
.app[data-kind="room"] {
  --accent: #ff9d4d;
  --accent-glow: rgba(255, 157, 77, 0.14);
  --focus-ring: rgba(255, 157, 77, 0.75);
  --on-accent: #2a1400;
  --bubble-mine: rgba(255, 157, 77, 0.16);
}
:root[data-theme="light"] .app[data-kind="room"] {
  --accent: #a83c00;
  --accent-glow: rgba(168, 60, 0, 0.10);
  --focus-ring: rgba(168, 60, 0, 0.65);
  --on-accent: #ffffff;
  --bubble-mine: rgba(168, 60, 0, 0.13);
}

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

/* hidden 속성은 브라우저 기본 규칙(display:none)으로 동작하는데,
 * 그 규칙은 우리가 쓴 .app { display: grid } 같은 클래스 규칙에 밀린다.
 * 그러면 숨겼다고 생각한 것이 화면에 그대로 남는다 — 여기서 한 번에 못 박는다. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  /* 한글이 본문이므로 한글이 예쁜 글꼴을 먼저 놓는다.
   * Pretendard 가 안 내려오면 기기에 있는 한글 글꼴로 이어 받는다. */
  font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR',
               -apple-system, BlinkMacSystemFont, system-ui,
               'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;   /* 한글은 단어 가운데서 끊지 않는다 */
}

button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

:where(button, input, textarea, a):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- 공통 조각 ---- */

.ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.ghost:hover { background: var(--bg-card-hover); color: var(--text-main); }

.primary {
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  color: var(--on-accent);
  cursor: pointer;
  font-weight: 700;
  padding: 12px 20px;
}
.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.danger-btn {
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  width: 100%;
}
.danger-btn:hover { background: var(--danger); color: var(--bg-base); }

/* 손가락으로 누르는 자리는 넉넉하게 잡는다 */
.icon-btn {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  flex: none;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-main); }

@media (pointer: coarse) {
  .ghost { min-height: 40px; padding: 9px 16px; }
  .icon-btn { min-height: 44px; min-width: 44px; }
}

.field {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-main);
  padding: 12px 14px;
  width: 100%;
}
.field::placeholder { color: var(--text-dim); }

.notice { color: var(--danger); font-size: 13px; min-height: 20px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- 3단 뼈대 ---- */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 232px;
  /* 모바일 가상 키보드가 올라오면 talk.js 가 --app-h 를 실제 보이는 높이로 맞춘다 */
  height: var(--app-h, 100dvh);
  overflow: hidden;
}

.veil {
  background: var(--veil);
  inset: 0;
  position: fixed;
  z-index: 30;
}

/* ---- 왼쪽: 방 목록 ---- */

.lnb {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px;
  z-index: 40;
}

.lnb-head { align-items: center; display: flex; gap: 8px; padding: 0 4px 14px; }
.lnb-brand { font-size: 17px; font-weight: 700; text-decoration: none; }
.lnb-close { display: none; margin-left: auto; }

.lnb-me {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
}
.lnb-me-label { color: var(--text-muted); display: block; font-size: 11px; }
.lnb-me-row { align-items: center; display: flex; gap: 8px; margin-top: 2px; }
.lnb-me-nick {
  flex: 1; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.lnb-label {
  color: var(--text-dim); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; padding: 0 6px 6px;
}

.lnb-rooms { display: grid; gap: 4px; }

.lnb-room {
  align-items: center;
  border-radius: 12px;
  border-left: 3px solid transparent;
  color: inherit;
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  text-decoration: none;
}
.lnb-room:hover { background: var(--bg-card-hover); }
.lnb-room[aria-current="page"] {
  background: var(--accent-glow);
  border-left-color: var(--accent);
}
.lnb-room-icon { flex: none; font-size: 17px; }
.lnb-room-name { display: block; font-size: 14px; font-weight: 700; }
.lnb-room-desc { color: var(--text-muted); display: block; font-size: 11px; }

.lnb-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; }

/* ---- 가운데: 대화 ---- */

.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }

.chat-head {
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex: none;
  gap: 8px;
  padding: 10px 14px;
}

.chat-title { font-size: 16px; font-weight: 700; white-space: nowrap; }

.chat-kind {
  background: var(--accent-glow);
  border-radius: 999px;
  color: var(--accent);
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  white-space: nowrap;
}

/* 휘발성 방에서 "혼자 남았다" 가 되면 뱃지가 눈에 띄게 바뀐다 */
.chat-kind.alone {
  background: var(--danger);
  color: var(--bg-base);
}

.chat-head-tail { display: flex; gap: 4px; margin-left: auto; }

.people-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}
.people-btn:hover { background: var(--bg-card-hover); color: var(--text-main); }

/* ---- 핀 (상시방) ---- */

.pin {
  align-items: center;
  background: var(--accent-glow);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex: none;
  gap: 10px;
  padding: 8px 14px;
}
.pin-icon { flex: none; }

/* 꽂힌 글로 데려가는 자리. 버튼 안에 버튼을 넣을 수 없어 따로 뺐다. */
.pin-body {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  flex: 1;
  font: inherit;
  min-width: 0;
  padding: 4px 0;
  text-align: left;
}
.pin-body:hover .pin-text { text-decoration: underline; }
.pin-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; font-size: 13px;
}
.pin-meta { color: var(--text-muted); display: block; font-size: 11px; }
.pin-off { flex: none; }

/* ---- 검색 (상시방) ---- */

.search {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex: none;
  gap: 8px;
  padding: 10px 14px;
}
.search input { flex: 1; }

.result-head {
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex: none;
  gap: 8px;
  font-size: 13px;
  padding: 8px 14px;
}
.result-head span { color: var(--text-muted); }

mark { background: var(--accent); border-radius: 3px; color: var(--on-accent); padding: 0 2px; }

/* ---- 말들 ---- */

.chat-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-wrap: anywhere;
  overflow-y: auto;
  padding: 18px 16px;
  scroll-behavior: smooth;
}

/* 휘발성 방은 바닥에 경고 줄무늬를 깔아 둔다.
 * "어느 방에 쓰고 있는지" 만 알려 주면 되므로 아주 옅게, 넓게 깐다 —
 * 글보다 바닥이 먼저 보이면 그건 실패다. */
.app[data-kind="room"] .chat-log {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 26px,
    rgba(255, 157, 77, 0.028) 26px 52px
  );
}
:root[data-theme="light"] .app[data-kind="room"] .chat-log {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 26px,
    rgba(168, 60, 0, 0.035) 26px 52px
  );
}

.chat-empty { color: var(--text-dim); font-size: 14px; margin: auto; text-align: center; }

.day {
  align-self: center;
  background: var(--bubble-other);
  border-radius: 999px;
  color: var(--text-muted);
  flex: none;
  font-size: 12px;
  margin: 14px 0 8px;
  padding: 3px 12px;
}

.msg { display: flex; flex: none; flex-direction: column; margin-top: 10px; max-width: 78%; }
.msg.tight { margin-top: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.flash .bubble { animation: flash 1.4s ease-out; }

@keyframes flash {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.msg-nick { color: var(--text-muted); font-size: 12px; margin: 0 4px 3px; }

.msg-row { align-items: flex-end; display: flex; gap: 6px; }
.msg.mine .msg-row { flex-direction: row-reverse; }

.bubble {
  background: var(--bubble-other);
  border-radius: 14px;
  padding: 9px 13px;
  white-space: pre-wrap;
}
.msg.mine .bubble { background: var(--bubble-mine); }

/* 인용 답장 — 무엇에 대한 말인지 붙여 둔다 */
.quote {
  border-left: 3px solid var(--accent);
  margin: -2px 0 7px;
  opacity: 0.85;
  padding-left: 8px;
}
.quote-nick { color: var(--accent); display: block; font-size: 11px; font-weight: 700; }
.quote-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 12px; overflow: hidden;
}

/* 지운 글 — 자리는 남기고 내용만 비운다.
 * 말풍선처럼 안 보이게 해서 "여기 뭔가 있었다" 만 남긴다. */
.bubble.gone {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}
.quote-text.gone { color: var(--text-dim); font-style: italic; }

.msg-at { color: var(--text-dim); flex: none; font-size: 11px; }

.msg-acts { display: flex; gap: 2px; flex: none; }
.msg-acts button {
  background: transparent; border: 0; border-radius: 8px;
  color: var(--text-dim); cursor: pointer; font-size: 12px;
  min-height: 28px; min-width: 28px;
}
.msg-acts button:hover { background: var(--bg-card-hover); color: var(--text-main); }

/* 마우스가 있는 화면에서는 올려놨을 때만 꺼낸다.
 * 손가락만 있는 화면에서는 늘 보이게 둔다 — 호버가 없기 때문이다. */
@media (hover: hover) and (pointer: fine) {
  .msg-acts { opacity: 0; transition: opacity 0.12s; }
  .msg:hover .msg-acts, .msg:focus-within .msg-acts { opacity: 1; }
}
@media (pointer: coarse) {
  .msg-acts button { min-height: 40px; min-width: 40px; }
}

/* ---- 맨 아래로 ---- */

.to-bottom {
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  bottom: 118px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  color: var(--on-accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  min-height: 40px;
  padding: 0 16px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 5;
}

/* ---- 쓰는 자리 ---- */

.chat-foot {
  border-top: 1px solid var(--border-subtle);
  flex: none;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
}

.reply-strip {
  align-items: center;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
}
.reply-strip-body { min-width: 0; }
.reply-strip-nick { color: var(--accent); font-size: 11px; font-weight: 700; }
.reply-strip-text {
  color: var(--text-muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-strip .icon-btn { margin-left: auto; }

.composer { align-items: flex-end; display: flex; gap: 8px; }

.composer textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  flex: 1;
  max-height: 140px;
  min-height: 46px;
  padding: 12px 14px;
  resize: none;
}

/* 휘발성 방은 쓰는 자리부터 다르게 보이게 한다.
 * 기밀을 어느 방에 적고 있는지 손이 먼저 알아채야 한다. */
.app[data-kind="room"] .composer textarea {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.composer .primary { border-radius: 14px; flex: none; height: 46px; padding: 0 20px; }

.chat-state { color: var(--text-dim); font-size: 12px; min-height: 18px; padding: 4px 2px 0; }
.chat-state.bad { color: var(--danger); }

/* 입력 중 — 자리를 늘 잡아 둔다.
 * 나타났다 사라질 때마다 밑의 입력칸이 흔들리면 글쓰기가 방해된다. */
.typing {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 12px;
  gap: 6px;
  height: 18px;
  padding: 0 2px 4px;
}

.typing-dots {
  background: currentColor;
  border-radius: 50%;
  flex: none;
  height: 5px;
  width: 5px;
  box-shadow: 8px 0 currentColor, 16px 0 currentColor;
  margin-right: 16px;
  animation: typing-blink 1.2s infinite ease-in-out;
}

@keyframes typing-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* 움직임을 불편해하는 사람에게는 깜빡이지 않는다 */
@media (prefers-reduced-motion: reduce) {
  .typing-dots { animation: none; opacity: 0.7; }
}

/* ---- 오른쪽: 접속자·방 정보 ---- */

.side {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  z-index: 40;
}

.side-head { align-items: center; display: flex; gap: 8px; }
.side-title { color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.side-close { display: none; margin-left: auto; }

.people { display: grid; gap: 2px; }
.person {
  align-items: center; border-radius: 8px; display: flex;
  font-size: 13px; gap: 8px; padding: 7px 8px;
}
.person.me { color: var(--accent); font-weight: 700; }
.dot {
  background: #4ade80; border-radius: 50%; flex: none;
  height: 7px; width: 7px;
}

.side-note {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px;
}
.side-note strong { color: var(--text-main); }

.side-code {
  align-items: center;
  background: var(--accent-glow);
  border-radius: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px;
}

/* ---- 좁은 화면 ---- */

@media (max-width: 1119px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .side {
    bottom: 0; position: fixed; right: 0; top: 0; width: 268px;
    transform: translateX(100%); transition: transform 0.2s ease;
  }
  .side.open { transform: translateX(0); }
  .side-close { display: inline-flex; }
}

@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lnb {
    bottom: 0; left: 0; position: fixed; top: 0; width: 264px;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .lnb.open { transform: translateX(0); }
  .lnb-close { display: inline-flex; }
  .chat-log { padding: 14px 12px; }
  .msg { max-width: 88%; }
  .to-bottom { bottom: 112px; }
}

/* 마우스가 있는 화면에서만 여는 단축키를 안내한다 */
.only-wide { display: none; }
@media (hover: hover) and (pointer: fine) { .only-wide { display: inline; } }

.only-narrow { display: none; }
@media (max-width: 767px) { .only-narrow { display: inline-flex; } }

/* ---- 첫 화면 (index.html) ---- */

.menu { margin: 0 auto; max-width: 720px; padding: 40px 20px 64px; }
.menu-head { margin-bottom: 24px; }
.menu-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.menu-sub { color: var(--text-muted); font-size: 15px; margin-top: 6px; }

.who {
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 26px;
  padding: 14px 16px;
}
.who-label { color: var(--text-muted); font-size: 13px; }
.who-nick { flex: 1; font-weight: 700; min-width: 80px; }

/* 아이디로 들어가는 자리 */
.signin { display: block; }
.signin h2 { font-size: 16px; font-weight: 700; }
.signin .hint { color: var(--text-muted); font-size: 13px; margin: 6px 0 14px; }
.signin-row { display: flex; gap: 8px; }
.signin-row .field { flex: 1; }
.signin-row .primary { flex: none; }
.signin .notice { margin-top: 10px; }
.signin-make { display: flex; gap: 8px; margin-top: 4px; }

@media (max-width: 480px) {
  .signin-row { flex-wrap: wrap; }
  .signin-row .primary { width: 100%; }
}

.cards { display: grid; gap: 14px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  color: inherit;
  display: block;
  padding: 22px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); transform: translateY(-2px); }
.card.warn { border-color: rgba(255, 157, 77, 0.35); }

.card-top { align-items: center; display: flex; gap: 10px; }
.card-icon { font-size: 22px; }
.card-name { font-size: 19px; font-weight: 700; }
.card-desc { color: var(--text-muted); font-size: 14px; margin-top: 10px; }
.card-tag {
  background: var(--accent-glow); border-radius: 999px; color: var(--accent);
  font-size: 12px; font-weight: 700; margin-left: auto; padding: 4px 10px;
}
.card.warn .card-tag { background: rgba(255, 157, 77, 0.16); color: #ff9d4d; }
:root[data-theme="light"] .card.warn .card-tag { color: #a83c00; }

.menu-foot { color: var(--text-dim); font-size: 13px; margin-top: 28px; text-align: center; }

@media (max-width: 480px) {
  .menu { padding: 28px 16px 48px; }
  .menu-title { font-size: 25px; }
}

/* ---- 코드 입력 모달 ---- */

.modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  max-width: 380px;
  padding: 22px;
  position: relative;
  width: 100%;
  z-index: 51;
}
.modal-box h2 { font-size: 17px; font-weight: 700; }
.modal-box .hint { color: var(--text-muted); font-size: 13px; margin: 6px 0 14px; }
.modal-row { display: flex; gap: 8px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.code-field {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
}

/* 코드를 보여주는 자리. 큰 글자는 코드에만 주고,
 * 옆의 단추까지 같이 커지지 않게 크기를 따로 못 박는다. */
.code-show {
  align-items: center;
  background: var(--accent-glow);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  padding: 12px;
}
.code-value {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;   /* 자간이 끝 글자 뒤에도 붙어 가운데가 밀리는 것을 되돌린다 */
}
.code-show .primary { font-size: 14px; padding: 9px 16px; }
.side-code .code-value { font-size: 20px; letter-spacing: 0.24em; text-indent: 0.24em; }

/* ---- 코드방 들어가기 화면 ---- */

.gate { margin: 0 auto; max-width: 480px; padding: 44px 20px; }
.gate h1 { font-size: 24px; font-weight: 700; }
.gate p { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.gate-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  margin-top: 20px;
  padding: 20px;
}
.gate-box h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.gate-box .hint { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.gate-foot { align-items: center; display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
