/* =========================================================
   오목 페이지 (omok.html) — 크림 종이 바탕 + 남색 위 막대 + 나무 바둑판
   ========================================================= */
:root {
    --om-navy: #1e2942;
    --om-navy2: #2b3a5c;
    --om-gold: #c9a27e;
    --om-cream: #fbf7ef;
    --om-paper: #f4ecdd;
    --om-ink: #2c2418;
    --om-mute: #8a7d68;
    --om-wood: #a8743a;
    --om-lav: #dad9ff;
    --om-plum: #36347a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--om-cream);
    color: var(--om-ink);
    font-family: "Noto Sans KR", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 위 막대 */
.om-top { background: linear-gradient(180deg, var(--om-navy2), var(--om-navy)); border-bottom: 3px solid var(--om-gold); }
.om-top-in {
    max-width: 980px; margin: 0 auto; padding: 14px 16px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.om-title { margin: 0; color: #fff3c4; font-size: 1.5rem; letter-spacing: 0.04em; }
.om-title small { margin-left: 8px; font-size: 0.82rem; font-weight: 600; color: #e9d9c4; letter-spacing: 0; }
.om-brand { font-family: "Chewy", cursive; color: var(--om-gold); font-size: 1.05rem; white-space: nowrap; }

/* 본문: PC는 판(왼쪽) + 설정(오른쪽), 폰은 위아래 */
.om-main {
    max-width: 980px; margin: 0 auto; padding: 20px 16px 10px;
    display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start;
}

/* 상태 줄 + 오른쪽 위 모서리 소리 버튼 */
.om-statusrow {
    display: flex; align-items: center; gap: 10px;
    max-width: 600px; margin: 0 auto 10px;
}
.om-statusrow .om-status { flex: 1; margin: 0; }
/* 남은 시간 동그라미 */
.om-timer {
    position: relative; flex: none; width: 46px; height: 46px;
    display: grid; place-items: center;
}
.om-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.om-tr-bg { fill: #fff; stroke: #eadfcb; stroke-width: 4; }
.om-tr {
    fill: none; stroke: #2fae7a; stroke-width: 4; stroke-linecap: round;
    stroke-dasharray: 119.38; stroke-dashoffset: 0;
    transition: stroke 0.2s;
}
.om-timer span { position: relative; font-weight: 700; font-size: 1.05rem; color: var(--om-ink); font-variant-numeric: tabular-nums; }
.om-timer.idle .om-tr { stroke: #d8ccb4; }
.om-timer.idle span { color: var(--om-mute); }
.om-timer.ai .om-tr { stroke: #9aa6c4; }
.om-timer.ai span { color: #6b7799; }
.om-timer.warn .om-tr { stroke: #e5402b; }
.om-timer.warn span { color: #c62f1c; animation: omBeat 1s ease-in-out infinite; }
.om-timer.end .om-tr { stroke: #c9bfae; }
@keyframes omBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } }

.om-mute {
    flex: none; width: 42px; height: 42px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(160deg, rgba(120, 170, 235, 0.55), rgba(40, 80, 150, 0.75));
    box-shadow: 0 4px 12px rgba(30, 50, 100, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: transform 0.12s, filter 0.15s;
}
.om-mute:hover { filter: brightness(1.08); }
.om-mute:active { transform: scale(0.94); }
.om-mute svg { width: 24px; height: 24px; overflow: visible; }
.om-mute .om-spk { fill: #fff; }
.om-mute .om-wave { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; }
.om-mute .om-slash { fill: none; stroke: #e5402b; stroke-width: 2.6; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 1px #fff); }
.om-mute.muted .om-wave { opacity: 0.35; }
.om-mute.muted .om-slash { opacity: 1; }

.om-status {
    margin: 0 auto 10px; max-width: 600px;
    padding: 9px 14px; border-radius: 10px;
    background: #fff; border: 1px solid #e3d8c4;
    text-align: center; font-weight: 700; font-size: 0.98rem; color: var(--om-ink);
    min-height: 1.5em;
}
.om-status.thinking::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: omDots 1.2s steps(4) infinite; }
@keyframes omDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.om-status.win  { background: #fff4cf; border-color: #e8c66a; color: #7a5200; }
.om-status.lose { background: #eef0f7; border-color: #c4cbe0; color: #2b3a5c; }
.om-status.warn { background: #ffe9e6; border-color: #f2b2a8; color: #a3321f; }

.om-board {
    position: relative;
    width: 100%; max-width: 600px; margin: 0 auto;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(70, 40, 10, 0.28), 0 2px 0 rgba(0, 0, 0, 0.08);
}
.om-board canvas { display: block; width: 100%; height: 100%; border-radius: 10px; touch-action: manipulation; cursor: pointer; }
.om-hint { margin: 10px auto 0; max-width: 600px; text-align: center; font-size: 0.85rem; color: var(--om-mute); }

/* 결과 창 (판 위) */
.om-result {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(30, 20, 8, 0.28); border-radius: 10px;
    animation: omFade 0.35s ease;
}
.om-result[hidden] { display: none; }
@keyframes omFade { from { opacity: 0; } to { opacity: 1; } }
.om-result-card {
    background: var(--om-cream); border: 2px solid var(--om-gold); border-radius: 14px;
    padding: 18px 26px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: omPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes omPop { from { transform: scale(0.8); } to { transform: scale(1); } }
.om-result-title { margin: 0; font-size: 1.6rem; font-weight: 700; }
.om-result-sub { margin: 4px 0 14px; color: var(--om-mute); font-size: 0.9rem; }

/* 설정 칸 */
.om-panel {
    background: #fff; border: 1px solid #e3d8c4; border-radius: 12px;
    padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.om-group { display: flex; flex-direction: column; gap: 6px; }
.om-label { font-size: 0.8rem; font-weight: 700; color: var(--om-mute); letter-spacing: 0.05em; }
.om-seg { display: flex; background: var(--om-paper); border: 1px solid #e3d8c4; border-radius: 10px; padding: 3px; gap: 3px; }
.om-seg button {
    flex: 1; border: 0; background: transparent; border-radius: 8px;
    padding: 8px 4px; font: inherit; font-size: 0.88rem; font-weight: 600; color: #6b5c47; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.om-seg button.on { background: var(--om-navy); color: #fff3c4; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.om-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.om-black { background: radial-gradient(circle at 35% 30%, #666, #000 70%); }
.om-white { background: radial-gradient(circle at 35% 30%, #fff, #cfc9bd 80%); border: 1px solid #b8b0a0; }
.om-inline { width: 0.85em; height: 0.85em; margin: 0 0 0 3px; vertical-align: -0.08em; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }
.om-note { margin: -6px 0 0; font-size: 0.8rem; color: #a3321f; }

.om-actions { display: flex; gap: 8px; }
.om-btn {
    font: inherit; font-size: 0.92rem; font-weight: 700;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid #d8ccb4; background: var(--om-paper); color: var(--om-ink);
    transition: transform 0.1s, background 0.15s;
}
.om-btn:active:not(:disabled) { transform: translateY(1px); }
.om-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.om-actions .om-btn { flex: 1; }
.om-exit { background: #eef0f7; border-color: #c4cbe0; color: var(--om-navy2); }
.om-exit:hover { background: #e2e6f2; }
.om-primary { background: linear-gradient(180deg, #b77f42, #9a6430); border-color: #8a5a2b; color: #fff; }
.om-primary:hover:not(:disabled) { background: linear-gradient(180deg, #c48a4b, #a66c35); }

.om-online {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--om-lav); border-color: #c3c1f0; color: var(--om-plum);
}
.om-online:disabled { opacity: 0.75; }
.om-soon { font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--om-plum); color: #fff; }

.om-check { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: #5a4c38; cursor: pointer; }
.om-check input { width: 16px; height: 16px; accent-color: var(--om-navy); }

.om-record { font-size: 0.82rem; color: #5a4c38; background: var(--om-paper); border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.om-record b { color: var(--om-ink); }
.om-rec { white-space: nowrap; }

.om-rules { font-size: 0.85rem; color: #4a3d2c; }
.om-rules summary { cursor: pointer; font-weight: 700; color: var(--om-navy2); }
.om-rules ul { padding-left: 1.2em; margin: 8px 0 0; line-height: 1.7; }
.om-rules ul ul { margin: 2px 0; }

.om-foot { text-align: center; font-size: 0.78rem; color: var(--om-mute); padding: 18px 16px 26px; }

/* ---------- 폰 ---------- */
@media (max-width: 760px) {
    .om-top-in { padding: 11px 16px; }
    .om-title { font-size: 1.25rem; }
    .om-title small { display: block; margin: 2px 0 0; }
    .om-brand { font-size: 0.92rem; }
    .om-main { grid-template-columns: 1fr; gap: 14px; padding: 12px 10px 6px; }
    .om-status { font-size: 0.92rem; }
    .om-board, .om-board canvas { border-radius: 8px; }
    .om-panel { padding: 14px; }
    .om-seg button { padding: 10px 4px; font-size: 0.92rem; }
    .om-btn { padding: 12px 14px; }
}

/* ===== 온라인 대결 (2026-11-14) ===== */
.om-online:hover { background: #cfcdfb; }
.om-mode-online .om-ai-only { display: none !important; }
.om-timer.opp .om-tr { stroke: #9aa6c4; }
.om-timer.opp span { color: #6b7799; }
.om-online-box {
    display: flex; flex-direction: column; gap: 10px;
    background: linear-gradient(180deg, #f1f0ff, #e6e5ff); border: 1px solid #c3c1f0; border-radius: 12px; padding: 12px;
}
.om-online-box[hidden] { display: none; }
.om-on-head { font-weight: 800; color: var(--om-plum); font-size: 1rem; }
.om-on-head small { font-weight: 600; font-size: 0.75rem; color: #6d6aa8; margin-left: 4px; }
.om-on-sec { display: flex; flex-direction: column; gap: 8px; }
.om-on-sec[hidden] { display: none; }
.om-on-sec .om-btn small { font-weight: 600; font-size: 0.75rem; opacity: 0.8; margin-left: 4px; }
.om-join { display: flex; gap: 6px; }
.om-join input {
    flex: 1; min-width: 0; font: inherit; font-size: 1rem; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; text-align: center;
    padding: 9px 8px; border: 1px solid #c3c1f0; border-radius: 10px; background: #fff; color: var(--om-plum);
}
.om-join input::placeholder { letter-spacing: 0.02em; font-weight: 600; color: #a5a3cf; }
.om-join .om-btn { flex: none; }
.om-on-msg { margin: 0; font-size: 0.86rem; color: #4b4880; line-height: 1.5; }
.om-code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #fff; border: 1px dashed #a9a6e8; border-radius: 10px; padding: 8px 10px; }
.om-code-box[hidden] { display: none; }
.om-code-box span { flex-basis: 100%; white-space: nowrap; font-size: 0.75rem; font-weight: 700; color: #6d6aa8; }
.om-code-box b { font-size: 1.5rem; letter-spacing: 0.18em; color: var(--om-plum); font-variant-numeric: tabular-nums; flex: 1; }
.om-code-box .om-btn { padding: 7px 10px; font-size: 0.82rem; white-space: nowrap; }
.om-on-info { margin: 0; font-size: 0.86rem; color: #3f3c74; line-height: 1.6; }
.om-opp { font-weight: 700; }
.om-opp.on { color: #23905a; }
.om-opp.off { color: #c2412b; }
.om-on-err { margin: 0; font-size: 0.82rem; color: #b8321f; background: #fff1ee; border-radius: 8px; padding: 7px 9px; }
.om-on-err[hidden] { display: none; }
@media (max-width: 760px) {
    .om-join input { font-size: 16px; }
}

/* 그만할래요 (2026-11-15) */
.om-stop { background: #fff4f1; border-color: #efc2b8; color: #a3402c; }
.om-stop:hover:not(:disabled) { background: #ffe9e3; }
.om-stop.om-stop-hot { border-color: #e08a76; box-shadow: 0 0 0 2px rgba(224, 138, 118, 0.25); }
.om-result-card .om-stop { margin-left: 6px; }

/* 온라인 대결 버튼의 NEW — 홈 게임 막대 FREE!와 같은 모양으로 통통 흔들림 (2026-11-15, PC·폰) */
.om-online .om-soon {
    display: inline-block;
    padding: 0; border-radius: 0; background: none;
    font-family: "Chewy", "Comic Sans MS", cursive;
    font-weight: 400; font-size: 1rem; letter-spacing: 0.04em; line-height: 1;
    color: #ff5e8a;
    text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 0 2px 0 rgba(255, 179, 71, 0.9);
    transform: rotate(-7deg);
    animation: omNewWiggle 2.6s ease-in-out infinite;
}
@keyframes omNewWiggle {
    0%, 70%, 100% { transform: rotate(-7deg) scale(1); }
    78% { transform: rotate(4deg) scale(1.12); }
    86% { transform: rotate(-10deg) scale(1.05); }
    93% { transform: rotate(-5deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .om-online .om-soon { animation: none; } }

/* 폰에서 온라인 대결 안내가 한눈에 보이게 (2026-11-15)
   - 가로로 넘치던 문제(판·소리 버튼이 오른쪽으로 잘림) → 칸 너비를 화면 안으로 고정
   - 고르기·기다리기 동안은 온라인 안내를 판 위로, 글씨·여백을 조금 작게 */
@media (max-width: 760px) {
    .om-main { grid-template-columns: minmax(0, 1fr); }
    .om-board-wrap, .om-panel { min-width: 0; }
    .om-mode-online.om-on-pre .om-panel { order: -1; }
    .om-mode-online .om-panel { padding: 10px; gap: 10px; }
    .om-online-box { padding: 10px; gap: 7px; border-radius: 10px; }
    .om-on-head { font-size: 0.92rem; }
    .om-on-head small { font-size: 0.7rem; }
    .om-on-sec { gap: 6px; }
    .om-online-box .om-btn { padding: 9px 10px; font-size: 0.86rem; }
    .om-on-sec .om-btn small { font-size: 0.7rem; }
    .om-join input { padding: 7px 6px; }
    .om-on-msg, .om-on-info { font-size: 0.8rem; line-height: 1.45; }
    .om-code-box { padding: 6px 9px; }
    .om-code-box b { font-size: 1.3rem; }
    .om-code-box .om-btn { padding: 6px 9px; font-size: 0.78rem; }
    .om-on-err { font-size: 0.76rem; padding: 6px 8px; }
    /* 끝난 판: 한 판 더 · 그만할래요를 한 줄에 */
    #omOnPlay { flex-direction: row; flex-wrap: wrap; }
    #omOnPlay .om-on-info { flex-basis: 100%; }
    #omOnPlay .om-btn { flex: 1 1 40%; min-width: 0; }
    .om-mode-online .om-record { padding: 8px 10px; font-size: 0.76rem; line-height: 1.55; }
}

/* ===== 온라인 대화 (2026-11-15, omok.js가 #omOnPlay 안에 만들어요) ===== */
.om-chat { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed #b9b6ee; }
.om-chat[hidden] { display: none; }
.om-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; color: var(--om-plum); font-size: 0.92rem; }
.om-chat-off {
    flex: none; padding: 3px 9px; border-radius: 999px; border: 1px solid #c3c1f0; background: #fff;
    color: #5a57b5; font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}
.om-chat-off:hover { background: #f1f0ff; }
.om-chat-off.has-new { border-color: #ff8fab; color: #d63c6a; box-shadow: 0 0 0 2px rgba(255, 94, 138, 0.18); }
.om-chat-body { display: flex; flex-direction: column; gap: 7px; }
.om-chat-body[hidden], .om-chat-free[hidden], .om-chat-offmsg[hidden] { display: none; }
.om-chat-log {
    height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px;
    padding: 8px; border-radius: 10px; background: #fff; border: 1px solid #d6d4f7;
    scrollbar-width: thin; overscroll-behavior: contain;
}
.om-chat-log:empty::before { content: attr(aria-label); margin: auto; font-size: 0.78rem; color: #b0aed6; }
.om-msg { display: flex; flex-direction: column; max-width: 86%; }
.om-msg small { font-size: 0.66rem; color: #9a98c8; margin: 0 4px 1px; }
.om-msg span {
    padding: 5px 10px; border-radius: 12px; font-size: 0.86rem; line-height: 1.4;
    word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.om-msg.theirs { align-self: flex-start; }
.om-msg.theirs span { background: #f1f0ff; color: #2f2c66; border-top-left-radius: 4px; }
.om-msg.mine { align-self: flex-end; align-items: flex-end; }
.om-msg.mine span { background: var(--om-plum); color: #fff; border-top-right-radius: 4px; }
.om-chat-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.om-chat-presets button, .om-chat-emo button {
    padding: 4px 9px; border-radius: 999px; border: 1px solid #c3c1f0; background: #fff;
    color: var(--om-plum); font: inherit; font-size: 0.76rem; cursor: pointer; white-space: nowrap;
}
.om-chat-presets button:hover, .om-chat-emo button:hover { background: #f1f0ff; }
.om-chat-form { display: flex; gap: 6px; }
.om-chat-form input {
    flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #c3c1f0; border-radius: 10px;
    background: #fff; color: var(--om-ink); font: inherit; font-size: 0.9rem;
}
.om-chat-form input:focus { outline: none; border-color: #8f8ce0; box-shadow: 0 0 0 2px rgba(143, 140, 224, 0.25); }
#omOnPlay .om-chat-form .om-btn, .om-chat-form .om-btn { flex: none; padding: 8px 12px; font-size: 0.84rem; }
.om-chat-emo { display: flex; flex-wrap: wrap; gap: 4px; }
.om-chat-emo button { padding: 2px 7px; font-size: 1rem; border-radius: 8px; }
.om-chat-note { margin: 0; font-size: 0.72rem; color: #8a87bb; }
.om-chat-note.warn { color: #c2412b; font-weight: 700; }
.om-chat-offmsg { margin: 0; font-size: 0.78rem; color: #8a87bb; }
@media (max-width: 760px) {
    #omOnPlay .om-chat { flex-basis: 100%; }
    .om-chat-log { height: 120px; }
    .om-chat-form input { font-size: 16px; }          /* 16px 미만이면 아이폰이 확대해 버려요 */
    #omOnPlay .om-chat .om-btn { flex: none; }
    .om-msg span { font-size: 0.84rem; }
}

/* ===== 입장 축하 띠 + 꽃가루 (2026-11-15, omok.js의 celebrateJoin) ===== */
.om-join-banner {
    position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden;
    display: grid; place-items: center;
    animation: omJoinIn 0.35s ease-out;
}
.om-join-banner p {
    margin: 0; padding: 12px 22px; border-radius: 999px;
    background: linear-gradient(135deg, #ff5e8a, #ffb36b);
    color: #fff; font-size: 1.25rem; font-weight: 800; letter-spacing: 0.01em;
    box-shadow: 0 8px 24px rgba(180, 60, 90, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.7);
    animation: omJoinPop 0.5s cubic-bezier(.2, 1.6, .4, 1);
    text-align: center; word-break: keep-all;
}
.om-join-banner i {
    position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px;
    animation-name: omConfetti; animation-timing-function: ease-in; animation-fill-mode: forwards;
}
.om-join-banner.out { opacity: 0; transition: opacity 0.45s; }
@keyframes omJoinIn { from { opacity: 0; } }
@keyframes omJoinPop { from { transform: scale(0.4); opacity: 0; } }
@keyframes omConfetti { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .om-join-banner i { display: none; } .om-join-banner p { animation: none; } }

/* 📤 카톡 등으로 보내기 (navigator.share 되는 브라우저만) */
.om-btn.om-share { background: #fee500; border-color: #e6cf00; color: #3a2a00; font-weight: 800; }
.om-btn.om-share:hover { background: #ffeb3b; }

/* ===== 폰: 대화창을 화면 아래에 붙여 늘 떠 있게 (2026-11-15) ===== */
.om-chat-min {
    flex: none; margin-left: auto; padding: 3px 9px; border-radius: 999px; border: 1px solid #c3c1f0; background: #fff;
    color: #5a57b5; font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}
.om-chat-min[hidden] { display: none; }
.om-chat-min.has-new { border-color: #ff8fab; color: #d63c6a; box-shadow: 0 0 0 2px rgba(255, 94, 138, 0.18); }
.om-chat-head { gap: 6px; }
.om-chat-head > span { margin-right: auto; }
.om-chat.om-chat-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    margin: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px; border-top: 2px solid #b9b6ee; border-radius: 14px 14px 0 0;
    background: rgba(246, 245, 255, 0.98);
    box-shadow: 0 -6px 18px rgba(54, 52, 122, 0.18);
    max-width: 640px; margin-left: auto; margin-right: auto;
}
.om-chat-dock .om-chat-body { gap: 6px; }
.om-chat-dock .om-chat-log { height: 72px; padding: 6px 8px; }
.om-chat-dock .om-msg span { padding: 4px 9px; font-size: 0.84rem; }
.om-chat-dock .om-msg small { display: none; }
.om-chat-dock .om-chat-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 1px; }
.om-chat-dock .om-chat-presets::-webkit-scrollbar { display: none; }
.om-chat-dock .om-chat-presets button { flex: none; }
.om-chat-dock .om-chat-emo { display: none; }               /* 폰 자판에 이모지가 있어서 숨김 */
.om-chat-dock .om-chat-note:not(.warn) { display: none; }   /* 경고(천천히 보내 주세요 등)만 */
.om-chat-dock .om-chat-form input { padding: 7px 10px; }
.om-chat-dock.is-min .om-chat-body,
.om-chat-dock.is-min .om-chat-offmsg { display: none; }

/* ===== 시작 카운트다운 5·4·3·2·1 (2026-11-15) ===== */
.om-countdown {
    position: absolute; inset: 0; z-index: 5; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 10px;
}
.om-countdown b {
    font-size: clamp(4rem, 18vw, 7rem); line-height: 1; font-weight: 900; color: #fff;
    text-shadow: 0 4px 0 #5a57b5, 0 8px 22px rgba(40, 30, 90, 0.45);
}
.om-countdown b.pop { animation: omCdPop 0.9s ease-out; }
.om-countdown b.go { color: #ffd166; text-shadow: 0 4px 0 #c2410c, 0 8px 22px rgba(120, 50, 0, 0.4); animation: omCdPop 0.5s ease-out; }
.om-countdown small {
    padding: 6px 14px; border-radius: 999px; background: rgba(54, 52, 122, 0.88); color: #fff;
    font-size: 0.92rem; font-weight: 700; text-align: center; word-break: keep-all; max-width: 90%;
}
.om-countdown.out { opacity: 0; transition: opacity 0.3s; }
@keyframes omCdPop { 0% { transform: scale(1.8); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.92); opacity: 0.85; } }
/* 입장 축하 띠는 판 위쪽으로 (가운데엔 숫자) */
.om-join-banner { place-items: start center; padding-top: 9%; }

/* ===== 온라인 대결 종료 버튼 (2026-11-16, omok.js가 만듦) ===== */
.om-result-exit { display: none; }
body.om-mode-online .om-result-exit { display: inline-block; }
#omOnPlay .om-on-exit { order: 9; }
#omOnPlay .om-chat { order: 10; }   /* PC: 종료 버튼은 대화창 위 (그만할래요·새 대결 바로 아래) */

/* ===== 온라인 무르기 요청/대답 (2026-11-16, omok.js가 만듦) ===== */
.om-undo-ask { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(30, 24, 60, 0.28); border-radius: 10px; }
.om-undo-ask[hidden] { display: none; }
.om-undo-card {
    width: min(86%, 340px); padding: 16px 18px 12px; border-radius: 14px; text-align: center;
    background: var(--om-cream, #fffaf0); border: 2px solid var(--om-gold, #d8b25a);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); animation: omPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.om-undo-t { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; color: #36347a; }
.om-undo-d { margin: 0 0 12px; font-size: 0.82rem; color: #6b6890; line-height: 1.5; word-break: keep-all; }
.om-undo-b { display: flex; gap: 8px; justify-content: center; }
.om-undo-b .om-btn { flex: 1; }
.om-undo-bar { margin-top: 10px; height: 5px; border-radius: 3px; background: #ece8dc; overflow: hidden; }
.om-undo-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff8fab, #ffd166); }
.om-btn.om-undo-req:disabled { opacity: 0.5; cursor: default; }
.om-flash {
    position: absolute; left: 50%; top: 12%; transform: translateX(-50%); z-index: 8; pointer-events: none;
    padding: 9px 18px; border-radius: 999px; background: rgba(54, 52, 122, 0.92); color: #fff;
    font-weight: 800; font-size: 0.95rem; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    animation: omJoinPop 0.4s cubic-bezier(.2, 1.6, .4, 1);
}
.om-flash.out { opacity: 0; transition: opacity 0.35s; }
@media (max-width: 480px) { .om-flash { font-size: 0.85rem; white-space: normal; text-align: center; width: max-content; max-width: 86%; } }
