body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    padding: 20px;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
}

/* 2단 레이아웃: 왼쪽 코딩 / 오른쪽 결과 */
.layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.left-panel,
.right-panel {
    flex: 1;
    min-width: 0;
}

.player-section {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 좁은 화면에서는 위아래로 쌓기 */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
}

.blockly-workspace {
    height: 400px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.controls {
    text-align: center;
    margin: 20px 0;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#reset-btn {
    background-color: #e74c3c;
}

#reset-btn:hover {
    background-color: #c0392b;
}

#game-board, #results {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 무작위 여러 판 시연: 카드 영역 */
#card-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    /* 판 개수에 따라 JS가 조정하는 카드 크기 (기본값) */
    --card-w: 44px;
    --card-h: 62px;
    --card-font: 15px;
}

/* 한 판 = 한 줄 (판 번호 · 카드들 · 결과) */
.round-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    flex-wrap: wrap;
}

.round-label {
    min-width: 44px;
    font-weight: bold;
    color: #2c3e50;
}

.cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--card-w);
    height: var(--card-h);
    border: 1px solid #333;
    border-radius: 6px;
    background: #fff;
    font-size: var(--card-font);
    font-weight: bold;
    color: #2c3e50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    animation: dealIn 0.4s ease;
}

.card.red {
    color: #e74c3c;
}

@keyframes dealIn {
    from { transform: translateY(-40px) rotate(-8deg) scale(0.85); opacity: 0; }
    to   { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}

#round-result {
    min-height: 24px;
    margin: 8px 0;
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}

/* 판별 결과 배지 */
.round-badge {
    font-weight: bold;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 6px;
    color: #555;
    white-space: nowrap;
}

.round-badge.win {
    background: #eafaf1;
    color: #27ae60;
    animation: pop 0.4s ease;
}

.round-badge.lose {
    background: #fdecea;
    color: #e74c3c;
    animation: pop 0.4s ease;
}

@keyframes pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 랜덤판 수 입력 */
.demo-count-label {
    font-weight: bold;
    color: #2c3e50;
}

.demo-count-label input {
    width: 56px;
    padding: 6px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

