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

:root {
    --primary-color: #0066ff;
    --secondary-color: #00d4ff;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a2a;
    --warning-bg: #ff3333;
    --success-bg: #00cc66;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ヘッダー */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2rem 0;
    box-shadow: 0 2px 20px rgba(0, 102, 255, 0.3);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* メインコンテンツ */
.main {
    flex: 1;
    padding: 3rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.warning-box {
    background-color: rgba(255, 51, 51, 0.1);
    border: 1px solid var(--warning-bg);
    border-radius: 8px;
    padding: 1rem;
    display: inline-block;
}

.warning-box p {
    color: #ff6666;
    margin: 0;
    font-weight: 500;
}

/* コントロールパネル */
.control-panel {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.control-panel > div {
    margin-bottom: 2rem;
}

.control-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* パターンボタン */
.pattern-buttons,
.area-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.pattern-btn,
.area-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.pattern-btn:hover,
.area-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.pattern-btn.active,
.area-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: white;
    font-weight: 500;
}

/* スピードコントロール */
.speed-control {
    text-align: center;
}

#speedSlider {
    width: 100%;
    max-width: 400px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    margin: 1rem 0;
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
}

#speedSlider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
}

#speedValue {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #3a3a3a;
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* タイマー */
.timer {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.timer span {
    color: var(--primary-color);
    font-weight: 600;
}

/* 説明セクション */
.instructions {
    margin-top: 3rem;
}

.instructions .container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
}

.instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.instructions ol {
    list-style: none;
    counter-reset: step-counter;
}

.instructions li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.info-box {
    background-color: rgba(0, 102, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-box p {
    color: var(--text-secondary);
    margin: 0;
}

/* フッター */
.footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-selector select {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

/* キャンバス */
.heal-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

/* カスタムエリア */
.custom-area {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border: 2px dashed var(--primary-color);
    background-color: rgba(0, 102, 255, 0.1);
    display: none;
    cursor: move;
    z-index: 1000;
}

.custom-area p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-weight: 500;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: nwse-resize;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .pattern-buttons,
    .area-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 1rem;
    }
}