/* Player's phone. */

body.play {
	margin: 0;
	min-height: 100dvh;
	background: var(--game-background);
	color: #f5f5f4;
	font-family: 'Inter', sans-serif;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

#join {
	max-width: 420px;
	margin: 0 auto;
	padding: 24px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#join h1 {
	margin: 0 0 8px;
	font-size: 26px;
}

#join label, #join .label {
	font-weight: bold;
	margin-top: 8px;
}

#join input {
	font: inherit;
	font-size: 20px;
	padding: 12px;
	border-radius: 8px;
	border: 2px solid #78716c;
	background: #fafaf9;
	color: #1c1917;
	-webkit-user-select: text;
	user-select: text;
}

.colors {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.swatch {
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--dark);
	border: 4px solid transparent;
	cursor: pointer;
}

.swatch.selected {
	border-color: #fff;
	box-shadow: 0 0 0 3px var(--dark);
}

#join button[type=submit], #join button.secondary {
	font: inherit;
	font-size: 20px;
	font-weight: bold;
	padding: 14px;
	border-radius: 8px;
	border: 0;
	background: #f5f5f4;
	color: #1c1917;
	margin-top: 12px;
}

#join button.secondary {
	background: transparent;
	color: #f5f5f4;
	border: 2px solid #78716c;
	margin-top: 0;
	font-size: 16px;
}

#join button.danger {
	color: #fecaca;
	border-color: #7f1d1d;
}

.error {
	color: #fecaca;
	background: #7f1d1d;
	padding: 8px 12px;
	border-radius: 6px;
	margin: 0;
}

#game {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	padding: 12px 16px;
	box-sizing: border-box;
	gap: 12px;
}

#game[hidden] {
	display: none;
}

#me {
	background: var(--dark);
	color: var(--light);
	border-radius: 10px;
	padding: 10px 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.me-name {
	font-weight: bold;
	font-size: 20px;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	overflow-wrap: anywhere;
}

.me-name .edit {
	font: inherit;
	font-size: 12px;
	font-weight: normal;
	background: transparent;
	color: inherit;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 2px 6px;
	opacity: 0.8;
}

.me-score {
	font-size: 18px;
	white-space: nowrap;
}

#main {
	flex: 1;
	display: flex;
}

.buzzer {
	flex: 1;
	border-radius: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px;
	min-height: 50dvh;
	border: 0;
	font: inherit;
	color: inherit;
	background: #57534e;
	touch-action: manipulation;
}

.buzzer .big {
	font-size: 44px;
	font-weight: bold;
	overflow-wrap: anywhere;
}

.buzzer .small {
	font-size: 18px;
	margin-top: 8px;
	opacity: 0.85;
}

.buzzer.idle {
	background: transparent;
	border: 2px dashed #78716c;
}

.buzzer.locked {
	background: #57534e;
	color: #a8a29e;
}

.buzzer.live {
	background: var(--dark);
	color: var(--light);
	box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
	cursor: pointer;
}

.buzzer.live .big {
	font-size: 64px;
}

.buzzer.live:active, .buzzer.live.pending {
	transform: translateY(6px);
	box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
	filter: brightness(1.2);
}

.buzzer.mine, .buzzer.other {
	background: var(--dark);
	color: var(--light);
}

.buzzer.pulse {
	animation: glow 0.8s ease-in-out infinite alternate;
}

@keyframes glow {
	from { box-shadow: 0 0 0 0 #fff; }
	to { box-shadow: 0 0 0 10px #fff; }
}

#top {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 15px;
}

.toprow {
	display: flex;
	justify-content: space-between;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--dark);
	color: var(--light);
}

.toprow.mine {
	font-weight: bold;
	outline: 2px solid #fff;
}

.offline-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: #7f1d1d;
	color: #fecaca;
	text-align: center;
	padding: 8px;
	font-size: 14px;
}
