/* Extracted from onesong/includes/page-onesong-share-reel.php */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    background: #faf6f0;
    color: #2a1a20;
    font-family: 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body { padding: 20px 16px 40px; }

.share-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8dfd0;
}
.share-header__back {
    display: inline-flex; align-items: center; gap: 6px;
    color: #6a4858; text-decoration: none; font-size: 13px;
    margin-bottom: 14px;
}
.share-header h1 {
    font-size: 22px; font-weight: 500;
    font-family: 'Shippori Mincho', serif;
    margin-bottom: 6px; color: #2a1a20;
}
.share-header p { font-size: 13px; color: #6a4858; line-height: 1.6; }

.card-link {
    background: #fff;
    border: 1px solid #e8dfd0;
    border-radius: 10px;
    padding: 14px 18px;
    max-width: 480px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #2a1a20;
}
.card-link:hover { border-color: #d94e7a; }
.card-link__icon { font-size: 28px; }
.card-link__body { flex: 1; }
.card-link__title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.card-link__desc { font-size: 11px; color: #6a4858; }
.card-link__arrow { color: #d94e7a; font-size: 18px; }

.howto {
    background: #fff8e6; border-left: 3px solid #f5c518;
    padding: 14px 18px; border-radius: 8px;
    max-width: 480px; margin: 0 auto 20px;
    font-size: 13px; line-height: 1.7; color: #6a4858;
}
.howto strong { color: #2a1a20; }
.howto ol { padding-left: 20px; margin-top: 6px; }

.preview-area { max-width: 280px; margin: 0 auto 24px; }
.preview-frame {
    width: 100%;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.preview-frame[data-aspect="reel"] { aspect-ratio: 9 / 16; }
.preview-frame[data-aspect="feed"] { aspect-ratio: 4 / 5; }
canvas#preview-canvas { width: 100%; height: 100%; display: block; }
.preview-overlay {
    position: absolute;
    bottom: 12px; left: 12px; right: 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px; color: #fff;
    display: flex; justify-content: space-between; align-items: center;
}
.rec-indicator {
    display: none;
    position: absolute;
    top: 12px; left: 12px;
    background: #dc2743; color: #fff;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 10px; font-weight: 600;
    align-items: center; gap: 6px;
}
.rec-indicator.shown { display: flex; }
.rec-indicator::before {
    content: ''; width: 7px; height: 7px;
    background: #fff; border-radius: 50%;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.section {
    background: #fff;
    border: 1px solid #e8dfd0;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 auto 16px;
    max-width: 480px;
}
.section h3 {
    font-size: 14px; font-weight: 600;
    margin-bottom: 12px; color: #2a1a20;
    display: flex; align-items: center; gap: 8px;
}
.section h3 .num {
    background: #d94e7a; color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.section h3 .badge-new {
    background: #f5c518; color: #2a1a20;
    font-size: 9px; font-weight: 700;
    padding: 2px 8px; border-radius: 50px;
    margin-left: auto;
    letter-spacing: 0.05em;
}
.section .help { font-size: 11px; color: #6a4858; margin-top: 6px; line-height: 1.5; }

/* キャッチコピー */
.catchphrase-input {
    width: 100%;
    padding: 12px 14px;
    background: #faf6f0;
    border: 1.5px solid #e0d4c0;
    border-radius: 8px;
    color: #2a1a20;
    font-size: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    outline: none;
}
.catchphrase-input:focus { border-color: #d94e7a; background: #fff; }
.catchphrase-input::placeholder { color: #b0a090; font-weight: 400; font-size: 14px; }

.catchphrase-counter {
    text-align: right;
    font-size: 11px;
    color: #6a4858;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.catchphrase-counter.warn { color: #c67a00; }

.catchphrase-presets {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 10px;
}
.catchphrase-preset-btn {
    padding: 6px 12px;
    background: #faf6f0;
    border: 1px solid #d94e7a;
    border-radius: 50px;
    color: #d94e7a;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
}
.catchphrase-preset-btn:hover { background: #d94e7a; color: #fff; }

.duration-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duration-preset-btn {
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid #e0d4c0;
    border-radius: 8px;
    color: #2a1a20;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
}
.duration-preset-btn:hover { border-color: #d94e7a; }
.duration-preset-btn.active { background: #d94e7a; border-color: #d94e7a; color: #fff; }
.duration-preset-btn small { display: block; font-size: 11px; opacity: 0.75; margin-top: 3px; }

.audio-box { background: #faf6f0; border-radius: 8px; padding: 12px; }
audio { width: 100%; margin-bottom: 8px; }

.audio-status {
    background: rgba(255,170,77,0.15);
    border: 1px solid rgba(255,170,77,0.3);
    color: #c67a00;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}
.audio-status.ready {
    background: rgba(108,219,138,0.15);
    border-color: rgba(108,219,138,0.3);
    color: #2a7a4a;
}

.range-slider-wrap { margin: 14px 0 8px; position: relative; padding: 0 12px; }
.range-slider { position: relative; height: 32px; margin: 12px 0 4px; }
.range-slider__track {
    position: absolute; left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    height: 4px; background: #e0d4c0; border-radius: 2px;
}
.range-slider__fill {
    position: absolute; top: 50%; left: var(--range-fill-left, 0); width: var(--range-fill-width, 100%); transform: translateY(-50%);
    height: 4px; background: #d94e7a; border-radius: 2px;
    pointer-events: none; opacity: .3;
}
.range-slider__fill.is-ready { opacity: 1; }
.range-slider__handle {
    position: absolute; top: 50%; left: var(--range-handle-left, 0);
    transform: translate(-50%, -50%);
    width: 22px; height: 22px;
    background: #d94e7a; border: 2px solid #fff;
    border-radius: 50%; cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2; touch-action: none;
}
.range-slider__handle:hover { transform: translate(-50%, -50%) scale(1.1); }
.range-slider__handle.start { z-index: 3; }
body.is-range-dragging { user-select: none; }
.range-slider__labels {
    display: flex; justify-content: space-between;
    font-size: 10px; color: #888; margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.range-numeric {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin: 12px 0 8px;
}
.range-numeric label { font-size: 11px; color: #6a4858; display: block; margin-bottom: 4px; }
.range-numeric input[type="number"] {
    width: 100%; padding: 8px 10px;
    background: #fff; border: 1px solid #e0d4c0;
    border-radius: 5px; color: #2a1a20; font-size: 13px;
    font-family: inherit; font-variant-numeric: tabular-nums;
}
.range-info {
    display: flex; justify-content: space-between;
    align-items: center;
    background: rgba(217,78,122,0.1);
    border: 1px solid rgba(217,78,122,0.3);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px; color: #6a4858;
    margin-top: 8px;
}
.range-info strong { color: #d94e7a; }
.range-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.range-buttons button {
    flex: 1; padding: 8px 10px;
    background: #fff; border: 1px solid #d94e7a;
    border-radius: 5px; color: #d94e7a;
    cursor: pointer; font-size: 11px; font-family: inherit;
    min-width: 80px; white-space: nowrap;
}
.range-buttons button:hover { background: #d94e7a; color: #fff; }

.option-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-btn {
    padding: 12px 10px;
    background: #fff;
    border: 1.5px solid #e0d4c0;
    border-radius: 8px;
    color: #2a1a20; cursor: pointer;
    font-size: 13px; font-family: inherit;
    text-align: center;
}
.option-btn:hover { border-color: #d94e7a; }
.option-btn.active { background: #d94e7a; border-color: #d94e7a; color: #fff; font-weight: 600; }
.option-btn small { display: block; font-size: 10px; opacity: 0.7; margin-top: 2px; }

.lyric-blocks {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 300px; overflow-y: auto; padding: 4px;
}
.lyric-block {
    background: #faf6f0; border: 1.5px solid #e0d4c0;
    border-radius: 8px; padding: 12px 14px;
    cursor: pointer; transition: all .15s;
    display: flex; gap: 10px; align-items: flex-start;
}
.lyric-block:hover { border-color: #d94e7a; }
.lyric-block.selected {
    background: rgba(217,78,122,0.05);
    border-color: #d94e7a;
}
.lyric-block input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: #d94e7a; cursor: pointer;
    flex-shrink: 0; margin-top: 2px;
}
.lyric-block__content {
    flex: 1; font-family: 'Shippori Mincho', serif;
    font-size: 13px; line-height: 1.7;
    color: #2a1a20; white-space: pre-wrap;
}
.lyric-block__num {
    font-size: 10px; color: #888;
    margin-bottom: 4px;
    font-family: 'Noto Sans JP', sans-serif;
    letter-spacing: 0.05em;
}
.lyric-actions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.lyric-actions button {
    padding: 5px 10px; background: transparent;
    border: 1px solid #d94e7a; border-radius: 50px;
    color: #d94e7a; font-size: 11px;
    cursor: pointer; font-family: inherit;
}
.lyric-actions button:hover { background: #d94e7a; color: #fff; }
.lyric-info-box { margin-top: 8px; font-size: 11px; color: #6a4858; line-height: 1.5; }
.lyric-info-box strong { color: #d94e7a; }

.checkbox-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
    background: #faf6f0; border-radius: 6px;
    padding: 10px 14px; cursor: pointer; user-select: none;
}
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #d94e7a; cursor: pointer; }
.checkbox-row .label { font-size: 13px; color: #2a1a20; }

.action-buttons { display: flex; flex-direction: column; gap: 8px; }
.action-btn {
    padding: 14px 20px;
    min-height: 44px;
    border: none; border-radius: 50px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-preview { background: #4a8af4; color: #fff; }
.btn-record { background: #dc2743; color: #fff; }
.btn-record.recording { background: #999; animation: pulse 1.5s infinite; }
.status-box {
    background: rgba(108,219,138,0.1);
    border-left: 3px solid #6cdb8a;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 12px; color: #2a7a4a;
    min-height: 44px;
    display: flex; align-items: center;
    margin-top: 10px;
}
.status-box.error { background: rgba(255,107,107,0.1); border-color: #ff6b6b; color: #c63d3d; }
.status-box.warn { background: rgba(255,170,77,0.1); border-color: #ffa94d; color: #c67a00; }

.recorded-result {
    display: none;
    background: #faf6f0;
    border-radius: 10px;
    padding: 14px;
    margin-top: 14px;
}
.recorded-result.shown { display: block; }
.recorded-result video { width: 100%; border-radius: 6px; margin-bottom: 10px; }
.download-btn {
    display: block; width: 100%;
    padding: 14px;
    background: #2a1a20; color: #fff;
    text-align: center; text-decoration: none;
    border-radius: 50px;
    font-weight: 600; font-size: 14px;
}
.ig-btn-result {
    display: block; width: 100%;
    margin-top: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
    color: #fff;
    text-align: center; text-decoration: none;
    border-radius: 50px;
    font-weight: 600; font-size: 14px;
    border: none; cursor: pointer;
    font-family: inherit;
}

.help--preset { margin-top:10px!important; }
.lyric-selector { margin-top:14px; }
.lyric-selector.is-muted { opacity:.4; }
.checkbox-row--flush { margin-top:0!important; }

/* Accessibility: stable touch targets and keyboard focus */
.card-link,
.catchphrase-preset-btn,
.duration-preset-btn,
.range-buttons button,
.option-btn,
.lyric-actions button,
.checkbox-row,
.action-btn,
.download-btn,
.ig-btn-result {
    min-height: 44px;
}

.catchphrase-preset-btn,
.range-buttons button,
.lyric-actions button {
    min-width: 44px;
}

.card-link:focus-visible,
.catchphrase-preset-btn:focus-visible,
.duration-preset-btn:focus-visible,
.range-buttons button:focus-visible,
.option-btn:focus-visible,
.lyric-actions button:focus-visible,
.checkbox-row:focus-within,
.action-btn:focus-visible,
.download-btn:focus-visible,
.ig-btn-result:focus-visible {
    outline: 3px solid rgba(217, 78, 122, .85);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}

