/* includes/story_intro.php 전용 CSS */

#si-board-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 0 20px;
}

/* 기본 배경 (테마 미적용 시) */
#si-board-wrapper {
    background: #424874; /* Default: French Blue */
    border-radius: 6px;
    padding: 31px 38px 31px 38px;
    transform-origin: center center;
    position: relative;
}

/* 테마 적용 시 (우선순위 상향) */
html[class*="theme-"] #si-board-wrapper,
html[class*="theme-"] #si-board-area #board {
    background-color: var(--bg-dark) !important;
}

#si-board-area #game-container {
    background: transparent !important;
    margin: 0 !important;
    padding: 20px !important;
}

#si-board-area #hit-layer {
    top: 20px !important;
    left: 20px !important;
}

#si-board-area #board {
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows: repeat(10, var(--cell-size));
    background-color: var(--bg-dark, #9DA3A4) !important;
}

#si-board-area .cell::before,
#si-board-area .cell::after {
    background: var(--line-color, #ffffff) !important;
    opacity: 0;
    transition: opacity 1.8s ease;
}

#si-board-area.si-theme-active .cell::before,
#si-board-area.si-theme-active .cell::after {
    opacity: 1;
}

#si-board-area #board .cell:nth-child(10n)::before,
#si-board-area #board .cell:nth-child(10n)::after {
    box-shadow: var(--cell-size) 0 0 0 var(--line-color, #ffffff) !important;
}

#si-board-area #board .cell:nth-child(n+91)::before,
#si-board-area #board .cell:nth-child(n+91)::after {
    box-shadow: 0 var(--cell-size) 0 0 var(--line-color, #ffffff) !important;
}

#si-board-area #board .cell:nth-child(10n):nth-child(n+91)::before,
#si-board-area #board .cell:nth-child(10n):nth-child(n+91)::after {
    box-shadow: var(--cell-size) 0 0 0 var(--line-color, #ffffff), 
                0 var(--cell-size) 0 0 var(--line-color, #ffffff), 
                var(--cell-size) var(--cell-size) 0 0 var(--line-color, #ffffff) !important;
}

#si-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    transition: opacity 0.6s;
    pointer-events: none;
    z-index: 20;
    text-align: center;
}

#si-overlay-tag {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

#si-overlay-body {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.9;
    max-width: 84%;
    white-space: pre-line;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.01em;
}

#si-logo-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

#si-logo-watermark img {
    width: 55%;
    max-width: 280px;
    opacity: 0.1;
    filter: grayscale(100%);
}

@media (max-width: 600px) {
    #si-logo-watermark img {
        max-width: 44vw;
    }
}

#si-final {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 1.5s;
    pointer-events: none;
    z-index: 30;
}

#si-final-line1 {
    font-size: 1.0rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    font-weight: 400;
}

#si-final-line2 {
    font-size: 2.8rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.stone.si-connect {
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.9), 0 0 5px rgba(46, 204, 113, 0.6) !important;
}

@keyframes si-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.stone.si-danger {
    animation: si-pulse 0.65s ease-in-out infinite;
}

.stone.si-danger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1.5px solid #e74c3c !important;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 5;
}

#si-skip-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#si-skip-btn:hover {
    color: #fff;
}

html.bg-light #si-skip-btn {
    color: rgba(0, 0, 0, 0.35);
}

html.bg-light #si-skip-btn:hover {
    color: #000;
}

html.bg-light #btn-replay-intro {
    color: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
}

#btn-replay-intro {
    display: none;
}

@media (max-width: 600px) {
    #si-board-wrapper {
        padding: calc(1.5vw + 8px) 2vw calc(1.5vw + 8px) 2vw;
    }
}