
.pei-box {
    width: 100%;
    max-width: 760px;
    margin: 32px auto;
    padding: 24px;
    border-radius: 18px;
    background: #111111;
    color: #f5d77b;
    border: 1px solid #d8b45c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

.pei-meta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    color: #fff4c4;
}

.pei-meta span {
    background: rgba(255,255,255,0.08);
    padding: 8px 12px;
    border-radius: 999px;
}

.pei-board-wrap {
    width: min(100%, 460px, calc(100vw - 32px));
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.pei-board {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.pei-board .pei-selected-square {
    box-shadow: inset 0 0 0 4px #f5d77b !important;
}

.pei-board [data-square] {
    cursor: pointer;
}

.pei-board .board-b72b1,
.pei-board .chessboard-63f37 {
    max-width: 100% !important;
}

.pei-status {
    margin: 18px 0 8px;
    font-weight: 700;
    color: #ffffff;
}

.pei-actions {
    margin-top: 12px;
}

.pei-actions button {
    margin: 6px;
    padding: 11px 18px;
    border-radius: 10px;
    border: none;
    background: #d8b45c;
    color: #111111;
    font-weight: 700;
    cursor: pointer;
}

.pei-actions button:hover,
.pei-actions button:focus {
    background: #f5d77b;
}

.pei-correction {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.09);
    color: #ffffff;
    word-break: break-word;
}

.pei-correction a {
    color: #f5d77b;
    text-decoration: underline;
}

@media (max-width: 520px) {
    .pei-box {
        width: 100%;
        margin: 18px auto;
        padding: 12px;
        border-radius: 14px;
    }

    .pei-board-wrap {
        width: min(100%, calc(100vw - 24px));
    }

    .pei-meta span {
        font-size: 0.88rem;
        padding: 7px 10px;
    }

    .pei-actions button {
        width: 100%;
        max-width: 280px;
    }
}
