/* Batailles de boules de neige */
.sbf { --sbf-ice: #e8f4fb; --sbf-blue: #1e6fa8; --sbf-deep: #0d3d63; --sbf-green: #2e8b57; --sbf-red: #c0392b; }

.sbf-header {
	position: relative; overflow: hidden; text-align: center;
	background: linear-gradient(180deg, #0d3d63 0%, #1e6fa8 60%, #9fd0ef 100%);
	border-radius: 8px; padding: 18px 10px 14px; margin-bottom: 8px; color: #fff;
}
.sbf-title { color: #fff; font-size: 2em; margin: 0; border: 0; text-shadow: 0 2px 4px rgba(0,0,0,.4); font-family: inherit; }
.sbf-tagline { margin: 4px 0 0; opacity: .9; }
.sbf-snow span { position: absolute; top: -20px; color: #fff; opacity: .8; font-size: 16px; animation: sbf-fall 9s linear infinite; }
.sbf-snow span:nth-child(1) { left: 5%; animation-delay: 0s; }
.sbf-snow span:nth-child(2) { left: 18%; animation-delay: 2s; font-size: 12px; }
.sbf-snow span:nth-child(3) { left: 32%; animation-delay: 4s; }
.sbf-snow span:nth-child(4) { left: 47%; animation-delay: 1s; font-size: 20px; }
.sbf-snow span:nth-child(5) { left: 61%; animation-delay: 3s; }
.sbf-snow span:nth-child(6) { left: 74%; animation-delay: 5s; font-size: 12px; }
.sbf-snow span:nth-child(7) { left: 86%; animation-delay: 2.5s; }
.sbf-snow span:nth-child(8) { left: 95%; animation-delay: 6s; font-size: 14px; }
@keyframes sbf-fall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(160px) rotate(360deg); } }

.sbf-tabs { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sbf-tabs li a { display: block; padding: 6px 14px; border-radius: 16px; background: var(--sbf-ice); color: var(--sbf-deep); font-weight: bold; text-decoration: none; }
.sbf-tabs li.active a, .sbf-tabs li a:hover { background: var(--sbf-blue); color: #fff; }

.sbf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; margin-bottom: 8px; }
.sbf-card { margin-bottom: 0; }
.sbf-card h3, .sbf .panel h3 { margin-top: 0; }
.sbf-block { margin-bottom: 8px; }
.sbf-center { text-align: center; }
.sbf-empty { opacity: .7; font-style: italic; list-style: none; }

.sbf-levels { display: flex; flex-direction: column; gap: 6px; }
.sbf-level { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 6px; background: rgba(255,255,255,.5); cursor: pointer; }
.sbf-reward { color: var(--sbf-green); }

.sbf-stats { list-style: none; margin: 0; padding: 0; }
.sbf-stats li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted rgba(0,0,0,.15); }
.sbf-inline { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.sbf-inline li { flex-direction: column; border: 0; }

.sbf-top { margin: 0 0 6px 20px; padding: 0; }
.sbf-top li { padding: 2px 0; }
.sbf-top li span { float: right; font-weight: bold; }
.sbf-list { margin: 0 0 6px 18px; }

.sbf-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; flex-wrap: wrap; }
.sbf-row > span:first-child { flex: 1 1 260px; }
.sbf-turn { color: var(--sbf-red); }
.sbf-result-win { color: var(--sbf-green); font-weight: bold; }
.sbf-result-loss { color: var(--sbf-red); font-weight: bold; }
.sbf-result-draw { color: #777; font-weight: bold; }

.sbf-flash { background: #e6f6ea; border: 1px solid #9ad0a8; color: #1e5631; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; font-weight: bold; }

/* Arena */
.sbf-arena-panel { background: linear-gradient(180deg, #dff0fb 0%, #ffffff 70%); }
.sbf-meta { text-align: center; font-size: .95em; }
.sbf-arena { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.sbf-fighter { flex: 1; text-align: center; transition: opacity .3s; }
.sbf-fighter.sbf-ko { opacity: .45; filter: grayscale(1); }
.sbf-avatar { font-size: 64px; line-height: 1.1; }
.sbf-left .sbf-avatar { animation: sbf-bob 2.4s ease-in-out infinite; }
.sbf-right .sbf-avatar { animation: sbf-bob 2.4s ease-in-out infinite .6s; }
@keyframes sbf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.sbf-name { font-size: 1.2em; font-weight: bold; }
.sbf-rating { font-size: .9em; opacity: .8; }
.sbf-delta { font-weight: bold; }
.sbf-hp { position: relative; height: 18px; margin: 6px auto; max-width: 240px; background: #f3d6d6; border-radius: 9px; overflow: hidden; border: 1px solid #c9a; }
.sbf-hp-bar { height: 100%; background: linear-gradient(90deg, #2e8b57, #6fd18f); transition: width .5s; }
.sbf-hp span { position: absolute; top: 0; left: 0; right: 0; font-size: 11px; line-height: 18px; font-weight: bold; color: #222; }
.sbf-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.sbf-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #dbeaf5; font-size: .85em; }
.sbf-badge.used { background: #eee; color: #999; }
.sbf-badge.ready { background: #d7f2df; color: #1e5631; }

.sbf-vs { width: 80px; text-align: center; position: relative; font-size: 1.6em; color: var(--sbf-deep); }
.sbf-ball { color: #fff; text-shadow: 0 0 3px #7aa; font-size: 26px; animation: sbf-throw 1.8s ease-in-out infinite alternate; }
@keyframes sbf-throw { 0% { transform: translate(-40px, 6px); } 50% { transform: translate(0, -14px); } 100% { transform: translate(40px, 6px); } }

.sbf-result { text-align: center; font-size: 1.3em; font-weight: bold; padding: 10px; margin: 8px 0; border-radius: 8px; }
.sbf-result.sbf-result-win { background: #e1f5e7; }
.sbf-result.sbf-result-loss { background: #fbe3e1; }
.sbf-result.sbf-result-draw { background: #eee; }

.sbf-invite { padding: 10px; background: #fff8e1; border-radius: 8px; margin: 8px 0; }
.sbf-wait { text-align: center; padding: 10px; font-size: 1.1em; }

.sbf-move { margin-top: 10px; border-top: 2px dashed #b9d9ee; padding-top: 10px; }
.sbf-move h3 { text-align: center; }
.sbf-move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sbf-move fieldset { border: 1px solid #b9d9ee; border-radius: 8px; padding: 8px; }
.sbf-move legend { font-weight: bold; padding: 0 6px; }
.sbf-choice { display: block; cursor: pointer; margin: 4px 0; }
.sbf-choice input { position: absolute; opacity: 0; }
.sbf-choice span { display: block; padding: 8px 10px; border-radius: 6px; border: 2px solid #d6e8f4; background: #fff; }
.sbf-choice span b { font-size: 1.3em; }
.sbf-choice span small { display: block; opacity: .75; }
.sbf-choice input:checked + span { border-color: var(--sbf-blue); background: var(--sbf-ice); box-shadow: 0 0 0 2px rgba(30,111,168,.15); }
.sbf-choice input:focus-visible + span { outline: 2px solid var(--sbf-deep); }
.sbf-special { font-weight: bold; cursor: pointer; }
.sbf-throw { font-size: 1.2em !important; padding: 6px 26px !important; }
.sbf-forfeit { text-align: right; margin-top: 12px; font-size: .9em; opacity: .85; }

.sbf-log-entry { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 6px 8px; align-items: center; }
.sbf-log-entry p { margin: 1px 0; }
.sbf-r-hit, .sbf-r-crit { color: #a0331f; }
.sbf-r-crit { font-weight: bold; }
.sbf-r-dodge { color: #1e6fa8; }
.sbf-r-miss { color: #777; }
.sbf-r-shatter { color: #6a3ea1; }

/* Tables */
.sbf-table td, .sbf-table th { padding: 5px 6px; }
.sbf-table tr.sbf-me td { font-weight: bold; background: #fff8d6; }

/* Bracket */
.sbf-bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.sbf-bracket-round { min-width: 200px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.sbf-bracket-round h4 { text-align: center; margin: 0; }
.sbf-match { display: block; border: 1px solid #b9d9ee; border-radius: 6px; background: #fff; padding: 4px 8px; text-decoration: none !important; color: inherit; }
.sbf-match span { display: flex; justify-content: space-between; padding: 2px 0; }
.sbf-match span.win { font-weight: bold; color: var(--sbf-green); }
.sbf-match.active { border-color: var(--sbf-blue); }
.sbf-match.mine { box-shadow: 0 0 0 2px #f1c40f; }
.sbf-match small { opacity: .7; }
.sbf-players { columns: 3 180px; margin-left: 18px; }
.sbf-players li.out { opacity: .55; }
.sbf-players li.champion { font-weight: bold; }

.sbf-rules li { margin-bottom: 4px; }
.sbf-zones-table { max-width: 420px; margin: 10px 0; }

@media (max-width: 700px) {
	.sbf-move-grid { grid-template-columns: 1fr; }
	.sbf-avatar { font-size: 44px; }
	.sbf-vs { width: 44px; }
	.sbf-log-entry { grid-template-columns: 1fr; }
}

/* ---- v2: action arena ---- */
.sbf-live-now { background: #fdecea; color: #a0331f; border-radius: 6px; padding: 6px 12px; margin-bottom: 8px; font-weight: bold; }
.sbf-versus { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 10px; }
.sbf-side { flex: 1; text-align: center; }
.sbf-side .sbf-avatar { font-size: 44px; animation: none; }
.sbf-red .sbf-name { color: #d9483b; }
.sbf-blue .sbf-name { color: #2d6fd6; }
.sbf-score { font-size: 1.4em; font-weight: bold; color: var(--sbf-deep); }
.sbf-arena-root { margin: 6px 0 10px; }
.sbf-canvas-wrap { position: relative; width: 100%; max-width: 1100px; margin: 0 auto; background: #0d3d63; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(13,61,99,.25); }
.sbf-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; outline: none; }
.sbf-canvas-wrap:fullscreen { display: flex; align-items: center; justify-content: center; max-width: none; border-radius: 0; }
.sbf-canvas-wrap:fullscreen .sbf-canvas { width: min(100vw, calc(100vh * 16 / 9)); }
.sbf-arena-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 1100px; margin: 6px auto 0; flex-wrap: wrap; }
.sbf-arena-status { font-weight: bold; }
.sbf-help { max-width: 1100px; margin: 6px auto 0; }
.sbf-help summary { cursor: pointer; font-weight: bold; }
.sbf-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0; }
.sbf-mode-card { background: #fff; border: 2px solid #b9d9ee; border-radius: 10px; padding: 12px; text-align: center; }
.sbf-mode-card h3 { margin-top: 0; }
a.sbf-big, .sbf-big { display: inline-block; font-size: 1.15em !important; padding: 6px 22px !important; text-decoration: none !important; }

/* ---- v2.1 ---- */
/* Title always readable, whatever the board style does to h2 */
.sbf .sbf-header .sbf-title,
.sbf .sbf-header h2.sbf-title {
	color: #ffffff !important;
	background: none !important;
	border: 0 !important;
	text-shadow: 0 2px 0 #0d3d63, 0 0 10px rgba(0, 0, 0, .55), 0 0 2px #000 !important;
	letter-spacing: .5px;
}
.sbf .sbf-header .sbf-tagline { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.sbf-music-box { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sbf-music-box select { max-width: 180px; }
.sbf-music-volume { width: 90px; vertical-align: middle; }

/* ---------- Version 3 ---------- */
.sbf-quick .sbf-highlight { background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 80%); border: 2px solid #9cc9ec; }
.sbf-big { display: inline-block; font-size: 1.1em; padding: 6px 18px; }
.sbf-wide { grid-column: 1 / -1; }
.sbf-me { font-weight: bold; }

/* Badges */
.sbf-badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.sbf-badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px; border-radius: 8px; background: #f3f9fd; border: 1px solid #cfe5f5; }
.sbf-badge-item.locked { opacity: .45; filter: grayscale(1); }
.sbf-badge-icon { font-size: 28px; line-height: 1.2; }
.sbf-badge-name { font-weight: bold; }
.sbf-badge-toast { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #fff7d6; border: 1px solid #f0d878; color: #6b5300; font-weight: bold; animation: sbf-pop .5s ease-out; }
@keyframes sbf-pop { 0% { transform: scale(.6); opacity: 0; } 80% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }

/* Matchmaking */
.sbf-queue-wait { text-align: center; padding: 20px 0; }
.sbf-spinner { font-size: 48px; display: inline-block; animation: sbf-spin 2s linear infinite; }
@keyframes sbf-spin { to { transform: rotate(360deg); } }
.sbf-queue-status { font-size: 1.2em; font-weight: bold; color: #0d3d63; }

/* Shop */
.sbf-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sbf-item { text-align: center; padding: 8px; border-radius: 10px; background: #f7fbfe; border: 2px solid #dbeaf5; margin: 0; }
.sbf-item.owned { border-color: #9ad0a8; }
.sbf-item.equipped { border-color: #2e8b57; background: #e6f6ea; }
.sbf-item.locked { opacity: .6; }
.sbf-item-preview { font-size: 40px; line-height: 1.2; height: 52px; display: flex; align-items: center; justify-content: center; }
.sbf-swatch { display: inline-block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #bbb; }
.sbf-item-name { font-weight: bold; margin: 4px 0 2px; }
.sbf-item-tier { color: #d4ac0d; font-size: .9em; min-height: 1.2em; }
.sbf-item-state { display: inline-block; margin-top: 4px; font-size: .9em; }
.sbf-shop-balance { font-weight: bold; }

/* Share block */
.sbf-share { margin-top: 8px; }
.sbf-share-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sbf-share-btn { display: inline-block; padding: 6px 12px; border-radius: 18px; border: 0; font-weight: bold; font-size: 1em; color: #fff !important; text-decoration: none !important; cursor: pointer; background: #607d8b; font-family: inherit; }
.sbf-share-btn:hover { filter: brightness(1.1); }
.sbf-share-whatsapp { background: #25d366; }
.sbf-share-email { background: #7f8c8d; }
.sbf-share-facebook { background: #1877f2; }
.sbf-share-x { background: #111; }
.sbf-share-telegram { background: #229ed9; }
.sbf-share-messenger { background: #a033ff; }
.sbf-share-sms { background: #16a085; }
.sbf-share-copy, .sbf-share-native { background: #1e6fa8; }

/* Profile, posts and board index */
.sbf-profile h3 { margin-top: 0; }
.sbf-profile-badges { font-size: 24px; letter-spacing: 2px; }
.sbf-profile-badges .sbf-badge-icon { font-size: 24px; cursor: help; }
.sbf-post-challenge a { font-weight: bold; }
.sbf-index-block h3 a { color: inherit; }
.sbf-index-play { font-weight: bold; }

/* v3.0.1: header and share block with a big snowman on each side */
.sbf-header-row { display: flex; align-items: center; justify-content: center; gap: 18px; position: relative; z-index: 1; }
.sbf-header-text { flex: 0 1 auto; min-width: 0; }
.sbf-snowman { font-size: 72px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.sbf-snowman-left { animation: sbf-bob 2.4s ease-in-out infinite; }
.sbf-snowman-right { animation: sbf-bob 2.4s ease-in-out infinite .6s; transform-origin: bottom center; }
.sbf .sbf-header .sbf-tagline { font-size: 1.45em; font-weight: bold; margin-top: 6px; opacity: 1; }

.sbf .panel.sbf-share {
	background: linear-gradient(180deg, #0d3d63 0%, #1e6fa8 60%, #9fd0ef 100%);
	color: #fff; border: 0; border-radius: 8px; text-align: center; padding: 14px 10px;
}
.sbf .panel.sbf-share h3 { color: #fff !important; border: 0; font-size: 1.5em; margin: 0 0 4px; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.sbf .panel.sbf-share p { color: #fff; font-size: 1.15em; margin: 0 0 10px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.sbf-share .sbf-share-btn { box-shadow: 0 2px 4px rgba(0,0,0,.25); }

@media (max-width: 700px) {
	.sbf-snowman { font-size: 44px; }
	.sbf-header-row { gap: 8px; }
	.sbf .sbf-header .sbf-tagline { font-size: 1.1em; }
}
