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

/* 다크모드 기본 설정 */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    border: 1px solid #404040;
}

.main-content {
    padding: 30px;
    background: #1e1e1e;
}

.section {
    margin-bottom: 40px;
    background: linear-gradient(135deg, #2d2d30 0%, #3a3a3d 100%);
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid #3498db;
    border: 1px solid #404040;
}

.section h2 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-setup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-card {
    background: linear-gradient(135deg, #3a3a3d 0%, #4a4a4d 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #555;
    transition: all 0.3s ease;
}

.grid-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.2);
}

.grid-card label {
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 10px;
    display: block;
}

.grid-card select, .grid-card input {
    width: 100%;
    padding: 10px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #2d2d30;
    color: #e0e0e0;
}

.grid-card select:focus, .grid-card input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.gem-input {
    background: linear-gradient(135deg, #3a3a3d 0%, #4a4a4d 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    border: 1px solid #555;
}

.gem-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #e0e0e0;
    font-size: 14px;
}

.form-group input, .form-group select {
    padding: 10px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #2d2d30;
    color: #e0e0e0;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #1abc9c 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

/* 젬/그리드 리스트 */
.gem-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gem-item {
    background: linear-gradient(135deg, #3a3a3d 0%, #4a4a4d 100%);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.gem-item:hover {
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.gem-info {
    flex: 1;
}

.gem-type {
    font-weight: bold;
    margin-bottom: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.gem-stats {
    font-size: 14px;
    color: #b0b0b0;
}

.gem-actions {
    margin-left: 15px;
}

/* 젬 타입별 색상 */
.order-type {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.chaos-type {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 젬 서브타입별 색상 (질서 - 다크모드) */
.gem-stable {
    border-left: 5px solid #2196f3 !important;
    box-shadow: inset 3px 0 0 rgba(33, 150, 243, 0.3) !important;
}

.gem-solid {
    border-left: 5px solid #4caf50 !important;
    box-shadow: inset 3px 0 0 rgba(76, 175, 80, 0.3) !important;
}

.gem-immutable {
    border-left: 5px solid #9c27b0 !important;
    box-shadow: inset 3px 0 0 rgba(156, 39, 176, 0.3) !important;
}

/* 젬 서브타입별 색상 (혼돈 - 다크모드) */
.gem-erosion {
    border-left: 5px solid #ff9800 !important;
    box-shadow: inset 3px 0 0 rgba(255, 152, 0, 0.3) !important;
}

.gem-distortion {
    border-left: 5px solid #ffeb3b !important;
    box-shadow: inset 3px 0 0 rgba(255, 235, 59, 0.3) !important;
}

.gem-collapse {
    border-left: 5px solid #f44336 !important;
    box-shadow: inset 3px 0 0 rgba(244, 67, 54, 0.3) !important;
}

/* 그리드 등급별 색상 (다크모드 - 로스트아크 스타일) */
.grid-hero {
    background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%) !important;
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8) !important;
    border: 2px solid #7b1fa2 !important;
}

.grid-legend {
    background: linear-gradient(135deg, #ffeb3b 0%, #ffc107 100%) !important;
    color: #1a1a1a !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.9) !important;
    border: 2px solid #f57f17 !important;
    font-weight: bold !important;
}

.grid-relic {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%) !important;
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8) !important;
    border: 2px solid #bf360c !important;
}

.grid-ancient {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%) !important;
    color: #1a1a1a !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.9) !important;
    border: 2px solid #9e9e9e !important;
    font-weight: bold !important;
}

.grid-default {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%) !important;
    color: white;
}

/* 결과 섹션 */
.result-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid #404040;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grid-result {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.grid-result h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #fff;
}

.gem-result {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #fff;
}

.total-points {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #3498db; /* 단순한 색상으로 변경 */
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #3498db;
}

.no-result {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-style: italic;
}

/* 스크롤바 다크모드 */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #2d2d30;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1abc9c 100%);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .gem-form {
        grid-template-columns: 1fr;
    }
    
    .grid-setup {
        grid-template-columns: 1fr;
    }
    
    .gem-list {
        grid-template-columns: 1fr;
    }
    
    body {
        padding: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
}