:root {
  --bg: #ffffff;
  --bg-2: #f2f3f5;
  --text: #16181c;
  --muted: #6b7079;
  --line: #e4e6ea;
  --accent: #3b5bdb;
  --mine: #3b5bdb;
  --mine-text: #ffffff;
  --theirs: #eef0f3;
  --theirs-text: #16181c;
  --unread: #e0a400;
  --danger: #d9433b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --bg-2: #1b1d21;
    --text: #eceef1;
    --muted: #8b909a;
    --line: #2a2d33;
    --accent: #6a86ff;
    --mine: #4c6cf0;
    --theirs: #24272d;
    --theirs-text: #eceef1;
    --unread: #f2c230;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

.view {
  /* --app-h = 실제로 보이는 높이 (키보드가 올라오면 줄어듦, app.js 가 넣음) */
  height: var(--app-h, 100dvh);
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

/* 로그인 */
#view-login, #view-pending { justify-content: center; padding: 24px 16px; overflow-y: auto; }
.login-box { text-align: center; width: 100%; max-width: 380px; margin: 0 auto; }
.logo { width: 76px; height: 76px; border-radius: 20px; }
.big { font-size: 56px; }
.login-box h1 { margin: 10px 0 18px; font-size: 28px; letter-spacing: -0.5px; }
.tabs { display: flex; background: var(--bg-2); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input, .field input {
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); font-size: 16px; outline: none; width: 100%;
}
.auth-form input:focus, .field input:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; text-align: left; padding: 2px 4px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.primary {
  padding: 14px; border-radius: 12px; background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 600;
}
.avatar-pick {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 6px; background: var(--bg-2);
  border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; font-size: 22px; line-height: 1.2;
}
.avatar-pick small { font-size: 11px; color: var(--muted); }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; }
.big-avatar { width: 108px; height: 108px; border-style: solid; }

/* 프로필 사진 */
.pf {
  width: 36px; height: 36px; border-radius: 14px; flex: none; object-fit: cover;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.pf.sm { width: 28px; height: 28px; border-radius: 10px; font-size: 13px; }
.pf.xl { width: 108px; height: 108px; border-radius: 50%; font-size: 40px; }

/* 상단바 */
.bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.bar h2 { margin: 0; font-size: 18px; flex: 1; }
.bar .title { flex: 1; min-width: 0; text-align: center; }
.bar .title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .title small { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 40px; height: 40px; border-radius: 10px; font-size: 22px; flex: none; display: grid; place-items: center; }
.icon:hover { background: var(--bg-2); }
#btn-back, .btn-home { font-size: 32px; line-height: 1; }

/* 방 목록 */
.room-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.room-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.room-list li:hover { background: var(--bg-2); }
.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 18px;
}
.room-info { flex: 1; min-width: 0; }
.room-top, .room-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.room-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top .pin { font-size: 13px; margin-right: 4px; }
.room-top time { font-size: 12px; color: var(--muted); flex: none; }
.room-last { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; min-width: 0; }
.badge { flex: none; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 7px; }
.online-dot { color: #2fb36d; font-size: 12px; }
.me-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: 14px;
}
.me-btn { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.link { color: var(--accent); font-size: 14px; }

/* 메시지 */
.messages { flex: 1; overflow-y: auto; padding: 12px 10px 4px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--bg-2); padding: 4px 10px; border-radius: 10px; margin: 12px 0 8px; }
.msg { display: flex; gap: 8px; max-width: 82%; }
.msg.theirs { align-self: flex-start; }
.msg.mine { align-self: flex-end; justify-content: flex-end; }
.msg.first { margin-top: 6px; }
.pf-col { width: 36px; flex: none; }
.msg-main { display: flex; flex-direction: column; min-width: 0; }
.msg.mine .msg-main { align-items: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); margin: 0 0 3px 2px; }
.row { display: flex; align-items: flex-end; gap: 5px; }
.msg.mine .row { flex-direction: row-reverse; }
.content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.mine .content { align-items: flex-end; }
.bubble {
  padding: 9px 13px; border-radius: 18px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; font-size: 15.5px;
}
.msg.theirs .bubble { background: var(--theirs); color: var(--theirs-text); border-top-left-radius: 6px; }
.msg.mine .bubble { background: var(--mine); color: var(--mine-text); border-bottom-right-radius: 6px; }
.meta { display: flex; flex-direction: column; align-items: flex-start; flex: none; margin-bottom: 2px; }
.msg.mine .meta { align-items: flex-end; }
.meta time { font-size: 11px; color: var(--muted); }
.unread { font-size: 11px; font-weight: 700; color: var(--unread); line-height: 1.1; }
.msg.pending .bubble { opacity: .55; }

.media { display: block; border-radius: 14px; overflow: hidden; max-width: min(240px, 60vw); background: var(--bg-2); }
/* 사진은 자르지 않고 원래 비율 그대로 (세로로 긴 캡처도 전체가 보이게) */
button.media { background: none; }
.media img { display: block; width: auto; height: auto; max-width: min(240px, 60vw); max-height: 360px; object-fit: contain; border-radius: 14px; }
@media (min-width: 700px) {
  .media img { max-width: 320px; max-height: 420px; }
  video.media { width: 320px; }
}
video.media { width: min(240px, 60vw); max-height: 360px; background: #000; }
.sticker { display: block; width: 120px; height: 120px; object-fit: contain; }
.msg audio { width: 230px; max-width: 100%; }
.file-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: var(--theirs); color: var(--theirs-text); text-decoration: none; max-width: 240px;
}
.file-icon { font-size: 22px; flex: none; }
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-meta b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { font-size: 12px; color: var(--muted); }

.typing { font-size: 12px; min-height: 18px; padding: 0 16px; }

/* 입력창 */
.composer {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
/* 키보드가 올라와 있으면 홈 바 자리 여백은 필요 없음 → 입력창이 키보드에 딱 붙게 */
body.kb .composer { padding-bottom: 8px; }
.composer .input {
  flex: 1; min-width: 0; max-height: 120px; overflow-y: auto;
  padding: 10px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg-2); outline: none; font-size: 16px; line-height: 1.35;
  white-space: pre-wrap; word-break: break-word; -webkit-user-select: text; user-select: text;
}
.composer .input.composing::before { content: none !important; }
.composer .input:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.round { flex: none; width: 40px; height: 42px; border-radius: 50%; font-size: 21px; }
.round:hover, .round.on { background: var(--bg-2); }
.send {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 18px;
}

/* 이모티콘 창 */
.sticker-panel { height: min(300px, 42dvh); display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.composer:has(+ .sticker-panel:not([hidden])) { padding-bottom: 8px; }
.sticker-tabs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; flex: none; }
.sticker-tabs button { padding: 6px 12px; border-radius: 16px; background: var(--bg-2); font-size: 13px; white-space: nowrap; }
.sticker-tabs button.active { background: var(--accent); color: #fff; }
.sticker-tabs .edit { margin-left: auto; background: none; color: var(--accent); }
.sticker-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; padding: 4px 10px 10px; align-content: start; }
.st { position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; }
.st:hover { background: var(--bg-2); }
.st img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.st .del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.st.picked { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: 2px solid var(--accent); }
.sticker-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 10px 6px; padding: 8px 12px; border-radius: 16px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.sticker-preview img { width: 110px; height: 110px; object-fit: contain; }
.sticker-preview-actions { display: flex; gap: 8px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 30px 16px; }

/* 사진 크게 보기 */
.viewer {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}
.viewer { overflow: hidden; touch-action: none; }
.viewer img {
  max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; -webkit-touch-callout: default;
  touch-action: none; user-select: none; -webkit-user-select: none; transform-origin: center; will-change: transform;
}
.viewer-bar { position: relative; z-index: 1; }
.viewer-bar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.viewer-bar button { color: #fff; background: rgba(255,255,255,.16); padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* 내 정보 / 회원 관리 */
.page { flex: 1; overflow-y: auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.row-input { display: flex; gap: 8px; }
.small-btn { padding: 9px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; flex: none; }
.small-btn.ghost { background: var(--bg-2); color: var(--text); }
.danger { padding: 13px; border-radius: 12px; background: var(--bg-2); color: var(--danger); font-weight: 600; margin-top: 12px; }
.admin-list { list-style: none; margin: 0; padding: 0 0 env(safe-area-inset-bottom); overflow-y: auto; flex: 1; }
.admin-list li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-list li.st-pending { background: color-mix(in srgb, var(--unread) 12%, transparent); }
.admin-list li.st-rejected { opacity: .6; }
.admin-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  max-width: calc(100% - 32px); text-align: center;
}

/* ---- 홈: 패널 + 아래 탭 ---- */
#view-home .panels { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel { flex: 1; min-height: 0; overflow-y: auto; }
.panel.page { padding-bottom: 24px; }
.tabbar {
  display: flex; border-top: 1px solid var(--line); background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; font-size: 11px; color: var(--muted);
}
.tabbar button span { font-size: 21px; line-height: 1.1; filter: grayscale(1); opacity: .6; }
.tabbar button.active { color: var(--accent); font-weight: 700; }
.tabbar button.active span { filter: none; opacity: 1; }
.tab-badge {
  position: absolute; top: 3px; left: calc(50% + 6px); font-style: normal;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 1px 5px;
}

/* 앨범 */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
@media (min-width: 560px) { .album-grid { grid-template-columns: repeat(4, 1fr); } }
.al { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-2); }
.al img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 26px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.album-grid .empty, .item-list .empty { grid-column: 1 / -1; }

/* 링크 · 게시판 목록 */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item-list li:hover { background: var(--bg-2); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; }
.item-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main .url { color: var(--accent); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main .snippet { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-main small { font-size: 12px; }
.post-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.icon.del { font-size: 15px; color: var(--muted); width: 32px; height: 32px; }

/* 게시글 */
.post { gap: 12px; }
.post-title { font-size: 21px; margin: 0; line-height: 1.35; word-break: break-word; }
.post-meta { display: flex; align-items: center; gap: 8px; }
.post-meta span { display: flex; flex-direction: column; }
.post-meta small { font-size: 12px; }
.post-image { display: block; width: 100%; border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.post-image img { display: block; width: 100%; max-height: 70dvh; object-fit: contain; }
.post-text { font-size: 16px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.comments-title { font-size: 14px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.comments li > div { flex: 1; min-width: 0; word-break: break-word; }
#view-post .composer .input, .composer .input { flex: 1; }

/* 글쓰기 */
.write-title, .write-body {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); font-size: 16px; outline: none; resize: vertical;
}
.write-title { font-weight: 700; font-size: 17px; }
.write-body { min-height: 200px; line-height: 1.55; flex: 1; }
.write-image { padding: 12px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.write-image img { max-width: 100%; max-height: 220px; border-radius: 10px; }
#view-write .small-btn { flex: none; }

/* 채팅: 링크 · 답장 인용 · 좋아요 */
.bubble .link-in { color: inherit; text-decoration: underline; word-break: break-all; }
.bubble.has-quote { min-width: 140px; max-width: 260px; }
.quote {
  display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: normal;
  padding-bottom: 7px; margin-bottom: 7px; border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.bubble.quote-only .quote { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.quote .q-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.quote b { font-size: 12.5px; font-weight: 700; }
.quote span { font-size: 12.5px; opacity: .65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.quote .q-pic { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; }
.likes-row:empty { display: none; }
.likes-row { display: flex; margin-top: 3px; }
.msg.mine .likes-row { justify-content: flex-end; }
.like-chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.like-chip.on { border-color: #f2a6b3; background: color-mix(in srgb, #e04e6a 12%, var(--bg)); }
.msg.flash .bubble, .msg.flash .media, .msg.flash .sticker { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--unread); } 100% { box-shadow: 0 0 0 0 transparent; } }
.bubble, .sticker, .meta { cursor: pointer; }

/* 답장 줄 */
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 6px 4px 6px 12px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 10px; }
.reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.reply-info b { color: var(--accent); }
.reply-info span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar .icon { font-size: 15px; width: 32px; height: 32px; }

/* 아래에서 올라오는 메뉴 */
.sheet { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box {
  width: 100%; max-width: 520px; background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px;
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet-title { font-size: 13px; color: var(--muted); padding: 8px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
#sheet-actions { display: flex; flex-direction: column; gap: 2px; }
.sheet-btn { text-align: left; padding: 13px 14px; border-radius: 12px; font-size: 16px; }
.sheet-btn:hover { background: var(--bg-2); }
.sheet-btn.cancel { text-align: center; background: var(--bg-2); font-weight: 600; margin-top: 4px; }
.danger-text { color: var(--danger); }

.viewer video { max-width: 100%; max-height: calc(100dvh - 120px); }

/* Face ID 잠금 */
.lock {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px;
}
.lock h2 { margin: 4px 0 0; font-size: 26px; }
.lock .primary { width: min(320px, 100%); margin-top: 12px; }
.lock-toggle { flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-weight: 600; }
.lock-toggle small { width: 100%; font-weight: 400; padding-left: 26px; }

.viewer-count {
  position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 12px;
}
.viewer video { touch-action: auto; }
.viewer-bar, .viewer-bar button { touch-action: manipulation; }

/* 기능 개선 요청 */
.req-summary { cursor: default !important; padding: 8px 16px !important; background: var(--bg-2); }
.req { align-items: flex-start !important; cursor: default !important; }
.req-check { flex: none; width: 34px; height: 34px; font-size: 22px; display: grid; place-items: center; margin-top: -4px; }
.req .item-main b { white-space: normal; }
.req.done .item-main b { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
/* 완료 스티커: 비스듬한 도장 모양 */
.done-tag {
  display: inline-block; text-decoration: none; margin-left: 8px; vertical-align: 1px;
  font-size: 12px; font-weight: 900; letter-spacing: .5px; color: #fff; background: #2fb36d;
  padding: 3px 9px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 2px #2fb36d, 0 2px 6px rgba(0,0,0,.18);
  transform: rotate(-6deg);
}
.req.done .done-tag { color: #fff; }
.req .snippet { -webkit-line-clamp: 4; }
.tabbar button { font-size: 10.5px; }

.req-comments { list-style: none; margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45; }
/* .item-list li 의 flex·여백·줄을 받지 않게 (이름이 세로로 한 글자씩 꺾이던 원인) */
.item-list .req-comments li { display: block; padding: 0 22px 0 0; border: 0; cursor: default; background: none; }
.req-comments li { position: relative; padding-right: 22px; word-break: break-word; }
.claude-logo { width: 16px; height: 16px; vertical-align: -3px; }
.req-comments li.bot b { color: var(--accent); }
.c-del { position: absolute; right: 0; top: 0; color: var(--muted); font-size: 12px; }
.req-reply { align-self: flex-start; font-size: 13px; margin-top: 4px; }
#room-name { cursor: pointer; }

/* 개선 요청 사진 */
.req-pics { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.req-pics img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer; background: var(--bg-2); }
.req-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* 세로 화면 고정 안내 */
.rotate-hint { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; text-align: center; background: var(--bg); color: var(--text, inherit); padding: 24px; }
.rotate-hint[hidden] { display: none; }
.rotate-hint .rotate-icon { font-size: 48px; transform: rotate(-90deg); margin-bottom: 8px; }
.rotate-hint p { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.rotate-hint small { color: var(--muted); }

/* 카톡처럼: 채팅방 상단바 아래·입력창 위 구분선과 입력칸 테두리를 없앰 (2026-11-21 태웅 요청) */
#view-chat .bar { border-bottom: 0; }
#view-chat .composer { border-top: 0; }
#view-chat .composer .input { border-color: transparent; }

/* GIPHY 검색 */
.sticker-search { display: flex; align-items: center; gap: 8px; padding: 0 10px 6px; flex: none; }
.sticker-search[hidden] { display: none; }
.sticker-search input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 16px; border: 0; background: var(--bg-2); font-size: 16px; outline: none; }
.giphy-by { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* 이모티콘 플러스: 입력창 위 GIPHY 추천 줄 */
.giphy-suggest { position: relative; display: flex; align-items: center; padding: 4px 34px 2px 8px; flex: none; }
.giphy-suggest[hidden] { display: none; }
.gs-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.gs-row::-webkit-scrollbar { display: none; }
.gs-item { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--bg-2); padding: 3px; }
.gs-item img { width: 100%; height: 100%; object-fit: contain; }
.gs-by { flex: none; writing-mode: vertical-rl; font-size: 9px; padding: 0 2px; }
.gs-close { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 13px; background: var(--bg-2); color: var(--muted); font-size: 12px; }

/* 게시판 링크 글 */
.post-link-host { color: var(--accent); font-size: 12.5px; }
.post-link { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); color: inherit; text-decoration: none; }
.post-link b { color: var(--accent); }
.post-link small { color: var(--muted); word-break: break-all; }

/* 지운 메시지 */
.bubble.deleted { background: transparent !important; color: var(--muted) !important; border: 1px dashed var(--line); font-size: 14px; cursor: default; }
/* 링크 미리보기 카드 */
.link-card { display: flex; flex-direction: column; width: 240px; max-width: 100%; margin-top: 4px; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.link-card[hidden] { display: none; }
.link-card img { width: 100%; max-height: 140px; object-fit: cover; display: block; }
.lc-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 11px 9px; }
.lc-text b { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-text span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-text small { font-size: 11px; color: var(--muted); }
.msg.mine .link-card { margin-left: auto; }
/* 투표 */
.bubble.poll { display: flex; flex-direction: column; gap: 6px; min-width: 220px; max-width: 280px; background: var(--bg-2) !important; color: var(--text) !important; border: 1px solid var(--line); white-space: normal; }
.poll-q { font-size: 15px; }
.poll-opt { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); text-align: left; overflow: hidden; }
.poll-opt.on { border-color: var(--accent); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 16%, transparent); pointer-events: none; transition: width .25s; }
.poll-label { position: relative; flex: 1; font-size: 14px; }
.poll-n { position: relative; font-weight: 700; color: var(--accent); }
.poll-who { position: relative; flex-basis: 100%; font-size: 11px; color: var(--muted); }
/* 메뉴: 줄바꿈 표시, 검색 결과처럼 길면 스크롤 */
.sheet-btn { white-space: pre-line; }
#sheet-actions { max-height: 60dvh; overflow-y: auto; }
.link-card { flex: none; align-self: flex-end; width: 240px; }
.msg.theirs .link-card { align-self: flex-start; }

/* 입력 폼 (prompt 대신) */
.form-modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); display: flex; justify-content: center; }
.form-modal[hidden] { display: none; }
.form-box { width: 100%; max-width: 560px; height: 100%; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.form-head b { font-size: 16px; }
.form-head .link { font-size: 15px; color: var(--muted); }
.form-body { flex: 1; overflow-y: auto; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.form-input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-size: 16px; outline: none; box-sizing: border-box; }
.form-input:focus { border-color: var(--accent); }
textarea.form-input { resize: vertical; line-height: 1.5; font-family: inherit; }
.form-options { display: flex; flex-direction: column; gap: 6px; }
.opt-row { display: flex; gap: 6px; align-items: center; }
.opt-row .icon { flex: none; color: var(--muted); }
.form-add { align-self: flex-start; color: var(--accent); font-size: 14px; padding: 4px 0; }
.form-check { margin-top: 10px; }
.form-images { display: flex; flex-wrap: wrap; gap: 8px; }
.form-pic, .form-pic-add { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; flex: none; }
.form-pic img { width: 100%; height: 100%; object-fit: cover; }
.form-pic button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 11px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; }
.form-pic-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px dashed var(--line); background: var(--bg-2); font-size: 22px; }
.form-pic-add small { font-size: 11px; color: var(--muted); }
.write-link { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-size: 15px; outline: none; box-sizing: border-box; }

/* 방 아이콘 */
.avatar.room-emoji { background: var(--bg-2); font-size: 24px; }
.avatar.room-pic { padding: 0; overflow: hidden; background: var(--bg-2); }
.avatar.room-pic img { width: 100%; height: 100%; object-fit: cover; }
#room-name.manage { cursor: pointer; }
#room-name.manage::after { content: ' ▾'; font-size: .7em; color: var(--muted); }
.form-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.icon-pick { height: 52px; border-radius: 14px; background: var(--bg-2); font-size: 26px; border: 2px solid transparent; display: grid; place-items: center; overflow: hidden; padding: 0; }
.icon-pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.icon-pick[data-icon=""] { font-size: 20px; font-weight: 700; color: var(--muted); }
.icon-pick img { width: 100%; height: 100%; object-fit: cover; }
.icon-photo { border-style: dashed; border-color: var(--line); display: flex; flex-direction: column; gap: 0; font-size: 20px; }
.icon-photo small { font-size: 10px; color: var(--muted); }
.icon-photo.on { border-style: solid; border-color: var(--accent); }

/* 게임 카드 */
.bubble.game-card { display: flex; flex-direction: column; gap: 3px; min-width: 190px; background: var(--bg-2) !important; color: var(--text) !important; border: 1px solid var(--line); white-space: normal; cursor: pointer; }
.bubble.game-card.my-turn { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.game-card b { font-size: 15px; }
.gc-status { font-size: 14px; }
.gc-open { font-size: 13px; color: var(--accent); align-self: flex-end; }
.game-card .small-btn { align-self: flex-start; margin-top: 4px; }
/* 게임 화면 */
.game-box { overflow-y: auto; }
.game-status { text-align: center; padding: 12px 16px 6px; }
.gs-players { font-size: 15px; }
.gs-text { margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--muted); }
.gs-text.mine { color: var(--accent); }
.game-board { padding: 8px 10px; display: flex; flex-direction: column; align-items: center; }
.board { display: grid; grid-template-columns: repeat(var(--w), 1fr); width: min(100%, 520px); aspect-ratio: var(--w) / var(--h); touch-action: manipulation; user-select: none; }
.cell { position: relative; padding: 0; display: grid; place-items: center; border-radius: 0; background: none; }
.stone { display: block; width: 84%; height: 84%; border-radius: 50%; }
.stone.p1 { background: radial-gradient(circle at 35% 30%, #666, #111 70%); }
.stone.p2 { background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf 75%); box-shadow: inset 0 0 0 1px #aaa; }
.stone.ghost { opacity: .45; }
.cell.last .stone::after { content: ''; position: absolute; inset: 0; margin: auto; width: 26%; height: 26%; border-radius: 50%; background: #e03b3b; }
.cell.last .stone { position: relative; }
/* 오목: 나무 판 + 선 (칸 가운데 교차) */
.board-gomoku { background: #e3b96a; border-radius: 6px; padding: 2px; }
.board-gomoku .cell { background: linear-gradient(#5a3e12, #5a3e12) center / 1px 100% no-repeat, linear-gradient(#5a3e12, #5a3e12) center / 100% 1px no-repeat; }
.board-gomoku .stone { width: 92%; height: 92%; }
/* 리버시: 초록 판 */
.board-reversi { background: #2e7d4f; gap: 2px; padding: 2px; border-radius: 6px; }
.board-reversi .cell { background: #3a9563; }
.board-reversi .cell.hint::before { content: ''; width: 22%; height: 22%; border-radius: 50%; background: rgba(0,0,0,.28); }
/* 사목: 파란 판, 빨강·노랑 */
.board-c4 { background: #2556c4; gap: 4px; padding: 6px; border-radius: 12px; }
.board-c4 .cell { background: var(--bg); border-radius: 50%; }
.board-c4 .stone { width: 100%; height: 100%; }
.board-c4 .stone.p1 { background: radial-gradient(circle at 35% 30%, #ff7a7a, #d62828 70%); box-shadow: none; }
.board-c4 .stone.p2 { background: radial-gradient(circle at 35% 30%, #fff3a0, #f2c200 70%); box-shadow: none; }
.game-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); }
.game-actions .primary { width: min(100%, 360px); }
.rv-count { font-size: 18px; font-weight: 700; }
/* 숫자야구 */
.bb-secret { margin: 4px 0 10px; padding: 8px 14px; border-radius: 12px; background: var(--bg-2); }
.bb-secret b { letter-spacing: 4px; font-size: 18px; }
.bb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 520px); }
.bb-cols h4 { margin: 0 0 6px; font-size: 14px; text-align: center; }
.bb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bb-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--bg-2); font-size: 14px; }
.bb-list li b { letter-spacing: 3px; font-size: 16px; }
.bb-n { color: var(--muted); font-size: 12px; width: 16px; }
.bb-r { margin-left: auto; font-weight: 700; color: var(--accent); }
.bb-help { text-align: center; margin-top: 12px; }
.bb-input { display: flex; gap: 8px; width: min(100%, 360px); }
.bb-input input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-size: 18px; letter-spacing: 4px; text-align: center; outline: none; }
.bb-input .primary { width: auto; padding: 0 18px; }
.bb-input input:placeholder-shown { letter-spacing: 0; font-size: 15px; }
/* 채팅방 🔗 초대 링크 버튼 없앰 (2026-11-22 사용자 요청) */
#btn-share { display: none !important; }

/* 🎵 노래 카드 */
.song-card { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 280px; padding: 10px 12px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); text-align: left; color: var(--text); }
.song-card.now { border-color: var(--accent); }
.song-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: 18px; }
.song-t { display: flex; flex-direction: column; min-width: 0; }
.song-t b { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 미니 플레이어: 화면 맨 아래 (키보드가 올라오면 숨김) */
:root { --mini-h: calc(54px + env(safe-area-inset-bottom)); }
.mini { position: relative; max-width: 640px; margin: 0 auto; height: var(--mini-h); box-sizing: border-box; padding: 0 6px env(safe-area-inset-bottom); display: flex; align-items: center; gap: 2px; background: var(--bg-2); border-top: 1px solid var(--line); }
.mini[hidden] { display: none; }
body.has-mini .view { height: calc(var(--app-h, 100dvh) - var(--mini-h)); }
body.has-mini .tabbar { padding-bottom: 0; }
body.has-mini .composer { padding-bottom: 8px; }
body.kb .mini { display: none; }
body.kb.has-mini .view { height: var(--app-h, 100dvh); }
.mini-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px; }
.mini-ic { font-size: 20px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-text b, .mini-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text b { font-size: 14px; }
.mini-text small { font-size: 12px; }
.mini-btn { width: 40px; height: 40px; font-size: 20px; flex: none; }
.mini-x { font-size: 14px; color: var(--muted); width: 30px; }
.mini-progress { position: absolute; left: 0; top: 0; height: 2px; background: var(--accent); width: 0; transition: width .25s linear; }
/* 전체 플레이어 */
.mp-box { display: flex; flex-direction: column; }
.mp-spacer { width: 52px; }
.mp-now { padding: 16px 18px 6px; text-align: center; }
.mp-now > b { font-size: 18px; display: block; min-height: 1.4em; }
.mp-seek { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mp-seek input { flex: 1; accent-color: var(--accent); }
.mp-seek small { width: 38px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-ctrl { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 8px; }
.mp-ctrl button { font-size: 26px; width: 48px; height: 48px; }
.mp-ctrl .mp-play { font-size: 34px; width: 64px; height: 64px; }
.mp-mode { opacity: .35; font-size: 20px !important; }
.mp-mode.on { opacity: 1; }
.mp-tabs { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.mp-tabs button { flex: 1; padding: 8px 0; border-radius: 12px; font-size: 14px; background: var(--bg-2); }
.mp-tabs button.active { background: var(--accent); color: #fff; }
.mp-body { flex: 1; overflow-y: auto; padding: 10px 14px calc(20px + env(safe-area-inset-bottom)); }
.ly { text-align: center; padding: 6px 0 45vh; } /* 위 빈칸 없이 시작, 아래만 남겨서 마지막 줄도 가운데로 */
.ly.plain { padding: 10px 0; line-height: 1.9; color: var(--text); }
.ly-line { margin: 0; padding: 7px 4px; font-size: 17px; color: var(--muted); transition: color .2s, transform .2s; cursor: pointer; }
.ly-line.on { color: var(--text); font-weight: 700; transform: scale(1.06); }
.mp-list { list-style: none; margin: 0; padding: 0; }
.mp-list li { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mp-list li.now { color: var(--accent); font-weight: 700; }
.mp-n { width: 24px; text-align: center; color: var(--muted); font-size: 13px; flex: none; }
.mp-t { flex: 1; min-width: 0; font-size: 14.5px; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pl { margin-bottom: 16px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); }
.pl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-head b { font-size: 15px; }
.pl-head .small-btn { margin-left: auto; }
.pl .mp-list li { border-color: color-mix(in srgb, var(--line) 60%, transparent); }

/* 게임방·음악방 위 버튼 줄 */
.room-bar { display: flex; gap: 6px; padding: 6px 10px 8px; overflow-x: auto; flex: none; align-items: center; scrollbar-width: none; }
.room-bar[hidden] { display: none; }
.room-bar::-webkit-scrollbar { display: none; }
.room-bar button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 12px; border-radius: 14px; background: var(--bg-2); font-size: 14px; font-weight: 600; }
.room-bar button small { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.rb-hint { font-size: 12px; flex: none; white-space: nowrap; }

/* 📋 할 일 */
.form-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rb-wide small { font-weight: 600; color: var(--text) !important; font-size: 12px !important; }
#rb-next { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.task-check { flex: none; font-size: 22px; width: 34px; height: 34px; display: grid; place-items: center; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 5px; cursor: pointer; }
.task-title { font-size: 15.5px; line-height: 1.4; word-break: break-word; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); font-weight: 600; }
.tag.all { --c: #6b7280; }
.due { font-size: 12px; color: var(--muted); }
.due.today { color: #d97706; font-weight: 600; }
.due.late { color: #dc2626; font-weight: 600; }
.task-h { margin: 18px 0 4px; font-size: 13px; color: var(--muted); }

/* 가사 도구: 싱크 조절 · 고치기 */
.ly-tools { position: sticky; top: -10px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 2px 8px; background: var(--bg); }
.ly-sync { display: flex; align-items: center; gap: 4px; }
.ly-sync button { padding: 4px 8px; border-radius: 10px; background: var(--bg-2); font-size: 12.5px; }
.ly-sync b { font-size: 12.5px; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.ly-tools .link { font-size: 13px; color: var(--accent); }

/* 사진 묶음 (카톡처럼) */
.photo-grid { display: grid; gap: 3px; width: min(260px, 66vw); border-radius: 14px; overflow: hidden; }
.photo-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.photo-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.pg-cell { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; background: var(--bg-2); border-radius: 0; }
.pg-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.pg-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; font-weight: 700; }
.msg.mine .photo-grid { margin-left: auto; }

/* 🎲 게임방 타일 화면 */
.gtabs { display: flex; flex: 1; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 3px; }
.room-bar .gtabs button { flex: 1; flex-direction: row; justify-content: center; padding: 7px 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; }
.room-bar .gtabs button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
#view-chat.lobby-on #messages, #view-chat.lobby-on #typing, #view-chat.lobby-on #composer, #view-chat.lobby-on #reply-bar,
#view-chat.lobby-on #giphy-suggest, #view-chat.lobby-on #sticker-preview, #view-chat.lobby-on #sticker-panel { display: none !important; }
.game-lobby { flex: 1; overflow-y: auto; padding: 4px 14px calc(18px + env(safe-area-inset-bottom)); }
.game-lobby[hidden] { display: none; }
.game-lobby h3 { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; margin: 14px 2px 8px; }
.game-lobby h3 small { margin-right: auto; }
.gl-active, .gl-new { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gl-game, .gl-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); text-align: left; color: var(--text); min-width: 0; }
.gl-tile { align-items: center; text-align: center; padding: 18px 10px 14px; }
.gl-icon { font-size: 30px; line-height: 1.1; }
.gl-tile .gl-icon { font-size: 38px; }
.gl-game b, .gl-tile b { font-size: 15px; }
.gl-tile small { font-size: 11.5px; }
.gl-st { font-size: 13px; font-weight: 600; }
.gl-game small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gl-game.my-turn { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.gl-game.my-turn .gl-st { color: var(--accent); }
.gl-recent { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.gl-recent li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.gl-recent li:last-child { border-bottom: 0; }
.gl-recent .gl-r { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-empty { font-size: 13px; padding: 4px 2px; }

/* 게임 타일: 종류마다 하나 (2026-11-22) */
.gl-tile { position: relative; }
.gl-tile .gl-go { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.gl-tile.playing .gl-st { margin-top: 4px; font-size: 13.5px; font-weight: 700; }
.gl-tile.my-turn { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); animation: glPulse 1.6s ease-in-out infinite; }
.gl-tile.my-turn .gl-st { color: var(--accent); }
.gl-badge { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 10px; padding: 2px 8px; }
@keyframes glPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .gl-tile.my-turn { animation: none; } }

/* 📅 달력방 */
.cal-head { display: flex; align-items: center; gap: 4px; margin: 6px 0 8px; }
.cal-head b { font-size: 17px; min-width: 104px; text-align: center; }
.cal-head .small-btn { margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; }
.cal-wd.sun, .cal-day.sun .cd-n { color: #e5484d; }
.cal-wd.sat, .cal-day.sat .cd-n { color: #3e7bfa; }
.cal-day { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-height: 64px; padding: 4px 2px; border-radius: 10px; background: transparent; color: var(--text); text-align: left; min-width: 0; }
.cal-day .cd-n { align-self: center; font-size: 13px; font-weight: 600; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; }
.cal-day.out { opacity: .38; }
.cal-day.today .cd-n { background: var(--accent); color: #fff !important; }
.cal-day.sel { background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cd-ev { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-ev i { font-style: normal; font-size: 10px; line-height: 1.35; padding: 0 3px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); border-left: 2px solid var(--c); }
.cd-ev em { font-style: normal; font-size: 10px; color: var(--muted); text-align: center; }
.cal-sel-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 8px; font-size: 15px; }
.cal-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.cal-list li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cal-list li:last-child { border-bottom: 0; }
.ce-time { flex: none; width: 44px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ce-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ce-body b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-body small { font-size: 12px; white-space: pre-wrap; }

/* 판 댓글 */
.game-comments { padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.gc-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gc-list li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.gc-list li span { flex: 1; min-width: 0; word-break: break-word; }
.gc-list li small { flex: none; font-size: 11px; }
.gc-del { flex: none; font-size: 11px; color: var(--muted); padding: 0 2px; background: none; }
.gc-input { display: flex; gap: 6px; }
.gc-input input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 16px; }
.gl-cc { font-size: 12px; color: var(--muted); flex: none; }

/* 여러 날 일정 = 이어진 막대 */
.cd-ev i.span { border-left: 0; border-radius: 0; margin: 0 -3px; padding-left: 5px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.cd-ev i.span-s { border-radius: 4px 0 0 4px; margin-left: 0; border-left: 2px solid var(--c); }
.cd-ev i.span-e { border-radius: 0 4px 4px 0; margin-right: 0; }
.ce-time { line-height: 1.25; }

/* 달력 일정 칩: 반전 색(진한 배경 + 흰 글씨), 작은 글씨로 한 줄 5글자 (2026-11-22) */
.game-lobby .cal-grid { margin: 0 -8px; gap: 1px; }
.cal-day { padding: 3px 1px; gap: 1px; }
.cd-ev { gap: 2px; }
.cd-ev i, .cd-ev i.span, .cd-ev i.span-s, .cd-ev i.span-e {
  font-size: 9.5px; line-height: 15px; letter-spacing: -0.4px; font-weight: 600;
  padding: 0 2px; border: 0; border-radius: 3px; margin: 0;
  background: var(--c); color: #fff; text-overflow: clip;
}
.cd-ev i.span { border-radius: 0; margin: 0 -1px; }
.cd-ev i.span-s { border-radius: 3px 0 0 3px; margin-left: 0; }
.cd-ev i.span-e { border-radius: 0 3px 3px 0; margin-right: 0; }
.cal-day.out .cd-ev i { opacity: .75; }
.cd-ev i.span { margin: 0 -2px; }
.cd-ev i.span-s { margin: 0 -2px 0 0; }
.cd-ev i.span-e { margin: 0 0 0 -2px; }
.cd-ev i { text-align: center; } /* 일정 글씨 가운데 정렬 (사용자 요청) */

/* 📋 업무방 할 일 탭 */
.wk-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.wk-head .wk-filter { flex: 1; margin: 0; }
.wk-head .wk-filter small { color: var(--muted); font-weight: 400; }
.wk-body .empty { padding: 30px 0; text-align: center; }
.wk-head .wk-filter .active small { color: inherit; opacity: .85; }

/* ⚡ 실시간 게임 */
.rt-box { display: flex; flex-direction: column; }
.rt-timer { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 48px; text-align: right; }
.rt-body { flex: 1; display: flex; flex-direction: column; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.rt-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.rt-big { font-size: 64px; line-height: 1.1; }
.rt-count { font-size: 96px; font-weight: 800; color: var(--accent); }
.rt-end.win h2 { color: var(--accent); }
.rt-btns { display: flex; gap: 8px; margin-top: 10px; }
.rt-tiles .gl-tile { border-style: dashed; }
/* 줄다리기 */
.tug { margin: 10px 0 18px; }
.tug-names, .tug-counts { display: flex; justify-content: space-between; font-size: 15px; }
.tug-names .me { color: var(--accent); }
.tug-counts { font-size: 13px; color: var(--muted); margin-top: 6px; }
.tug-track { position: relative; height: 54px; margin-top: 8px; border-radius: 27px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, var(--bg-2)), var(--bg-2) 50%, color-mix(in srgb, #f08c2e 25%, var(--bg-2))); }
.tug-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: #b08550; }
.tug-mid { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; background: var(--muted); }
.tug-goal { position: absolute; top: 0; bottom: 0; width: 6px; background: var(--accent); border-radius: 3px; }
.tug-goal.l { left: 0; } .tug-goal.r { right: 0; background: #f08c2e; }
.tug-flag { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 34px; transition: left .08s linear; }
.rt-tap { flex: 1; min-height: 200px; border-radius: 28px; background: var(--accent); color: #fff; font-size: 34px; font-weight: 800; touch-action: manipulation; }
.rt-tap.hit { animation: rtHit .12s; }
@keyframes rtHit { 50% { transform: scale(.96); filter: brightness(1.15); } }
/* 반응속도 */
.rx-score { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin-bottom: 12px; }
.rx-score b { font-size: 26px; }
.rx-pad { flex: 1; border-radius: 28px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-size: 24px; touch-action: manipulation; }
.rx-pad > div { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rx-pad small { font-size: 14px; opacity: .9; }
.rx-pad.red { background: #e5484d; } .rx-pad.green { background: #2fb36d; } .rx-pad.result { background: var(--bg-2); color: var(--text); }
.rx-pad.tapped { filter: brightness(.85); }
/* 묵찌빠 */
.mjb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mjb-stage { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.mjb-stage b { font-size: 24px; } .mjb-stage .atk { color: #e5484d; } .mjb-stage .def { color: var(--accent); }
.mjb-stage small { color: var(--muted); }
.mjb-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.mjb-bar i { display: block; height: 100%; width: 100%; background: var(--accent); }
.mjb-reveal { display: flex; align-items: center; gap: 18px; font-size: 72px; min-height: 100px; }
.mjb-reveal small { font-size: 16px; color: var(--muted); }
.mjb-note { font-weight: 700; min-height: 22px; margin: 0; }
.mjb-hands { display: flex; gap: 12px; margin-top: auto; }
.mjb-hands button { width: 96px; height: 96px; border-radius: 24px; font-size: 52px; background: var(--bg-2); border: 2px solid transparent; touch-action: manipulation; }
.mjb-hands button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--bg-2)); }
.mjb-hands.done button:not(.on) { opacity: .4; }
/* 뱀 */
.sn-info { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.sn-me { color: #3e63dd; } .sn-op { color: #f08c2e; }
.sn-cv { align-self: center; border-radius: 8px; touch-action: none; }
.sn-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 52px); gap: 6px; justify-content: center; margin-top: 10px; }
.sn-pad button { border-radius: 14px; background: var(--bg-2); font-size: 22px; touch-action: manipulation; }
.sn-pad [data-dir="up"] { grid-column: 2; grid-row: 1; } .sn-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.sn-pad [data-dir="down"] { grid-column: 2; grid-row: 2; } .sn-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }

/* 🏆 전적 */
.st-hero { margin: 8px 0 14px; padding: 16px 14px 12px; border-radius: 18px; background: var(--bg-2); }
.st-vs { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.st-p { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; flex: 1; }
.st-p.r { justify-content: flex-end; }
.st-p i, .st-legend i, .st-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.st-score { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.st-score b { font-size: 40px; line-height: 1; } .st-score small { font-size: 22px; color: var(--muted); }
.st-bar { display: flex; gap: 2px; height: 12px; margin: 10px 0 6px; }
.st-bar.big { height: 18px; }
.st-bar i { background: var(--c); min-width: 4px; }
.st-bar i:first-child { border-radius: 4px 0 0 4px; } .st-bar i:last-child { border-radius: 0 4px 4px 0; } .st-bar i:only-child { border-radius: 4px; }
.st-bar.st-none { border-radius: 4px; background: color-mix(in srgb, var(--muted) 15%, transparent); align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.st-sub { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.st-card { margin: 0 0 14px; }
.st-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; margin: 6px 2px 10px; }
.st-legend { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.st-legend i { width: 8px; height: 8px; margin-left: 4px; }
.st-streak { font-size: 12.5px; font-weight: 700; }
.st-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.st-chip { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); }
.st-chip.draw { background: color-mix(in srgb, var(--muted) 35%, transparent); color: var(--text); }
.st-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.st-rows li { display: grid; grid-template-columns: 92px 22px 1fr 22px; align-items: center; gap: 6px; }
.st-rows li.none { opacity: .45; }
.st-rows .st-bar { margin: 0; }
.st-g { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-n { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; } .st-n.b { text-align: left; }
.st-line { position: relative; }
.st-line svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; }
.st-grid { stroke: var(--line); stroke-width: 1; }
.st-ax { font-size: 10px; fill: var(--muted); }
.st-end { font-size: 12px; font-weight: 700; fill: var(--text); }
.st-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-tip { position: absolute; top: -6px; width: 150px; padding: 7px 9px; border-radius: 10px; background: var(--bg); box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.st-tip span { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.st-tip i { width: 8px; height: 8px; }

/* 오목 금수 ✕ */
.cell.ban { cursor: not-allowed; }
.ban-x { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: calc(var(--cell, 22px) * .6); color: #e5484d; pointer-events: none; }

/* 🃏 트럼프 카드 */
.pc { --w: 34px; position: relative; width: var(--w); aspect-ratio: 5 / 7; border-radius: 6px; background: #fff; border: 1px solid #c9ccd3; color: #1d1f24;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1; padding: 0; flex: none; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pc b { font-size: calc(var(--w) * .38); font-weight: 800; letter-spacing: -.5px; }
.pc i { font-style: normal; font-size: calc(var(--w) * .42); }
.pc.red { color: #d23b3b; }
.pc.back { background: repeating-linear-gradient(45deg, #3b6cf6 0 4px, #5a86f8 4px 8px); border-color: #2f56c6; }
.pc.empty { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; }
.pc.mini { --w: 18px; margin-left: -9px; } .pc.mini:first-child { margin-left: 0; }
.cg { display: flex; flex-direction: column; gap: 14px; padding: 6px 12px; }
.cg-row { display: flex; flex-direction: column; gap: 6px; }
.cg-who { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cg-fan { display: flex; }
.cg-hand { display: flex; flex-wrap: wrap; gap: 3px; }
.cg-hand .pc { --w: min(31px, calc((100vw - 60px) / 11)); }
.cg-hand.small .pc { --w: 26px; }
.cg-hand.bj .pc { --w: 54px; }
.cg-hand .pc.meld { box-shadow: inset 0 -4px 0 var(--mk), 0 1px 2px rgba(0,0,0,.12); }
.cg-hand .pc.dead { opacity: .95; }
.cg-hand button.pc { cursor: pointer; transition: transform .1s; }
.cg-hand button.pc.sel { transform: translateY(-8px); outline: 2px solid var(--accent); }
.cg-gap { width: 8px; }
.cg-center { display: flex; justify-content: center; gap: 28px; padding: 6px 0; }
.cg-pile { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; padding: 4px; border-radius: 10px; }
.cg-pile .pc { --w: 52px; }
.cg-pile small { font-size: 11px; color: var(--muted); }
.cg-pile.can { box-shadow: 0 0 0 2px var(--accent); }
.cg-pile:disabled { opacity: .8; }
.cg-hint { text-align: center; margin: 0 0 6px; font-size: 13px; }
.cg-btns { display: flex; gap: 8px; justify-content: center; }
.cg-btns .knock { background: #2fb36d; }
.cg-result { text-align: center; font-weight: 700; font-size: 15px; margin: 4px 0; }
.cg-note { font-size: 12px; margin: 0; }
.bj-v { font-size: 18px; } .bj-mid { text-align: center; font-size: 12px; }
.bj-tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--bg-2); color: var(--muted); font-weight: 600; }
.bj-tag.bust { background: #e5484d; color: #fff; } .bj-tag.bj { background: #2fb36d; color: #fff; } .bj-tag.now { color: var(--accent); }
.ghost-btn { background: var(--bg-2); color: var(--text); padding: 12px 22px; border-radius: 14px; font-weight: 700; }
/* 🏃 스피드 */
.sp-opp { display: flex; align-items: baseline; gap: 6px; justify-content: center; font-size: 14px; } .sp-opp b { font-size: 22px; }
.sp-stuck { text-align: center; font-size: 13px; font-weight: 700; color: #e0a43e; margin-top: 6px; }
.sp-piles { flex: 1; display: flex; align-items: center; justify-content: center; gap: 22px; }
.sp-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; padding: 6px; border-radius: 14px; }
.sp-pile .pc { --w: 92px; } .sp-pile small { font-size: 11px; color: var(--muted); }
.sp-pile.pref { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.sp-me { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sp-hand { display: flex; gap: 6px; justify-content: center; min-height: 92px; }
.sp-hand .pc { --w: 58px; touch-action: manipulation; }
.sp-hand .pc:not(.can) { opacity: .55; }
.pc.shake { animation: pcShake .25s; }
@keyframes pcShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.cg-hand:not(.small):not(.bj) { gap: 2px; flex-wrap: nowrap; }
.cg-hand:not(.small):not(.bj) .pc { --w: min(31px, calc((100vw - 64px) / 11)); }
.cg-btns button { white-space: nowrap; }

/* 게임 설명 팝업 */
.gt-wrap { display: inline-flex; align-items: center; gap: 6px; }
.help-q { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted); background: none; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; }
.ghelp { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ghelp[hidden] { display: none; }
.ghelp-box { width: 100%; max-width: 380px; max-height: 85vh; overflow-y: auto; background: var(--bg); color: var(--text); border-radius: 16px; padding: 20px 18px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.ghelp-box h3 { margin: 0 0 8px; font-size: 19px; }
.ghelp-goal { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-weight: 600; font-size: 14px; }
.ghelp-box ul { margin: 0 0 14px; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.ghelp-box li + li { margin-top: 4px; }
.ghelp-off { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.ghelp-box .primary { width: 100%; padding: 11px; font-size: 15px; }

/* 게임 타일 3열 (2026-11-22) */
.gl-active, .gl-new { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gl-tile { padding: 14px 6px 11px; }
.gl-tile .gl-icon { font-size: 32px; }
.gl-tile b { font-size: 14px; }
.gl-tile small { font-size: 10.5px; line-height: 1.3; }
.gl-tile .gl-go { font-size: 12px; }
.gl-tile.playing .gl-st { font-size: 12.5px; }
/* 🔨 두더지 잡기 */
.ml-score { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 18px 2px; font-size: 15px; }
.ml-score b { font-size: 30px; color: var(--text); }
.ml-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; max-width: 420px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.ml-hole { position: relative; aspect-ratio: 1; border: none; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #3d2a1a 0 45%, #6b4a2e 46% 62%, #8bbf5a 63%); overflow: hidden; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.ml-mole { position: absolute; left: 0; right: 0; bottom: -60%; font-size: 52px; line-height: 1; text-align: center; transition: bottom .12s ease-out; pointer-events: none; }
.ml-hole.up .ml-mole { bottom: 22%; }
.ml-hole.gold { box-shadow: 0 0 0 3px #f5c400 inset; }
.ml-hole.bomb { box-shadow: 0 0 0 3px #e5484d inset; }
.ml-hole.whack .ml-mole { transform: scale(.75); filter: brightness(.7); }
.ml-pop { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; opacity: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ml-pop.show { animation: mlPop .7s ease-out; }
@keyframes mlPop { 0% { opacity: 1; transform: translateY(0) scale(1.2); } 100% { opacity: 0; transform: translateY(-30%) scale(1); } }

/* 💼 입사일 카운터 */
.ms-bar { display: flex; gap: 8px; padding: 10px 12px 4px; }
.ms-bar[hidden] { display: none; }
.ms-chip { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.ms-name { font-size: 12px; font-weight: 700; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-val { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-val b { font-size: 15px; }
.cal-ms { padding: 6px 0 8px; }
.ms-val small { font-size: 12px; color: var(--muted); margin-left: 2px; }
.ms-bar { flex-wrap: wrap; }
.ms-chip { flex: 1 1 140px; }
/* 기념일 카드 3열 (태웅 요청) */
.ms-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ms-chip { padding: 7px 8px; gap: 1px; }
.ms-name { font-size: 11.5px; }
.ms-val { display: flex; flex-direction: column; line-height: 1.25; }
.ms-val b { font-size: 16px; }
.ms-val small { margin-left: 0; font-size: 11.5px; }
/* 전적 종목별 2열 (태웅 요청 "2열로 컴팩트하게") */
.st-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.st-rows li { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "g a s b" "bar bar bar bar"; gap: 4px 3px; }
.st-rows .st-g { grid-area: g; font-size: 12.5px; }
.st-rows .st-n { font-size: 12.5px; }
.st-rows .st-n.a { grid-area: a; }
.st-rows .st-n.b { grid-area: b; }
.st-rows li:not(.none)::after { content: ':'; grid-area: s; font-size: 11px; color: var(--muted); }
.st-rows .st-bar { grid-area: bar; }

/* 🎵 음악방 노래 탭 */
.ml-top { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.ml-top .primary { flex: 1 1 100%; padding: 11px; font-size: 15px; }
.ml-top .small-btn { flex: 1 1 0; padding: 9px 6px; font-size: 13.5px; }
.ml-q { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 15px; }
.ml-count { font-size: 12px; margin: 8px 2px 4px; }
.ml-list { list-style: none; margin: 0; padding: 0; }
.ml-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ml-list li.on { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; }
.ml-list li.on b { color: var(--accent); }
.ml-ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.ml-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ml-t b, .ml-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-t b { font-size: 14.5px; font-weight: 600; }
.ml-t small { font-size: 12px; }
.ml-list .icon { flex: none; font-size: 15px; opacity: .7; padding: 4px; background: none; border: none; }
.ml-none { justify-content: center; cursor: default; border: none !important; }
.ml-hint { font-size: 12px; text-align: center; margin: 14px 0 4px; }

/* 🫧 비눗방울 대작전 */
.rt.bub .form-box { max-width: none; }
.rt.bub .rt-body { padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); }
.bb-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 8px; align-content: start; }
.bb-mid { display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; }
.bb-hud { display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; font-size: 12px; padding: 2px 4px 4px; white-space: nowrap; }
.bb-p b { color: var(--c); } .bb-p em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-st { font-weight: 800; color: var(--muted); }
.bb-cv { width: 100%; aspect-ratio: 512 / 320; border-radius: 10px; background: #121828; image-rendering: auto; touch-action: none; }
.bb-pad { display: flex; gap: 10px; justify-content: center; touch-action: none; }
.bb-pad button { width: 72px; height: 64px; border-radius: 18px; border: none; background: var(--bg-2); color: var(--text); font-size: 26px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.bb-pad button.on { background: color-mix(in srgb, var(--accent) 30%, var(--bg-2)); transform: scale(.95); }
.bb-pad.r button[data-k="jump"] { background: color-mix(in srgb, var(--accent) 18%, var(--bg-2)); }
/* 세로: 판 위, 버튼 아래 (◀▶ 왼쪽 · 🫧⤴ 오른쪽) */
@media (orientation: portrait) {
  .bb-wrap { grid-template-columns: 1fr 1fr; grid-template-areas: "mid mid" "l r"; }
  .bb-mid { grid-area: mid; } .bb-pad.l { grid-area: l; justify-content: flex-start; } .bb-pad.r { grid-area: r; justify-content: flex-end; }
}
/* 가로: 버튼이 판 양옆 */
@media (orientation: landscape) {
  .rt.bub .form-head { padding: 4px 14px; }
  .bb-wrap { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 1fr; align-items: center; height: 100%; }
  .bb-pad { flex-direction: column; }
  .bb-pad button { width: 64px; height: 58px; }
  .bb-cv { width: auto; max-width: 100%; height: calc(100dvh - 92px - env(safe-area-inset-bottom)); max-height: calc((100vw - 170px) * 0.625); }
}

/* 붙여넣기 보내기 확인 */
.fc-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 14px; max-height: 50vh; overflow-y: auto; }
.fc-list.one { grid-template-columns: 1fr; }
.fc-list img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.fc-list.one img { aspect-ratio: auto; max-height: 45vh; object-fit: contain; }
.fc-file { aspect-ratio: 1; border-radius: 8px; background: var(--bg-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 28px; padding: 6px; overflow: hidden; }
.fc-file small { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-btns { display: flex; gap: 8px; }
.fc-btns button { flex: 1; padding: 11px; font-size: 15px; }
#fc-no { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); }

/* 기념일 접기 (경복 요청) */
#ms-home:not(.folded) { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)) 22px; }
.ms-close { align-self: stretch; border: none; border-radius: 10px; background: var(--bg-2); color: var(--muted); font-size: 13px; padding: 0; cursor: pointer; }
#ms-home.folded { display: block; padding: 6px 12px 0; }
.ms-open { width: 100%; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: none; border-radius: 10px; background: var(--bg-2); color: var(--text); font-size: 13px; cursor: pointer; }
.ms-open span { margin-left: auto; color: var(--muted); font-size: 12px; }
/* 🫧 고침 (2026-11-23 태웅 제보: 가로에서 방향키 안 보임·누르면 글자 선택·확대됨·깜박임) — grid 대신 flex, 판 크기는 bubble.js fit() 이 정함 */
.rt.bub, .rt.bub * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.rt.bub .rt-body { touch-action: none; overscroll-behavior: none; }
.rt.bub .bb-wrap { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; flex: 1; min-height: 0; height: auto; grid-template: none; }
.rt.bub .bb-mid { flex: 1 1 100%; order: 0; min-width: 0; }
.rt.bub .bb-pad { flex-direction: row; }
.rt.bub .bb-pad.l { order: 1; flex: 1 1 40%; justify-content: flex-start; }
.rt.bub .bb-pad.r { order: 2; flex: 1 1 40%; justify-content: flex-end; }
.rt.bub .bb-cv { aspect-ratio: auto; max-height: none; max-width: none; }
.rt.bub .bb-wrap.land { flex-wrap: nowrap; align-items: center; align-content: stretch; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.rt.bub .bb-wrap.land .bb-pad { flex: none; flex-direction: column; }
.rt.bub .bb-wrap.land .bb-pad.l { order: 0; } .rt.bub .bb-wrap.land .bb-pad.r { order: 2; }
.rt.bub .bb-wrap.land .bb-mid { order: 1; flex: 1 1 auto; align-self: stretch; justify-content: center; }

/* 🏰 성 지키기 (2026-11-24) */
.td-root { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; margin: -6px -10px 0; }
.td-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; padding: 0 4px; min-height: 30px; }
.td-hud b { font-size: 17px; }
.td-hpw.low b { color: #e5484d; animation: tdBlink 1s infinite; }
@keyframes tdBlink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .td-hpw.low b { animation: none; } }
.td-wave { flex: 1; text-align: center; font-size: 13px; white-space: nowrap; }
.td-wave .small-btn { padding: 3px 8px; font-size: 12px; margin-left: 4px; }
.td-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.td-wrap canvas { display: block; border-radius: 10px; touch-action: none; -webkit-touch-callout: none; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.td-bar { display: flex; align-items: center; gap: 6px; min-height: 58px; padding: 0 2px; }
.td-tip { flex: 1; font-size: 13px; }
.td-info { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-info b { font-size: 14px; }
.td-b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation; }
.td-b span { font-size: 22px; line-height: 1.1; }
.td-b b { font-size: 12.5px; }
.td-b small { font-size: 11.5px; color: var(--muted); }
.td-b:disabled, .td-bar .small-btn:disabled { opacity: .45; }
.td-x { border: none; background: none; color: var(--muted); font-size: 18px; padding: 8px; cursor: pointer; }
.td-wave [hidden] { display: none; }
/* ↕︎ 이모티콘 탭 순서 (2026-11-25) */
.sticker-tabs .order-btn { background: none; color: var(--accent); }
.sticker-tabs .order-title { flex: 1; align-self: center; font-size: 14px; }
.st-order { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; }
.st-order li { display: flex; align-items: center; gap: 6px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.st-order li span { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-order button { width: 38px; height: 34px; border-radius: 10px; background: var(--bg-2); color: var(--text); font-size: 14px; }
.st-order button:disabled { opacity: .3; }
.st-order-reset { grid-column: 1 / -1; justify-self: center; margin: 10px 0 4px; }
/* 이모티콘방 위 바로가기 (2026-11-25) */
.room-bar .emo-link { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: 12px; background: #fee500; color: #191919; font-size: 14px; font-weight: 700; text-decoration: none; }
.room-bar .emo-link span { font-weight: 400; opacity: .7; }
/* 🧱 블록 배틀 (2026-11-26) */
.bk-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: -6px -10px 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bk-cv { display: block; touch-action: none; }
.bk-pad { margin-top: auto; width: 100%; max-width: 460px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 0 4px; flex: none; }
.bk-pad button { height: 54px; border-radius: 14px; background: var(--bg-2); color: var(--text); font-size: 22px; font-weight: 700; touch-action: none; -webkit-tap-highlight-color: transparent; border: 1px solid var(--line); }
.bk-pad button:active { background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); }
.bk-pad .sm { font-size: 13px; }
.bk-pad .drop { background: var(--accent); color: #fff; border-color: transparent; }
/* 🐍 좌회전·우회전 버튼 (2026-11-26) */
.sn-pad2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 10px; }
.sn-pad2 button { height: 64px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.sn-pad2 button small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sn-pad2 button:active { background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); }
/* 💡 요청 알림 끄기 (2026-11-26) */
.req-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req-bell { padding: 5px 10px; border-radius: 14px; background: var(--bg-2); color: var(--text); font-size: 12.5px; border: 1px solid var(--line); }
.req-bell.off { color: var(--muted); }
