/**
 * 手描きイラスト変換アプリのスタイルシート - 手描き風デザイン
 */

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

body {
    font-family: 'Comic Sans MS', 'Marker Felt', 'Comic Sans', cursive, sans-serif;
    background: #FFFEF7;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* 手描き風の背景パターン */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 182, 193, 0.03) 35px, rgba(255, 182, 193, 0.03) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(176, 224, 230, 0.03) 35px, rgba(176, 224, 230, 0.03) 70px);
    pointer-events: none;
    z-index: 0;
}

.app-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.container {
    background: #FFFFFF;
    border: 4px dashed #FFB6C1;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 0 0 8px #FFF9E8;
    padding: 40px;
    width: 100%;
    position: relative;
    transform: rotate(-0.5deg);
}

.container::before {
    content: '✏️';
    position: absolute;
    top: -15px;
    left: -15px;
    font-size: 2em;
    transform: rotate(15deg);
}

.container::after {
    content: '🎨';
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 2em;
    transform: rotate(-15deg);
}

h1 {
    text-align: center;
    color: #FF6B9D;
    margin-bottom: 12px;
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow:
        2px 2px 0 #FFB6C1,
        4px 4px 0 #FFD6E8;
    transform: rotate(0.5deg);
}

.subtitle {
    text-align: center;
    color: #4A5568;
    margin-bottom: 30px;
    font-size: 1.1em;
    font-weight: 600;
    transform: rotate(-0.3deg);
}

/* コントロール部分 */
.controls {
    background: #FFFFFF;
    border: 4px dashed #FFB6C1;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    transform: rotate(0.3deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.controls::before {
    content: '⚙️ 設定';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #FFFFFF;
    padding: 4px 12px;
    font-weight: 800;
    color: #FF6B9D;
    font-size: 1.1em;
    transform: rotate(-2deg);
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: 900;
    color: #333;
    margin-bottom: 8px;
    font-size: 1.05em;
    letter-spacing: 0.5px;
    position: relative;
    padding-left: 24px;
}

.control-group label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

.control-group:nth-child(1) label::before {
    background: #FFB6C1;
}

.control-group:nth-child(2) label::before {
    background: #B0E0E6;
}

.control-group:nth-child(3) label::before {
    background: #B8F5B8;
}

.control-group:nth-child(4) label::before {
    background: #FFE5B4;
}

.control-group:nth-child(5) label::before {
    background: #F0B5DB;
}

.pixel-size-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pixel-btn {
    flex: 1;
    min-width: 65px;
    padding: 12px 18px;
    border: 3px solid;
    border-radius: 0;
    background: white;
    color: #6b7280;
    font-size: 1em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    transform: rotate(-1deg);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.pixel-btn:focus {
    outline: 3px dashed #FFB6C1;
    outline-offset: 2px;
}

.pixel-btn:nth-child(1) {
    border-color: #FFE0E6;
    color: #FFB6C1;
}

.pixel-btn:nth-child(2) {
    border-color: #D0F0F6;
    color: #B0E0E6;
}

.pixel-btn:nth-child(3) {
    border-color: #D8F5D8;
    color: #B8F5B8;
}

.pixel-btn:nth-child(4) {
    border-color: #FFF4D4;
    color: #FFE5B4;
}

.pixel-btn:nth-child(1):hover {
    border-color: #FFB6C1;
    background: #FFD6E8;
    color: #FF6B9D;
    transform: rotate(-2deg) scale(1.05);
    box-shadow: 4px 4px 0 rgba(255, 182, 193, 0.5);
}

.pixel-btn:nth-child(2):hover {
    border-color: #B0E0E6;
    background: #E0F8FF;
    color: #5BC0DE;
    transform: rotate(1deg) scale(1.05);
    box-shadow: 4px 4px 0 rgba(176, 224, 230, 0.5);
}

.pixel-btn:nth-child(3):hover {
    border-color: #B8F5B8;
    background: #E8FFE8;
    color: #66CC66;
    transform: rotate(-1deg) scale(1.05);
    box-shadow: 4px 4px 0 rgba(184, 245, 184, 0.5);
}

.pixel-btn:nth-child(4):hover {
    border-color: #FFE5B4;
    background: #FFF8E1;
    color: #FFB84D;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 4px 4px 0 rgba(255, 229, 180, 0.5);
}

.pixel-btn:nth-child(1).active {
    border-color: #FFB6C1;
    background: linear-gradient(135deg, #FFB6C1, #FFDEE2);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.pixel-btn:nth-child(2).active {
    border-color: #B0E0E6;
    background: linear-gradient(135deg, #B0E0E6, #C8E8ED);
    color: white;
    box-shadow: 0 4px 15px rgba(176, 224, 230, 0.4);
}

.pixel-btn:nth-child(3).active {
    border-color: #B8F5B8;
    background: linear-gradient(135deg, #B8F5B8, #D4F5D4);
    color: white;
    box-shadow: 0 4px 15px rgba(184, 245, 184, 0.4);
}

.pixel-btn:nth-child(4).active {
    border-color: #FFE5B4;
    background: linear-gradient(135deg, #FFE5B4, #FFF4E1);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 229, 180, 0.4);
}

.pixel-btn:active {
    transform: translateY(0);
}

.control-hint {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    line-height: 1.5;
    font-weight: 600;
}

.control-group select {
    width: 100%;
    padding: 12px 16px;
    border: 3px solid #FFB6C1;
    border-radius: 0;
    background: white;
    color: #333;
    font-size: 1em;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    font-weight: 800;
    border-left: 6px solid;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.control-group:nth-child(2) select {
    border-left-color: #B0E0E6;
}

.control-group:nth-child(3) select {
    border-left-color: #B8F5B8;
}

.control-group select:hover {
    border-color: #FFB6C1;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.15);
}

.control-group select:focus {
    border-color: #FFB6C1;
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.15);
}

.control-group:nth-child(2) select:hover,
.control-group:nth-child(2) select:focus {
    border-color: #B0E0E6;
    box-shadow: 0 4px 12px rgba(176, 224, 230, 0.15);
}

.control-group:nth-child(3) select:hover,
.control-group:nth-child(3) select:focus {
    border-color: #B8F5B8;
    box-shadow: 0 4px 12px rgba(184, 245, 184, 0.15);
}

.control-group select option {
    background: white;
    color: #374151;
}

/* トグルスイッチスタイル */
.toggle-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.toggle-item {
    flex: 1;
    min-width: 200px;
}

.toggle-item label[for] {
    display: block;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9em;
    letter-spacing: 0.3px;
    position: relative;
    padding-left: 12px;
}

.toggle-item label[for]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

.toggle-item:nth-child(1) label[for]::before {
    background: #B0E0E6;
}

.toggle-item:nth-child(2) label[for]::before {
    background: #FFE5B4;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch::before{
  background: transparent !important;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: 28px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch:hover .toggle-slider {
    background: #b0b5c0;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #FFB6C1, #B0E0E6);
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(28px);
}

.toggle-label {
    font-weight: 700;
    color: #374151;
    font-size: 0.95em;
    min-width: 50px;
    user-select: none;
}

/* ドロップエリア */
#dropArea {
    border: 4px dashed #FFB6C1;
    border-radius: 0;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #FFF5F5 0%, #F0F9FF 50%, #F0FDF4 100%);
    position: relative;
    transform: rotate(0.5deg);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

#dropArea::before {
    content: '📎';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 2em;
    transform: rotate(-15deg);
    z-index: 1;
}

#dropArea::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 3px solid #B0E0E6;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

#dropArea:hover::after,
#dropArea.dragging::after {
    opacity: 1;
}

#dropArea:hover {
    transform: rotate(-0.5deg) scale(1.02);
    box-shadow: 8px 8px 0 rgba(255, 182, 193, 0.5);
}

#dropArea.dragging {
    transform: rotate(1deg) scale(1.05);
    box-shadow: 12px 12px 0 rgba(176, 224, 230, 0.8);
}

.drop-icon {
    font-size: 4em;
    margin-bottom: 16px;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.1));
}

.drop-text {
    font-size: 1.4em;
    color: #FF6B9D;
    margin-bottom: 12px;
    font-weight: 900;
    text-shadow: 2px 2px 0 #FFB6C1;
    transform: rotate(-1deg);
}

.drop-subtext {
    color: #666;
    font-size: 1em;
    font-weight: 700;
    transform: rotate(0.5deg);
}

#fileInput {
    display: none;
}

/* プレビュー部分 */
#preview {
    display: none;
    margin-top: 20px;
}

/* 比較スライダー */
.comparison-container {
    max-width: 800px;
    margin: 0 auto;
}

.comparison-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.comparison-image-wrapper {
    position: relative;
    width: 100%;
    cursor: zoom-in;
}

.comparison-original,
.comparison-converted {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 0 0 50%);
}

.comparison-converted {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.comparison-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 5;
}

.comparison-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e5e7eb;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comparison-handle span {
    font-size: 20px;
    color: #374151;
    font-weight: bold;
}

.comparison-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 10px;
}

.comparison-label-left,
.comparison-label-right {
    font-size: 0.9em;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-label-left {
    position: relative;
    padding-left: 12px;
}

.comparison-label-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFB6C1;
}

.comparison-label-right {
    position: relative;
    padding-right: 12px;
}

.comparison-label-right::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #B8F5B8;
}

.preview-actions {
    text-align: center;
    margin-top: 20px;
}

.image-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.image-box {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.image-box h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 8px;
}

.image-box:nth-child(1) h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #FFB6C1, #B0E0E6);
    border-radius: 2px;
}

.image-box:nth-child(2) h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #B8F5B8, #FFE5B4);
    border-radius: 2px;
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 12px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.image-box img:hover {
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 16px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#convertedImage {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.zoomable {
    cursor: zoom-in;
}

.zoom-hint {
    text-align: center;
    font-size: 0.75em;
    color: #6b7280;
    margin-top: 8px;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

#modalCaption {
    text-align: center;
    color: white;
    padding: 15px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    font-weight: 600;
    padding: 10px 25px;
}

/* ボタン */
#downloadBtn {
    display: inline-block;
    margin: 0 8px;
    padding: 16px 50px;
    background: #FFB6C1;
    color: white;
    border: 4px solid #FF6B9D;
    border-radius: 0;
    font-size: 1.2em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    transform: rotate(-1deg);
    font-family: 'Comic Sans MS', cursive;
}

#downloadBtn:hover {
    transform: rotate(1deg) scale(1.05);
    box-shadow: 8px 8px 0 rgba(255, 182, 193, 0.8);
    background: #FF6B9D;
    border-color: #FF1493;
}

#downloadBtn:focus {
    outline: 4px dashed #FFB6C1;
    outline-offset: 4px;
}

#downloadBtn:active {
    transform: rotate(0deg) scale(1);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

#resetBtn {
    display: inline-block;
    margin: 0 8px;
    padding: 16px 50px;
    background: white;
    color: #4A5568;
    border: 4px solid #D1D5DB;
    border-radius: 0;
    font-size: 1.2em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    transform: rotate(1deg);
    font-family: 'Comic Sans MS', cursive;
}

#resetBtn:hover {
    background: #F0F8FF;
    color: #FF6B9D;
    border-color: #B8F5B8;
    transform: rotate(-1deg) scale(1.05);
    box-shadow: 8px 8px 0 rgba(184, 245, 184, 0.8);
}

#resetBtn:focus {
    outline: 4px dashed #B8F5B8;
    outline-offset: 4px;
}

/* ローディング */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
    color: #FFB6C1;
    font-size: 1em;
}

.loading.show {
    display: block;
}

.loading p {
    margin-top: 12px;
    font-weight: 600;
    color: #6b7280;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #FFB6C1;
    border-right: 4px solid #B0E0E6;
    border-bottom: 4px solid #B8F5B8;
    border-left: 4px solid #FFE5B4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* プログレスバー */
.progress-container {
    max-width: 400px;
    margin: 20px auto 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #FFF0F5;
    border-radius: 0;
    overflow: hidden;
    box-shadow:
        inset 2px 2px 0 rgba(0, 0, 0, 0.1),
        4px 4px 0 rgba(255, 182, 193, 0.3);
    border: 3px solid #FFB6C1;
    transform: rotate(-0.5deg);
}

/* キャンセルボタン */
.cancel-btn {
    padding: 8px 24px;
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.cancel-btn:focus {
    outline: 3px solid rgba(239, 68, 68, 0.3);
    outline-offset: 2px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF6B9D 0%, #FFB6C1 33%, #5BC0DE 66%, #66CC66 100%);
    border-radius: 0;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 1.1em;
    font-weight: 900;
    color: #FF6B9D;
    text-shadow: 1px 1px 0 #FFB6C1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .image-container {
        flex-direction: column;
    }

    .image-box {
        max-width: 100%;
    }

    .pixel-size-buttons {
        gap: 8px;
    }

    .pixel-btn {
        min-width: 55px;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 32px;
    }

    .toggle-row {
        gap: 16px;
    }

    .toggle-item {
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .controls {
        padding: 15px;
    }

    #dropArea {
        padding: 30px 15px;
    }

    .drop-icon {
        font-size: 2.5em;
    }

    .drop-text {
        font-size: 1em;
    }

    .preview-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    #downloadBtn, #resetBtn {
        padding: 12px 30px;
        font-size: 0.95em;
        width: 100%;
        max-width: 300px;
    }
}

/* フッター */
.app-footer {
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.footer-content {
    width: 100%;
}

.footer-text {
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 600;
}

.footer-link {
    color: #FF6B9D;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    transform: rotate(0deg);
}

.footer-link:hover {
    color: #FFB6C1;
    text-decoration: underline;
    transform: rotate(0.5deg) scale(1.05);
}

.footer-links {
    margin-top: 10px;
    font-size: 0.85em;
    font-weight: 600;
    color: #9CA3AF;
}

.footer-links .footer-link {
    font-size: 1em;
}

/* トースト通知 */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    color: #374151;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #B0E0E6;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.success {
    border-left-color: #B8F5B8;
}

.toast.warning {
    border-left-color: #FFE5B4;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease;
}

.toast-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}
