/* css/style.css - 전역 스타일 및 셋업 화면 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ecf0f1;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* 셋업 화면 */
#setup-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.setup-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.setup-container h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: #bdc3c7;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.setup-section {
    margin-bottom: 30px;
}

.setup-section h3 {
    margin-bottom: 15px;
    color: #f1c40f;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.player-count-btn,
.difficulty-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: 2px solid #3498db;
    background: transparent;
    color: #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-count-btn:hover,
.difficulty-btn:hover {
    background: rgba(52, 152, 219, 0.3);
}

.player-count-btn.selected,
.difficulty-btn.selected {
    background: #3498db;
    color: white;
}

.start-btn {
    padding: 15px 60px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-weight: bold;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.rules-summary {
    margin-top: 30px;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
}

.rules-summary h4 {
    margin-bottom: 15px;
    color: #f1c40f;
    text-align: center;
}

.rules-summary ul {
    list-style: none;
}

.rules-summary li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.rules-summary li:last-child {
    border-bottom: none;
}

/* 게임 화면 레이아웃 */
#game-screen {
    padding: 15px;
}

.game-layout {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.board-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ui-section {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 패널 스타일 */
.panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panel h3 {
    margin-bottom: 12px;
    color: #f1c40f;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

/* 게임 로그 */
.game-log {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 350px;
    max-height: 200px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    overflow: hidden;
}

.log-header {
    background: rgba(52, 152, 219, 0.8);
    padding: 10px 15px;
    font-weight: bold;
}

.log-content {
    padding: 10px 15px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 15px;
    padding: 30px;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #f1c40f;
    text-align: center;
}

.modal-content p {
    margin-bottom: 15px;
    text-align: center;
}

.modal-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #3498db;
    color: white;
}

.modal-btn:hover:not(:disabled) {
    background: #2980b9;
}

.modal-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

.modal-btn.primary {
    background: #2ecc71;
}

.modal-btn.primary:hover {
    background: #27ae60;
}

.modal-btn.secondary {
    background: #95a5a6;
}

.modal-btn.secondary:hover {
    background: #7f8c8d;
}

/* 주사위 결과 */
.dice-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    z-index: 999;
    animation: diceAppear 0.3s ease;
}

@keyframes diceAppear {
    from {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.dice {
    font-size: 4rem;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

.dice-total {
    font-size: 2rem;
    color: #f1c40f;
    font-weight: bold;
}

/* 새 게임 버튼 */
.new-game-btn {
    padding: 12px;
    font-size: 1rem;
    background: #e74c3c;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.new-game-btn:hover {
    background: #c0392b;
}

/* 반응형 */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
    }

    .ui-section {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ui-section .panel {
        flex: 1 1 calc(50% - 10px);
        min-width: 280px;
    }

    .game-log {
        position: static;
        width: 100%;
        max-height: 150px;
        margin-top: 20px;
    }
}
