.t1-wrap {
	margin: 0 auto;
	font-family: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
	color: #E6ECF3;
}

.t1-stage {
	position: relative;
	background: #0B1018;
	border-radius: 14px;
	padding: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Sterowanie wisi nad strona przy krawedziach ekranu, poza plansza - dzieki temu
 * nie zabiera ani piksela pola gry. Pokazuje sie tylko na dotyku i tylko w trakcie serii. */
.t1-pads {
	display: none;
	position: fixed;
	top: 50%;
	transform: translateY( -50% );
	z-index: 9;
	gap: 10px;
	align-items: center;
}

/* Domyslnie kierunki pod prawym kciukiem, skok pod lewym.
 * Klasa t1-lefty odwraca uklad dla osob leworecznych. */
.t1-pads-move {
	right: max( 8px, env( safe-area-inset-right ) );
}

.t1-pads-act {
	left: max( 8px, env( safe-area-inset-left ) );
}

/* Skok w dolnym rogu, nie na srodku wysokosci - tam lezy kciuk przy trzymaniu
 * telefonu poziomo (uwaga z testow). Kierunki zostaja na srodku. */
.t1-wrap .t1-pads.t1-pads-act {
	top: auto;
	transform: none;
	bottom: max( 7vh, calc( env( safe-area-inset-bottom ) + 8px ) );
}

.t1-lefty .t1-pads-move {
	right: auto;
	left: max( 8px, env( safe-area-inset-left ) );
}

.t1-lefty .t1-pads-act {
	left: auto;
	right: max( 8px, env( safe-area-inset-right ) );
}

/* Kierunki jeden nad drugim: kciuk przesuwa sie w pionie zamiast siegac w bok.
 * Bieg w prawo na dole, bo uzywa sie go przez wiekszosc serii.
 * Potrojny selektor, bo motywy potrafia narzucac wlasny uklad kontenerom. */
.t1-wrap .t1-pads.t1-pads-move {
	flex-direction: column;
}

.t1-touch.t1-playing .t1-pads {
	display: flex;
}

.t1-pad {
	width: clamp( 58px, 17vh, 104px );
	height: clamp( 58px, 17vh, 104px );
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp( 20px, 5vh, 32px );
	line-height: 1;
	cursor: pointer;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.t1-pad-jump {
	width: clamp( 72px, 21vh, 126px );
	height: clamp( 72px, 21vh, 126px );
}

.t1-stage canvas {
	display: block;
	width: min( 100%, calc( ( 100vh - 30px ) * 16 / 9 ) );
	height: auto;
	border-radius: 8px;
	background: #0B1016;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.t1-rotate,
.t1-save {
	position: absolute;
	inset: 12px;
	z-index: 2;
	border-radius: 8px;
	background: rgba(9, 13, 20, 0.94);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	text-align: center;
}

.t1-rotate[hidden],
.t1-save[hidden] {
	display: none;
}

.t1-rotate-title {
	margin: 0;
	font-size: 18px;
	color: #D42B2B;
}

.t1-rotate-sub {
	margin: 0;
	font-size: 14px;
	color: #8FA0B5;
	max-width: 300px;
}

.t1-save {
	inset: auto 12px 12px 12px;
	background: rgba(9, 13, 20, 0.96);
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	padding: 14px;
	border: 1px solid #223046;
}

.t1-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: left;
}

.t1-field[hidden] {
	display: none;
}

.t1-label {
	font-size: 12px;
	color: #8FA0B5;
}

.t1-save input {
	background: #131C28;
	border: 1px solid #2A3A4E;
	border-radius: 8px;
	color: #E6ECF3;
	padding: 8px 10px;
	font-size: 15px;
	min-width: 180px;
}

.t1-save input:focus-visible {
	outline: 2px solid #D42B2B;
	outline-offset: 1px;
}

.t1-submit {
	align-self: flex-end;
	background: #D42B2B;
	color: #FFFFFF;
	border: 0;
	border-radius: 8px;
	padding: 10px 20px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	min-height: 40px;
}

.t1-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.t1-again {
	align-self: flex-end;
	background: transparent;
	color: #E6ECF3;
	border: 1px solid #2A3A4E;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 15px;
	cursor: pointer;
	min-height: 40px;
}

.t1-again:hover {
	border-color: #45596F;
}

.t1-msg {
	flex-basis: 100%;
	margin: 0;
	font-size: 14px;
	color: #5FCB77;
}

.t1-save:has( .t1-submit:disabled ) .t1-msg {
	color: #8FA0B5;
}

.t1-board {
	margin-top: 16px;
	background: #0B1018;
	border-radius: 14px;
	padding: 16px 18px;
}

.t1-board-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 10px;
}

.t1-board-title {
	font-size: 16px;
	font-weight: 500;
	color: #E6ECF3;
}

.t1-board-season {
	font-size: 13px;
	color: #6E7F94;
	font-variant-numeric: tabular-nums;
}

.t1-board-empty {
	margin: 0;
	font-size: 14px;
	color: #8FA0B5;
}

.t1-board-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.t1-row {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid #17202C;
	font-size: 15px;
}

.t1-row:last-child {
	border-bottom: 0;
}

.t1-pos {
	color: #6E7F94;
	font-variant-numeric: tabular-nums;
}

.t1-row.is-podium .t1-pos,
.t1-row.is-podium .t1-score {
	color: #D42B2B;
}

.t1-row.is-you {
	background: rgba( 212, 43, 43, 0.09 );
	border-radius: 6px;
	padding-left: 6px;
	padding-right: 6px;
}

.t1-row.is-you .t1-nickname::after {
	content: " (Ty)";
	color: #6E7F94;
	font-size: 13px;
}

.t1-nickname {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.t1-score {
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.t1-off {
	padding: 16px;
	border-radius: 10px;
	background: #F1EFE8;
	color: #444441;
	font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
	.t1-wrap * {
		animation: none !important;
		transition: none !important;
	}
}

.t1-diag {
	margin-top: 12px;
	padding: 14px 16px;
	border-radius: 10px;
	background: #2A1520;
	border: 1px solid #7A2B4C;
	color: #F3D4DE;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13px;
	line-height: 1.6;
	white-space: pre-wrap;
}

.t1-diag[hidden] {
	display: none;
}


/* ---- Tryb immersyjny: na telefonie plansza przejmuje cale okno ----
 * Bez tego gra siedzi w kolumnie tresci motywu i traci wiekszosc ekranu. */
.t1-wrap.t1-touch.t1-playing {
	position: fixed;
	inset: 0;
	z-index: 99998;
	max-width: none;
	margin: 0;
	padding: 0;
	background: #05080C;
	display: flex;
	align-items: center;
	justify-content: center;
}

.t1-wrap.t1-touch.t1-playing .t1-stage {
	width: 100%;
	height: 100%;
	padding: 0;
	border-radius: 0;
	background: transparent;
}

.t1-wrap.t1-touch.t1-playing .t1-stage canvas {
	width: min( 100vw, calc( 100vh * 16 / 9 ) );
	max-width: 100vw;
	border-radius: 0;
}

.t1-wrap.t1-touch.t1-playing .t1-board {
	display: none;
}

body.t1-lock {
	overflow: hidden;
}

/* ---- Odporność na style motywu ----
 * Motywy czesto ustawiaja wlasne tlo i obramowanie dla kazdego <button>.
 * Wyzsza specyficznosc plus reset appearance zabezpiecza wyglad sterowania. */
.t1-wrap .t1-pads .t1-pad,
.t1-wrap .t1-save .t1-submit,
.t1-wrap .t1-save .t1-again {
	-webkit-appearance: none;
	appearance: none;
	background-image: none;
	box-shadow: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
}

.t1-wrap .t1-pads .t1-pad {
	background-color: rgba( 255, 255, 255, 0.07 );
	border: 1px solid rgba( 255, 255, 255, 0.2 );
	border-radius: 50%;
	color: rgba( 255, 255, 255, 0.62 );
}

.t1-wrap .t1-pads .t1-pad-jump {
	color: rgba( 212, 43, 43, 0.8 );
	border-color: rgba( 212, 43, 43, 0.35 );
}

.t1-wrap .t1-pads .t1-pad.is-on {
	background-color: rgba( 212, 43, 43, 0.22 );
	border-color: rgba( 212, 43, 43, 0.65 );
	color: #FFFFFF;
}

.t1-wrap .t1-save .t1-submit {
	background-color: #D42B2B;
	color: #FFFFFF;
	border: 0;
}

.t1-wrap .t1-save .t1-again {
	background-color: transparent;
	color: #E6ECF3;
	border: 1px solid #2A3A4E;
}

/* Plotno jest fokusowalne, zeby klawisze trafialy do gry. Obrys pokazujemy
 * tylko przy nawigacji klawiatura, nie po kliknieciu mysza. */
#t1-canvas:focus {
	outline: none;
}

#t1-canvas:focus-visible {
	outline: 3px solid #D42B2B;
	outline-offset: -3px;
}
