* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 10px;
    background: linear-gradient(27deg, #fff7f3 0%, #574c46 100%);
    color: #f5e6d3;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

h1 {
    margin-bottom: 5px;
    color: #f4d9b8;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: clamp(1.5rem, 5vw, 2rem);
    text-align: center;
}

.subtitle {
    color: #c9a876;
    margin-bottom: 20px;
    font-style: italic;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 650px;
    padding: 0 10px;
}

.canvas-container {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.5),
        inset 0 0 20px rgba(0,0,0,0.3);
    background: radial-gradient(circle, #1a0f08 0%, #0d0705 100%);
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    max-width: 600px;
    max-height: 600px;
}

/* カップの縁（輪っか）を追加 */
.canvas-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 40px solid #ddd;
    box-shadow:
        inset 0 -5px 10px rgba(0,0,0,0.5),
        inset 0 5px 10px rgba(100,80,60,0.3),
        0 0 0 3px rgba(201, 168, 118, 0.4);
    pointer-events: none;
}

canvas {
    display: block;
    cursor: crosshair;
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

.controls {
    background: rgba(74, 44, 26, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(201, 168, 118, 0.3);
    width: 100%;
    max-width: 500px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
}

label {
    font-size: 12px;
    color: #c9a876;
}

input[type="range"] {
    width: 100%;
    min-width: 120px;
    accent-color: #c9a876;
}

button {
    background: linear-gradient(135deg, #c9a876 0%, #a88a5e 100%);
    color: #2c1810;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 14px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 168, 118, 0.5);
}

button:active {
    transform: translateY(0);
}

.info {
    font-size: 14px;
    color: #c9a876;
    text-align: center;
    max-width: 90%;
    margin-bottom: 10px;
    padding: 0 10px;
}

.value-display {
    color: #f4d9b8;
    font-weight: bold;
}

.presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
}

.preset-btn {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 3px;
    }

    .info {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .container {
        gap: 10px;
    }

    .controls {
        padding: 10px;
        gap: 10px;
    }

    .control-group {
        min-width: 120px;
    }

    label {
        font-size: 11px;
    }

    button {
        padding: 10px 20px;
        font-size: 13px;
    }

    .preset-btn {
        min-width: 120px;
    }

    /* スマホ表示でも輪っかを適切に表示 */
    .canvas-container::after {
        border-width: 10px;
    }
}