.cg-omok{
    width:100%;
    max-width:920px;
    margin-left:auto;
    margin-right:auto;
    border:1px solid #e6e6e6;
    background:#fff;
    padding:16px;
    box-sizing:border-box;
}

.cg-omok__noscript{
    padding:12px;
    border:1px solid #f0d1d1;
    background:#fff5f5;
    color:#8a1f1f;
    margin-bottom:12px;
    font-size:14px;
}

.cg-omok__tabs{
    display:flex;
    gap:8px;
    margin-bottom:12px;
}

.cg-omok__tab{
    appearance:none;
    border:1px solid #d9d9d9;
    background:#fff;
    color:#111;
    padding:10px 12px;
    cursor:pointer;
    font-weight:700;
    font-size:14px;
}

.cg-omok__tab.is-active{
    border-color:#111;
}

.cg-omok__panel{ display:none; }
.cg-omok__panel.is-active{ display:block; }

.cg-omok__controls{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:flex-end;
    margin-bottom:12px;
}

.cg-omok__controls--stack{
    flex-direction:column;
    align-items:stretch;
}

.cg-omok__row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:flex-end;
}

.cg-omok__row--space{
    justify-content:space-between;
    align-items:center;
}

.cg-omok__field{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:140px;
}

.cg-omok__field--grow{
    flex:1 1 260px;
}

.cg-omok__field--full{
    flex:1 1 100%;
    min-width:0;
}

.cg-omok__label{
    font-size:12px;
    color:#333;
    font-weight:700;
}




.cg-omok__labelrow{
    display:flex;
    align-items:center;
    gap:6px;
}

.cg-omok__iconbtn{
    appearance:none;
    -webkit-appearance:none;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    padding:0 4px;
    font-size:14px;
    line-height:1;
    cursor:pointer;
}

.cg-omok__iconbtn:hover{
    background:transparent !important;
}

/* Masked manual "room password" input without triggering browser password generation */
.cg-omok__input--mask{
    -webkit-text-security:disc;
    text-security:disc;
}

.cg-omok__iconbtn:focus{
    outline:1px solid #111;
    outline-offset:2px;
}

.cg-omok__check{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    font-weight:800;
    color:#111;
    cursor:pointer;
}

.cg-omok__checkbox{
    width:16px;
    height:16px;
    margin:0;
}

.cg-omok__input,
.cg-omok__select{
    width:100%;
    padding:10px 10px;
    border:1px solid #d9d9d9;
    background:#fff;
    color:#111;
    font-size:14px;
    box-sizing:border-box;
}

.cg-omok__btn{
    width:100%;
    padding:10px 12px;
    border:1px solid #111;
    background:#111;
    color:#fff;
    font-size:14px;
    font-weight:800;
    cursor:pointer;
}

.cg-omok__btn--alt{
    border:1px solid #111;
    background:#fff;
    color:#111;
}

.cg-omok__btn:disabled{
    opacity:.5;
    cursor:not-allowed;
}

.cg-omok__status{
    font-size:14px;
    font-weight:800;
    color:#111;
    padding:10px 0;
}

.cg-omok__hint{
    font-size:12px;
    color:#666;
    min-height:0;
    line-height:1.2;
    margin-top:2px;
}

.cg-omok__boardwrap{
    overflow:hidden;
    width:100%;
    border:1px solid #e6e6e6;
    background:#f6f6f6;
    padding:12px;
    box-sizing:border-box;
}

.cg-omok__localactions{
    margin-top:10px;
}

.cg-omok__board{
    display:block;
    width:100%;
    aspect-ratio: 1 / 1;
    height:auto;
    background:#f2d8a7;
    touch-action:manipulation;
}

.cg-omok__rooms{
    border:1px solid #e6e6e6;
    background:#fff;
}

.cg-omok__room{
    display:flex;
    gap:10px;
    justify-content:space-between;
    align-items:center;
    padding:10px 12px;
    border-top:1px solid #efefef;
}

.cg-omok__room:first-child{
    border-top:none;
}

.cg-omok__roominfo{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}

.cg-omok__roomtitle{
    font-weight:900;
    color:#111;
    font-size:14px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.cg-omok__roommeta{
    font-size:12px;
    color:#555;
}

.cg-omok__roomactions{
    display:flex;
    gap:8px;
    align-items:center;
}

.cg-omok__roombtn{
    appearance:none;
    border:1px solid #111;
    background:#fff;
    color:#111;
    padding:8px 10px;
    cursor:pointer;
    font-weight:800;
    font-size:13px;
}

.cg-omok__match.is-hidden{
    display:none;
}

.cg-omok__matchbar{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    margin:10px 0;
}

.cg-omok__matchinfo{
    font-size:14px;
    font-weight:900;
    color:#111;
    width:100%;
    text-align:center;
}

.cg-omok__matchactions{
    display:flex;
    flex-direction:column;
    gap:10px;
    align-items:stretch;
    width:100%;
    min-width:0;
}

.is-hidden{ display:none !important; }

@media (max-width: 640px){
    .cg-omok{ padding:12px; }
    .cg-omok__btn[data-online-applynick]{ margin-bottom:12px; }

    .cg-omok__btn[data-online-createroom]{ margin-bottom:10px; }
    .cg-omok__tabs{ gap:6px; }
    .cg-omok__tab{ flex:1; text-align:center; }

    /* 모바일에서 온라인 입력 영역 여백 축소 */
    .cg-omok__controls{ gap:6px; margin-bottom:8px; }
    .cg-omok__row{ flex-direction:column; align-items:stretch; gap:6px; }
    .cg-omok__field{ min-width:0; gap:4px; }
    .cg-omok__field--grow{ flex: 0 1 auto; }
    .cg-omok__hint{ margin-top:0; line-height:1.15; }
    .cg-omok__status{ padding:4px 0; line-height:1.2; }

    /* 닉네임 적용 버튼 아래는 약간의 간격 유지 */
    .cg-omok__btn[data-online-applynick]{ margin-bottom:10px; }
}

/* Visually hidden but accessible */
.cg-omok__visually-hidden{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
}

.cg-omok__matchtitle{
    font-size:15px;
    font-weight:900;
    margin-bottom:6px;
    color:#111;
}

.cg-omok__matchline{
    font-size:14px;
    font-weight:900;
    color:#111;
    line-height:1.25;
    text-align:center;
}
.cg-omok__matchline--sub{
    font-size:13px;
    font-weight:800;
    color:#222;
    margin-top:4px;

    text-align:center;
}

.cg-omok__matchfooter{
    display:flex;
    gap:10px;
    margin-top:10px;
    flex-wrap:wrap;
}
.cg-omok__matchfooter .cg-omok__btn{
    flex:1 1 180px;
    min-width:140px;
}
@media (max-width: 640px){
    .cg-omok__matchfooter{
        flex-direction:column;
        gap:8px;
    }
    .cg-omok__matchfooter .cg-omok__btn{
        width:100%;
        flex:0 0 auto;
        min-width:0;
    }
}

.cg-omok__btn[data-online-ready]{ width:100%; }


/* Winner overlay (fireworks/confetti) */
.cg-omok__win{
  position:fixed;
  inset:0;
  z-index:999999;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.35);
}
.cg-omok__win.is-lose{
  background:rgba(0,0,0,.45);
}
.cg-omok__win.is-hidden{ display:none; }
.cg-omok__confetti{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
.cg-omok__winbox{
  position:relative;
  background:#fff;
  border:2px solid #000;
  padding:18px 22px;
  max-width:92vw;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.cg-omok__win.is-lose .cg-omok__winbox{
  border-color:#111;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  animation: cg-omok-sadshake 0.35s ease-in-out 2;
}
.cg-omok__wintext{
  font-weight:900;
  font-size:22px;
  line-height:1.2;
}

.cg-omok__resultmain{
  font-weight:900;
  font-size:44px;
  line-height:1;
  text-align:center;
}
.cg-omok__resultsub{
  margin-top:10px;
  font-weight:800;
  font-size:16px;
  text-align:center;
  opacity:0.92;
}

@keyframes cg-omok-sadshake{
  0%{ transform:translateX(0); }
  25%{ transform:translateX(-2px); }
  50%{ transform:translateX(2px); }
  75%{ transform:translateX(-1px); }
  100%{ transform:translateX(0); }
}

.cg-omok__matchline--score{
  font-weight:800;
  margin-top:4px;
}


.cg-omok__lock{
  display:inline-block;
  font-size:12px;
  line-height:1;
  padding:4px 6px;
  border:1px solid #ddd;
  background:#f7f7f7;
  color:#111;
  vertical-align:middle;
}
