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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

h1 {
    font-size: 3em;
    font-weight: 700;
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.subtitle {
    font-size: 1.2em;
    color: #999;
    margin-bottom: 20px;
}

.language-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    padding: 5px 15px;
    background: #222;
    border: 1px solid #444;
    color: #999;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: #333;
    color: #fff;
}

.lang-btn.active {
    background: #3a86ff;
    color: #fff;
    border-color: #3a86ff;
}

.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.warning-box, .how-to-use {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #333;
}

.warning-box {
    border-color: #ff006e;
    background: rgba(255, 0, 110, 0.05);
}

.warning-box h3 {
    color: #ff006e;
    margin-bottom: 10px;
}

.warning-box ul {
    list-style: none;
    padding-left: 20px;
}

.warning-box li {
    margin-bottom: 8px;
    position: relative;
}

.warning-box li:before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #ff006e;
}

.how-to-use h3 {
    color: #3a86ff;
    margin-bottom: 10px;
}

.how-to-use ol {
    padding-left: 25px;
}

.how-to-use li {
    margin-bottom: 8px;
}

.control-section {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #333;
    margin-bottom: 30px;
}

.pattern-selector h3 {
    margin-bottom: 20px;
    color: #fff;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.pattern-btn {
    background: #222;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.pattern-btn:hover {
    border-color: #3a86ff;
    transform: translateY(-2px);
}

.pattern-btn.active {
    border-color: #3a86ff;
    background: rgba(58, 134, 255, 0.1);
}

.pattern-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 5px;
    background: #333;
}

.pattern-preview.rapid-rgb {
    background: linear-gradient(to right, #ff0000, #00ff00, #0000ff);
}

.pattern-preview.color-cycle {
    background: conic-gradient(from 0deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.pattern-preview.strobe {
    background: repeating-linear-gradient(45deg, #fff 0, #fff 5px, #000 5px, #000 10px);
}

.pattern-preview.sweep {
    background: linear-gradient(to right, #000, #fff, #000);
}

.pattern-btn span {
    display: block;
    color: #ccc;
    font-size: 0.9em;
}

.settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    min-width: 60px;
    color: #999;
}

.setting-item input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3a86ff;
    border-radius: 50%;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3a86ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.setting-item span {
    min-width: 40px;
    text-align: right;
    color: #fff;
}

.control-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.primary-btn, .secondary-btn, .success-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.primary-btn {
    background: #3a86ff;
    color: #fff;
}

.primary-btn:hover:not(:disabled) {
    background: #2a76ef;
    transform: translateY(-2px);
}

.secondary-btn {
    background: #444;
    color: #fff;
}

.secondary-btn:hover:not(:disabled) {
    background: #555;
}

.success-btn {
    background: #00c896;
    color: #fff;
}

.success-btn:hover {
    background: #00b385;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer {
    text-align: center;
    font-size: 1.2em;
    color: #999;
}

#timer-display {
    color: #fff;
    font-weight: bold;
    font-family: monospace;
    font-size: 1.3em;
}

.canvas-section {
    position: relative;
    margin-bottom: 30px;
}

#repair-canvas {
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 10px;
    border: 1px solid #333;
}

#canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    cursor: pointer;
}

#canvas-overlay.hidden {
    display: none;
}

#canvas-overlay p {
    color: #fff;
    font-size: 1.2em;
    margin: 5px;
}

#canvas-overlay p:first-child {
    font-size: 1.5em;
    font-weight: bold;
}

.stats-section {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #333;
    margin-bottom: 30px;
    text-align: center;
}

.stats-section h3 {
    margin-bottom: 20px;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background: #222;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #444;
}

.stat-label {
    display: block;
    color: #999;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #fff;
    font-size: 1.8em;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #333;
    color: #666;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .info-section {
        grid-template-columns: 1fr;
    }
    
    .settings {
        grid-template-columns: 1fr;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .control-buttons {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 2em;
    }
}