/* 황제 오목 전용 스타일. 색 토큰은 style.css 의 :root 를 그대로 쓴다. */
.omok-shell{min-height:100vh;background:radial-gradient(120% 90% at 50% 0,#2c1d0e 0,#0a0705 60%)}
/* 왼쪽 전적 · 가운데 판 · 오른쪽 방. 1440 폭에서 판이 세로 기준(100vh − 132px)을 그대로 쓰도록 폭을 넓혔다 */
.omok-main{display:grid;grid-template-columns:250px minmax(0,1fr) 340px;gap:18px;max-width:1480px;margin:0 auto;padding:14px 16px 16px;align-items:start;height:calc(100vh - 60px);overflow:hidden}
@supports (height:100dvh){.omok-main{height:calc(100dvh - 60px)}}

/* 판은 세로 기준으로 꽉 차게. 132px = 헤더 60 + 위아래 여백 + 여유 */
.omok-board-wrap{position:relative;width:min(100%,calc(100vh - 132px));aspect-ratio:1;margin:0 auto;border-radius:20px;overflow:hidden;box-shadow:0 24px 60px #000a,0 0 0 1px #ffffff14,0 0 0 1px #e8ba5433}
@supports (height:100dvh){.omok-board-wrap{width:min(100%,calc(100dvh - 132px))}}
#board{display:block;width:100%;height:100%;touch-action:manipulation;cursor:pointer}
.omok-banner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:16px 30px;border:1px solid #ffe18188;border-radius:16px;background:#140c05e8;color:#ffe9a8;font-family:"Black Han Sans",sans-serif;font-size:clamp(22px,4vw,34px);text-align:center;box-shadow:0 16px 40px #000c;pointer-events:none;animation:omokBanner .35s cubic-bezier(.2,1.4,.4,1) both}
.omok-banner small{display:block;margin-top:4px;font-family:inherit;font-size:13px;color:#d9c49a;font-weight:600}
.omok-banner[hidden]{display:none}
@keyframes omokBanner{from{opacity:0;transform:translate(-50%,-50%) scale(.85)}}
@keyframes omokPop{from{opacity:0;transform:scale(.85)}}
.omok-banner b.reward{display:block;margin-top:6px;font-size:18px;color:#7ef0a0}

.omok-side{display:flex;flex-direction:column;gap:10px;min-height:0;max-height:100%;overflow-y:auto;scrollbar-width:none}
.omok-side::-webkit-scrollbar{display:none}
.omok-side>*{flex-shrink:0}
.omok-side>#roomPanel:not([hidden]){flex:1 1 auto;min-height:0;flex-shrink:1}
.omok-title h1{margin:2px 0 0;font-family:"Black Han Sans",sans-serif;font-size:32px;font-weight:400;color:#fff}
.omok-title .eyebrow{margin:0}
.omok-card{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid #ffffff14;border-radius:20px;background:#150e08e6;box-shadow:0 10px 30px #0006}
.omok-card[hidden]{display:none}
.omok-actions{display:flex;gap:8px;flex-wrap:wrap}
.omok-actions>*{flex:1}
.omok-actions [hidden]{display:none}
.omok-primary{padding:12px 20px;border:0;border-radius:999px;white-space:nowrap;background:linear-gradient(135deg,#f2cf72,#b9822a);color:#2a1702;font-size:15px;font-weight:900;cursor:pointer;box-shadow:0 10px 26px #b9822a44}
.omok-primary:hover{filter:brightness(1.08)}
.omok-ghost{padding:11px 16px;border:1px solid #ffffff1f;border-radius:999px;white-space:nowrap;background:#1d140c;color:#eadcc2;font-size:13px;font-weight:800;cursor:pointer}
.omok-ghost:hover{border-color:#f2cf7266;color:#fff}
.omok-ghost.small{flex:0 0 auto;padding:8px 12px;font-size:12px}
.join-row{display:flex;gap:6px}
.join-row input{flex:1;min-width:0;padding:10px 14px;border:1px solid #ffffff1f;border-radius:999px;background:#0e0905;color:#fff;font-size:15px;font-weight:900;letter-spacing:3px;text-align:center;text-transform:uppercase}
.join-row input:focus,.chat-form input:focus{outline:none;border-color:#f2cf7288}
.rooms-head{display:flex;justify-content:space-between;align-items:center;color:#eadcc2;font-size:13px}
.room-list{display:flex;flex-direction:column;gap:6px;max-height:110px;overflow-y:auto}
.room-list button{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 14px;border:1px solid #ffffff14;border-radius:14px;background:#1d140c;color:#eadcc2;font-size:13px;text-align:left;cursor:pointer}
.room-list button:hover{border-color:#f2cf7266}
.room-list small{color:#a8977c}
.room-list .empty{margin:0;padding:10px;color:#8b7c66;font-size:12px;text-align:center}

.room-code{display:flex;align-items:center;gap:8px;color:#a8977c;font-size:13px}
.room-code b{color:#ffe9a8;font-size:20px;letter-spacing:3px}
.watch-badge{margin-left:auto;padding:3px 9px;border-radius:999px;background:#41d9ee22;color:#7fe6f5;font-size:11px;font-weight:800}
.watch-badge[hidden]{display:none}
.seats{display:flex;flex-direction:column;gap:8px}
.seat{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:10px 12px;border:1px solid #ffffff12;border-radius:16px;background:#0f0a06;transition:border-color .2s,box-shadow .2s}
.seat.turn{border-color:#f2cf72;box-shadow:0 0 0 1px #f2cf7255,0 0 18px #f2cf7233}
.seat.offline{opacity:.55}
.seat div{display:flex;flex-direction:column;min-width:0}
.seat-name{color:#fff;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seat-meta{color:#a8977c;font-size:11px}
.seat-clock{font-family:"Black Han Sans",sans-serif;font-size:22px;color:#eadcc2;font-variant-numeric:tabular-nums}
.seat-clock.warn{color:#ff7a6b}
.stone{display:inline-block;width:22px;height:22px;border-radius:50%}
.stone.black{background:radial-gradient(circle at 35% 30%,#666,#111 55%,#000)}
.stone.white{background:radial-gradient(circle at 35% 30%,#fff,#ddd 60%,#aaa)}
.stone.oni-basic{background:radial-gradient(circle at 35% 30%,#7fd6ff,#1663a8 75%)}
.stone.oni-kwangjin{background:#f3f4f6 url(/static/images/oni-skin-leekwangjin.png) 22% 8%/180% auto no-repeat;box-shadow:0 0 0 2px #1663a8 inset}
.skin-card b{color:#eadcc2;font-size:13px}
.skin-pick{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.skin-pick button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px;border:1px solid #ffffff1a;border-radius:16px;background:#1d140c;color:#eadcc2;font-size:13px;font-weight:800;cursor:pointer}
.skin-pick button small{color:#a8977c;font-size:11px;font-weight:600}
.skin-pick button[aria-checked="true"]{border-color:#f2cf72;box-shadow:0 0 0 1px #f2cf7255;color:#fff}
.skin-preview{display:flex;gap:4px;margin-bottom:2px}
.skin-preview .stone{width:26px;height:26px}
.omok-side:has(#roomPanel:not([hidden])) .skin-note{display:none}
.omok-side:has(#roomPanel:not([hidden])) .skin-card{gap:6px;padding:12px 16px}
.skin-note{color:#8b7c66;font-size:11px;line-height:1.5}
.omok-modal{position:absolute;inset:0;display:grid;place-items:center;padding:16px;background:#0008;backdrop-filter:blur(2px)}
.omok-modal[hidden]{display:none}
.omok-modal-box{display:flex;flex-direction:column;gap:10px;width:min(360px,100%);padding:22px;border:1px solid #ff6b5a88;border-radius:22px;background:#1a0d08f2;text-align:center;box-shadow:0 20px 50px #000c;animation:omokPop .3s cubic-bezier(.2,1.4,.4,1) both}
.omok-modal-box .eyebrow{margin:0;color:#ff8a7a}
.omok-modal-box h2{margin:0;font-family:"Black Han Sans",sans-serif;font-weight:400;font-size:26px;color:#fff}
.omok-modal-box p{margin:0;color:#ffd9c9;font-size:14px;line-height:1.6}
.omok-modal-box small{color:#a8977c;font-size:12px;line-height:1.5}
.omok-modal-box .omok-primary{margin-top:4px}
.ai-pick{display:flex;flex-direction:column;gap:6px}
.ai-pick b{display:flex;justify-content:space-between;align-items:baseline;color:#eadcc2;font-size:13px}
.ai-pick b small{color:#8b7c66;font-size:11px;font-weight:600}
.ai-levels{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.ai-levels .level-master{border-color:#ff5a4a66;color:#ffb3a8}
.ai-levels .level-master:hover{border-color:#ff5a4a;color:#fff}
.ai-levels[hidden]{display:none}
.ai-levels button[data-level="easy"]:hover{border-color:#7ef0a088}
.ai-levels button[data-level="hard"]:hover{border-color:#ff8a7a88}
.room-levels button[aria-checked="true"]{border-color:#f2cf72;color:#fff;box-shadow:0 0 0 1px #f2cf7255}
.team-create{display:flex;flex-direction:column;align-items:center;gap:1px}
.team-create small{color:#a8977c;font-size:10px;font-weight:600}
.team-list{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid #ffffff12;border-radius:16px;background:#0f0a06}
.team-list[hidden]{display:none}
.team-list b{color:#eadcc2;font-size:12px}
.team-list ol{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:5px}
.team-list li{padding:4px 9px;border:1px solid #ffffff1a;border-radius:999px;color:#d6c7aa;font-size:12px}
.team-list li.now{border-color:#f2cf72;color:#fff;box-shadow:0 0 0 1px #f2cf7255;background:#2a1d0c}
.team-list li.me{font-weight:900}
.team-list li.off{opacity:.45;text-decoration:line-through}
.level-note{margin:0;color:#a8977c;font-size:12px;text-align:center}
.level-note[hidden]{display:none}
.room-levels button:disabled{cursor:default;opacity:.55}
.pause-cover{position:absolute;inset:0;display:grid;place-items:center;background:#0b0704b8;backdrop-filter:blur(3px)}
.pause-cover[hidden]{display:none}
.pause-cover>div{display:flex;flex-direction:column;align-items:center;gap:8px;padding:22px 30px;border:1px solid #f2cf7266;border-radius:22px;background:#160e07ee}
.pause-cover b{font-family:"Black Han Sans",sans-serif;font-size:30px;font-weight:400;color:#ffe9a8}
.pause-cover small{color:#bfae90;font-size:12px}
.pause-cover button[hidden]{display:none}
.pause-ask{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border:1px solid #f2cf7277;border-radius:16px;background:#2a1d0c;color:#ffe9a8;font-size:13px}
.pause-ask[hidden]{display:none}
.pause-ask div{display:flex;gap:6px}
.omok-primary.small{padding:8px 14px;font-size:12px}
.room-status{margin:0;min-height:18px;color:#eadcc2;font-size:13px;text-align:center}
.omok-status{margin:0;min-height:18px;color:var(--cyan);font-size:12px}

.omok-chat{display:flex;flex-direction:column;gap:6px}
.omok-chat{flex:1 1 auto;min-height:0}
.chat-log{flex:1 1 auto;height:auto;min-height:70px;max-height:200px;overflow-y:auto;padding:8px 10px;border:1px solid #ffffff10;border-radius:14px;background:#0c0805;font-size:12px;line-height:1.6;color:#d6c7aa;word-break:break-all}
.chat-log b{color:#ffe9a8;margin-right:6px}
.chat-log .watch b{color:#7fe6f5}
.chat-form{display:flex;gap:6px}
.chat-form input{flex:1;min-width:0;padding:9px 14px;border:1px solid #ffffff1f;border-radius:999px;background:#0e0905;color:#fff;font-size:13px}

.boss-cover{position:fixed;inset:0;z-index:9999;overflow:hidden;background:#000}
.boss-cover[hidden]{display:none}
.boss-image{display:block;width:100%;height:100%;object-fit:contain;user-select:none}

.omok-records{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;max-height:100%;overflow-y:auto;scrollbar-width:none}
.omok-records::-webkit-scrollbar{display:none}
.omok-records>*{flex-shrink:0}
/* 넓은 화면에서 왼쪽 맨 위는 사이트 공통 '뒤로' 버튼(position:fixed) 자리다 — 그만큼 내려 제목이 가리지 않게 한다 */
@media (min-width:1241px){.omok-records{padding-top:46px}}
.omok-records .omok-card{gap:10px;padding:14px}
.rec-head{display:flex;justify-content:space-between;align-items:baseline;color:#eadcc2;font-size:13px}
.rec-head small{color:#8b7c66;font-size:11px}
.rec-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;text-align:center}
.rec-summary div{display:flex;flex-direction:column;gap:2px;padding:8px 0;border-radius:10px;background:#0f0a06}
.rec-summary b{font-family:"Black Han Sans",sans-serif;font-size:20px;font-weight:400;color:#fff;font-variant-numeric:tabular-nums}
.rec-summary .win b{color:#7ef0a0}
.rec-summary .lose b{color:#ff8a7a}
.rec-summary small{color:#a8977c;font-size:11px}
.rec-earned{margin:0;color:#a8977c;font-size:12px;text-align:right}
.rec-earned b{color:#ffe9a8}
.rec-history{display:flex;flex-direction:column;gap:5px;max-height:200px;overflow-y:auto}
.rec-history div{display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:8px;padding:7px 9px;border-radius:9px;background:#0f0a06;font-size:12px;color:#d6c7aa}
.rec-history div>b{width:22px;height:22px;display:grid;place-items:center;border-radius:6px;font-size:12px;color:#fff;background:#5a4a35}
.rec-history .win>b{background:#1f8a4c}
.rec-history .lose>b{background:#a3372b}
.rec-history .stone{width:12px;height:12px}
.rec-history span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rec-history small{color:#8b7c66;font-size:11px;white-space:nowrap}
.rec-board{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px}
.rec-board li{display:grid;grid-template-columns:22px 1fr auto;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;background:#0f0a06;font-size:12px;color:#eadcc2}
.rec-board li i{font-style:normal;color:#f2cf72;font-weight:900;text-align:center}
.rec-board li.me{box-shadow:0 0 0 1px #f2cf7277 inset}
.rec-board li b{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rec-board li span{color:#7ef0a0;font-weight:800}
.rec-board li.rec-empty{display:block}
.rec-empty{margin:0;padding:8px;color:#8b7c66;font-size:12px;text-align:center;list-style:none}

.omok-rules{padding:12px 16px;border:1px solid #ffffff14;border-radius:20px;background:#120c07;color:#bfae90;font-size:12px;line-height:1.7}
.omok-rules[open]{max-height:50vh;overflow-y:auto}
.omok-rules summary{cursor:pointer;color:#eadcc2;font-weight:800}
.omok-rules p{margin:8px 0 0}
.omok-rules b{color:#ffe9a8}

/* 좁은 화면: 전적은 오른쪽 방 패널 아래로 내려간다(판이 먼저 커야 한다) */
@media (max-width:1240px){
  .omok-main{height:auto;overflow:visible}
  .omok-side,.omok-records{max-height:none;overflow:visible}
  .omok-main{grid-template-columns:minmax(0,1fr) 340px}
  .omok-records{grid-column:2;grid-row:2}
  .omok-board-wrap{grid-column:1;grid-row:1 / span 2}
  .omok-side{grid-column:2;grid-row:1}
}
@media (max-width:900px){
  .omok-chat{flex:none}.chat-log{height:150px;flex:none}
  .omok-main{grid-template-columns:1fr;padding:10px 16px 32px}
  .omok-board-wrap,.omok-side,.omok-records{grid-column:1;grid-row:auto}
  .omok-records{order:3}
  .omok-board-wrap{width:100%}
  .omok-title{display:none}
}
