/* ═══════════════════════════════════════════════════════════
   睡眠サイクル逆算＆起床アラーム計算機 — styles
   prefix: sc-
═══════════════════════════════════════════════════════════ */

.sc-container {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1f2937;
}

/* ── Feature Banner ── */
.sc-feature-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1.5px solid #a5b4fc;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
}

.sc-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sc-feature-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.sc-feature-item strong {
    font-size: 13px;
    font-weight: 700;
    color: #3730a3;
    display: block;
    margin-bottom: 2px;
}

.sc-feature-item p {
    font-size: 12px;
    color: #4f46e5;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .sc-feature-banner {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Step Cards ── */
.sc-step-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.sc-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #a5b4fc;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 0.4px;
}

.sc-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

/* ── Mode Toggle ── */
.sc-mode-wrap {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.sc-mode-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #6b7280;
    transition: all 0.2s;
    text-align: center;
}

.sc-mode-btn.active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Time Picker ── */
.sc-time-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.sc-time-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    min-width: 80px;
}

.sc-time-select {
    flex: 1;
    padding: 14px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 800;
    font-family: inherit;
    color: #1e1b4b;
    background: #fafafa;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s;
    cursor: pointer;
}

.sc-time-select:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
}

.sc-time-colon {
    font-size: 28px;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1;
    padding: 0 2px;
}

/* ── Slider ── */
.sc-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sc-slider-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
    min-width: 80px;
}

.sc-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e0e7ff;
    border-radius: 3px;
    outline: none;
}

.sc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.sc-slider-value {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    min-width: 40px;
    text-align: right;
}

/* ── Buttons ── */
.sc-btn-calc {
    display: block;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transition: opacity 0.2s, transform 0.1s;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
    text-align: center;
    box-sizing: border-box;
}

.sc-btn-calc:hover {
    opacity: 0.9;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.sc-btn-calc:active {
    transform: scale(0.98);
}

.sc-btn-now {
    display: block;
    width: 100%;
    padding: 14px;
    background: #1e1b4b;
    color: #e0e7ff;
    border: 2px solid #4f46e5;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.15s;
    box-sizing: border-box;
}

.sc-btn-now:hover {
    background: #312e81;
    border-color: #818cf8;
}

/* Share button */
.sc-btn-share {
    display: block;
    width: 100%;
    padding: 14px;
    background: transparent;
    color: #6366f1;
    border: 2px solid #a5b4fc;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.15s;
    box-sizing: border-box;
    margin-top: 12px;
}

.sc-btn-share:hover {
    background: #eef2ff;
    border-color: #6366f1;
}

/* ── Share Preview ── */
.sc-share-preview {
    margin-top: 16px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.sc-share-hint {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    margin: 0 0 12px;
    line-height: 1.4;
}

.sc-share-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto 16px;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.sc-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.sc-btn-copy-img,
.sc-btn-download {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    flex: 1;
    min-width: 140px;
}

.sc-btn-copy-img {
    background: #eef2ff;
    color: #4f46e5;
    border: 1.5px solid #a5b4fc;
}

.sc-btn-download {
    background: #10b981;
    color: white;
}

.sc-btn-copy-img:hover {
    background: #e0e7ff;
}

.sc-btn-download:hover {
    background: #059669;
}

/* ── Results ── */
.sc-results-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    border: 1.5px solid #e5e7eb;
    position: relative;
    user-select: none;
}

.sc-result-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sc-result-card:active {
    transform: scale(0.99);
}

.sc-result-card.best {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #a5b4fc;
}

.sc-result-card.good {
    background: #f0fdf4;
    border-color: #86efac;
}

.sc-result-card.ok {
    background: #fffbeb;
    border-color: #fcd34d;
}

.sc-result-card.short,
.sc-result-card.nap,
.sc-result-card.micro {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.8;
}

.sc-result-medal {
    font-size: 22px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.sc-result-time {
    font-size: 28px;
    font-weight: 800;
    color: #1e1b4b;
    min-width: 80px;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.sc-result-card.short .sc-result-time,
.sc-result-card.nap .sc-result-time,
.sc-result-card.micro .sc-result-time {
    color: #6b7280;
    font-size: 22px;
}

.sc-result-meta {
    flex: 1;
}

.sc-result-cycles {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.sc-result-note {
    font-size: 13px;
    font-weight: 700;
    color: #4f46e5;
    margin-top: 2px;
}

.sc-result-card.good .sc-result-note {
    color: #059669;
}

.sc-result-card.ok .sc-result-note {
    color: #d97706;
}

.sc-result-card.short .sc-result-note,
.sc-result-card.nap .sc-result-note,
.sc-result-card.micro .sc-result-note {
    color: #9ca3af;
}

.sc-copy-hint {
    font-size: 11px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* ── Toast ── */
.sc-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e1b4b;
    color: #e0e7ff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, opacity 0.25s;
    opacity: 0;
    z-index: 9999;
    white-space: nowrap;
}

.sc-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Sleep Stage Chart ── */
.sc-chart-section {
    margin-top: 20px;
}

.sc-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 10px;
}

.sc-chart-wrap {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 14px;
    padding: 16px 12px 10px;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.sc-chart-ylabel-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 2px 0;
    flex-shrink: 0;
}

.sc-chart-ylabel-col span {
    font-size: 10px;
    color: #a5b4fc;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.sc-chart-canvas {
    width: 100%;
    display: block;
    border-radius: 4px;
}

.sc-chart-legend {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sc-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #a5b4fc;
    font-weight: 600;
}

.sc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sc-chart-xaxis {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 2px;
}

.sc-chart-xlabel {
    font-size: 10px;
    color: #818cf8;
}

/* ── Sleep Tip ── */
.sc-tip-box {
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.sc-tip-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.2;
}

.sc-tip-text {
    font-size: 13px;
    color: #3730a3;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

/* ── Input Label ── */
.sc-input-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 6px;
    display: block;
}

/* ── Section Title ── */
.sc-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .sc-result-time {
        font-size: 22px;
        min-width: 65px;
    }

    .sc-result-card.short .sc-result-time,
    .sc-result-card.nap .sc-result-time,
    .sc-result-card.micro .sc-result-time {
        font-size: 18px;
    }

    .sc-mode-btn {
        font-size: 12px;
        padding: 10px 6px;
    }

    .sc-time-select {
        font-size: 18px;
        padding: 12px 8px;
    }
}