/* ============================================================
   Athletics Results Manager – Frontend Styles
   ============================================================ */

:root {
    --ar-primary:   #1a56db;
    --ar-success:   #0e9f6e;
    --ar-warning:   #e3a008;
    --ar-danger:    #e02424;
    --ar-flash:     #ff4500;
    --ar-live:      #e02424;
    --ar-gray:      #6b7280;
    --ar-border:    #e5e7eb;
    --ar-bg:        #f9fafb;
    --ar-radius:    6px;
}

/* ── 共通テーブル ─────────────────────────────────────────── */
.ar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: var(--ar-radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.ar-table thead {
    background: #1e3a5f;
    color: #fff;
}

.ar-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: .03em;
    white-space: nowrap;
}

.ar-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--ar-border);
    vertical-align: middle;
}

.ar-table tbody tr:hover {
    background: #f0f7ff;
}

.ar-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── 大会一覧 ────────────────────────────────────────────── */
.ar-competitions-wrap {
    overflow-x: auto;
}

.ar-date {
    white-space: nowrap;
    color: var(--ar-gray);
    font-size: 0.85rem;
}

.ar-comp-name a {
    color: var(--ar-primary);
    text-decoration: none;
    font-weight: 600;
}
.ar-comp-name a:hover { text-decoration: underline; }

.ar-center { text-align: center; }

.ar-dash { color: var(--ar-border); }

/* ── ステータスバッジ ─────────────────────────────────────── */
.ar-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.ar-badge-scheduled { background: #eff6ff; color: #1d4ed8; }
.ar-badge-ongoing   { background: #ecfdf5; color: #065f46; }
.ar-badge-finished  { background: #f3f4f6; color: #374151; }
.ar-badge-unknown   { background: #fef3c7; color: #92400e; }

/* ── 速報バッジ ──────────────────────────────────────────── */
.ar-flash-badge {
    display: inline-block;
    background: var(--ar-flash);
    color: #fff;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    animation: ar-pulse 1.4s ease-in-out infinite;
}

@keyframes ar-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .55; }
}

/* ── ライブ配信ボタン ─────────────────────────────────────── */
.ar-live-btn {
    display: inline-block;
    background: var(--ar-live);
    color: #fff !important;
    text-decoration: none !important;
    padding: 4px 12px;
    border-radius: var(--ar-radius);
    font-size: 0.82rem;
    font-weight: 700;
    transition: opacity .2s;
}
.ar-live-btn:hover { opacity: .82; }

/* ── 結果トグルボタン ─────────────────────────────────────── */
.ar-toggle-results {
    background: var(--ar-primary);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: var(--ar-radius);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background .2s;
}
.ar-toggle-results:hover   { background: #1e429f; }
.ar-toggle-results.ar-open { background: #374151; }

/* ── 結果行（インライン展開） ─────────────────────────────── */
.ar-results-row > td {
    padding: 0 !important;
    background: var(--ar-bg);
}

/* ── 種目タブ ────────────────────────────────────────────── */
.ar-events-tabs { padding: 12px; }

.ar-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 14px 0;
    padding: 0;
}

.ar-tab-item {
    padding: 5px 14px;
    border: 1px solid var(--ar-primary);
    border-radius: 99px;
    color: var(--ar-primary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.ar-tab-item:hover,
.ar-tab-item.ar-active {
    background: var(--ar-primary);
    color: #fff;
}

/* ── 結果テーブル ──────────────────────────────────────────── */
.ar-results-table .ar-rank   { text-align: center; font-weight: 700; width: 50px; }
.ar-results-table .ar-result { font-weight: 700; color: #111; }
.ar-results-table .ar-wind   { color: var(--ar-gray); font-size: 0.85rem; }
.ar-results-table .ar-note   { color: var(--ar-gray); font-size: 0.85rem; }

.ar-flash-row { background: #fff7ed; }

/* ── 速報カード ──────────────────────────────────────────── */
.ar-flash-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

.ar-flash-card {
    border: 2px solid var(--ar-flash);
    border-radius: var(--ar-radius);
    padding: 16px;
    background: #fff;
}

.ar-flash-title {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── 大会詳細ページ ──────────────────────────────────────── */
.ar-results-wrap {
    background: #fff;
    border-radius: var(--ar-radius);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.ar-comp-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ar-comp-meta {
    color: var(--ar-gray);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* ── その他 ─────────────────────────────────────────────── */
.ar-no-data {
    color: var(--ar-gray);
    padding: 1rem;
    text-align: center;
}

/* ── レスポンシブ ────────────────────────────────────────── */
@media (max-width: 600px) {
    .ar-table th:nth-child(5),
    .ar-table td:nth-child(5),
    .ar-table th:nth-child(7),
    .ar-table td:nth-child(7) {
        display: none;
    }
}
