/* RESET */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	scrollbar-width: none;
}

*::-webkit-scrollbar {
	display: none;
}

button, a {
	font-size: 1em;
	color: var(--black);
	font-family: inherit;
	font-weight: 600;
}

[hidden] { display: none !important; }

/* SHARED THEME, USED BY BOTH PAGES */
html:has(.page-dashboard) {
	background: var(--pink);
}

:root {
	--pink: #e6b5b2;
	--green: #2c5745;
	--orange: #e55604;
	--white: #fff;
	--black: #000;
	--muted-black: #0000004f;
	--muted: #ffffff8f;
}

body {
	font-family: 'Space Grotesk', monospace;
	font-size: 16px;
	background: var(--pink);
	color: var(--black);
	min-height: 100vh;
	font-weight: 700;
	padding: 20px;
	box-sizing: border-box;
	display: flex;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	user-select: none;
	flex-direction: column;
	overflow-x: hidden;
}


.margin-top-10 { margin-top: 10px; }

.margin-bottom-10 { margin-bottom: 10px; }
.margin-bottom-20 { margin-bottom: 20px; }

.padding-10 { padding: 10px; }

.logo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 2em;
}

.logo-pig {
	height: 45px;
	width: auto;
	object-fit: cover;
}

#eye {
	animation: eye-move 8s ease-out 2s 1;
	transform-box: fill-box;
	transform-origin: center;
}

@keyframes eye-move {
	0%   { transform: translate(0, 0); }
	12%  { transform: translate(8.38px, 0.36px); }
	50%  { transform: translate(8.38px, 0.36px); }
	62%  { transform: translate(0, 0); }
	100% { transform: translate(0, 0); }
}

.page-dashboard {
	padding: 0;
	padding-top: 20px;
}
.page-dashboard .card::after {
	content: none;
}

.page-dashboard .card {
	box-shadow: 4px 4px 0 var(--black);
	overflow: hidden;
	padding-bottom: 20px;
}
.page-dashboard .card-status {
	margin-bottom: 10px;
}
.page-dashboard .card-sub {
	position: absolute;
	background: var(--muted-black);
	color: var(--muted);
	width: 100%;
	left: 0;
	bottom: 0;
	padding: 2px;
	padding-left: 15px;
	font-size: .7em;
	border-radius: 0 0 18px 0;
}

.page-court:not(.success) {
	background: var(--green);
}

.page-court.inuse {
	background: var(--orange);
}

.page-court .logo span {
	color: var(--white);
	-webkit-text-stroke: 4px var(--black);
}

.page-court .card {
	border: 2px solid var(--black);
}

.page-court.success {
	background: var(--pink);
}

.page-court.success .card {
	background: transparent;
	border-radius: 0;
	border: none;
	padding: 0;
	box-shadow: none;
}

.page-court.success .card::after {
	content: none;
}

.page-court.success .logo-pig {
	opacity: 0;
}

.page-court.success .logo span {
	color: var(--black);
	-webkit-text-stroke: 2px var(--black);
}

.bom-jogo {
	font-size: 3em;
	font-weight: 700;
	color: var(--black);
	line-height: 1;
}

.bom-jogo-countdown {
	position: fixed;
	bottom: 20px;
	right: 20px;
	font-size: 2.5em;
	font-weight: 700;
	color: var(--black);
}

.page-court .finish-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 2px solid var(--black);
	background: var(--white);
	color: var(--black);
	box-shadow: 4px 4px 0 var(--black);
}

.page-court .submit {
	background: transparent;
	border: 2px solid var(--black);
}

.page-court .dur-btn {
	border: 2px solid var(--black);
	background: transparent;
	color: var(--white);
}

.page-court .dur-btn.selected {
	background: var(--white);
	color: var(--black);
	box-shadow: 4px 4px 0 var(--black);
}

.page-court .info-link {
	position: static;
	background: transparent;
	color: var(--white);
	width: auto;
	padding: 20px 0 0;
}

header {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
}

.logo span {
	color: var(--black);
	-webkit-text-stroke: 2px var(--black);
	paint-order: stroke fill;
}

.toolbar-wrap {
	position: relative;
}

.toolbar {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 5px;
	padding: 0 20px;
	overflow-x: scroll;
}

.filter-hint {
	position: absolute;
	top: 105%;
	left: 0;
	right: 0;
	z-index: 10;
	padding: 0 20px;
	font-size: 0.6em;
	pointer-events: none;
	font-weight: 400;
	text-align: center;
	transform: translateY(-100%);
	opacity: 0;
	animation: filter-hint-slide 5s ease-in-out 2s forwards;
}

@keyframes filter-hint-slide {
	0%   { transform: translateY(-50%); opacity: 0; }
	5%  { transform: translateY(0);     opacity: 1; }
	95%  { transform: translateY(0);     opacity: 1; }
	100% { transform: translateY(-50%); opacity: 0; }
}

.filter-tags {
	display: flex;
	flex-wrap: nowrap;
	gap: 5px;
}

.view-toggle {
	display: flex;
	align-items: center;
	height: 40px;
	background: #fff;
	border: 2px solid #000;
	border-radius: 100px;
	padding: 3px;
	flex-shrink: 0;
}

.divider {
	height: 0;
	background: none;
	border-top: 2px dashed var(--black);
	margin: 20px 0;
}

.view-toggle-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 33px;
	border: none;
	background: transparent;
	border-radius: 20px;
	font-family: inherit;
	text-transform: uppercase;
}

.view-toggle-btn.active {
	background: #000;
	color: #fff;
}

.view-toggle-btn img, #back-link img {
	width: 15px;
	height: auto;
}
.link-icon {
	height: 20px;
	width: auto;
}

.view-toggle-btn.active img {
	filter: invert(1);
}

.filter-tag:focus {
	outline: none;
}

.filter-tag {
	display: inline-flex;
	align-items: center;
	height: 40px;
	gap: 5px;
	padding: 0 15px;
	border-radius: 100px;
	border: 2px solid #000;
	background: none;
	font-family: inherit;
	user-select: none;
	font-weight: 600;
	text-transform: uppercase;
	transition: all 0.15s;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}

.filter-tag-icon {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.filter-tag.active .filter-tag-icon {
	transform: rotate(135deg);
}

.filter-tag.active {
	background: #fff;
	border-color: #000;
	color: #000;
}

.grid {
	display: grid;
	grid-template-columns: 1fr;
	align-content: start;
	gap: 10px;
	flex: 1;
	padding: 20px;
	padding-bottom: 60px;
}

.grid[hidden] {
	display: none;
}

.grid.grid--empty {
	align-content: center;
	justify-items: center;
}

.empty {
	text-align: center;
	font-size: 1.5em;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.empty-pig {
	height: 80px;
	width: auto;
	transform: rotate(180deg);
}


#map {
	flex: 1;
	border: 2px solid var(--black);
	overflow: hidden;
	margin: 20px;
	margin-bottom: 60px;
}

.maplibregl-marker svg path {
	fill: var(--green);
}

.maplibregl-marker svg ellipse {
	display: none;
}

.marker-occupied svg path {
	fill: var(--orange);
}

.maplibregl-popup-content {
	background: var(--green);
	color: var(--white);
	font-family: 'Space Grotesk', monospace;
	font-weight: 400;
	padding: 5px 10px;
	box-shadow: 3px 3px 0 var(--black);
	border: var(--black);
	border-radius: 5px;
}

.popup-occupied .maplibregl-popup-content {
	background: var(--orange);
}

.maplibregl-popup-tip {
	display: none;
}

.maplibregl-popup-close-button {
	display: none;
}

.popup-link {
	color: inherit;
	text-decoration: none;
	display: block;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.popup-body {
	display: flex;
	align-items: center;
	gap: 10px;
}

.popup-name {
	font-weight: 700;
	font-size: 1em;
	line-height: 1;
}

.popup-desc {
	font-size: 0.8em;
	font-weight: 400;
	color: var(--white);
	line-height: 1;
	margin-top: 5px;
}


.card {
	padding: 15px;
	text-decoration: none;
	color: #fff;
	width: 100%;
	border: none;
	border-radius: 20px 20px 20px 0;
	position: relative;
}

.card::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	transform: translate(6px, 6px);
	z-index: -1;
	border: 2px solid var(--black);
}

.card.available {
	background: var(--green);
}

.card.inuse {
	background: var(--orange);
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.badge-group {
	display: flex;
	gap: 5px;
	flex-wrap: nowrap;
}

.city,
.court-label {
	font-weight: 700;
	font-size: 0.8em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.8);
	display: flex;
	align-items: center;
	gap: 6px;
}

.city-flag {
	width: 18px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 30px;
	border: 2px solid #000;
	background: #fff;
	color: #000;
	font-size: 0.8em;
	font-weight: 700;
	text-transform: uppercase;
	width: fit-content;
	white-space: nowrap;
}

.badge-icon {
	height: 15px;
	width: auto;
	margin-right: 5px;
	vertical-align: middle;
}

.badge.available,
.badge.inuse,
.badge.time {
	background: #fff;
	color: #000;
}

.card-status {
	font-size: 1.8em;
	font-weight: 700;
	color: var(--white);
	text-transform: uppercase;
	line-height: 1;
	margin: 5px 0;
}

.card-sub {
	color: var(--muted);
	font-weight: 400;
}

.card-sub b {
	color: var(--white);
}

.info-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 10px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-align: center;
	position: fixed;
	bottom: 0;
	background: var(--pink);
	width: 100%;
	left: 0px;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.info-toggle {
	display: flex;
	justify-content: center;
	padding: 20px;
	padding-top: 0px;
}

#infoToggle {
	width: 100%;
}

#infoToggle .view-toggle-btn {
	flex: 1;
	gap: 5px;
	font-size: .8em;
	font-weight: 700;
}

.info-hero {
	position: relative;
	right: -20px;
	height: 30vh;
	overflow: hidden;
	pointer-events: none;
	margin: 20px 0;
}

.info-pig {
	position: absolute;
	right: -40%;
	top: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	overflow: visible;
}

.info-content {
	padding: 0 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.info-heading {
	font-size: 1.5em;
	font-weight: 700;
	color: #000;
}

.info-sub1 {
	font-size: 1.2em;
	font-weight: 700;
	color: rgba(0, 0, 0, 0.7);
}

.info-sub2, .info-sub2 a {
	font-weight: 700;
	color: rgba(0, 0, 0, 0.4);
}

.duration-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.dur-btn {
	padding: 10px 0;
	border-radius: 10px;
	font-family: inherit;
	font-weight: 500;
	transition: all 0.15s;
}

.submit {
	width: 100%;
	margin-top: 15px;
	padding: 15px;
	border: none;
	border-radius: 10px;
}

.submit:disabled {
	pointer-events: none;
}

.message {
	text-align: center;
	color: var(--white);
	font-weight: 400;
}


.finish-btn {
	width: 100%;
	padding: 15px;
	border-radius: 10px;
	background: transparent;
	font-family: inherit;
	font-weight: 600;
	margin-top: 15px;
}

.finish-btn:disabled {
	pointer-events: none;
	opacity: 0.4;
}

.finish-btn.extend-confirming:disabled {
	opacity: 1;
}

.extend-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 10px;
}

.extend-row .finish-btn {
	margin-top: 0;
}

@media (min-width: 768px) {
	body {
		max-width: 430px;
		margin: 0 auto;
	}
}
