
:root {
    --bg0: #05060f;
    --bg1: #071826;
    --glass: rgba(255,255,255,.06);
    --glass2: rgba(255,255,255,.10);
    --line: rgba(255,255,255,.12);
    --ink: #e9f8ff;
    --muted: rgba(233,248,255,.65);
    --radius: 22px;
    --shadow: 0 24px 70px rgba(0,0,0,.55);
    --shadow2: 0 12px 40px rgba(0,0,0,.35);
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(1200px 800px at 20% 10%, rgba(0,191,255,.18), transparent 55%), radial-gradient(900px 600px at 80% 30%, rgba(255,45,111,.16), transparent 58%), radial-gradient(700px 500px at 70% 90%, rgba(122,162,255,.14), transparent 55%), linear-gradient(180deg, var(--bg0), var(--bg1));
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
    overflow-x: hidden;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 18px 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    box-shadow: var(--shadow2);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 10px;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 30%, rgba(0,191,255,.35), transparent 55%), radial-gradient(circle at 70% 60%, rgba(255,45,111,.30), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.brandText .title {
    font-weight: 900;
    letter-spacing: .2px
}

.brandText .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.btn {
    border: none;
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
    user-select: none;
}

    .btn:hover {
        transform: translateY(-1px);
        filter: brightness(1.06)
    }

    .btn:active {
        transform: translateY(0);
        filter: brightness(.98)
    }

    .btn.primary {
        border-color: rgba(0,191,255,.30);
        background: radial-gradient(circle at 30% 20%, rgba(0,191,255,.26), transparent 55%), linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
    }

.chip {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    margin-top: 16px;
}

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr
    }
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.panelHd {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.panelTitle {
    font-weight: 900;
    letter-spacing: .2px
}

.hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55
}

.panelBd {
    padding: 12px 14px 16px
}

.boardWrap {
    border-radius: 26px;
    padding: 12px;
    background: radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 26px 80px rgba(0,0,0,.55);
}

#boardSvg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
    border-radius: 18px;
}

    #boardSvg g, #boardSvg path, #boardSvg circle, #boardSvg rect, #boardSvg ellipse, #boardSvg text {
        vector-effect: non-scaling-stroke;
    }

#boardLayer {
    pointer-events: none;
}

#piecesLayer {
    pointer-events: auto;
}

.statusRow {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pill {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    min-width: 220px;
}

.pillLabel {
    font-size: 12px;
    color: var(--muted)
}

.pillValue {
    font-weight: 900;
    font-size: 18px;
    margin-top: 2px
}

.pillMeta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px
}

.toast {
    flex: 1;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.25);
    color: var(--muted);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.log {
    max-height: 560px;
    overflow: auto;
    padding-right: 6px
}

.logItem {
    padding: 10px 10px;
    margin-bottom: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
}

.who {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px
}

.tag {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06)
}

    .tag.you {
        border-color: rgba(0,191,255,.28);
        color: rgba(0,191,255,.90)
    }

    .tag.ai {
        border-color: rgba(255,45,111,.28);
        color: rgba(255,45,111,.90)
    }

    .tag.system {
        border-color: rgba(255,255,255,.20);
        color: rgba(233,248,255,.75)
    }

.msg {
    font-size: 13px;
    line-height: 1.5
}

.piece {
    position: relative;
    z-index: 10;
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease, opacity .12s ease;
    opacity: 1;
    fill: #1E3A8A !important;
}

    .piece:hover {
        filter: brightness(1.10);
        transform: translateY(-2px);
        z-index: 20;
    }

    .piece text {
        paint-order: stroke;
        stroke: rgba(255,255,255,.18);
        stroke-width: 1px;
        font-size: 20px;
    }

.winBanner {
    margin-top: 10px;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.16);
    background: radial-gradient(circle at 20% 30%, rgba(0,191,255,.18), transparent 60%), radial-gradient(circle at 80% 50%, rgba(255,45,111,.16), transparent 62%), rgba(255,255,255,.05);
    display: none;
}

    .winBanner.show {
        display: block
    }

    .winBanner .big {
        font-size: 18px;
        font-weight: 900
    }

    .winBanner .small {
        margin-top: 6px;
        color: var(--muted);
        font-size: 12px
    }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 18px;
}

    .modal.show {
        display: flex
    }

.modalCard {
    width: min(520px, 96vw);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    box-shadow: 0 34px 90px rgba(0,0,0,.65);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.modalHd {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modalBd {
    padding: 14px 16px 16px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

.modalBtns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap
}

.throwLayer {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.40);
    backdrop-filter: blur(6px);
    z-index: 50;
}

    .throwLayer.show {
        display: flex
    }

.throwCard {
    width: min(520px, 92%);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    box-shadow: 0 34px 90px rgba(0,0,0,.65);
    padding: 14px 16px 16px;
    text-align: center;
}

.throwTitle {
    font-weight: 900;
    letter-spacing: .2px
}

.throwResult {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 900;
    color: rgba(233,248,255,.92)
}

.sticks {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 12px;
    height: 110px;
    align-items: center;
}

/* =====================================
   [수정] 윷가락 디자인 및 X 표시 수정
   - 글자 숨김 처리 및 그래픽 선명화
   ===================================== */
.stick {
    width: 34px;
    height: 110px;
    border-radius: 18px;
    background: linear-gradient(180deg, #d9953a, #b87420);
    box-shadow: 0 18px 40px rgba(0,0,0,.45);
    position: relative;
    transform-origin: 50% 80%;
}

    /* 윷가락 앞면 굴곡 그림자 */
    .stick::before {
        content: "";
        position: absolute;
        inset: 10px 8px;
        border-radius: 14px;
        background: rgba(0,0,0,.06);
        opacity: .45;
    }

    .stick .x {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 18px;
        height: 18px;
        opacity: 0; /* 기본은 숨김(뒷면) */
        /* [중요] HTML에 'X' 텍스트가 있어도 CSS로 그린 X만 보이도록 폰트 크기 0 처리 */
        font-size: 0 !important;
        display: block;
    }

        /* X 모양 그리기 (가로/세로 막대) */
        .stick .x::before,
        .stick .x::after {
            content: "";
            position: absolute;
            left: 50%;
            top: 50%;
            width: 20px; /* 길이를 조금 늘림 */
            height: 3px; /* 두께 */
            background: #2a1a10; /* 진한 고동색(먹물 느낌)으로 변경하여 선명하게 */
            border-radius: 2px; /* 둥근 정도를 줄여서 날렵하게 */
            transform-origin: center;
        }

        /* 대각선 회전 */
        .stick .x::before {
            transform: translate(-50%,-50%) rotate(45deg);
        }

        .stick .x::after {
            transform: translate(-50%,-50%) rotate(-45deg);
        }

    /* 앞면일 때 X 표시 보이기 */
    .stick.front .x {
        opacity: 1;
    }

    /* 위치값 (Back Do는 pos2 사용하므로 중앙 정렬됨) */
    .stick .x.pos1 {
        top: 20px;
    }

    .stick .x.pos2 {
        top: 46px;
    }

    .stick .x.pos3 {
        top: 72px;
    }

@keyframes toss {
    0% {
        transform: translateY(40px) scale(0.95);
        filter: blur(0px);
    }

    35% {
        transform: translateY(-50px) scale(1.05);
        filter: blur(0.2px);
    }

    70% {
        transform: translateY(10px) scale(1.00);
        filter: blur(0px);
    }

    100% {
        transform: translateY(0px) scale(1.00);
    }
}

.stick.tossing {
    animation: toss 800ms cubic-bezier(.2,.85,.2,1) both;
}

.node, .node-big, .node-small {
    pointer-events: none;
}

    .node-big circle {
        filter: none !important;
    }

.log::-webkit-scrollbar {
    width: 10px;
}

.log::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,.25);
}

.log::-webkit-scrollbar-track {
    background: rgba(0,0,0,.12);
}

.piece {
    filter: none !important;
}

    .piece circle {
        filter: none !important;
    }