/* CertifiQuiz
   Operate 화면: 셸(짙은 초록 헤더) + 옅게 물든 바탕 + 흰 시트.
   그라데이션, 장식 그림자, 이모지 아이콘, 카드 안 카드 없음. */

:root {
  --ground: #eef2ef;
  --sheet: #fbfcfb;
  --sunk: #e4ebe6;
  --line: #d3ddd6;
  --line-strong: #b9c8be;
  --ink: #15211b;
  --ink-2: #4a5a51;
  --ink-3: #6f7f76;
  --shell: #133d2c;
  --shell-ink: #e6f0ea;
  --shell-ink-2: #a9c3b4;
  --accent: #1b8a5a;
  --accent-ink: #f3fbf6;
  --accent-hover: #167449;
  --accent-soft: #d6eee0;
  --accent-soft-ink: #12573a;
  --board: #17261f;
  --board-2: #213429;
  --board-ink: #eef5f0;
  --board-ink-2: #b5c9bd;
  --ok: #1d8f57;
  --ok-on-board: #7fe0ab;
  --bad: #c9373f;
  --bad-on-board: #ff9aa0;
  --warn: #b97a0d;
  --gold: #c99412;
  --r: 8px;
  --r-lg: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--font); font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
::selection { background: var(--accent-soft); color: var(--accent-soft-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { text-wrap: balance; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .g-time, .g-progress, .count, td { font-variant-numeric: tabular-nums; }

/* 아이콘 */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* 툴팁: data-tip 속성 */
[data-tip] { position: relative; }
[data-tip]:not([data-tip=""])::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  width: max-content; max-width: 240px; padding: 6px 9px; border-radius: 6px;
  background: var(--ink); color: #f1f5f2; font-size: 12.5px; font-weight: 500; line-height: 1.45; text-align: left; white-space: pre-line;
  box-shadow: 0 6px 16px -6px rgba(21, 33, 27, .45);
  opacity: 0; pointer-events: none; transition: opacity .12s var(--ease), transform .12s var(--ease); z-index: 40;
}
[data-tip]:not([data-tip=""]):hover::after,
[data-tip]:not([data-tip=""]):focus-visible::after,
.tip-icon:focus::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }
[data-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 8px); }
[data-tip-pos="bottom-end"]::after { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: translate(0, -4px); }
[data-tip-pos="bottom-end"]:hover::after, [data-tip-pos="bottom-end"]:focus-visible::after, .tip-icon[data-tip-pos="bottom-end"]:focus::after { transform: translate(0, 0); }
.tip-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink-3); cursor: help; }
.tip-icon:hover { color: var(--ink); }
.tip-icon .i { width: 16px; height: 16px; }

/* 셸 */
.shell { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 20px; background: var(--shell); color: var(--shell-ink); }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--shell-ink); text-decoration: none; }
.brand b { font-weight: 800; color: #8fe0b4; }
.online { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--shell-ink-2); }
.online .i { width: 16px; height: 16px; }
.shell .me { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.me-nick { font-weight: 700; white-space: nowrap; }
.me-rating { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(230, 240, 234, .12); color: var(--shell-ink); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: help; }
.me-rating .i { width: 15px; height: 15px; color: #8fe0b4; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex-shrink: 0; }
.conn.on { background: #6fd39d; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }

/* 뷰 전환 */
.view { display: none; }
.view.active { display: block; animation: enter .28s var(--ease); }
@keyframes enter { from { opacity: .4; } to { opacity: 1; } }

/* 버튼, 입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--sheet); font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--sunk); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunk); color: var(--ink); }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.small .i { width: 16px; height: 16px; }
.btn.start { width: 100%; height: 52px; margin-top: 16px; background: var(--bad); border-color: var(--bad); color: #fff; font-size: 17px; }
.btn.start:hover { background: #b02f36; }
.btn.start:disabled { background: var(--sunk); border-color: var(--line); color: var(--ink-3); opacity: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn.on-dark { color: var(--shell-ink-2); }
.icon-btn.on-dark:hover { background: rgba(230, 240, 234, .12); color: var(--shell-ink); }
input[type="text"], select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--sheet); }
input[type="text"]::placeholder { color: var(--ink-3); }
input[type="text"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input:disabled, select:disabled { background: var(--sunk); color: var(--ink-2); cursor: not-allowed; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* 공용 */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.sheet-head { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.count { margin-left: 4px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.tag .i { width: 14px; height: 14px; }
.tag.accent { background: var(--accent-soft); color: var(--accent-soft-ink); }

/* 시작 화면 */
.home { max-width: 520px; margin: 12vh auto 0; }
.home h1 { margin: 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
.lede { margin: 12px 0 28px; font-size: 17px; color: var(--ink-2); }
.nick-form { display: flex; gap: 8px; }
.nick-form input { flex: 1; height: 48px; font-size: 16px; }
.nick-form .btn { height: 48px; padding: 0 24px; font-size: 16px; }
.features { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.features li { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.features .i { width: 16px; height: 16px; color: var(--accent); }

/* 로비 */
.lobby { display: grid; gap: 16px; }
.lobby-cols, .room-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .lobby-cols, .room-cols { grid-template-columns: 1fr; } }
.group-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.group-tabs button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.group-tabs button:hover { background: var(--sunk); color: var(--ink); }
.group-tabs button.active { background: var(--ink); color: var(--sheet); }
.group-tabs .n { margin-left: 4px; opacity: .6; font-variant-numeric: tabular-nums; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cert { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: transparent; text-align: left; font-weight: 600; cursor: pointer; }
.cert:hover { border-color: var(--line-strong); background: var(--sunk); }
.cert .n { font-size: 12px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.cert.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-ink); }
.cert.active .n { color: var(--accent-soft-ink); }
.cert:disabled { color: var(--ink-3); border-style: dashed; cursor: not-allowed; background: transparent; }
.setup-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunk); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 650; cursor: pointer; }
.seg-btn .i { width: 16px; height: 16px; }
.seg-btn.active { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 33, 27, .12); }
#btn-queue { height: 44px; padding: 0 22px; font-size: 15px; }

/* 방 목록 */
.toolbar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.join-form { display: flex; align-items: center; gap: 2px; }
.join-form input { width: 104px; height: 36px; text-transform: uppercase; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.join-form input::placeholder { letter-spacing: 0; }
#btn-create-room { height: 36px; padding: 0 12px; font-size: 14px; }
.room-list { display: flex; flex-direction: column; }
.room-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.room-row:first-child { border-top: 0; }
.room-row:hover { background: var(--ground); }
.room-row.blocked { cursor: default; color: var(--ink-3); }
.room-row.blocked:hover { background: transparent; }
.room-row .room-no { font-weight: 750; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.room-row .title { min-width: 0; }
.room-row .title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.room-row .title small { display: flex; gap: 10px; margin-top: 2px; color: var(--ink-3); font-size: 12.5px; }
.room-row .title small span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.room-row .title small .i { width: 13px; height: 13px; }
.room-row .people { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.room-row .people .i { width: 15px; height: 15px; }
.room-row .state { font-size: 12.5px; font-weight: 650; color: var(--ink-3); min-width: 40px; text-align: right; }
.room-row .state.open { color: var(--accent); }
.empty { padding: 32px 0; text-align: center; color: var(--ink-3); }

/* 랭킹 */
.tabs { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--sunk); }
.tab { display: inline-grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 0; }
.tab .i { width: 16px; height: 16px; }
.tab.active { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 33, 27, .12); }
.lb-body { overflow-x: auto; }
.lb-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-body th { padding: 0 6px 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.lb-body td { padding: 8px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.lb-body .rank { width: 32px; color: var(--ink-3); font-weight: 700; }
.lb-body tr:nth-child(1) .rank { color: var(--gold); }
.lb-body .val { font-weight: 750; }
.lb-body .sub { color: var(--ink-3); font-size: 12.5px; }
.lb-body tr.me td { background: var(--accent-soft); color: var(--accent-soft-ink); }
.provisional { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--line-strong); vertical-align: middle; }

/* 매칭 대기 */
.queue { max-width: 420px; margin: 14vh auto 0; text-align: center; }
.queue h2 { margin: 20px 0 6px; font-size: 22px; }
.queue-desc { margin: 0; color: var(--ink-2); }
.queue-status { margin: 18px 0 24px; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pulse { width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--accent); animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(27, 138, 90, .45); } 100% { box-shadow: 0 0 0 22px rgba(27, 138, 90, 0); } }

/* 대기실 */
.room-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.room-bar .room-no { font-size: 24px; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums; color: var(--shell); }
.room-title { margin-left: 8px; font-size: 17px; }
.room-meta { display: inline-flex; gap: 6px; flex-wrap: wrap; }
#btn-room-leave { margin-left: auto; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 112px; border: 1px solid var(--line); border-radius: var(--r); }
.slot.empty { border-style: dashed; }
.slot.me { border-color: var(--accent); background: var(--accent-soft); }
.slot .avatar { width: 40px; height: 40px; font-size: 16px; }
.slot .name { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 14px; }
.slot .host { position: absolute; top: 8px; left: 8px; color: var(--gold); }
.slot .host .i { width: 16px; height: 16px; }
.settings { display: grid; gap: 14px; }
.settings label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.settings label.check { display: inline-flex; align-items: center; gap: 8px; width: max-content; color: var(--ink); font-size: 14px; cursor: pointer; }
.settings label.check .i { width: 16px; height: 16px; color: var(--ink-2); }
.settings .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 게임: 문제판이 이 화면의 시그니처. 단색 잉크판에 굵은 문제, 정답 공개 때만 색이 들어온다 */
.game { max-width: 820px; margin: 0 auto; }
.game-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.g-progress { margin-left: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.g-time { margin-left: auto; min-width: 56px; text-align: right; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.g-time.low { color: var(--bad); }
.timer { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--accent); transition: width .1s linear; }
.timer-bar.low { background: var(--bad); }
.board { position: relative; min-height: 320px; margin-top: 14px; padding: 28px; border-radius: 14px; background: var(--board); color: var(--board-ink); }
.countdown { padding: 72px 0; text-align: center; font-size: 80px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.question { margin-bottom: 22px; font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; word-break: keep-all; max-width: 65ch; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } .question { font-size: 18px; } .board { padding: 20px; } }
.choice { display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 13px 14px; border: 1px solid transparent; border-radius: 10px; background: var(--board-2); color: var(--board-ink); text-align: left; font-size: 16px; cursor: pointer; transition: background .12s, border-color .12s; }
.choice:hover:not(:disabled) { background: #2b4336; }
.choice:disabled { cursor: default; }
.choice .k { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; background: rgba(238, 245, 240, .1); color: var(--board-ink-2); font-size: 13px; font-weight: 700; }
.choice.picked { border-color: var(--board-ink-2); }
.choice.correct { border-color: var(--ok-on-board); background: rgba(127, 224, 171, .16); }
.choice.correct .k { background: var(--ok-on-board); color: var(--board); }
.choice.wrong { border-color: var(--bad-on-board); background: rgba(255, 154, 160, .14); }
.choice.wrong .k { background: var(--bad-on-board); color: var(--board); }
.choice.dim { opacity: .4; }
.status { display: flex; align-items: center; gap: 6px; min-height: 22px; margin-top: 16px; font-size: 14px; color: var(--board-ink-2); }
.status .i { width: 16px; height: 16px; }
.status.good { color: var(--ok-on-board); font-weight: 700; }
.status.bad { color: var(--bad-on-board); font-weight: 700; }
.reveal { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(238, 245, 240, .14); }
.reveal-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
.reveal-title.good { color: var(--ok-on-board); }
.reveal-title.bad { color: var(--bad-on-board); }
.reveal-exp { margin: 6px 0 0; color: var(--board-ink-2); font-size: 14px; word-break: keep-all; max-width: 70ch; }
.reveal-players { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--board-ink-2); }
.reveal-players span { display: inline-flex; align-items: center; gap: 4px; }
.reveal-players .i { width: 14px; height: 14px; }
.reveal-players .ok .i { color: var(--ok-on-board); }
.reveal-players .no .i { color: var(--bad-on-board); }
.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 12px; }
.score { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sheet); }
.score.me { border-color: var(--accent); }
.score.left { opacity: .45; }
.score.left .sname { text-decoration: line-through; }
.score.lead b { color: var(--gold); }
.score .avatar { width: 26px; height: 26px; font-size: 11px; }
.score .sname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.score b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score .mark { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 0 0 var(--r) var(--r); }
.score .mark.answered { background: var(--warn); }
.score .mark.correct { background: var(--ok); }
.score .mark.wrong { background: var(--bad); }
.game-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* 결과 */
.result { max-width: 760px; margin: 6vh auto 0; }
.result-head { display: flex; align-items: center; gap: 6px; }
.result-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.result-title .i { width: 34px; height: 34px; }
.result-title.win { color: var(--ok); }
.result-title.loss { color: var(--bad); }
.result-title.draw { color: var(--warn); }
.result-title.void, .result-title.solo { color: var(--ink-2); }
.result-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 22px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sheet); }
.result-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.result-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.result-table td { padding: 11px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.result-table tr:first-child td { border-top: 0; }
.result-table .num { text-align: right; }
.result-table tr.me td { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 650; }
.result-table tr.left td { color: var(--ink-3); }
.delta { margin-left: 4px; font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.result-actions { display: flex; gap: 8px; margin-top: 20px; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: #f1f5f2; font-size: 14px; font-weight: 600; box-shadow: 0 10px 24px -10px rgba(21, 33, 27, .55); opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); }

/* 모바일 */
@media (max-width: 640px) {
  .shell { gap: 10px; padding: 0 12px; }
  .online > * { display: none; }
  .me-nick { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
  main { padding: 16px 12px 48px; }
  .sheet { padding: 16px; }
  .home { margin-top: 8vh; }
  .setup-bar { flex-direction: column; align-items: stretch; }
  .seg { display: flex; } .seg-btn { flex: 1; justify-content: center; }
  .toolbar { width: 100%; margin-left: 0; margin-top: 8px; }
  .join-form { flex: 1; } .join-form input { flex: 1; width: auto; }
  .room-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .room-row .state { display: none; }
  .result-title { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.result-table.unranked th:nth-child(n+6), .result-table.unranked td:nth-child(n+6) { display: none; }
.lobby { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .lobby-cols, .room-cols { grid-template-columns: minmax(0, 1fr); } }
.cert { min-width: 0; }
.cert > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cert { font-size: 14px; } }
@media (max-width: 640px) { .join-form, .join-form input { min-width: 0; } #btn-create-room { flex-shrink: 0; } }

/* 로그인 */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.btn.oauth { height: 48px; font-size: 15px; gap: 10px; }
.btn.oauth .logo { width: 20px; height: 20px; flex-shrink: 0; }
.btn.google { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.btn.google:hover { background: #f6f8f6; border-color: #c6cbc8; }
.btn.kakao { background: #fee500; border-color: #fee500; color: rgba(0, 0, 0, .85); }
.btn.kakao:hover { background: #f5dc00; border-color: #f5dc00; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#btn-queue.locked { background: var(--sunk); border-color: var(--line-strong); color: var(--ink-2); }
#btn-queue.locked:hover { background: var(--line); }
.me-rating.guest { font-weight: 600; color: var(--shell-ink-2); }
@media (max-width: 640px) { .auth { grid-template-columns: 1fr; } }

/* 동의, 탈퇴, 푸터 */
.consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.consent input { margin-top: 2px; }
.consent a, .doc a { color: var(--accent-soft-ink); text-underline-offset: 3px; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 18px; padding: 0; border: 0; background: none; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.link-btn .i { width: 14px; height: 14px; }
.link-btn.danger:hover { color: var(--bad); }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 24px 16px 32px; font-size: 13px; }
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot b { font-weight: 700; color: var(--ink-2); }

/* 문서 페이지 (이용약관, 개인정보처리방침, 공지사항) */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.doc h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.02em; }
.doc .meta { margin: 0 0 28px; color: var(--ink-3); font-size: 14px; }
.doc h2 { margin: 32px 0 10px; font-size: 18px; }
.doc p, .doc li { max-width: 70ch; color: var(--ink); line-height: 1.75; }
.doc ol, .doc ul { padding-left: 1.3em; }
.doc li + li { margin-top: 4px; }
.doc table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--sunk); font-weight: 650; }
.doc .table-wrap { border: 0; background: none; }
.unset { color: var(--bad); font-weight: 700; }
.notice { border-top: 1px solid var(--line); }
.notice summary { display: flex; align-items: baseline; gap: 10px; padding: 14px 4px; cursor: pointer; list-style: none; }
.notice summary::-webkit-details-marker { display: none; }
.notice summary .tag { flex-shrink: 0; }
.notice summary strong { flex: 1; font-weight: 650; }
.notice summary time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.notice .body { padding: 0 4px 18px; }
.notice .body p { margin: 0 0 10px; }
