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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #fef8f4;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><g fill="none" stroke="%23f4dcc8" stroke-width="1" opacity="0.3"><path d="M20,50 Q25,35 30,50 T40,50"/><circle cx="25" cy="45" r="3"/><circle cx="35" cy="45" r="2"/><path d="M60,30 Q65,20 70,30 T80,30"/><circle cx="65" cy="25" r="2.5"/><circle cx="75" cy="25" r="2"/><path d="M10,80 Q15,70 20,80 T30,80"/><circle cx="15" cy="75" r="2"/></g></svg>');
    background-size: 100px 100px;
    min-height: 100vh;
    padding: 20px;
    color: #5a4a3a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.character-container {
    flex-shrink: 0;
}

.header-character {
    width: 180px;
    height: auto;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(217, 125, 84, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.title-container {
    text-align: left;
}

.header-prefix {
    color: #a67c52;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.header h1 {
    color: #d97d54;
    font-size: 3rem;
    font-weight: 900;
    margin: 0 0 10px 0;
    line-height: 1.2;
    text-shadow: 2px 2px 0px #f4a460, 4px 4px 0px #f9d5b8;
    letter-spacing: 3px;
}

.subtitle {
    color: #c8916d;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 10px;
}

/* 説明セクション */
.instructions {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
}

.instructions h2 {
    color: #d97d54;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.step {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fff5ed 0%, #ffe8d9 100%);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
}

.step-number {
    min-width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e89b6d 0%, #d97d54 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(217, 125, 84, 0.3);
}

.step-content h3 {
    color: #d97d54;
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* モード選択セクション */
.mode-selection {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
}

.mode-selection h2 {
    color: #d97d54;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

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

.mode-btn {
    padding: 30px;
    background: linear-gradient(135deg, #fff5ed 0%, #ffe8d9 100%);
    border: 3px solid #f4c4a0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn i {
    color: #e89b6d;
    margin-bottom: 15px;
}

.mode-btn h3 {
    color: #d97d54;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.mode-btn p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.mode-btn small {
    color: #999;
    font-size: 0.85rem;
}

.mode-btn:hover {
    transform: translateY(-5px);
    border-color: #e89b6d;
    box-shadow: 0 8px 20px rgba(217, 125, 84, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #e89b6d 0%, #d97d54 100%);
    border-color: #d97d54;
    box-shadow: 0 8px 20px rgba(217, 125, 84, 0.4);
}

.mode-btn.active i,
.mode-btn.active h3,
.mode-btn.active p,
.mode-btn.active small {
    color: white;
}

/* イラストセクション */
.illustration-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
}

.illustration-section h2 {
    color: #d97d54;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

.illustration-info {
    padding: 15px;
    background: linear-gradient(135deg, #fff5ed 0%, #ffe8d9 100%);
    border-radius: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8a6d52;
}

.illustration-info i {
    color: #e89b6d;
    font-size: 1.2rem;
}

/* アップロードセクション */
.upload-section, .mapping-section, .saved-maps {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.1);
}

.upload-section h2, .mapping-section h2, .saved-maps h2 {
    color: #d97d54;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

/* タブ */
.angle-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px 25px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #fff5ed;
    border-color: #e89b6d;
}

.tab-btn.active {
    background: linear-gradient(135deg, #e89b6d 0%, #d97d54 100%);
    color: white;
    border-color: #d97d54;
    box-shadow: 0 4px 10px rgba(217, 125, 84, 0.3);
}

/* アップロードエリア */
.upload-area {
    border: 3px dashed #f4c4a0;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fffaf7;
}

.upload-area:hover {
    border-color: #e89b6d;
    background: #fff5ed;
}

.upload-area.dragover {
    border-color: #d97d54;
    background: #ffe8d9;
    transform: scale(1.02);
}

.upload-placeholder i {
    color: #e89b6d;
    margin-bottom: 15px;
}

.upload-placeholder p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.upload-placeholder small {
    color: #999;
}

/* マッピングコントロール */
.mapping-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: #666;
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.3);
}

#markerSize {
    width: 120px;
}

#sizeValue {
    min-width: 40px;
    font-weight: 700;
    color: #d97d54;
}

/* Canvas */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 25px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#imageCanvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

/* メモエリア */
.memo-section {
    margin-bottom: 25px;
}

.memo-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.memo-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.memo-section textarea:focus {
    outline: none;
    border-color: #e89b6d;
}

/* ボタン */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #e89b6d 0%, #d97d54 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(217, 125, 84, 0.3);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 125, 84, 0.4);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #9bbc85 0%, #7da869 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(125, 168, 105, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(125, 168, 105, 0.4);
}

/* 保存済みマップ */
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.map-card {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.map-card:hover {
    transform: translateY(-5px);
}

.map-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.map-card-content {
    padding: 15px;
}

.map-card-title {
    font-weight: 500;
    color: #ff69b4;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-card-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.map-card-memo {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    line-height: 1.5;
}

.map-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.85rem;
    flex: 1;
}

.export-section {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* レスポンシブ */
/* レスポンシブ追加スタイル */
.map-card-title {
    font-weight: 700;
    color: #d97d54;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
        text-shadow: 2px 2px 0px #ff69b4, 3px 3px 0px #ffa0d2;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .title-container {
        text-align: center;
    }

    .header-character {
        width: 120px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .mapping-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-wrap: wrap;
    }

    .maps-grid {
        grid-template-columns: 1fr;
    }
}
