/* Shared form and card styles used by account, profile and staff pages. */

.tdc-card {
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	padding: 2rem 1.25rem;
}
.tdc-card h1 {
	font-size: 2.1rem;
	line-height: 1.1;
	margin: 0 0 2rem;
}
.tdc-card h2 {
	font-size: 1.1rem;
	margin: 2rem 0 0.75rem;
}

/* Explanatory text needs room, or it reads as part of the field below it. */
.tdc-card p {
	margin: 0 0 1.5rem;
	line-height: 1.5;
}

.field {
	margin-bottom: 1.6rem;
}

/* Small capitals in the brand colour, sitting above an underlined field. The
   label carries the colour so the input itself can be quiet. */
.field label {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-primary);
	margin-bottom: 0.45rem;
}
.field .hint {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.45rem;
}

/* A line, not a box. Less furniture on a page that is mostly fields, and it
   keeps the eye moving down the form. */
.tdc-card input,
.tdc-card select,
.tdc-card textarea {
	width: 100%;
	padding: 0.5rem 0;
	border: none;
	border-bottom: 1px solid var(--border-color);
	border-radius: 0;
	background: transparent;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem; /* 16px stops iPhone zooming in on focus */
	transition: border-color 0.15s ease;
}
.tdc-card input::placeholder,
.tdc-card textarea::placeholder { color: var(--text-muted); }

.tdc-card input:focus,
.tdc-card select:focus,
.tdc-card textarea:focus {
	outline: none;
	border-bottom-color: var(--color-primary);
}

/* A select has no box to hang the native arrow on any more, so it gets its
   own. currentColor keeps it right in both themes. */
.tdc-card select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 1.5rem;
	background-image:
		linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: right 0.6rem center, right 0.3rem center;
	background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
	background-repeat: no-repeat;
}

/* Checkboxes and radios are not full-width fields. */
.tdc-card input[type="checkbox"],
.tdc-card input[type="radio"] {
	width: auto;
	accent-color: var(--color-primary);
	border-bottom: none;
}

.tdc-card button {
	width: 100%;
	padding: 0.9rem 1.25rem;
	margin-bottom: 0.75rem;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.tdc-card button:disabled {
	opacity: 0.5;
	cursor: default;
}
.btn-primary {
	/* Dark text on the brand teal: white on this colour is hard to read. */
	background: var(--color-primary);
	color: #0b1a1b;
}
.btn-secondary {
	background: transparent;
	color: var(--text-primary);
	border: 1px solid var(--border-color) !important;
}
.btn-google {
	background: #fff;
	color: #222;
}

/* The way out of a form is a quiet underlined link, never another button. */
.link-row {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.9rem;
}
.link-row a,
.link-row button.link {
	color: var(--text-primary);
	background: none;
	border: none;
	border-bottom: 1px solid var(--color-primary);
	padding: 0 0 2px;
	width: auto;
	margin: 0;
	font-size: 0.9rem;
	font-weight: normal;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
}

.status {
	text-align: center;
	margin-top: 1rem;
	font-size: 0.9rem;
	min-height: 1.2em;
}
.status.error   { color: var(--color-error); }
.status.success { color: var(--color-success); }

.badge {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	border: 1px solid var(--border-color);
	color: var(--text-muted);
	vertical-align: middle;
}
.badge.verified {
	border-color: var(--color-success);
	color: var(--color-success);
}
/* Staff pages: player search results and selected player */
.results { margin: 0.5rem 0 1rem; }
.tdc-card button.result {
	display: block;
	text-align: left;
	padding: 0.75rem;
	margin-bottom: 0.5rem;
	border: 1px solid var(--border-color);
	background: var(--bg-surface);
	color: var(--text-primary);
	font-weight: normal;
}
.result .sub,
.selected-player .sub { font-size: 0.85rem; color: var(--text-muted); }
.selected-player {
	padding: 0.75rem;
	border: 1px solid var(--color-primary);
	border-radius: 6px;
	margin-bottom: 1rem;
}
.muted { color: var(--text-muted); font-size: 0.85rem; }
.tile-link {
	display: block;
	padding: 1rem;
	margin-bottom: 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	background: var(--bg-surface);
	color: var(--text-primary);
}
.tile-link .sub { display: block; margin-top: 0.25rem; font-size: 0.85rem; color: var(--text-muted); }
/* Staff hub: a glow shows which tier a tool belongs to.
   tile-staff = any staff member. tile-admin = owners and admins only. tile-owner = owners only. */
.tile-link.tile-staff {
	border-color: color-mix(in srgb, var(--color-success) 55%, var(--border-color));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-success) 20%, transparent),
	            0 0 14px color-mix(in srgb, var(--color-success) 20%, transparent);
}
.tile-link.tile-admin {
	border-color: color-mix(in srgb, var(--color-primary) 55%, var(--border-color));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent),
	            0 0 16px color-mix(in srgb, var(--color-primary) 30%, transparent);
}
.tile-link.tile-owner {
	border-color: color-mix(in srgb, var(--color-owner) 55%, var(--border-color));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-owner) 25%, transparent),
	            0 0 16px color-mix(in srgb, var(--color-owner) 30%, transparent);
}
/* Credits page */
.balance-line {
	font-size: 1.3rem;
	font-weight: 600;
	margin: 0 0 1.25rem;
	font-variant-numeric: tabular-nums;
}
/* Redeem codes page */
#result-sub { font-weight: normal; font-size: 0.9rem; color: var(--text-muted); }
.code-list {
	display: grid;
	gap: 0.5rem;
	margin: 1rem 0 1.5rem;
}
.code-item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	background: var(--bg-surface);
}
.code-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 1.15rem;
	letter-spacing: 0.05em;
}
.code-value-credits {
	font-size: 0.85rem;
	color: var(--text-muted);
	white-space: nowrap;
}
@media print {
	.tdc-card { max-width: none; padding: 0; }
	.code-item { border-color: #000; background: #fff; break-inside: avoid; }
	.code-value-credits { color: #000; }
}

/* ── Match list (/matches/) ──────────────────────────────────────── */
.match-card {
	display: block;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 0.85rem 1rem;
	margin-bottom: 0.75rem;
	background: var(--bg-surface);
	color: inherit;
	text-decoration: none;
}
.match-card:hover { border-color: var(--accent-color, #4bb8c4); }
.match-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}
.match-opponent {
	font-size: 1.05rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.match-score {
	flex: 0 0 auto;
	font-size: 1.15rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}
.match-score .win { color: var(--accent-color, #4bb8c4); }
.match-score .dash { color: var(--text-muted); margin: 0 0.3rem; }
.match-meta {
	margin-top: 0.25rem;
	font-size: 0.82rem;
	color: var(--text-muted);
}
.match-tags { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ── New match (/matches/new/) ───────────────────────────────────── */
.chosen {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--border-color);
	margin-bottom: 2rem;
}
.chosen[hidden] { display: none; }
.chosen-avatar {
	flex: 0 0 auto;
	width: 2.75rem; height: 2.75rem;
	border-radius: 50%;
	border: 1px solid var(--border-color);
	background-size: cover; background-position: center;
	display: flex; align-items: center; justify-content: center;
	color: var(--text-muted); font-weight: 600;
}
.chosen-names { flex: 1 1 auto; min-width: 0; }
.chosen-display { font-weight: 600; }
.chosen-full { font-size: 0.82rem; color: var(--text-muted); }
.chosen .link {
	flex: 0 0 auto; width: auto; margin: 0; padding: 0 0 2px;
	background: none; border: none;
	border-bottom: 1px solid var(--color-primary);
	color: var(--text-primary);
	font-size: 0.85rem; font-weight: normal;
	letter-spacing: normal; text-transform: none;
}

/* Everything that is not a main setting, folded away until wanted. */
.set-group {
	border-top: 1px solid var(--border-color);
	padding: 0.9rem 0 0.2rem;
}
.set-group > summary {
	cursor: pointer;
	list-style: none;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 0.9rem;
}
.set-group > summary::-webkit-details-marker { display: none; }
.set-group > summary::after { content: ' +'; color: var(--color-primary); }
.set-group[open] > summary::after { content: ' –'; }

.result-name { display: block; }
.result-sub { display: block; font-size: 0.8rem; color: var(--text-muted); }

/* A link that needs to read as the page's main action. */
.btn-link {
	display: block;
	text-align: center;
	text-decoration: none;
	padding: 0.9rem 1.25rem;
	margin-bottom: 2rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* A checkbox has to be worth aiming a thumb at. */
.field input[type="checkbox"] {
	width: 1.4rem;
	height: 1.4rem;
	margin-top: 0.1rem;
}

/* A match waiting on you is the one thing in the list that is not just history. */
.match-card.needs-you { border-color: var(--color-primary); }
.badge.needs-you {
	border-color: var(--color-primary);
	color: var(--color-primary);
}
.badge.disputed {
	border-color: var(--color-error);
	color: var(--color-error);
}

/* The native dropdown list is drawn by the operating system and does not
   inherit the page's dark background — on Windows it came out as near-white
   text on white. These two properties are the only ones it honours. */
.tdc-card select option {
	background: var(--bg-base);
	color: var(--text-primary);
}
