/**
 * Recently Updated Games page.
 *
 * Loads after rsg-base.css, which supplies the palette tokens, .rsg-shell,
 * the hero, the shared title/chip atoms and the empty-page state. Only what
 * is unique to this page lives here: the day-tab strip, the day panels and
 * the single-line update rows.
 */

/* ── Toolbar: day tabs ────────────────────────────────────────────────── */

.rsg-toolbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 16px 0;
	margin-bottom: 8px;
	background: rgba(10, 14, 22, .88);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--rsg-border);
}

.rsg-tabs-scroll {
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--rsg-border-mid) transparent;
}
.rsg-tabs-scroll::-webkit-scrollbar { height: 4px; }
.rsg-tabs-scroll::-webkit-scrollbar-thumb { background: var(--rsg-border-mid); border-radius: 4px; }

.rsg-tabs {
	display: flex;
	gap: 8px;
	padding-bottom: 2px;
}

.rsg-tab {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	position: relative;
	padding: 10px 44px 10px 16px;
	background: var(--rsg-surface);
	border: 1px solid var(--rsg-border);
	border-radius: 12px;
	color: var(--rsg-muted);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.rsg-tab:hover {
	background: var(--rsg-hover);
	border-color: var(--rsg-border-mid);
	color: var(--rsg-text);
}

.rsg-tab:focus-visible {
	outline: 2px solid var(--rsg-accent);
	outline-offset: 2px;
}

.rsg-tab.is-active {
	background: linear-gradient(135deg, var(--rsg-primary) 0%, var(--rsg-primary-d) 100%);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 99, 186, .38);
}

.rsg-tab-range {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .3px;
	color: var(--rsg-dim);
}
.rsg-tab.is-active .rsg-tab-range { color: rgba(255, 255, 255, .78); }

.rsg-tab-count {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	min-width: 24px;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .07);
	color: var(--rsg-text);
	font-size: 11px;
	font-weight: 700;
	text-align: center;
}
.rsg-tab.is-active .rsg-tab-count { background: rgba(0, 0, 0, .26); color: #fff; }

/* A day with nothing logged still gets a tab — just a quieter one. */
.rsg-tab.is-empty:not(.is-active) { opacity: .5; }
.rsg-tab.is-empty:not(.is-active):hover { opacity: 1; }
.rsg-tab.is-empty:not(.is-active) .rsg-tab-count { color: var(--rsg-dim); }

/* ── Panels ───────────────────────────────────────────────────────────── */

.rsg-panel { padding: 12px 0 72px; }
.rsg-panel[hidden] { display: none; }

.rsg-panel-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 14px;
	padding: 14px 0 20px;
}

.rsg-page h2.rsg-panel-title {
	margin: 0;
	color: #fff;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -.2px;
}

.rsg-panel-range { font-size: 14px; color: var(--rsg-muted); }

.rsg-panel-count {
	margin-left: auto;
	padding: 5px 13px;
	border-radius: 999px;
	background: rgba(58, 163, 255, .12);
	border: 1px solid rgba(58, 163, 255, .22);
	color: var(--rsg-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .4px;
	text-transform: uppercase;
}

/* ── Rows ─────────────────────────────────────────────────────────────── */

.rsg-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }

/*
 * One row = one line. Everything here exists to stop that line breaking:
 *   - the row is a flex line, not a wrapping grid
 *   - the title is the only element allowed to flex, and it truncates
 *   - min-width:0 is what actually lets a flex item shrink below its
 *     min-content width; without it the title refuses to ellipsis and pushes
 *     the version pills onto their own line
 *   - the version pills are nowrap; they used to inherit overflow-wrap:anywhere
 *     with a 190px cap, which guaranteed strings like
 *     "v1.0061.34893.104891 + Co-op" wrapped onto three lines
 */
.rsg-row {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	padding: 13px 18px;
	background: var(--rsg-surface);
	border: 1px solid var(--rsg-border);
	border-radius: var(--rsg-radius);
	transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.rsg-row:hover {
	background: var(--rsg-surface-2);
	border-color: var(--rsg-border-mid);
	transform: translateX(3px);
}

.rsg-row[hidden] { display: none; }

.rsg-page a.rsg-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15.5px;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rsg-time {
	flex: 0 0 auto;
	font-size: 12.5px;
	color: var(--rsg-dim);
	white-space: nowrap;
	text-align: right;
	min-width: 96px;
}

.rsg-chip--auto   { background: rgba(58, 163, 255, .13); border-color: rgba(58, 163, 255, .26); color: #7cc0ff; }
.rsg-chip--manual { background: rgba(255, 190, 92, .11); border-color: rgba(255, 190, 92, .24); color: #ffc978; }

/* Version transition */

.rsg-ver {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	white-space: nowrap;
}

.rsg-ver-from,
.rsg-ver-to {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	/* Safety valve for pathological strings — truncate, never wrap. */
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: middle;
}

.rsg-ver-from {
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--rsg-border);
	color: var(--rsg-dim);
}

.rsg-ver-arrow {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	color: var(--rsg-accent);
}

.rsg-ver-to {
	background: linear-gradient(135deg, var(--rsg-primary) 0%, var(--rsg-primary-d) 100%);
	border: 1px solid transparent;
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 99, 186, .32);
}

/* ── Empty day ────────────────────────────────────────────────────────── */

.rsg-empty--day {
	padding: 54px 20px;
	margin: 0;
	background: var(--rsg-surface);
	border: 1px dashed var(--rsg-border-mid);
	border-radius: var(--rsg-radius);
	color: var(--rsg-dim);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.rsg-panel-count { margin-left: 0; }
}

/*
 * Narrow screens keep the single line by dropping the secondary metadata
 * rather than by wrapping. Title and from → to — the two things the row exists
 * to show — survive all the way down.
 */
@media (max-width: 1000px) {
	.rsg-ver-from, .rsg-ver-to { max-width: 190px; }
}

@media (max-width: 780px) {
	.rsg-time { display: none; }
}

@media (max-width: 700px) {
	.rsg-row { gap: 12px; padding: 12px 14px; }
	.rsg-row:hover { transform: none; }

	.rsg-page a.rsg-title { font-size: 14.5px; }
	.rsg-ver { gap: 6px; }
	.rsg-ver-from, .rsg-ver-to { max-width: 130px; font-size: 12px; padding: 4px 10px; }
	.rsg-ver-arrow { width: 15px; height: 15px; }
}

@media (max-width: 560px) {
	.rsg-chip { display: none; }
	.rsg-ver-from, .rsg-ver-to { max-width: 108px; }
}

@media (max-width: 420px) {
	.rsg-tab { padding: 9px 40px 9px 13px; }
	.rsg-page a.rsg-title { font-size: 14px; }
	.rsg-ver-from, .rsg-ver-to { max-width: 92px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.rsg-row:hover { transform: none; }
}
