/* MaGamers — Game Updates feed (/game-updates/)
 * Сторінка оновлень: стрічка подій (нові ігри + нові версії) + фільтри + пагінація.
 * Токени — дизайн-система сайту (docs/DESIGN.md), тому dark-тема працює автоматично.
 * Лінійка 11px — підлога для службового тексту. Анімації — лише transform/opacity.
 */

.upd-page { padding-bottom: var(--sp-xl); }
.upd-lead {
	max-width: 68ch;
	margin: 10px 0 0;
	font-size: var(--fs-meta);
	line-height: 1.6;
	color: var(--clr-muted);
}

.upd { display: flex; flex-direction: column; gap: var(--sp-lg); margin-top: var(--sp-lg); }

/* ---------- статистика ---------- */
.upd-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--sp-sm);
}
.upd-stat {
	padding: var(--sp-md);
	border: 1px solid var(--game-surface-line);
	border-radius: var(--game-surface-radius);
	background: var(--game-surface);
	box-shadow: var(--game-surface-shadow);
}
.upd-stat b {
	display: block;
	font-size: 1.55rem;
	font-weight: 800;
	line-height: 1.15;
	color: var(--clr-brand);
	font-variant-numeric: tabular-nums;
}
.upd-stat span {
	display: block;
	margin-top: 2px;
	font-size: max(11px, .8rem);
	color: var(--clr-muted);
}

/* ---------- фільтри ---------- */
.upd-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-sm) var(--sp-lg);
	padding-bottom: var(--sp-sm);
	border-bottom: 1px solid var(--game-surface-line);
}
.upd-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.upd-filter__lbl {
	margin-right: 2px;
	font-size: max(11px, .72rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--clr-muted);
}
.upd-chip {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 5px 12px;
	border: 1px solid var(--game-surface-line);
	border-radius: var(--r-pill);
	background: var(--game-surface);
	color: var(--clr-text-soft);
	font-size: max(11px, .8rem);
	font-weight: 600;
	text-decoration: none !important;
	transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.upd-chip:hover { color: var(--clr-brand); border-color: var(--clr-brand); }
.upd-chip.is-on { background: var(--clr-brand-hover); border-color: var(--clr-brand-hover); color: #fff; }

/* ---------- стрічка ---------- */
.upd-day { margin-bottom: var(--sp-lg); }
.upd-day__t {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: var(--clr-heading, var(--clr-text-soft));
}
.upd-day__n {
	font-size: max(11px, .72rem);
	font-weight: 700;
	color: var(--clr-muted);
	background: var(--clr-bg-light);
	border-radius: var(--r-pill);
	padding: 1px 8px;
}
.upd-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.upd-item__a {
	display: grid;
	grid-template-columns: 44px 96px minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--sp-md);
	padding: 10px 14px;
	border: 1px solid var(--game-surface-line);
	border-radius: var(--r-xl);
	background: var(--game-surface);
	color: inherit;
	text-decoration: none !important;
	transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.upd-item__a:hover {
	border-color: var(--clr-brand);
	transform: translateY(-1px);
	box-shadow: var(--game-surface-shadow-hover);
}
.upd-item__time {
	font-size: max(11px, .78rem);
	font-weight: 600;
	color: var(--clr-muted);
	font-variant-numeric: tabular-nums;
}
.upd-item__thumb {
	width: 96px;
	height: 54px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--game-surface-soft);
	border: 1px solid var(--game-surface-line);
}
.upd-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upd-item__body { min-width: 0; }
.upd-item__title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--clr-heading, var(--clr-text-soft));
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.upd-item__a:hover .upd-item__title { color: var(--clr-brand); }
.upd-item__ver {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-top: 3px;
	font-size: max(11px, .8rem);
	line-height: 1.3;
	color: var(--clr-muted);
}
.upd-item__ver b { color: var(--clr-link); font-weight: 700; }
.upd-item__ver s { color: var(--clr-muted); opacity: .8; }
.upd-item__side {
	display: flex;
	align-items: center;
	gap: var(--sp-sm);
	justify-self: end;
}
.upd-item__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: max(11px, .78rem);
	color: var(--clr-muted);
	white-space: nowrap;
}
.upd-item__rel {
	padding: 2px 7px;
	border-radius: 4px;
	background: var(--clr-bg-light);
	color: var(--clr-text-soft);
	font-weight: 600;
}

/* ---------- порожній стан ---------- */
.upd-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 44px 20px;
	border: 1px dashed var(--game-surface-line);
	border-radius: var(--game-surface-radius);
	text-align: center;
}
.upd-empty b { font-size: 15px; }
.upd-empty span { font-size: var(--fs-meta); color: var(--clr-muted); }
.upd-empty__link {
	margin-top: 10px;
	font-size: var(--fs-meta);
	font-weight: 700;
	color: var(--clr-link);
}

/* ---------- пагінація ---------- */
.upd-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding-top: var(--sp-sm);
	font-variant-numeric: tabular-nums;
}
.upd-pager__n,
.upd-pager__next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--game-surface-line);
	border-radius: var(--r-sm, 6px);
	background: var(--game-surface);
	color: var(--clr-text-soft);
	font-size: var(--fs-meta);
	font-weight: 600;
	text-decoration: none !important;
	transition: color var(--t-fast), border-color var(--t-fast);
}
.upd-pager__n:hover,
.upd-pager__next:hover { color: var(--clr-brand); border-color: var(--clr-brand); }
.upd-pager__n.is-on {
	background: var(--clr-brand-hover);
	border-color: var(--clr-brand-hover);
	color: #fff;
}
.upd-pager__gap { color: var(--clr-muted); padding: 0 2px; }

/* ---------- сайдбар-віджет: посилання «усі оновлення» ---------- */
.du-all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 10px;
	padding: 9px 12px;
	border: 1px solid rgba(255,255,255,.09);
	border-radius: var(--r-xl);
	background: rgba(255,255,255,.05);
	color: rgba(255,255,255,.88);
	font-size: max(11px, .8rem);
	font-weight: 700;
	text-decoration: none !important;
	transition: border-color var(--t-fast), color var(--t-fast);
}
.du-all:hover { border-color: var(--clr-brand); color: #fff; }
.du-empty { padding: 14px 0; font-size: var(--fs-meta); color: rgba(255,255,255,.6); }

/* ---------- плавне перемикання (AJAX) ---------- */
.upd-root { transition: opacity var(--t-base); }
.upd-root.is-loading { opacity: .55; }
.upd-root.is-swap .upd { animation: updSwap .28s ease; }
@keyframes updSwap {
	from { opacity: .35; transform: translateY(8px); }
	to   { opacity: 1;   transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.upd-root.is-swap .upd { animation: none; }
}

/* ---------- сайдбар-віджет: розширена версія ---------- */
.sidebar-block-title__link {
	flex-grow: 1;
	color: inherit;
	text-decoration: none !important;
}
.sidebar-block-title__link:hover { color: var(--clr-brand); }
.du-subtitle b { color: rgba(255,255,255,.9); font-weight: 800; }
.du-day { display: flex; flex-direction: column; gap: 9px; }
.du-day + .du-day { margin-top: 12px; }
.du-day__t {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 1px 2px;
	font-size: max(11px, .7rem);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: rgba(255,255,255,.5);
}
.du-day__n {
	font-size: max(11px, .66rem);
	font-weight: 800;
	color: rgba(255,255,255,.55);
	background: rgba(255,255,255,.08);
	border-radius: var(--r-pill);
	padding: 1px 7px;
}
.du-day__list { display: flex; flex-direction: column; gap: 9px; }
.du-item { grid-template-columns: 58px minmax(0, 1fr) auto; }
.du-time {
	align-self: start;
	padding-top: 2px;
	font-size: max(11px, .72rem);
	font-weight: 700;
	color: rgba(255,255,255,.45);
	font-variant-numeric: tabular-nums;
}
.du-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	text-transform: none;
	font-size: max(11px, .76rem);
	font-weight: 600;
	letter-spacing: 0;
}
.du-ver {
	color: rgba(255,255,255,.8);
	font-weight: 700;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.du-size { color: rgba(255,255,255,.5); flex-shrink: 0; }

/* ---------- сторінка гри: історія оновлень (таймлайн, як у byrutgame.org) ---------- */
.upd-hist {
	margin: 18px 0;
	border: 1px solid var(--game-surface-line);
	border-radius: var(--game-surface-radius);
	background: var(--game-surface);
	overflow: hidden;
}
.upd-hist__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	cursor: pointer;
	list-style: none;
	transition: background-color var(--t-fast);
}
.upd-hist__head::-webkit-details-marker { display: none; }
.upd-hist__head:hover { background: var(--game-surface-soft); }
.upd-hist__ic { display: flex; color: var(--clr-brand); }
.upd-hist__ic .icon { width: 18px; height: 18px; fill: currentColor; }
.upd-hist__t { font-size: 15px; font-weight: 700; color: var(--clr-heading, var(--clr-text-soft)); }
.upd-hist__n { font-size: max(11px, .78rem); color: var(--clr-muted); }
.upd-hist__last { margin-left: auto; font-size: max(11px, .78rem); color: var(--clr-muted); white-space: nowrap; }
.upd-hist__chev { width: 16px; height: 16px; fill: var(--clr-muted); transition: transform var(--t-base); }
.upd-hist[open] .upd-hist__chev { transform: rotate(180deg); }

.upd-tl { list-style: none; margin: 0; padding: 2px 16px 12px; }
.upd-tl__row {
	display: grid;
	grid-template-columns: 88px 18px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
}
.upd-tl__date { font-size: 13px; font-weight: 600; color: var(--clr-text-soft); white-space: nowrap; }
.upd-tl__dot {
	position: relative;
	width: 9px; height: 9px;
	margin: 0 auto;
	border-radius: 50%;
	background: var(--clr-muted);
	opacity: .45;
}
.upd-tl__dot::after {
	content: '';
	position: absolute;
	left: 50%; top: 13px;
	width: 2px; height: calc(100% + 12px);
	transform: translateX(-50%);
	background: rgba(15, 23, 42, .14);
}
html[data-theme="dark"] .upd-tl__dot::after { background: rgba(255, 255, 255, .18); }
.upd-tl__row:last-child .upd-tl__dot::after { display: none; }
.upd-tl__row.is-latest .upd-tl__dot {
	background: #16a34a;
	opacity: 1;
	box-shadow: 0 0 0 3px rgba(22, 163, 74, .16);
}
.upd-tl__v {
	font-size: 13px;
	font-weight: 600;
	color: var(--clr-link);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.upd-tl__cur {
	display: inline-block;
	margin-left: 8px;
	font-size: max(11px, .66rem);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--clr-brand);
	background: var(--clr-bg-light);
	border-radius: var(--r-pill);
	padding: 1px 7px;
	vertical-align: 1px;
}
.upd-tl__meta { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.upd-tl__age { font-size: 12px; color: var(--clr-muted); }
.upd-tl__b { font-size: 12px; color: var(--clr-muted); font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; }
.upd-hist__note {
	margin: 0;
	padding: 9px 16px 13px;
	border-top: 1px solid var(--game-surface-line);
	font-size: 12px;
	color: var(--clr-muted);
}

/* показати решту історії (коли версій багато) */
.upd-tl__more { list-style: none; padding: 0; }
.upd-hist__more { margin-top: 2px; }
.upd-hist__more > summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 12px;
	border-radius: 8px;
	background: var(--game-surface-soft);
	font-size: 13px;
	font-weight: 600;
	color: var(--clr-link);
	cursor: pointer;
	list-style: none;
	transition: background-color var(--t-fast);
}
.upd-hist__more > summary::-webkit-details-marker { display: none; }
.upd-hist__more > summary:hover { background: var(--clr-bg-light); }
.upd-hist__more .icon { width: 15px; height: 15px; fill: currentColor; transition: transform var(--t-base); }
.upd-hist__more[open] .icon { transform: rotate(180deg); }
.upd-tl--more { padding: 8px 0 2px; }
@media (max-width: 640px) {
	.upd-hist__head { gap: 8px; padding: 11px 13px; }
	.upd-hist__t { font-size: 14px; }
	.upd-hist__last { display: none; }
	.upd-tl { padding: 2px 13px 10px; }
	.upd-tl__row { grid-template-columns: 76px 16px minmax(0, 1fr); row-gap: 2px; }
	.upd-tl__v { white-space: normal; overflow: visible; }
	.upd-tl__meta { grid-column: 3; gap: 10px; }
	.upd-tl__b { min-width: 0; text-align: left; }
	.upd-hist__note { padding: 9px 13px 12px; }
}

/* ---------- мобільна ---------- */
@media (max-width: 900px) {
	.upd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.upd-item__a {
		grid-template-columns: 56px minmax(0, 1fr);
		grid-template-areas: "time body" "thumb side";
		row-gap: 10px;
	}
	.upd-item__time { grid-area: time; }
	.upd-item__thumb { grid-area: thumb; width: 72px; height: 40px; }
	.upd-item__body { grid-area: body; }
	.upd-item__side { grid-area: side; justify-self: start; }
	.upd-item__title { white-space: normal; }
}
