/* RoboChallenge Live. Every color is a variable (the site will be redesigned). */
:root {
	--brand: #21d4fd;          /* site primary cyan (Resources/CSS/style.css) */
	--brand-2: #2271bb;        /* site button gradient end */
	--accent: #b721ff;
	--navy: #061d3f;
	--navy-2: #050e2f;
	--bg: #f2f5f9;
	--surface: #ffffff;
	--surface-2: #eef2f7;
	--text: #1d1d1d;
	--muted: #5b6676;
	--line: #dde3ea;
	--on-brand: #ffffff;
	--on-status: #ffffff;    /* text on status chips and result dots */
	--on-soon: #1d1d1d;
	--st-onfield: #e0182d;
	--st-next: #f26a00;
	--st-soon: #e3a400;
	--st-waiting: #6b7684;
	--st-done: #2e8b57;
	--st-timed: #2271bb;
	--win: #2e8b57;
	--loss: #c62828;
	--draw: #6b7684;
	--warn-bg: #fff4d6;
	--warn-text: #7a5600;
	--shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .06);
	--radius: 14px;
	--font: "Roboto Condensed", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #071226;
		--surface: #0f1d36;
		--surface-2: #16284a;
		--text: #e9eef6;
		--muted: #9aa8bd;
		--line: #23385e;
		--st-waiting: #8a96a8;
		--warn-bg: #3a2e05;
		--warn-text: #ffd977;
		--shadow: 0 1px 3px rgba(0, 0, 0, .4);
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
	font: 16px/1.4 var(--font);
	padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
[hidden] { display: none !important; }

/* top bar + tabs */
.top {
	position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
	padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--navy); color: var(--on-brand);
}
.top .logo { height: 36px; width: auto; }
.top .app-name { font-weight: 700; letter-spacing: .5px; color: var(--brand); text-transform: uppercase; }
.icon-btn {
	margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .12); color: var(--on-brand); font-size: 22px; cursor: pointer;
}
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs {
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex;
	background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
	flex: 1; padding: 14px 4px; border: 0; background: none; color: var(--muted);
	font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: .4px; cursor: pointer;
}
.tabs button.on { color: var(--brand-2); box-shadow: inset 0 3px 0 var(--brand); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.banner { padding: 8px 16px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; text-align: center; }
.updated { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 20px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* forms */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.panel h1 { font-size: 22px; margin: 0 0 6px; }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input[type=email], input[type=text], input[inputmode=numeric], select, textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface-2); font-size: 18px;
}
input.code { letter-spacing: 8px; text-align: center; font-size: 28px; font-weight: 700; }
.btn {
	display: inline-block; width: 100%; margin-top: 14px; padding: 14px 18px; border: 0; border-radius: 26px;
	background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: var(--on-brand);
	font-weight: 700; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; text-align: center; text-decoration: none;
}
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--loss); }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; padding: 0; color: var(--brand-2); text-decoration: underline; cursor: pointer; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.msg.err { background: var(--warn-bg); color: var(--warn-text); }

/* match cards */
.card {
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
	margin-bottom: 14px; overflow: hidden; border-left: 6px solid var(--st-waiting);
}
.card.st-on_field { border-left-color: var(--st-onfield); }
.card.st-next { border-left-color: var(--st-next); }
.card.st-soon { border-left-color: var(--st-soon); }
.card.st-done { border-left-color: var(--st-done); }
.card.st-timed { border-left-color: var(--st-timed); }
.card.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px var(--brand); } }
.card-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 0; }
.card-head .who { flex: 1; min-width: 0; }
.robot { font-size: 20px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.cat { color: var(--muted); font-size: 14px; }
.chip {
	flex: none; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .3px; color: var(--on-status); background: var(--st-waiting); white-space: nowrap;
}
.chip.st-on_field { background: var(--st-onfield); animation: pulse 1.2s ease-in-out infinite; }
.chip.st-next { background: var(--st-next); }
.chip.st-soon { background: var(--st-soon); color: var(--on-soon); }
.chip.st-done { background: var(--st-done); }
.chip.st-timed { background: var(--st-timed); }
.chip.is-final { background: var(--st-done); }   /* the category ranking is final */
.card-head .chip + .chip { margin-left: -4px; }
.res-group h3 .chip { margin-left: 6px; padding: 2px 8px; font-size: 11px; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .65; } }
.field-box { display: flex; align-items: center; gap: 14px; margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.field-box .lbl { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.field-box .val { font-size: 40px; font-weight: 800; line-height: 1; color: var(--brand-2); overflow-wrap: anywhere; }
.field-box .val.hint { font-size: 16px; font-weight: 700; }
.field-box .ahead { margin-left: auto; text-align: right; }
.field-box .ahead b { display: block; font-size: 32px; line-height: 1; }
.card-body { padding: 12px 16px 14px; }
.row { display: flex; gap: 8px; margin: 4px 0; }
.row .k { color: var(--muted); min-width: 88px; }
.row .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opp { font-weight: 700; }
.team-tag, .flag-tag {
	display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 6px;
	border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-left: 4px; vertical-align: middle;
}
.flag-tag.missing { background: var(--loss); color: var(--on-status); }
.sched { margin: 6px 0 0; padding: 0; list-style: none; }
.sched li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.sched li.now { font-weight: 700; color: var(--brand-2); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }

/* results */
.res-group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 12px; }
.res-group h3 { margin: 0; font-size: 17px; }
.res-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.res-item:first-of-type { border-top: 0; }
.res-item .what { flex: 1; min-width: 0; }
.res-item .score { font-weight: 800; font-size: 18px; white-space: nowrap; }
.oc { font-size: 12px; font-weight: 800; width: 24px; height: 24px; border-radius: 50%; color: var(--on-status); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.oc.win { background: var(--win); } .oc.loss { background: var(--loss); } .oc.draw, .oc.bye { background: var(--draw); }
.year { font-size: 13px; font-weight: 700; color: var(--accent); }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--brand-2); color: var(--on-brand); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: var(--on-status); transition: .2s; }
.switch input:checked + span { background: var(--brand-2); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; }
.guide { margin: 8px 0 0; padding-left: 20px; }
.guide li { margin: 6px 0; }
.share-ico { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

@media print { .top, .tabs, .banner { display: none; } body { padding: 0; background: var(--surface); } }
