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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.header:hover {
    transform: translateY(-2px);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats {
    display: flex;
    gap: 30px;
}

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

.stat-item .label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-item .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.game-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.instruction {
    text-align: center;
    margin-bottom: 40px;
}

.instruction h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

.instruction p {
    color: #666;
    font-size: 1.1rem;
}

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

.character-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.character-card:hover::before {
    left: 100%;
}

.character-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.character-card:hover .character-avatar {
    transform: rotate(5deg) scale(1.1);
}

.character-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.character-type {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.character-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.trait-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.conversation-modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.character-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.character-info .character-avatar {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    flex-shrink: 0;
}

.character-details h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.character-details p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.mood-indicator {
    font-size: 0.9rem;
    color: #333;
}

.mood-status {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 5px;
}

.mood-status.happy { background: #e8f5e8; color: #2d8f2d; }
.mood-status.neutral { background: #f0f0f0; color: #666; }
.mood-status.sad { background: #ffe8e8; color: #c33; }
.mood-status.excited { background: #fff3e0; color: #f57c00; }
.mood-status.annoyed { background: #ffeaa7; color: #d63031; }

.conversation-history {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.user {
    background: #e3f2fd;
    text-align: right;
}

.message.character {
    background: #f3e5f5;
}

.message-options h4 {
    margin-bottom: 15px;
    color: #333;
}

.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.conversation-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.conversation-result.success {
    background: #e8f5e8;
    color: #2d8f2d;
    border: 2px solid #4caf50;
}

.conversation-result.neutral {
    background: #f0f0f0;
    color: #666;
    border: 2px solid #bbb;
}

.conversation-result.failure {
    background: #ffe8e8;
    color: #c33;
    border: 2px solid #f44336;
}

.xp-gain {
    font-weight: 600;
    margin-top: 10px;
}

.progress-container {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

.learning-display {
    margin-left: 30px;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.skill-item {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
}

.skill-gain {
    color: #4CAF50;
    font-weight: 600;
    margin-top: 5px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .learning-display {
        margin-left: 0;
    }
    
    .character-info {
        flex-direction: column;
        text-align: center;
    }
    
    .conversation-modal {
        width: 95%;
        padding: 20px;
    }
}