/* 試合データデモ専用のスタイル。共通レイアウトは /handball-apps-site/style.css を継承する。
   見た目はアプリ「ハンド記録」の記録画面（動画 + タップで飛べるタイムライン）と
   iOS grouped list 調のカードに寄せる。 */

/* iOS systemGroupedBackground 風のグレー背景（このページ限定）。 */
body {
    background: #f2f2f7;
}

/* このページは動画から始まるので、共通 main の上パディングを詰める。 */
main {
    padding-top: 12px;
}

/* ── 埋め込み動画（16:9 レスポンシブ）── */
.demo-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 0 0 16px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.demo-video-wrap iframe,
.demo-video-wrap > div {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── 状態 / エラー ── */
.demo-status {
    color: var(--muted);
    font-size: 14px;
    padding: 24px 0;
    text-align: center;
}

.demo-error {
    background: #fdf0f0;
    border: 1px solid #f0c9c9;
    border-radius: 12px;
    padding: 16px 20px;
    color: #a11;
    font-size: 14px;
}

.demo-error .detail {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

/* ── カード（iOS grouped list のセクション）── */
.demo-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin: 0 0 16px;
}

.demo-card > h2 {
    font-size: 1.05rem;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* 各セクションのラベルはカードの外（上）に置いて見た目を揃える。
   左はカード内容（padding 16px）と揃えて iOS のセクション見出し風にする。 */
.section-label {
    font-size: 1.05rem;
    margin: 0 0 8px;
    padding-left: 16px;
    line-height: 1.4;
}

/* タイムラインは高さを制限してカード内でスクロールさせる（動画・スタッツは常に見える）。 */
.timeline-card {
    max-height: 45vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── 得点タイムライン（両サイド + タップで動画へ）── */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline .tl-phase {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    padding: 14px 0 8px;
}

.timeline .tl-goal {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-top: 1px solid var(--border);
}

.timeline .tl-goal.seekable {
    cursor: pointer;
    transition: background 0.12s ease;
}

.timeline .tl-goal.seekable:hover {
    background: #f6f6f8;
}

.timeline .tl-goal .ev {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.timeline .tl-goal .ev.left {
    justify-content: flex-start;
}

.timeline .tl-goal .ev.right {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.timeline .tl-check {
    flex-shrink: 0;
    color: #007aff;
    font-size: 13px;
    font-weight: 700;
}

.timeline .tl-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline .tl-time {
    color: var(--muted);
    font-size: 13px;
    font-feature-settings: "tnum";
    white-space: nowrap;
    text-align: center;
}

/* ── スタッツ表（ラベル列 + 2 チーム列）── */
table.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

table.stat-table th,
table.stat-table td {
    padding: 7px 4px;
}

table.stat-table thead th {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    text-align: left;
}

table.stat-table thead th:first-child {
    width: 5em;
}

table.stat-table tbody th {
    color: var(--muted);
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
}

table.stat-table tbody td {
    text-align: left;
    font-feature-settings: "tnum";
}

table.stat-table tbody tr:not(:last-child) th,
table.stat-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

/* ── App Store への誘導ブロック（アプリでできること訴求）── */
.demo-pitch {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    margin: 24px 0 8px;
}

.demo-pitch h2 {
    font-size: 1.05rem;
    margin: 0 0 8px;
    line-height: 1.4;
}

.demo-pitch ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demo-pitch li {
    position: relative;
    padding: 8px 0 8px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.demo-pitch li:last-child {
    border-bottom: none;
}

.demo-pitch li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%);
}

.demo-pitch strong {
    color: var(--accent-dark);
    font-weight: 700;
}

/* ── アプリ導線 ── */
.demo-cta {
    margin: 20px 0 4px;
    text-align: center;
}
