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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header p {
    opacity: 0.9;
    font-size: 14px;
}

.content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
}

/* タブレット・スマホ対応 */
@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }

    .inputs {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .outputs {
        max-height: none;
    }
}

/* スマホ対応 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 20px;
    }

    header p {
        font-size: 12px;
    }

    .section {
        padding: 12px;
    }

    .section-title {
        font-size: 14px;
    }

    #staminaChart {
        height: 300px !important;
        max-height: 300px;
    }

    .weapon-stats {
        grid-template-columns: 1fr;
    }

    .input-group-inline {
        grid-template-columns: 1fr;
    }
}

.inputs {
    background: #f8f9fa;
    padding: 24px;
    border-right: 1px solid #e0e0e0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.outputs {
    padding: 24px;
    /* max-height: calc(100vh - 140px); */
    overflow-y: auto;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #667eea;
    border-radius: 2px;
}

.weapon-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
}

.weapon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.color-picker {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ddd;
    cursor: pointer;
}

.weapon-header input[type="text"] {
    flex: 1;
}

.weapon-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.input-group input[type="number"],
.input-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.input-group-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
    margin-bottom: 8px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

#staminaChart {
    width: 100%;
    height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.analysis-card {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
}

.analysis-card h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.analysis-card .value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.analysis-card .unit {
    font-size: 14px;
    color: #777;
}

.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.danger {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.weapon-list {
    list-style: none;
    padding: 0;
}

.weapon-list li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weapon-list li::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* 複数選択用のselectスタイルを追加 */
select[multiple] {
    height: auto;
    min-height: 80px;
}

select[multiple] option {
    padding: 4px 8px;
}

select[multiple] option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.info-text {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.stat-label {
    color: #555;
}

.stat-value {
    font-weight: 600;
    color: #333;
}
