/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 12px;
    color: #333;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

header h1 i {
    margin-right: 6px;
}

.subtitle {
    font-size: 12px;
    color: #999;
    font-weight: 300;
}

/* タイマー表示 */
.timer-display {
    text-align: center;
    margin-bottom: 20px;
}

.current-step {
    margin-bottom: 16px;
}

.step-label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

#currentStepName {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    line-height: 1.3;
}

/* 円形プログレスバー */
.time-circle {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0 auto 16px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 12;
}

.progress-ring-circle {
    fill: none;
    stroke: #667eea;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 942;
    stroke-dashoffset: 942;
    transition: stroke-dashoffset 1s linear;
}

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#timeDisplay {
    font-size: 100px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    margin-bottom: 10px;
}

.time-unit {
    font-size: 20px;
    color: #999;
    font-weight: 300;
}

.step-info {
    font-size: 15px;
    color: #999;
    font-weight: 500;
}

/* コントロールボタン */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 110px;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: 14px;
}

.btn-start {
    background: #667eea;
    color: white;
}

.btn-pause {
    background: #f59e0b;
    color: white;
}

.btn-resume {
    background: #10b981;
    color: white;
}

.btn-next {
    background: #8b5cf6;
    color: white;
}

.btn-reset {
    background: #6b7280;
    color: white;
}

/* 全体の進行状況 */
.overall-progress {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* 施術ステップ一覧 */
.steps-list {
    margin-bottom: 20px;
}

.steps-list h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* スクロールバーのスタイリング */
.steps-container::-webkit-scrollbar {
    width: 6px;
}

.steps-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.steps-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.steps-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step-item.active {
    background: #ede9fe;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.step-item.completed {
    background: #d1fae5;
    border-color: #10b981;
}

.step-item.completed .step-number {
    background: #10b981;
}

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-item.active .step-number {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.step-details {
    flex: 1;
}

.step-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    font-size: 14px;
}

.step-duration {
    font-size: 12px;
    color: #666;
}

.step-status {
    margin-left: auto;
    font-size: 20px;
    color: #10b981;
    flex-shrink: 0;
}

/* メニュー画面 */
.menu-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.menu-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.menu-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.menu-header h1 i {
    margin-right: 8px;
}

.menu-header .subtitle {
    font-size: 14px;
    color: #999;
    font-weight: 300;
    margin-bottom: 20px;
}

.menu-description {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    margin-top: 20px;
}

.menu-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.menu-option {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.menu-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.menu-option:active {
    transform: translateY(-2px);
}

.menu-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.menu-time {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.menu-label {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

/* 戻るボタン */
.back-btn {
    background: #e5e7eb;
    color: #666;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: #d1d5db;
}

.back-btn i {
    font-size: 12px;
}

/* サウンド設定 */
.settings {
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    text-align: center;
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sound-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* レスポンシブデザイン */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .menu-container {
        padding: 30px 20px;
    }

    .menu-header h1 {
        font-size: 24px;
    }

    .menu-description {
        font-size: 15px;
    }

    .menu-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .menu-option {
        padding: 25px 20px;
    }

    .menu-icon {
        font-size: 36px;
    }

    .menu-time {
        font-size: 28px;
    }

    .container {
        padding: 16px;
        border-radius: 16px;
    }

    header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    header h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 11px;
    }

    #currentStepName {
        font-size: 15px;
        min-height: 40px;
    }

    .time-circle {
        width: 300px;
        height: 300px;
    }

    .progress-ring {
        width: 300px;
        height: 300px;
    }

    #timeDisplay {
        font-size: 90px;
    }

    .btn {
        min-width: 95px;
        padding: 13px 16px;
        font-size: 14px;
    }

    .controls {
        gap: 8px;
    }

    .overall-progress {
        padding: 14px;
        margin-bottom: 20px;
    }

    .steps-list {
        margin-bottom: 16px;
    }

    .step-item {
        padding: 12px;
    }

    .steps-container {
        max-height: 350px;
    }
}

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

    .container {
        padding: 14px;
    }

    header h1 {
        font-size: 18px;
    }

    .subtitle {
        font-size: 11px;
    }

    #currentStepName {
        font-size: 14px;
        min-height: 38px;
    }

    .time-circle {
        width: 280px;
        height: 280px;
    }

    .progress-ring {
        width: 280px;
        height: 280px;
    }

    #timeDisplay {
        font-size: 84px;
    }

    .time-unit {
        font-size: 14px;
    }

    .btn {
        min-width: 85px;
        padding: 12px 14px;
        font-size: 13px;
        gap: 5px;
    }

    .step-item {
        padding: 11px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
        margin-right: 10px;
    }

    .step-name {
        font-size: 13px;
    }

    .step-duration {
        font-size: 11px;
    }

    .overall-progress {
        padding: 12px;
    }

    .progress-header {
        font-size: 13px;
    }

    .settings {
        padding: 14px;
    }

    .sound-toggle {
        font-size: 13px;
    }

    .steps-container {
        max-height: 300px;
    }

    .btn i {
        font-size: 13px;
    }
}