* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5em;
    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%; }
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.mode-btn {
    padding: 10px 30px;
    font-size: 16px;
    border: 2px solid rgba(96, 165, 250, 0.5);
    background: rgba(15, 23, 42, 0.6);
    color: #60a5fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.mode-btn.active {
    background: rgba(59, 130, 246, 0.8);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
    border-color: #60a5fa;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.format-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.format-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.minify-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.minify-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.copy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.clear-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.clear-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.editor-section {
    display: flex;
    flex-direction: column;
}

.editor-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(241, 245, 249, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    backdrop-filter: blur(4px);
}

textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.3);
}

textarea::placeholder {
    color: rgba(226, 232, 240, 0.4);
}

.error-message {
    color: #fecaca;
    padding: 12px;
    background: rgba(127, 29, 29, 0.6);
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.success-message {
    color: #bbf7d0;
    padding: 12px;
    background: rgba(20, 83, 45, 0.6);
    border-left: 4px solid #10b981;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .editor-wrapper {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
}
