/* Extracted from onesong/includes/page-onesong-share-card.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;
    overflow-x: hidden;
}
body { padding: 20px 16px 120px; }

/* ===== ヘッダー ===== */
.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;
}

/* ===== 動画リンク(誘導) ===== */
.reel-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;
    transition: border-color .15s;
}
.reel-link:hover { border-color: #d94e7a; }
.reel-link__icon { font-size: 28px; }
.reel-link__body { flex: 1; }
.reel-link__title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.reel-link__desc { font-size: 11px; color: #6a4858; }
.reel-link__arrow { color: #d94e7a; font-size: 18px; }

/* ===== デザイン選択 ===== */
.design-picker { margin-bottom: 24px; }
.design-picker__label {
    font-size: 13px; color: #6a4858; margin-bottom: 10px;
    text-align: center;
}
.design-picker__buttons {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; max-width: 480px; margin: 0 auto;
}
.design-btn {
    position: relative;
    padding: 12px 8px; background: #fff; border: 1.5px solid #e0d4c0;
    border-radius: 10px; cursor: pointer; text-align: center;
    font-family: inherit; font-size: 13px; color: #2a1a20;
    transition: all .2s;
}
.design-btn:hover { border-color: #d94e7a; }
.design-btn.active {
    background: #d94e7a; border-color: #d94e7a; color: #fff;
}
.design-btn__badge {
    position: absolute; top: -8px; right: -8px;
    background: #f5c518; color: #2a1a20;
    font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
    padding: 2px 8px; border-radius: 50px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ===== 使い方 ===== */
.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; }

/* ===== 選択カウンター ===== */
.selection-info {
    background: #fff;
    border: 1px solid #e8dfd0;
    border-radius: 10px;
    padding: 12px 18px;
    max-width: 480px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.selection-info__count {
    color: #2a1a20;
    font-weight: 600;
}
.selection-info__count strong { color: #d94e7a; font-size: 16px; }
.selection-info__warn {
    color: #d94e7a;
    font-size: 11px;
    font-weight: 600;
}
.selection-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.selection-actions button {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #d94e7a;
    border-radius: 50px;
    color: #d94e7a;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.selection-actions button:hover { background: #d94e7a; color: #fff; }

/* ===== カードプレビュー ===== */
.cards-preview {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 30px;
}
.card-block {
    margin-bottom: 20px;
    width: 100%;
    position: relative;
}

/* チェックボックス */
.card-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}
.card-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.card-checkbox input {
    width: 18px; height: 18px;
    accent-color: #d94e7a;
    cursor: pointer;
}
.card-checkbox__label {
    font-size: 12px;
    color: #6a4858;
}
.card-label-num {
    font-size: 11px;
    color: #999;
}

/* 未選択カードはグレーアウト */
.card-block.unselected .ig-card-wrap {
    opacity: 0.35;
    transition: opacity .2s;
}
.card-block.unselected .card-label-num::after {
    content: ' (除外)';
    color: #c66;
}

/* === カード本体 === */
.ig-card-wrap {
    width: 100%;
    max-width: 360px;
    height: var(--card-wrap-height, auto);
    margin: 0 auto;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    background: #f0e8d8;
}
.ig-card {
    position: absolute;
    top: 0; left: 0;
    width: 1080px;
    height: 1350px;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    overflow: hidden;
    transform-origin: top left;
    transform: scale(var(--card-scale, 0.001));
}
.ig-card.is-capturing {
    transform: scale(1);
    position: fixed;
    top: -99999px;
    left: 0;
}

#selected-count.is-over-limit {
    color: #c66;
}

/* テーマ変数 */
:root {
    --bg: #faf6f0;
    --ink: #2a1a20;
    --ink-soft: #6a4858;
    --accent: #d94e7a;
    --accent-soft: #f4c8d4;
    --font: 'Shippori Mincho', serif;
}
body[data-pattern="simple"] {
    --bg: #ffffff;
    --ink: #1a1a1a;
    --ink-soft: #888888;
    --accent: #1a1a1a;
    --accent-soft: #d0d0d0;
    --font: 'Noto Sans JP', sans-serif;
}
body[data-pattern="editorial"] {
    --bg: #f1ece1;
    --ink: #2a241c;
    --ink-soft: #8a7e6c;
    --accent: #b8714a;
    --accent-soft: #d4a578;
    --font: 'Shippori Mincho', serif;
}
body[data-pattern="classic"] {
    --bg: #faf6f0;
    --ink: #2a1a20;
    --ink-soft: #6a4858;
    --accent: #d94e7a;
    --accent-soft: #f4c8d4;
    --font: 'Shippori Mincho', serif;
}

/* ===== カバーカード ===== */
.ig-card.cover { padding: 0; }
.cover-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.cover-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.75) 100%);
}
.cover-brand {
    position: absolute; top: 56px; left: 56px;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3em;
    font-family: 'Noto Sans JP', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.cover-sub {
    position: absolute; left: 56px; right: 56px;
    bottom: 200px;
    color: rgba(255,255,255,0.9);
    font-size: 28px;
    letter-spacing: 0.15em;
    font-family: 'Noto Sans JP', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.cover-title {
    position: absolute; bottom: 90px; left: 56px; right: 56px;
    color: #fff;
    font-size: 60px;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
body[data-pattern="simple"] .cover-brand { font-weight: 500; letter-spacing: 0.25em; }
body[data-pattern="editorial"] .cover-brand { font-family: var(--font); font-weight: 500; letter-spacing: 0.2em; }
body[data-pattern="editorial"] .cover-title { font-family: var(--font); }
body[data-pattern="classic"] .cover-title { font-family: var(--font); }

/* ===== 歌詞カード ===== */
.ig-card.lyric { padding: 100px 100px; }

body[data-pattern="simple"] .ig-card.lyric .l-brand {
    position: absolute; top: 56px; left: 56px;
    font-size: 18px; font-weight: 500; letter-spacing: 0.3em;
    color: var(--ink);
}
body[data-pattern="simple"] .ig-card.lyric .l-no {
    position: absolute; top: 56px; right: 56px;
    font-size: 14px; color: var(--ink-soft); letter-spacing: 0.1em;
}
body[data-pattern="simple"] .ig-card.lyric .l-text {
    position: absolute; inset: 200px 100px 180px;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: 48px; line-height: 2.0; letter-spacing: 0.04em;
    font-weight: 400; white-space: pre-wrap;
}
body[data-pattern="simple"] .ig-card.lyric .l-divider {
    position: absolute; bottom: 110px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 1px;
    background: var(--accent-soft);
}

body[data-pattern="editorial"] .ig-card.lyric .l-brand {
    position: absolute; top: 70px; left: 80px;
    font-size: 16px; font-weight: 500; letter-spacing: 0.3em;
    color: var(--ink-soft);
    font-family: 'Noto Sans JP', sans-serif;
}
body[data-pattern="editorial"] .ig-card.lyric .l-no {
    position: absolute; top: 70px; right: 90px;
    font-size: 100px; font-weight: 300; color: var(--accent);
    line-height: 1;
}
body[data-pattern="editorial"] .ig-card.lyric .l-text {
    position: absolute; left: 160px; right: 100px; top: 220px; bottom: 200px;
    display: flex; align-items: center;
    border-left: 1px solid var(--accent);
    padding-left: 60px;
    font-size: 50px; line-height: 1.9; letter-spacing: 0.05em;
    white-space: pre-wrap;
}
body[data-pattern="editorial"] .ig-card.lyric .l-divider {
    position: absolute; bottom: 110px; left: 80px; right: 80px;
    border-bottom: 1px solid var(--accent-soft);
}
body[data-pattern="editorial"] .ig-card.lyric .l-divider::after {
    content: 'LYRICS';
    position: absolute; bottom: -18px; left: 50%;
    transform: translateX(-50%);
    background: var(--bg); padding: 0 18px;
    font-size: 14px; letter-spacing: 0.4em; color: var(--ink-soft);
    font-family: 'Noto Sans JP', sans-serif;
}

body[data-pattern="classic"] .ig-card.lyric .l-brand {
    position: absolute; top: 60px; left: 70px;
    font-size: 20px; font-weight: 700; letter-spacing: 0.25em;
    color: var(--accent);
    font-family: 'Noto Sans JP', sans-serif;
}
body[data-pattern="classic"] .ig-card.lyric .l-no {
    position: absolute; top: 60px; right: 70px;
    font-size: 18px; color: var(--ink-soft); letter-spacing: 0.15em;
    font-family: 'Noto Sans JP', sans-serif;
}
body[data-pattern="classic"] .ig-card.lyric .l-text {
    position: absolute; inset: 200px 110px 180px;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: 50px; line-height: 2.0; letter-spacing: 0.06em;
    font-weight: 500; white-space: pre-wrap;
}
body[data-pattern="classic"] .ig-card.lyric .l-divider {
    position: absolute; bottom: 130px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 1px;
    background: var(--accent);
}
body[data-pattern="classic"] .ig-card.lyric .l-divider::before,
body[data-pattern="classic"] .ig-card.lyric .l-divider::after {
    content: '';
    position: absolute; top: 50%;
    width: 7px; height: 7px;
    transform: translateY(-50%) rotate(45deg);
    background: var(--accent);
}
body[data-pattern="classic"] .ig-card.lyric .l-divider::before { left: -20px; }
body[data-pattern="classic"] .ig-card.lyric .l-divider::after { right: -20px; }

/* ===== クレジット ===== */
.card-credit {
    position: absolute; bottom: 36px; left: 0; right: 0;
    text-align: center;
    font-size: 18px; letter-spacing: 0.15em;
    color: var(--ink-soft); opacity: 0.6;
    font-family: 'Noto Sans JP', sans-serif;
}
body[data-pattern="simple"] .card-credit { color: #888; }
body[data-pattern="editorial"] .card-credit { color: var(--ink-soft); }
body[data-pattern="classic"] .card-credit { color: var(--accent); opacity: 0.55; }
.ig-card.cover .card-credit {
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    opacity: 1;
}

/* ===== アクションバー ===== */
.action-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.96);
    border-top: 1px solid #e8dfd0;
    padding: 14px 16px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.action-bar__inner {
    max-width: 480px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.action-btn {
    padding: 14px 16px;
    border: none; border-radius: 50px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: opacity .2s, transform .15s;
}
.action-btn:active { transform: scale(0.97); }
.action-btn--save { background: #2a1a20; color: #fff; }
.action-btn--save:hover { opacity: 0.9; }
.action-btn--ig {
    background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
    color: #fff;
}
.action-btn--ig:hover { opacity: 0.9; }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Accessibility: stable touch targets and keyboard focus */
.reel-link,
.design-btn,
.selection-actions button,
.card-checkbox,
.action-btn {
    min-height: 44px;
}

.selection-actions button,
.card-checkbox {
    min-width: 44px;
}

.reel-link:focus-visible,
.design-btn:focus-visible,
.selection-actions button:focus-visible,
.card-checkbox:focus-within,
.action-btn:focus-visible {
    outline: 3px solid rgba(217, 78, 122, .85);
    outline-offset: 3px;
}

.status-line {
    text-align: center; font-size: 12px; color: #6a4858;
    margin-top: 8px; min-height: 16px;
}

#share-toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #2a1a20; color: #fff;
    padding: 12px 24px; border-radius: 50px;
    font-size: 13px; z-index: 99999;
    transition: transform .3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#share-toast.show { transform: translateX(-50%) translateY(0); }

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

