* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #1b263b 50%, #0f172a 100%);
    min-height: 100vh;
    padding: 70px 20px 20px 20px;
    position: relative;
    color: white;
}

/* 背景の星のアニメーション */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.4), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 3s infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: bold;
    color: #f1f5f9;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 4px 6px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #60a5fa, #3b82f6, #60a5fa);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.preview-section {
    flex: 0 0 400px;
    position: sticky;
    top: 90px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.canvas-wrapper {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#iconCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.download-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.control-section {
    flex: 1;
    min-width: 400px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.2);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.control-section::-webkit-scrollbar {
    width: 8px;
}

.control-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.control-section::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.control-section::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

.control-section h3 {
    margin-bottom: 20px;
    color: #f1f5f9;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-title {
    margin: 0 0 15px 0;
    padding: 0;
    color: #60a5fa;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.form-group {
    margin-bottom: 20px;
}

.settings-section .form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #cbd5e1;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.form-group input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.form-group select:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

/* selectのオプションもダークテーマに */
.form-group select option {
    background: #1e293b;
    color: white;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.clear-image-btn {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-image-btn:hover {
    background: rgba(239, 68, 68, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.color-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 45px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
}

.color-input-group input[type="text"] {
    flex: 1;
}

.form-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(59, 130, 246, 0.2);
    outline: none;
    cursor: pointer;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.preset-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(59, 130, 246, 0.2);
}

.preset-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 10px 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
    color: white;
}

.gradient-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gradient-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    min-width: 80px;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}

.gradient-btn.active {
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.2);
}

.gradient-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .preview-section {
        position: static;
        flex: 1;
        width: 100%;
    }

    .control-section {
        max-height: none;
        overflow-y: visible;
    }
}
