/* 비석치기 배틀 - 신체 자세 미션 테마 스타일 (MIT License) */
:root {
    --bs-bg: #f5f0ea;
    --bs-board-bg: #ecdcc9;
    --bs-p1-color: #2563eb;
    --bs-p1-bg: #eff6ff;
    --bs-p2-color: #dc2626;
    --bs-p2-bg: #fef2f2;
    --bs-neutral: #4b5563;
    --bs-stone-dark: #27272a;
    --bs-stone-light: #d4d4d8;
    --bs-gold: #b45309;
    --bs-radius: 16px;
    --bs-shadow: 0 8px 24px rgba(60, 40, 20, 0.08);
}

.bs-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-color: var(--bs-bg);
    color: #1c1917;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* 상단 제어 바 */
.bs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e7e5e4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

.bs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bs-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.bs-wind-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #92400e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bs-brand-copy h1 {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: #292524;
    letter-spacing: -0.02em;
}

.bs-brand-kicker {
    font-size: 10px;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bs-top-actions {
    display: flex;
    gap: 8px;
}

.bs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.bs-btn .bs-icon {
    flex-shrink: 0;
}

.bs-btn-ghost {
    background: #f5f5f4;
    color: #44403c;
    border: 1px solid #e7e5e4;
}

.bs-btn-ghost:hover {
    background: #e7e5e4;
    color: #1c1917;
    transform: translateY(-1px);
}

.bs-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.bs-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.bs-btn-lg {
    padding: 14px 32px;
    font-size: 17px;
    border-radius: 14px;
}

/* 2인 대면 배틀 컨테이너 */
.bs-game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background-color: var(--bs-board-bg);
}

/* 플레이어 HUD */
.bs-player-hud {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: var(--bs-shadow);
    z-index: 5;
}

.bs-hud-p2 {
    border-bottom: 3px solid var(--bs-p2-color);
    transform: rotate(180deg);
}

.bs-hud-p1 {
    border-top: 3px solid var(--bs-p1-color);
}

.bs-hud-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.bs-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bs-player-tag {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 12px;
    color: #ffffff;
}

.bs-tag-p1 {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.bs-tag-p2 {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.bs-player-name {
    font-size: 14px;
    font-weight: 800;
    color: #292524;
}

.bs-turn-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.bs-turn-badge.is-active {
    background: #10b981;
    color: #ffffff;
    animation: pulse-badge 1.4s infinite;
}

.bs-turn-badge.is-waiting {
    background: #f5f5f4;
    color: #78716c;
    border: 1px solid #e7e5e4;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.bs-wind-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #92400e;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bs-player-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bs-stage-box {
    text-align: right;
}

.bs-stage-num {
    display: block;
    font-size: 10px;
    color: #78716c;
    font-weight: 700;
}

.bs-stage-name {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #1c1917;
}

/* 신체 자세 진행도 스텝 트랙 */
.bs-step-track {
    display: flex;
    gap: 3px;
}

.bs-step-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
    background: #e7e5e4;
    color: #a8a29e;
    transition: all 0.2s ease;
}

.bs-step-pill.is-passed {
    background: #10b981;
    color: #ffffff;
}

.bs-step-pill.is-current {
    background: #fbbf24;
    color: #1c1917;
    font-weight: 800;
    transform: scale(1.15);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.4);
    border: 1px solid #d97706;
}

/* 캔버스 경기장 */
.bs-arena-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#bs-canvas {
    width: 100%;
    height: 100%;
    max-width: 540px;
    object-fit: contain;
    cursor: crosshair;
}

/* 실시간 파워 게이지 */
.bs-power-gauge {
    position: absolute;
    left: 50%;
    width: 190px;
    padding: 8px 12px;
    background: rgba(28, 25, 23, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.15s ease;
}

.bs-power-gauge.is-p1 {
    bottom: 90px;
    top: auto;
    transform: translateX(-50%) rotate(0deg);
}

.bs-power-gauge.is-p2 {
    top: 90px;
    bottom: auto;
    transform: translateX(-50%) rotate(180deg);
}

.bs-power-gauge.is-hidden {
    display: none;
}

.bs-power-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #ffffff;
    font-weight: 800;
    margin-bottom: 4px;
}

.bs-power-track {
    width: 100%;
    height: 8px;
    background: #44403c;
    border-radius: 999px;
    overflow: hidden;
}

.bs-power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6 0%, #f59e0b 60%, #ef4444 100%);
    border-radius: 999px;
    transition: width 0.05s ease;
}

/* 중앙 자세 안내 배너 */
.bs-center-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(28, 25, 23, 0.95);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 16px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
    animation: banner-fade 2.0s forwards;
    z-index: 20;
    max-width: 85%;
}

.bs-center-banner.is-hidden {
    display: none;
}

.bs-banner-kicker {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 2px;
}

.bs-banner-text {
    display: block;
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
}

@keyframes banner-fade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
    85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* 모달 */
.bs-modal {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.bs-modal.is-hidden {
    display: none;
}

.bs-modal-card {
    background: #ffffff;
    border-radius: var(--bs-radius);
    padding: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.bs-modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.bs-modal-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #1c1917;
}

.bs-modal-card p {
    color: #57534e;
    font-size: 13px;
    margin-bottom: 18px;
}

.bs-modal-rules {
    max-width: 540px;
    text-align: left;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px;
}

.bs-rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bs-rules-header h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
}

.bs-license-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

/* 탭 전환 버튼 */
.bs-rules-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: #f5f5f4;
    padding: 4px;
    border-radius: 10px;
}

.bs-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 800;
    color: #78716c;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bs-tab-btn.is-active {
    background: #ffffff;
    color: #1c1917;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.bs-tab-content {
    display: none;
}

.bs-tab-content.is-active {
    display: block;
}

/* 1. 플레이 방법 가이드 */
.bs-guide-box {
    background: #fbf9f6;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.bs-guide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 900;
    color: #1c1917;
    margin-bottom: 8px;
}

.bs-guide-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

/* 경기장 거리 가이드 비주얼 */
.bs-court-visual {
    background: #fdfbf7;
    border: 1.5px solid #d6c7b2;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.bs-court-lane {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    border-left: 4px solid #a8a29e;
}

.bs-court-lane.is-out {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.bs-court-lane.is-deep {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.bs-court-lane.is-mid {
    background: #ecfdf5;
    border-left-color: #10b981;
    color: #065f46;
}

.bs-court-lane.is-front {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.bs-lane-badge {
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
}

.bs-lane-badge.is-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.bs-court-shooter {
    text-align: center;
    padding: 6px;
    background: #f5f5f4;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #57534e;
    border: 1px dashed #d6d3d1;
}

.bs-guide-caption {
    font-size: 11.5px;
    color: #57534e;
    line-height: 1.45;
    margin: 0;
}

/* 바람 가이드 비주얼 */
.bs-wind-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.bs-wind-vis-col {
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.bs-wind-vis-badge {
    font-size: 11px;
    font-weight: 800;
    color: #92400e;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.bs-wind-vis-arrow {
    font-size: 12px;
    color: #1e40af;
    margin-bottom: 2px;
}

.bs-wind-vis-sub {
    display: block;
    font-size: 10px;
    color: #78716c;
}

/* 2. 돌돌이 도감 카드 */
.bs-stone-catalog {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.bs-stone-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fbf9f6;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
}

.bs-stone-preview {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.bs-stone-preview .bs-blush-l,
.bs-stone-preview .bs-blush-r {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(251, 113, 133, 0.7);
    bottom: 11px;
}

.bs-stone-preview .bs-blush-l { left: 7px; }
.bs-stone-preview .bs-blush-r { right: 7px; }

.bs-stone-preview .bs-face {
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    user-select: none;
    z-index: 1;
}

.bs-stone-info {
    flex: 1;
}

.bs-stone-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.bs-stone-title {
    font-size: 13px;
    font-weight: 900;
    color: #1c1917;
}

.bs-trait-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
}

.bs-stone-desc {
    font-size: 11.5px;
    color: #57534e;
    line-height: 1.4;
    margin: 0;
}

.bs-stone-tip {
    display: block;
    font-size: 10.5px;
    color: #2563eb;
    font-weight: 700;
    margin-top: 1px;
}

.bs-rules-credits {
    padding: 8px 12px;
    background: #f5f5f4;
    border-radius: 6px;
    font-size: 11px;
    color: #78716c;
    margin-bottom: 14px;
}
