* {
    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: 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; }
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.container {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.preview-container {
    position: sticky;
    top: 20px;
}

#preview {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.preview-image-wrapper {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#preview img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .preview-container {
        position: static;
        width: 100%;
    }
    
    .container {
        min-width: auto;
    }
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95em;
}

input[type="text"],
input[type="number"],
input[type="range"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
    resize: vertical;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

select {
    background-color: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    font-weight: 500;
}

select option {
    background-color: #1b263b;
    color: #e2e8f0;
}

input[type="range"] {
    padding: 0;
    height: 8px;
    background: linear-gradient(to right, #60a5fa 0%, #3b82f6 100%);
    outline: none;
    border: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="range"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #60a5fa;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

input[type="color"] {
    width: 100%;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
}

.color-with-transparent {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-with-transparent input[type="color"] {
    flex: 1;
}

.transparent-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    color: #e2e8f0;
    font-size: 14px;
}

.transparent-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#preview img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.preview-title {
    font-size: 18px;
    color: #60a5fa;
    font-weight: 600;
    margin-bottom: 10px;
}

#downloadBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    margin-top: 15px;
}

#downloadBtn:hover {
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.loading {
    text-align: center;
    color: #60a5fa;
    font-weight: 600;
    margin-top: 20px;
}
