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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

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

textarea {
    resize: vertical;
    min-height: 100px;
}

.pattern-item {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    display: grid;
    gap: 10px;
}

.pattern-item input,
.pattern-item textarea {
    font-size: 14px;
    padding: 8px;
}

.remove-pattern {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.3s;
}

.remove-pattern:hover {
    background: #cc0000;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    touch-action: manipulation;
}

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

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #48bb78;
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #38a169;
}

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

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

#add-pattern {
    margin-top: 10px;
    width: 100%;
}

.diagnosis-card {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.diagnosis-card h3 {
    flex: 1;
    margin: 0;
    margin-right: 20px;
}

.diagnosis-card button {
    margin-left: 10px;
}

.no-diagnoses {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px;
}

#diagnosis-player {
    background: #f0f4ff;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

#diagnosis-result {
    background: #fff8dc;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

#result-content pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* モバイル対応 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .section {
        padding: 20px;
    }

    .diagnosis-card {
        flex-direction: column;
        text-align: center;
    }

    .diagnosis-card h3 {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .diagnosis-card button {
        width: 100%;
        margin: 5px 0;
    }

    #retry-diagnosis,
    #share-result {
        width: 100%;
        margin: 5px 0;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-out;
}

#diagnosis-result {
    animation: fadeIn 0.5s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}