/*
Freak's Courtside — フロント共通CSS。
配色: 黒・チャコール・白を基調、オレンジをアクセント。LIVEのみ赤。
全クラスは .bf-cs 配下のみ（既存サイトへ漏れ出さない）。
*/

.bf-cs {
	--bf-cs-black: #0b0b0d;
	--bf-cs-charcoal: #1c1c20;
	--bf-cs-charcoal-2: #2a2a30;
	--bf-cs-white: #ffffff;
	--bf-cs-offwhite: #f7f7f8;
	--bf-cs-border: #e2e2e6;
	--bf-cs-text: #17171a;
	--bf-cs-text-muted: #5c5c66;
	--bf-cs-orange: #ff7a1a;
	--bf-cs-orange-dark: #c85e10;
	--bf-cs-red: #e0182c;
	--bf-cs-focus: #ff7a1a;
	box-sizing: border-box;
	color: var(--bf-cs-text);
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 16px 40px;
}
.bf-cs *, .bf-cs *::before, .bf-cs *::after { box-sizing: inherit; }
.bf-cs a { color: inherit; }
.bf-cs :focus-visible {
	outline: 3px solid var(--bf-cs-focus);
	outline-offset: 2px;
}
.bf-cs-visually-hidden {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

.bf-cs-previewbar {
	background: var(--bf-cs-orange);
	color: #221200;
	font-weight: 700;
	text-align: center;
	padding: 8px 12px;
	border-radius: 8px;
	margin: 12px 0;
	font-size: 13px;
}

/* ---------- ハブ ---------- */

.bf-cs-hero {
	background: linear-gradient(135deg, var(--bf-cs-black), var(--bf-cs-charcoal));
	color: var(--bf-cs-white);
	border-radius: 16px;
	padding: 36px 24px;
	margin: 16px 0 28px;
	text-align: center;
}
.bf-cs-hero__eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	letter-spacing: .18em;
	font-weight: 700;
	color: var(--bf-cs-orange);
}
.bf-cs-hero__title {
	margin: 0 0 10px;
	font-size: clamp(28px, 6vw, 44px);
	font-weight: 800;
	letter-spacing: .01em;
}
.bf-cs-hero__copy {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
}
.bf-cs-hero__copy-en {
	margin: 4px 0 0;
	font-size: 13px;
	color: #cfcfd6;
}

.bf-cs-gamelist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.bf-cs-loading, .bf-cs-empty { text-align: center; padding: 40px 12px; color: var(--bf-cs-text-muted); }

.bf-cs-card {
	background: var(--bf-cs-white);
	border: 1px solid var(--bf-cs-border);
	border-radius: 14px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-decoration: none;
}
.bf-cs-card__status { display: flex; align-items: center; justify-content: space-between; }
.bf-cs-card__time { font-size: 13px; color: var(--bf-cs-text-muted); }
.bf-cs-card__matchup { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px; }
.bf-cs-vs { color: var(--bf-cs-text-muted); font-size: 12px; font-weight: 600; }
.bf-cs-card__score { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; }
.bf-cs-card__meta { font-size: 13px; color: var(--bf-cs-text-muted); text-align: center; }
/*
 * Cocoonテーマの記事内リンク色（特に a:visited）が、通常状態・訪問済み状態で
 * 想定外の暗い文字色を割り当てて黒背景と重なり「真っ黒で読めない」状態を作っていた。
 * :link/:visited/:hover/:focus-visible/:active のすべてを明示し、詳細度で負けないよう
 * background-color/colorに !important を付ける（テーマ側CSSと衝突しうる箇所のみ、
 * 限定的に使用）。ボタンはオレンジ背景＋濃い文字色を基本とし、hover/focus/active時のみ
 * 濃いオレンジ＋白文字にして押下状態を分かりやすくする。
 */
.bf-cs-card__cta,
.bf-cs-card__cta:link,
.bf-cs-card__cta:visited {
	display: block; text-align: center;
	background-color: var(--bf-cs-orange) !important;
	color: #1a0e00 !important;
	border-radius: 10px; padding: 12px; font-weight: 800; text-decoration: none;
	min-height: 44px; line-height: 20px; border: none;
}
.bf-cs-card__cta:hover,
.bf-cs-card__cta:focus-visible,
.bf-cs-card__cta:active {
	background-color: var(--bf-cs-orange-dark) !important;
	color: #fff !important;
}
.bf-cs-card__cta:focus-visible {
	outline: 3px solid var(--bf-cs-black);
	outline-offset: 2px;
}

.bf-cs-badge {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 11px; font-weight: 800; letter-spacing: .06em;
	padding: 4px 10px; border-radius: 999px;
	background: var(--bf-cs-offwhite); color: var(--bf-cs-text-muted);
	border: 1px solid var(--bf-cs-border);
}
.bf-cs-badge[data-status="open"] { color: var(--bf-cs-orange-dark); border-color: var(--bf-cs-orange); background: #fff3ea; }
.bf-cs-badge[data-status="live"] {
	color: #fff; background: var(--bf-cs-red); border-color: var(--bf-cs-red);
}
.bf-cs-badge[data-status="live"]::before {
	content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff;
	animation: bf-cs-pulse 1.4s ease-in-out infinite;
}
.bf-cs-badge[data-status="final"] { color: #fff; background: var(--bf-cs-charcoal); border-color: var(--bf-cs-charcoal); }
.bf-cs-badge[data-status="archived"] { color: var(--bf-cs-text-muted); }
.bf-cs-badge[data-status="suspended"] { color: #fff; background: var(--bf-cs-orange-dark); border-color: var(--bf-cs-orange-dark); }
.bf-cs-badge[data-status="postponed"],
.bf-cs-badge[data-status="delayed"] { color: var(--bf-cs-orange-dark); border-color: var(--bf-cs-orange); background: #fff3ea; }
.bf-cs-badge[data-status="canceled"] { color: var(--bf-cs-text-muted); background: var(--bf-cs-offwhite); text-decoration: line-through; }
.bf-cs-card__lifecycle,
.bf-cs-lifecycle-note {
	font-size: 12px; color: var(--bf-cs-orange-dark); background: #fff3ea;
	border-radius: 8px; padding: 6px 10px; margin: 6px 0 0;
}
@keyframes bf-cs-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
	.bf-cs-badge[data-status="live"]::before { animation: none; }
}

/* ---------- ルーム ---------- */

.bf-cs-backlink { display: inline-block; margin: 16px 0; font-size: 13px; color: var(--bf-cs-text-muted); text-decoration: none; }
.bf-cs-backlink:hover, .bf-cs-backlink:focus-visible { color: var(--bf-cs-orange-dark); }

.bf-cs-room__layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 960px) {
	.bf-cs-room__layout { grid-template-columns: minmax(0,1fr) 300px; align-items: start; }
}

.bf-cs-scorebar {
	background: linear-gradient(135deg, var(--bf-cs-black), var(--bf-cs-charcoal-2));
	color: var(--bf-cs-white);
	border-radius: 14px;
	padding: 14px 16px;
	position: sticky;
	top: 0;
	z-index: 5;
}
.bf-cs-scorebar__top { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #d7d7dd; }
.bf-cs-scorebar__top time { margin-left: auto; }
.bf-cs-scorebar__clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.bf-cs-scorebar__matchup { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 4px; }
.bf-cs-scorebar__side { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bf-cs-scorebar__score { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 800; }
.bf-cs-scorebar__meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #cfcfd6; flex-wrap: wrap; }
.bf-cs-stale { color: #ffcf9e; }
.bf-cs-lastupdate { color: #a9a9b3; }
.bf-cs-hidescore-toggle {
	background: transparent; border: 1px solid #4b4b57; color: #d7d7dd;
	border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.bf-cs-hidescore-toggle[aria-pressed="true"] { background: var(--bf-cs-orange); border-color: var(--bf-cs-orange); color: #1a1a1e; }
.bf-cs-scorebar[data-hide-score="true"] .bf-cs-scorebar__score { filter: blur(6px); user-select: none; }

.bf-cs-quarters {
	width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 8px; color: #cfcfd6;
}
.bf-cs-quarters th, .bf-cs-quarters td { padding: 3px 6px; text-align: center; }
.bf-cs-quarters th:first-child, .bf-cs-quarters td:first-child { text-align: left; }
.bf-cs-quarters thead th { color: #9a9aa4; font-weight: 600; }

.bf-cs-connbanner {
	background: #fff3ea; border: 1px solid var(--bf-cs-orange); color: var(--bf-cs-orange-dark);
	border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600;
}
.bf-cs-connbanner[data-level="error"] { background: #fde8e8; border-color: var(--bf-cs-red); color: #8c0f1e; }

.bf-cs-timeline-wrap { position: relative; }
.bf-cs-timeline {
	background: var(--bf-cs-offwhite);
	border: 1px solid var(--bf-cs-border);
	border-radius: 14px;
	height: 52vh;
	min-height: 320px;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { .bf-cs-timeline { scroll-behavior: auto; } }

.bf-cs-newcomments {
	position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
	background: var(--bf-cs-black); color: #fff; border: none; border-radius: 999px;
	padding: 8px 16px; font-weight: 700; font-size: 13px; cursor: pointer; min-height: 36px;
}
.bf-cs-newcomments:hover, .bf-cs-newcomments:focus-visible { background: var(--bf-cs-orange-dark); }

.bf-cs-comment {
	background: var(--bf-cs-white); border: 1px solid var(--bf-cs-border);
	border-radius: 10px; padding: 10px 12px;
}
.bf-cs-comment[data-pinned="true"] { border-color: var(--bf-cs-orange); background: #fff8f2; }
.bf-cs-comment[data-mine="true"] { border-color: var(--bf-cs-charcoal-2); }
.bf-cs-comment__head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.bf-cs-comment__nickname { font-weight: 700; }
.bf-cs-comment__team {
	font-size: 10px; font-weight: 700; background: var(--bf-cs-charcoal); color: #fff;
	padding: 2px 6px; border-radius: 6px;
}
.bf-cs-comment__admin-badge {
	font-size: 10px; font-weight: 700; background: var(--bf-cs-orange); color: #221200;
	padding: 2px 6px; border-radius: 6px;
}
.bf-cs-comment__time { margin-left: auto; color: var(--bf-cs-text-muted); }
.bf-cs-comment__body { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.bf-cs-comment__actions { display: flex; gap: 14px; margin-top: 6px; }
.bf-cs-iconbtn {
	background: none; border: none; padding: 6px 4px; min-height: 32px;
	color: var(--bf-cs-text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
	display: inline-flex; align-items: center; gap: 4px;
}
.bf-cs-iconbtn:hover, .bf-cs-iconbtn:focus-visible { color: var(--bf-cs-orange-dark); }
.bf-cs-iconbtn[aria-pressed="true"] { color: var(--bf-cs-red); font-weight: 800; }

.bf-cs-composer {
	background: var(--bf-cs-white); border: 1px solid var(--bf-cs-border);
	border-radius: 14px; padding: 10px; margin-top: 10px;
}
.bf-cs-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.bf-cs-reply-indicator {
	font-size: 12px; color: var(--bf-cs-text-muted); margin-bottom: 6px;
	display: flex; align-items: center; gap: 8px;
}
.bf-cs-reply-indicator[hidden] { display: none; } /* .bf-cs-modalと同じ理由（詳細度の同点でhidden無効化を防ぐ）。 */
.bf-cs-reply-indicator button { background: none; border: none; cursor: pointer; font-size: 16px; min-height: 24px; min-width: 24px; }
.bf-cs-composer__row { display: flex; gap: 8px; align-items: flex-end; }
.bf-cs-composer textarea {
	flex: 1; resize: none; border: 1px solid var(--bf-cs-border); border-radius: 10px;
	padding: 10px 12px; font-size: 15px; max-height: 120px; min-height: 44px;
	font-family: inherit;
}
.bf-cs-composer__submit {
	background: var(--bf-cs-orange); color: #221200; border: none; border-radius: 10px;
	padding: 0 18px; min-height: 44px; font-weight: 800; cursor: pointer; font-size: 14px;
}
.bf-cs-composer__submit:hover, .bf-cs-composer__submit:focus-visible { background: var(--bf-cs-orange-dark); color: #fff; }
.bf-cs-composer__submit:disabled { opacity: .5; cursor: not-allowed; }
.bf-cs-composer__note { min-height: 16px; font-size: 12px; color: var(--bf-cs-red); margin: 6px 2px 0; }

.bf-cs-panel {
	background: var(--bf-cs-white); border: 1px solid var(--bf-cs-border);
	border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.bf-cs-panel__title { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.bf-cs-panel__note { margin: 0; font-size: 12px; color: var(--bf-cs-text-muted); line-height: 1.6; }

#bf-cs-vote-body { display: flex; flex-direction: column; gap: 8px; }
.bf-cs-votebtn {
	border: 2px solid var(--bf-cs-border); background: var(--bf-cs-offwhite);
	border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; min-height: 44px;
	text-align: left; font-size: 13px;
}
.bf-cs-votebtn[aria-pressed="true"] { border-color: var(--bf-cs-orange); background: #fff3ea; color: var(--bf-cs-orange-dark); }
.bf-cs-vote-total { font-size: 12px; color: var(--bf-cs-text-muted); margin: 8px 0 0; }
.bf-cs-vote-error { font-size: 12px; color: var(--bf-cs-red); margin: 6px 0 0; min-height: 14px; }

.bf-cs-modal {
	position: fixed; inset: 0; background: rgba(11,11,13,.65);
	display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
/* [hidden]単体（UAスタイルシートのdisplay:none）とこのクラスのdisplay:flexは詳細度が同じため、
   カスケード順でこちらが勝ってしまい、hidden=trueにしても見た目上閉じない実バグがあった。
   属性セレクタを重ねて詳細度を上げ、hidden指定時は確実にdisplay:noneへ戻す。 */
.bf-cs-modal[hidden] { display: none; }
.bf-cs-modal__panel {
	background: #fff; border-radius: 16px; padding: 24px; max-width: 420px; width: 100%;
	max-height: 90vh; overflow-y: auto;
}
.bf-cs-modal__panel h2 { margin-top: 0; font-size: 18px; }
.bf-cs-modal__panel label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.bf-cs-modal__panel input[type="text"], .bf-cs-modal__panel select {
	width: 100%; padding: 10px 12px; border: 1px solid var(--bf-cs-border); border-radius: 8px; font-size: 15px; min-height: 44px;
}
.bf-cs-agree { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.bf-cs-rules-text { font-size: 12px; color: var(--bf-cs-text-muted); background: var(--bf-cs-offwhite); padding: 10px; border-radius: 8px; margin-top: 8px; line-height: 1.6; }

/* ---------- モバイル ---------- */

@media (max-width: 600px) {
	.bf-cs { padding: 0 12px 96px; }
	.bf-cs-scorebar { border-radius: 0; margin: 0 -12px; }
	.bf-cs-timeline { height: 48vh; }
	.bf-cs-room__side { order: 3; }
	.bf-cs-composer {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
		border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
		margin-top: 0;
	}
	.bf-cs-room__main { padding-bottom: 140px; }
}
