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

:root {
    --bg-color: #f5f5f0;
    --text-color: #2c2c2c;
    --accent-color: #8b4513;
    --paper-color: #fefefe;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

main {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: var(--paper-color);
    overflow: hidden;
}

#calligraphyCanvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    touch-action: none;
}

.paper-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        );
    pointer-events: none;
}

.controls {
    padding: 30px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.control-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group label {
    min-width: 120px;
    font-weight: 500;
}

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

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group span {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

button:hover {
    background: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-selector select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-family: inherit;
    cursor: pointer;
}

.instructions {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.95rem;
    background: #f9f9f9;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: #888;
    font-size: 0.9rem;
}

/* 禅モード */
.zen-mode {
    background: #1a1a1a;
}

.zen-mode .container {
    max-width: 100%;
    padding: 0;
}

.zen-mode header,
.zen-mode .controls,
.zen-mode .instructions,
.zen-mode footer {
    display: none;
}

.zen-mode main {
    box-shadow: none;
    border-radius: 0;
    height: 100vh;
}

.zen-mode .canvas-container {
    height: 100vh;
    background: #f5f5f0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .canvas-container {
        height: 400px;
    }
    
    .control-group {
        flex-wrap: wrap;
    }
    
    .control-group label {
        min-width: 100%;
        margin-bottom: 5px;
    }
    
    .button-group {
        flex-wrap: wrap;
    }
    
    button {
        flex: 1;
        min-width: calc(50% - 7.5px);
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
        text-align: center;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.6s ease-out;
}