/* Rymanora Chat Bingo
   Everything is scoped to .rcb and driven by variables, so retheming is a
   matter of overriding the block below in your theme's Additional CSS. */

.rcb {
	--rcb-bg: #1b0f24;
	--rcb-surface: #2a1636;
	--rcb-tile: #351b44;
	--rcb-line: #4a2a5c;
	--rcb-ink: #f7ecff;
	--rcb-dim: #b294c7;
	--rcb-hot: #ff3d9a;
	--rcb-chat: #4be0b0;
	--rcb-gold: #ffcc4d;
	--rcb-onhot: #24041a;
	--rcb-onchat: #05231b;
	--rcb-onwin: #2a1a00;
	--rcb-radius: 10px;

	background: var(--rcb-bg);
	color: var(--rcb-ink);
	padding: clamp(14px, 3vw, 26px);
	border-radius: calc(var(--rcb-radius) + 6px);
	font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	max-width: 820px;
	margin-inline: auto;
	box-sizing: border-box;
}

.rcb *,
.rcb *::before,
.rcb *::after {
	box-sizing: inherit;
}

.rcb--themefont {
	font-family: inherit;
}

/* -------------------------------- brand -------------------------------- */

.rcb__brand {
	display: flex;
	justify-content: center;
	margin-bottom: clamp(10px, 2vw, 18px);
}

.rcb__logo {
	display: block;
	width: 100%;
	height: auto;
}

/* ------------------------------- header ------------------------------- */

.rcb__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 16px;
}

.rcb__title {
	margin: 0;
	font-size: clamp(1.3rem, 4vw, 1.9rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--rcb-ink);
	line-height: 1.1;
}

.rcb__status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--rcb-dim);
}

.rcb__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--rcb-dim);
	flex: none;
}

.rcb__status[data-state="live"] {
	color: var(--rcb-chat);
}

.rcb__status[data-state="live"] .rcb__dot {
	background: var(--rcb-chat);
	animation: rcb-pulse 2.4s ease-in-out infinite;
}

.rcb__status[data-state="connecting"] .rcb__dot {
	background: var(--rcb-gold);
	animation: rcb-pulse 1s ease-in-out infinite;
}

@keyframes rcb-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

.rcb__notice {
	background: var(--rcb-surface);
	border-left: 3px solid var(--rcb-gold);
	padding: 12px 14px;
	border-radius: var(--rcb-radius);
	margin: 0;
	color: var(--rcb-dim);
}

/* -------------------------------- grid -------------------------------- */

.rcb__grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: clamp(4px, 1.2vw, 9px);
}

.rcb__tile {
	position: relative;
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: clamp(3px, 1.4vw, 10px);
	background: var(--rcb-tile);
	border: 1px solid var(--rcb-line);
	border-radius: var(--rcb-radius);
	color: var(--rcb-ink);
	font-family: inherit;
	font-size: clamp(0.52rem, 1.55vw, 0.84rem);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	overflow: hidden;
	transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rcb__tile:hover {
	border-color: var(--rcb-hot);
}

.rcb__tile:focus-visible {
	outline: 3px solid var(--rcb-gold);
	outline-offset: 2px;
}

.rcb__tileText {
	display: block;
	width: 100%;
	overflow-wrap: anywhere;
	hyphens: auto;
}

/* Ticked by the viewer */
.rcb__tile.is-marked {
	background: var(--rcb-hot);
	border-color: var(--rcb-hot);
	color: var(--rcb-onhot);
}

/* Ticked by chat — the signature state */
.rcb__tile.is-chat {
	background: var(--rcb-chat);
	border-color: var(--rcb-chat);
	color: var(--rcb-onchat);
	animation: rcb-called 0.5s ease;
}

@keyframes rcb-called {
	0% { transform: scale(0.86); }
	55% { transform: scale(1.06); }
	100% { transform: scale(1); }
}

.rcb__credit {
	display: block;
	max-width: 100%;
	font-size: 0.62em;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0.72;
}

.rcb__tile.is-free {
	background: var(--rcb-surface);
	border-color: var(--rcb-gold);
	color: var(--rcb-gold);
	cursor: default;
	font-weight: 800;
	letter-spacing: 0.02em;
}

/* Dark hairlines on both edges of the band, so the winning line stays visible
   no matter what colour the tiles underneath happen to be. */
.rcb__tile.is-winning {
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, 0.55),
		inset 0 0 0 4px var(--rcb-gold),
		inset 0 0 0 5px rgba(0, 0, 0, 0.35);
}

/* ------------------------------- controls ------------------------------ */

.rcb__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin-top: 16px;
}

.rcb__btn {
	background: transparent;
	border: 1.5px solid var(--rcb-hot);
	color: var(--rcb-hot);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 9px 18px;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.rcb__btn:hover {
	background: var(--rcb-hot);
	color: var(--rcb-onhot);
}

.rcb__btn:focus-visible {
	outline: 3px solid var(--rcb-gold);
	outline-offset: 2px;
}

.rcb__hint {
	margin: 0;
	font-size: 0.82rem;
	color: var(--rcb-dim);
}

.rcb__win {
	margin-top: 14px;
	padding: 12px 16px;
	border-radius: var(--rcb-radius);
	background: var(--rcb-gold);
	color: var(--rcb-onwin);
	font-size: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: baseline;
}

.rcb__win strong {
	font-size: 1.15rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* -------------------------------- feed --------------------------------- */

.rcb__feed {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--rcb-line);
}

.rcb__feedTitle {
	margin: 0 0 10px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rcb-dim);
}

.rcb__feedList {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rcb__feedItem {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	padding: 8px 12px;
	background: var(--rcb-surface);
	border-radius: 8px;
	font-size: 0.88rem;
	animation: rcb-slide 0.3s ease;
}

@keyframes rcb-slide {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.rcb__feedPhrase {
	font-weight: 600;
}

.rcb__feedWho {
	margin-left: auto;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--rcb-chat);
}

.rcb__feedEmpty {
	padding: 8px 12px;
	font-size: 0.85rem;
	color: var(--rcb-dim);
}

/* ------------------------------ small screens -------------------------- */

@media (max-width: 420px) {
	.rcb__tile {
		border-radius: 7px;
	}
	.rcb__credit {
		display: none;
	}
	.rcb__bar {
		justify-content: center;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rcb *,
	.rcb *::before,
	.rcb *::after {
		animation: none !important;
		transition: none !important;
	}
}
