.online-dice-roller {
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    font-family: 'Dotum', '돋움', sans-serif !important;
    background-color: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
}

.online-dice-roller * {
    box-sizing: border-box !important;
}

.online-dice-roller h2 {
    text-align: center !important;
    color: #333 !important;
    font-size: 1.725em !important;
    margin: 0 0 20px 0 !important;
    font-weight: bold !important;
    background-color: #e0e0e0 !important;
    padding: 12px !important;
    border: 1px solid #999 !important;
}

.main-container {
    display: flex !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
}

.bottom-container {
    display: flex !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
}

.section {
    flex: 1 !important;
    background: white !important;
    border: 1px solid #ccc !important;
    padding: 15px !important;
    min-height: 200px !important;
}

.section h3 {
    font-size: 1.225em !important;
    color: #333 !important;
    margin: 0 0 15px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #ddd !important;
    font-weight: bold !important;
}

.section h4 {
    font-size: 1.075em !important;
    color: #555 !important;
    margin: 15px 0 8px 0 !important;
    font-weight: bold !important;
}

.input-row {
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.input-row label {
    font-size: 1.025em !important;
    color: #555 !important;
    width: 80px !important;
    flex-shrink: 0 !important;
    font-weight: bold !important;
}

.input-row select,
.input-row input {
    flex: 1 !important;
    padding: 6px !important;
    border: 1px solid #999 !important;
    font-size: 1.025em !important;
    background: white !important;
    color: #333 !important;
}

.input-row select:focus,
.input-row input:focus {
    outline: 2px solid #4169e1 !important;
    outline-offset: -2px !important;
}

.btn-roll {
    width: 100% !important;
    padding: 12px !important;
    background: #228b22 !important;
    color: white !important;
    border: 1px solid #006400 !important;
    font-size: 1.125em !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin: 15px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-roll:hover {
    background: #006400 !important;
}

.btn-roll:active {
    background: #004d00 !important;
}

.btn-roll:disabled {
    background: #888 !important;
    cursor: not-allowed !important;
}

.btn-roll svg {
    width: 16px !important;
    height: 16px !important;
}

.quick-actions {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 15px !important;
}

.btn-quick,
.btn-auto {
    flex: 1 !important;
    padding: 6px !important;
    background: #4169e1 !important;
    color: white !important;
    border: 1px solid #1e3a8a !important;
    font-size: 0.975em !important;
    cursor: pointer !important;
}

.btn-quick:hover,
.btn-auto:hover {
    background: #1e3a8a !important;
}

.btn-auto.active {
    background: #dc143c !important;
    border-color: #8b0000 !important;
}

.preset-section {
    border-top: 1px solid #ddd !important;
    padding-top: 15px !important;
    margin-top: 15px !important;
}

.preset-buttons {
    display: flex !important;
    gap: 5px !important;
    margin-bottom: 8px !important;
    flex-wrap: wrap !important;
}

.btn-preset {
    padding: 4px 8px !important;
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #999 !important;
    font-size: 0.925em !important;
    cursor: pointer !important;
}

.btn-preset:hover {
    background: #e0e0e0 !important;
}

.btn-save-preset {
    width: 100% !important;
    padding: 5px !important;
    background: #ffa500 !important;
    color: white !important;
    border: 1px solid #ff8c00 !important;
    font-size: 0.925em !important;
    cursor: pointer !important;
}

.btn-save-preset:hover {
    background: #ff8c00 !important;
}

.dice-result-area {
    min-height: 80px !important;
    border: 1px solid #ddd !important;
    padding: 10px !important;
    background: #fafafa !important;
    margin-bottom: 10px !important;
    text-align: center !important;
    max-height: 200px !important;
    overflow-y: auto !important;
}

.result-controls {
    display: flex !important;
    gap: 5px !important;
    margin-bottom: 10px !important;
}

.btn-sort,
.btn-copy {
    flex: 1 !important;
    padding: 4px !important;
    background: #6c757d !important;
    color: white !important;
    border: 1px solid #495057 !important;
    font-size: 0.925em !important;
    cursor: pointer !important;
}

.btn-sort:hover,
.btn-copy:hover {
    background: #495057 !important;
}

.empty-text {
    text-align: center !important;
    color: #999 !important;
    font-size: 1.025em !important;
    margin: 20px 0 !important;
}

.dice-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
    align-items: center !important;
}

.dice-item {
    width: 35px !important;
    height: 35px !important;
    background: #4169e1 !important;
    color: white !important;
    border: 2px solid #1e3a8a !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    font-size: 1.125em !important;
    animation: diceRoll 0.5s ease-in-out !important;
}

.dice-item.highlighted {
    background: #ffd700 !important;
    border-color: #ffb300 !important;
    color: #333 !important;
}

@keyframes diceRoll {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    25% { transform: rotateX(180deg) rotateY(90deg); }
    50% { transform: rotateX(360deg) rotateY(180deg); }
    75% { transform: rotateX(540deg) rotateY(270deg); }
    100% { transform: rotateX(720deg) rotateY(360deg); }
}

.total-result {
    text-align: center !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    background: #e0f2f1 !important;
    border: 1px solid #4caf50 !important;
}

.total-sum {
    font-size: 2.125em !important;
    font-weight: bold !important;
    color: #2e7d32 !important;
    margin-bottom: 5px !important;
}

.total-label {
    font-size: 1.025em !important;
    color: #555 !important;
}

.target-status {
    font-size: 0.925em !important;
    margin-top: 5px !important;
    font-weight: bold !important;
}

.target-status.success {
    color: #2e7d32 !important;
}

.target-status.fail {
    color: #d32f2f !important;
}

.result-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    background: #f0f0f0 !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    font-size: 0.975em !important;
    margin-bottom: 10px !important;
}

.stat-item {
    text-align: center !important;
}

.stat-label {
    color: #555 !important;
    display: block !important;
}

.stat-value {
    font-weight: bold !important;
    color: #000080 !important;
    display: block !important;
    margin-top: 2px !important;
}

.probability-info {
    display: flex !important;
    justify-content: space-between !important;
    background: #fff3e0 !important;
    padding: 8px !important;
    border: 1px solid #ffb74d !important;
    font-size: 0.925em !important;
    margin-bottom: 10px !important;
}

.prob-item {
    text-align: center !important;
}

.prob-label {
    color: #555 !important;
    display: block !important;
}

.prob-value {
    font-weight: bold !important;
    color: #e65100 !important;
    display: block !important;
    margin-top: 2px !important;
}

.analysis-tabs {
    display: flex !important;
    margin-bottom: 15px !important;
    border-bottom: 1px solid #ddd !important;
}

.tab-btn {
    flex: 1 !important;
    padding: 8px !important;
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-bottom: none !important;
    font-size: 0.975em !important;
    cursor: pointer !important;
}

.tab-btn.active {
    background: white !important;
    color: #4169e1 !important;
    font-weight: bold !important;
}

.tab-btn:hover {
    background: #e0e0e0 !important;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

.stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
}

.stats-item {
    text-align: center !important;
    padding: 10px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

.stats-number {
    font-size: 1.625em !important;
    font-weight: bold !important;
    color: #4169e1 !important;
    margin-bottom: 5px !important;
}

.stats-label {
    font-size: 0.925em !important;
    color: #555 !important;
}

.session-info {
    margin-bottom: 15px !important;
}

.session-item {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 8px !important;
    font-size: 1.025em !important;
}

.session-label {
    color: #555 !important;
}

.session-value {
    font-weight: bold !important;
    color: #000080 !important;
}

.luck-indicator.good {
    color: #2e7d32 !important;
}

.luck-indicator.bad {
    color: #d32f2f !important;
}

.luck-indicator.excellent {
    color: #ff6f00 !important;
}

#distributionChart {
    width: 100% !important;
    height: 120px !important;
    border: 1px solid #ddd !important;
    margin-bottom: 10px !important;
}

.distribution-info {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 0.975em !important;
}

.dist-item {
    text-align: center !important;
}

.dist-label {
    color: #555 !important;
    display: block !important;
}

.dist-value {
    font-weight: bold !important;
    color: #000080 !important;
    display: block !important;
    margin-top: 2px !important;
}

.analysis-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 15px !important;
}

.btn-reset,
.btn-export {
    flex: 1 !important;
    padding: 6px !important;
    font-size: 0.975em !important;
    cursor: pointer !important;
}

.btn-reset {
    background: #dc143c !important;
    color: white !important;
    border: 1px solid #8b0000 !important;
}

.btn-reset:hover {
    background: #8b0000 !important;
}

.btn-export {
    background: #17a2b8 !important;
    color: white !important;
    border: 1px solid #138496 !important;
}

.btn-export:hover {
    background: #138496 !important;
}

.history-controls {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.history-controls select {
    flex: 1 !important;
    padding: 5px !important;
    border: 1px solid #999 !important;
    font-size: 0.975em !important;
    background: white !important;
    color: #333 !important;
}

.btn-clear {
    flex: 1 !important;
    padding: 5px !important;
    background: #dc143c !important;
    color: white !important;
    border: 1px solid #8b0000 !important;
    font-size: 0.975em !important;
    cursor: pointer !important;
}

.btn-clear:hover {
    background: #8b0000 !important;
}

.history-list {
    height: 160px !important;
    overflow-y: auto !important;
    border: 1px solid #ddd !important;
    padding: 8px !important;
    background: #fafafa !important;
    margin-bottom: 10px !important;
}

.history-item {
    padding: 6px !important;
    margin-bottom: 6px !important;
    background: white !important;
    border: 1px solid #ddd !important;
    font-size: 0.975em !important;
    border-left: 3px solid #4169e1 !important;
}

.history-item.success {
    border-left-color: #2e7d32 !important;
}

.history-item.fail {
    border-left-color: #d32f2f !important;
}

.history-header {
    font-weight: bold !important;
    color: #333 !important;
    margin-bottom: 3px !important;
}

.history-details {
    color: #666 !important;
    font-size: 1.025em !important;
}

.history-total {
    color: #2e7d32 !important;
    font-weight: bold !important;
}

.history-summary {
    display: flex !important;
    justify-content: space-between !important;
    background: #f0f0f0 !important;
    padding: 8px !important;
    border: 1px solid #ddd !important;
    font-size: 0.975em !important;
}

.summary-item {
    text-align: center !important;
}

.summary-label {
    color: #555 !important;
    display: block !important;
}

.summary-value {
    font-weight: bold !important;
    color: #000080 !important;
    display: block !important;
    margin-top: 2px !important;
}

.prob-calculator {
    margin-bottom: 15px !important;
}

.btn-calc {
    padding: 6px 12px !important;
    background: #4169e1 !important;
    color: white !important;
    border: 1px solid #1e3a8a !important;
    font-size: 0.975em !important;
    cursor: pointer !important;
}

.btn-calc:hover {
    background: #1e3a8a !important;
}

.prob-result {
    text-align: center !important;
    margin: 10px 0 !important;
    padding: 10px !important;
    background: #e3f2fd !important;
    border: 1px solid #2196f3 !important;
}

.prob-percentage {
    font-size: 1.625em !important;
    font-weight: bold !important;
    color: #1976d2 !important;
    margin-bottom: 5px !important;
}

.prob-description {
    font-size: 1.025em !important;
    color: #555 !important;
}

.example-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
    font-size: 0.925em !important;
}

.example-item {
    padding: 5px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    text-align: center !important;
}

.notice {
    text-align: center !important;
    font-size: 0.975em !important;
    color: #666 !important;
    padding: 12px !important;
    background: #ffffcc !important;
    border: 1px solid #cccc00 !important;
}

/* 다크모드 호환성 */
@media (prefers-color-scheme: dark) {
    .online-dice-roller {
        background-color: #2d2d2d !important;
        border-color: #555 !important;
        color: #e0e0e0 !important;
    }
    
    .online-dice-roller h2 {
        background-color: #404040 !important;
        color: #e0e0e0 !important;
        border-color: #666 !important;
    }
    
    .section {
        background: #3a3a3a !important;
        border-color: #555 !important;
    }
    
    .section h3,
    .section h4 {
        color: #e0e0e0 !important;
        border-color: #555 !important;
    }
    
    .input-row label {
        color: #ccc !important;
    }
    
    .input-row select,
    .input-row input {
        background: #2d2d2d !important;
        color: #e0e0e0 !important;
        border-color: #666 !important;
    }
    
    .dice-result-area {
        background: #404040 !important;
        border-color: #555 !important;
    }
    
    .empty-text {
        color: #888 !important;
    }
    
    .total-result {
        background: #2d4a2d !important;
        border-color: #4a7c4a !important;
    }
    
    .result-stats,
    .probability-info,
    .stats-item,
    .session-info,
    .distribution-info,
    .history-summary {
        background: #404040 !important;
        border-color: #555 !important;
    }
    
    .stat-label,
    .prob-label,
    .session-label,
    .dist-label,
    .summary-label {
        color: #ccc !important;
    }
    
    .tab-btn {
        background: #404040 !important;
        color: #e0e0e0 !important;
        border-color: #555 !important;
    }
    
    .tab-btn.active {
        background: #3a3a3a !important;
        color: #4169e1 !important;
    }
    
    .history-list {
        background: #404040 !important;
        border-color: #555 !important;
    }
    
    .history-item {
        background: #3a3a3a !important;
        border-color: #555 !important;
    }
    
    .history-header {
        color: #e0e0e0 !important;
    }
    
    .history-details {
        color: #ccc !important;
    }
    
    .prob-result {
        background: #2d3a4a !important;
        border-color: #4a6a8a !important;
    }
    
    .example-item {
        background: #404040 !important;
        border-color: #555 !important;
        color: #e0e0e0 !important;
    }
    
    .notice {
        background: #4a4a2d !important;
        border-color: #8a8a4a !important;
        color: #e0e0e0 !important;
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .online-dice-roller {
        padding: 8px 5px !important;
    }
    
    .online-dice-roller h2 {
        font-size: 1.425em !important;
        padding: 8px !important;
    }
    
    .main-container,
    .bottom-container {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .section {
        padding: 12px !important;
        min-height: auto !important;
    }
    
    .section h3 {
        font-size: 1.125em !important;
        margin-bottom: 10px !important;
    }
    
    .input-row label {
        width: 70px !important;
        font-size: 0.975em !important;
    }
    
    .input-row select,
    .input-row input {
        font-size: 0.975em !important;
        padding: 5px !important;
    }
    
    .btn-roll {
        padding: 10px !important;
        font-size: 1.025em !important;
    }
    
    .dice-item {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.025em !important;
    }
    
    .total-sum {
        font-size: 1.725em !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
    }
    
    .result-stats {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
    }
    
    .analysis-tabs {
        flex-direction: column !important;
    }
    
    .tab-btn {
        border-bottom: 1px solid #ddd !important;
    }
    
    .tab-btn:last-child {
        border-bottom: none !important;
    }
    
    .history-list {
        height: 120px !important;
    }
    
    .history-summary,
    .probability-info,
    .distribution-info {
        flex-direction: column !important;
        gap: 5px !important;
    }
    
    .example-grid {
        grid-template-columns: 1fr !important;
        gap: 3px !important;
    }
    
    .notice {
        font-size: 0.925em !important;
        padding: 8px !important;
    }
}

@media (max-width: 480px) {
    .online-dice-roller {
        padding: 5px 3px !important;
    }
    
    .section {
        padding: 8px !important;
    }
    
    .quick-actions,
    .analysis-actions,
    .history-controls {
        flex-direction: column !important;
        gap: 5px !important;
    }
    
    .preset-buttons {
        justify-content: center !important;
    }
    
    .dice-grid {
        gap: 4px !important;
    }
    
    .dice-item {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.925em !important;
    }
    
    .history-item {
        padding: 4px !important;
        font-size: 0.925em !important;
    }
    
    .stats-number {
        font-size: 1.325em !important;
    }
    
    .stats-label {
        font-size: 0.875em !important;
    }
}