/* Copyright 2026 davenonymous
 *
 * The home page: banner, server cards, team and rule change. Colours and
 * shared components come from theme.css.
 */

/* --------------------------------------------------------------------- hero */

.hero { position: relative; }
.hero__frame {
	width: min(100%, var(--content-width));
	margin-inline: auto;
	aspect-ratio: 2400 / 1018;
	max-height: 62vh;
	overflow: hidden;
	position: relative;
	border-bottom: 4px solid #0d0a08;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.hero__frame::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background:
		linear-gradient(180deg, rgba(21, 17, 15, 0) 70%, rgba(21, 17, 15, 0.75)),
		radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.45));
}
@media (min-width: 1440px) {
	.hero__frame { border-radius: 0 0 var(--radius-l) var(--radius-l); border-inline: 4px solid #0d0a08; }
}
.hero__image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero__caption {
	position: relative; z-index: 1;
	display: flex; align-items: flex-start; gap: 14px;
	margin-top: -26px;
}
.hero__tag {
	font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.08em;
	padding: 6px 16px; color: var(--text-on-accent);
	background: linear-gradient(180deg, var(--accent-bright), var(--accent));
	border-radius: var(--radius-s); box-shadow: var(--shadow-s);
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.hero__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 30px; color: var(--text-muted); }

/* --------------------------------------------------------------------- team */

.team-layout { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: clamp(16px, 2vw, 28px); align-items: start; }
@media (max-width: 960px) { .team-layout { grid-template-columns: 1fr; } }

.team-card { padding: 20px; display: grid; gap: 18px; }
@media (min-width: 961px) { .team-card { position: sticky; top: calc(var(--topbar-height) + 20px); } }
.team-card__identity { display: grid; justify-items: center; gap: 12px; text-align: center; }
.team-card__avatar { width: 112px; height: 112px; border-radius: var(--radius); object-fit: cover; background: var(--surface-3); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 0 4px var(--edge); }
.team-card__identity > div { min-width: 0; max-width: 100%; }
.team-card__name { font-family: var(--font-display); font-size: 1.7rem; overflow-wrap: break-word; letter-spacing: 0.04em; text-transform: uppercase; }
.team-card__name a { color: var(--text); text-decoration: none; }
.team-card__name a:hover { color: var(--gold); }
.team-card__meta { display: flex; justify-content: center; gap: 10px; align-items: center; margin-top: 6px; color: var(--text-muted); font-size: 0.92rem; }
.team-card__competitions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-card__competitions li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 0.95rem; }
.team-card__record { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.team-card__record div { padding: 10px 6px; text-align: center; border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--edge-soft); }
.team-card__record dt { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.team-card__record dd { margin: 0; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.1; }
.team-card__record .is-win { color: #a6cf6f; }
.team-card__record .is-loss { color: var(--red-bright); }
.team-card__link { justify-self: start; }

.team-main { display: grid; gap: clamp(16px, 2vw, 28px); min-width: 0; }

.roster { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
@media (max-width: 560px) { .roster { padding: 12px; gap: 8px; } .roster__avatar { width: 36px; height: 36px; } .roster__player { gap: 8px; padding: 6px 8px; } }
.roster__player {
	display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-width: 0;
	border-radius: var(--radius); background: rgba(0, 0, 0, 0.22); border: 1px solid var(--edge-soft);
	transition: border-color 120ms ease, background-color 120ms ease;
}
.roster__player:hover { border-color: var(--edge); background: rgba(0, 0, 0, 0.32); }
.roster__avatar { width: 44px; height: 44px; flex: none; border-radius: var(--radius-s); object-fit: cover; background: var(--surface-3); }
.roster__text { display: grid; min-width: 0; }
.roster__name { color: var(--text); text-decoration: none; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster__name:hover { color: var(--gold); }
.roster__role { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster__player--leader { border-color: rgba(227, 179, 62, 0.35); }
.roster__player--leader .roster__role { color: var(--gold); }
.roster__player--deputy .roster__role { color: var(--accent-bright); }
.roster__player--inactive { opacity: 0.55; }

.match-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(16px, 2vw, 28px); align-items: start; }
.panel__head .icon { color: var(--accent-bright); width: 1.3em; height: 1.3em; }
.panel__head .badge { margin-left: auto; }

.matches { list-style: none; margin: 0; padding: 6px 0; }
.match {
	position: relative;
	display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "left vs link" "left info link" "left maps link";
	gap: 4px 14px; align-items: center;
	padding: 12px 18px;
}
.match + .match { border-top: 1px solid rgba(0, 0, 0, 0.3); box-shadow: 0 -1px 0 var(--edge-soft); }
.match__when, .match__score { grid-area: left; }
.match__vs { grid-area: vs; display: flex; align-items: center; gap: 8px; min-width: 0; }
.match__info { grid-area: info; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--text-muted); font-size: 0.85rem; }
.match__link { grid-area: link; color: var(--text-dim); padding: 6px; }
.match__link:hover { color: var(--gold); }
.match__versus { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.match--upcoming { grid-template-areas: "left left link" "vs vs link" "info info link" "maps maps link"; }
.match__maps { grid-area: maps; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.match--upcoming .match__when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.04em; color: var(--gold); }
.match__unscheduled { color: var(--text-muted); }
.match__score {
	display: grid; justify-items: center; width: 64px; padding: 6px 0; border-radius: var(--radius);
	background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge-soft);
}
.match__outcome { font-family: var(--font-display); font-size: 1.1rem; line-height: 1; }
.match__rounds { font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.match--win .match__score { border-color: rgba(126, 163, 77, 0.55); background: var(--good-soft); }
.match--win .match__outcome { color: #a6cf6f; }
.match--loss .match__score { border-color: rgba(184, 56, 59, 0.55); background: var(--red-soft); }
.match--loss .match__outcome { color: var(--red-bright); }
.match--draw .match__outcome { color: var(--text-muted); }

.club { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; font-size: 1.02rem; }
a.club:hover { color: var(--gold); }
.club__avatar { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-3); }
.club__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-chip {
	display: inline-block; padding: 0 7px; border-radius: 3px;
	font-family: var(--font-mono); font-size: 0.76rem; line-height: 1.7;
	color: var(--text-muted); background: rgba(236, 227, 203, 0.06); border: 1px solid var(--edge-soft);
}

/* -------------------------------------------------------------------- rules */

.rule-note {
	position: relative;
	color: var(--paper-ink);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 120px),
		var(--paper);
	border-radius: var(--radius);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.5);
	padding: clamp(20px, 4vw, 44px) clamp(18px, 5vw, 56px) 20px;
	max-width: 980px;
}
.rule-note::before {
	content: ""; position: absolute; top: -10px; left: 50%; width: 120px; height: 22px; transform: translateX(-50%) rotate(-1.5deg);
	background: rgba(227, 179, 62, 0.55); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.rule-note__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--font-ui); font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; color: #7a6850; margin-bottom: 8px; }
.rule-note__head time { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.04em; color: var(--paper-ink); }
.rule-note__body { position: relative; font-family: var(--font-prose); font-size: 1rem; line-height: 1.65; overflow: hidden; }
.rule-note[data-collapsed="true"] .rule-note__body { max-height: 520px; }
.rule-note[data-collapsed="true"] .rule-note__body::after {
	content: ""; position: absolute; inset: auto 0 0 0; height: 140px; pointer-events: none;
	background: linear-gradient(180deg, rgba(244, 238, 223, 0), var(--paper));
}
.rule-note__body h2, .rule-note__body h3, .rule-note__body h4, .rule-note__body h5 {
	font-family: var(--font-display); letter-spacing: 0.03em; color: var(--paper-ink); margin: 1.4em 0 0.4em;
}
.rule-note__body h3 { font-size: 1.45rem; border-bottom: 2px solid rgba(47, 42, 36, 0.2); padding-bottom: 4px; }
.rule-note__body h4 { font-size: 1.2rem; }
.rule-note__body h5 { font-size: 1.05rem; }
.rule-note__body > :first-child { margin-top: 0.4em; }
.rule-note__body a { color: #9a4a1c; text-decoration-color: rgba(154, 74, 28, 0.4); }
.rule-note__body strong { color: #1e1a16; background: linear-gradient(180deg, transparent 55%, rgba(227, 179, 62, 0.45) 55%); }
.rule-note__body img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: var(--radius-s); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.rule-note__body code, .rule-note__body pre { font-family: var(--font-mono); font-size: 0.88em; background: rgba(47, 42, 36, 0.08); border-radius: 4px; }
.rule-note__body code { padding: 1px 5px; }
.rule-note__body pre { padding: 12px 14px; overflow-x: auto; }
.rule-note__body pre code { padding: 0; background: none; }
.rule-note__body blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid rgba(207, 106, 50, 0.6); background: rgba(207, 106, 50, 0.07); }
.rule-note__body table { border-collapse: collapse; margin: 1em 0; display: block; overflow-x: auto; }
.rule-note__body th, .rule-note__body td { border: 1px solid rgba(47, 42, 36, 0.25); padding: 4px 10px; }
.rule-note__source { white-space: pre-wrap; font-family: var(--font-prose); font-size: 0.95rem; margin: 0; background: none; }
.rule-note__more { display: flex; justify-content: center; padding-top: 12px; }
.rule-note__toggle { --btn-fg: var(--paper-ink); border-color: rgba(47, 42, 36, 0.35); }
.rule-note__toggle:hover { background: rgba(47, 42, 36, 0.06); }
.rule-note__toggle .icon { transition: transform 160ms ease; }
.rule-note[data-collapsed="false"] .rule-note__toggle .icon { transform: rotate(180deg); }
