* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', 'Nunito', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    min-height: 100vh;
    padding: 20px;
    color: #4a4a4a;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(168, 237, 234, 0.5);
    border: 3px solid #fff;
}

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Character & Settings Section */
.character-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.mascot-container {
    text-align: center;
    margin-bottom: 25px;
}

.mascot-container img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mascot-container img:hover {
    transform: scale(1.05) rotate(2deg);
}

.settings-panel {
    background: #fff;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(168, 237, 234, 0.3);
    width: 100%;
    max-width: 500px;
    border: 2px solid #e1f5fe;
}

.input-group {
    margin-bottom: 15px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.character-selector {
    display: flex;
    gap: 15px;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-custom {
    display: block;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
}

.radio-label input:checked+.radio-custom {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: white;
    border-color: #fbc2eb;
    box-shadow: 0 4px 10px rgba(161, 140, 209, 0.3);
}

#user-name {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#user-name:focus {
    outline: none;
    border-color: #a18cd1;
}

.criticism-level-selector {
    margin-bottom: 25px;
    padding: 20px;
    background: #f0faff;
    border-radius: 20px;
    border: 2px solid #e1f5fe;
}

.criticism-level-selector label {
    display: block;
    font-weight: bold;
    margin-bottom: 15px;
    color: #555;
}

.level-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.level-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 237, 234, 0.3);
}

.level-btn.active {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: white;
    border-color: #fbc2eb;
}

.level-description {
    font-size: 13px;
    color: #888;
    margin: 0;
    font-style: italic;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    margin-bottom: 20px;
    resize: vertical;
    font-family: inherit;
    background: #fff;
}

textarea:focus {
    outline: none;
    border-color: #a18cd1;
    box-shadow: 0 0 10px rgba(161, 140, 209, 0.2);
}

button#analyze-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

button#analyze-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(132, 250, 176, 0.6);
}

button#analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#result-section {
    display: none;
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.knight-message {
    background: #fff9c4;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px solid #fff176;
    position: relative;
}

.knight-message h3 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 20px;
}

.knight-message p {
    color: #5d4037;
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-wrap;
}

.analysis-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #a8edea;
}

.analysis-item strong {
    display: block;
    color: #4a4a4a;
    margin-bottom: 10px;
    font-size: 16px;
}

.analysis-item p,
.analysis-item pre {
    color: #666;
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

.analysis-item.critique {
    background: #ffedea;
    border-left-color: #ff9a9e;
}

.analysis-item.critique strong {
    color: #ff6b6b;
}

.analysis-item.counter {
    background: #e3f2fd;
    border-left-color: #90caf9;
}

.analysis-item.weapon {
    background: #f3e5f5;
    border-left-color: #ce93d8;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ffcdd2;
    text-align: center;
}

.copy-btn {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #f0f0f0;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .level-buttons {
        flex-direction: column;
    }

    .level-btn {
        width: 100%;
    }

    h1 {
        font-size: 24px;
    }
}