.betaNotice {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 22px;
  z-index: 10001;
  background: rgba(79, 142, 247, 0.13);
  backdrop-filter: blur(6px);
  color: rgba(180, 210, 255, 0.75);
  border-bottom: 1px solid rgba(79, 142, 247, 0.2);
  padding: 0 12px;
  line-height: 22px;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  user-select: none;
  -webkit-user-select: none;
}
.betaNoticeLink {
  color: rgba(122, 167, 255, 0.9);
  text-decoration: underline;
}
.betaNoticeLink:hover {
  color: #fff;
}

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--bg: #070b14;
	--surface: rgba(255, 255, 255, 0.042);
	--surface-h: rgba(255, 255, 255, 0.07);
	--border: rgba(255, 255, 255, 0.075);
	--text: rgba(221, 227, 245, 0.9);
	--muted: #58698e;
	--swim: #e05252;
	--swim-glow: rgba(224, 82, 82, 0.22);
	--green: #3ddc84;
	--gold: #ffd060;
}

html {
	height: 100%;
}

body {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	background: var(--bg);
	color: var(--text);
	height: 100%;
	display: flex;
	flex-direction: column;
	padding-top: 22px;
}

/* Header */
header {
	flex-shrink: 0;
	height: 52px;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 0 1.25rem;
	background: rgba(7, 11, 20, 0.88);
	backdrop-filter: blur(18px);
	border-bottom: 1px solid var(--border);
	z-index: 50;
}

.hdr-home {
	text-decoration: none;
	color: var(--muted);
	font-size: 0.8rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	transition: color 0.15s;
}

.hdr-home:hover {
	color: var(--text);
}

.hdr-sep {
	width: 1px;
	height: 16px;
	background: var(--border);
}

.hdr-title {
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--swim);
}

.hdr-info {
	margin-left: auto;
	font-size: 0.78rem;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.hdr-code {
	font-weight: 700;
	color: var(--text);
	letter-spacing: 0.06em;
}

/* === LOBBY SCREEN === */
#lobby-screen {
	flex: 1;
	overflow-y: auto;
	max-width: 460px;
	width: 100%;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
}

.lobby-hero {
	text-align: center;
	margin-bottom: 2rem;
}

.lobby-badge {
	display: inline-block;
	padding: 0.2rem 0.7rem;
	border-radius: 100px;
	background: rgba(224, 82, 82, 0.1);
	border: 1px solid rgba(224, 82, 82, 0.22);
	font-size: 10px;
	font-weight: 600;
	color: var(--swim);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 0.9rem;
}

.lobby-hero h1 {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 2.4rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	background: linear-gradient(135deg, var(--text) 20%, var(--swim) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 0.5rem;
}

.lobby-hero p {
	font-size: 0.84rem;
	color: var(--muted);
	line-height: 1.65;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 18px;
	padding: 1.35rem 1.4rem;
}

.panel+.panel {
	margin-top: 0.85rem;
}

.panel-title {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 0.9rem;
}


.panel-open-lobbies {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.panel-open-lobbies-refresh-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--muted);
	font-size: 0.82rem;
	padding: 2px 5px;
	border-radius: 6px;
	transition: color 0.15s;
	line-height: 1;
}

.panel-open-lobbies-refresh-btn:hover {
	color: var(--swim);
}

.panel-open-lobbies-list {
	font-size: 0.8rem;
	color: var(--muted);
	text-align: center;
	padding: 0.25rem 0;
}


.field {
	margin-bottom: 0.7rem;
}

.field label {
	display: block;
	font-size: 0.77rem;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 0.3rem;
}

input[type="text"] {
	width: 100%;
	padding: 0.58rem 0.85rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--border);
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.87rem;
	color: var(--text);
	outline: none;
	transition: border-color 0.15s;
}

input:focus {
	border-color: var(--swim);
}

input::placeholder {
	color: var(--muted);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.58rem 1.35rem;
	border-radius: 100px;
	font-family: inherit;
	font-size: 0.84rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.15s;
	white-space: nowrap;
}

.btn:hover:not(:disabled) {
	opacity: 0.85;
	transform: translateY(-1px);
}

.btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	transform: none !important;
}

.btn-swim {
	background: var(--swim);
	color: #fff;
}

.btn-ghost {
	background: var(--surface-h);
	border: 1px solid var(--border);
	color: var(--text);
}

.btn-full {
	width: 100%;
}

.or-divider {
	text-align: center;
	font-size: 0.75rem;
	color: var(--muted);
	margin: 0.5rem 0;
	position: relative;
}

.or-divider::before,
.or-divider::after {
	content: '';
	position: absolute;
	top: 50%;
	width: calc(50% - 1.5rem);
	height: 1px;
	background: var(--border);
}

.or-divider::before {
	left: 0;
}

.or-divider::after {
	right: 0;
}

.player-list {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.player-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.48rem 0.65rem;
	background: var(--surface-h);
	border-radius: 10px;
}

.p-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	font-size: 0.85rem;
}

.p-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.p-name {
	font-size: 0.85rem;
	font-weight: 600;
	flex: 1;
}

.p-host {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 100px;
	background: rgba(224, 82, 82, 0.12);
	border: 1px solid rgba(224, 82, 82, 0.25);
	color: var(--swim);
}

.err-msg {
	padding: 0.5rem 0.8rem;
	border-radius: 10px;
	margin-top: 0.5rem;
	background: rgba(224, 82, 82, 0.08);
	border: 1px solid rgba(224, 82, 82, 0.2);
	font-size: 0.81rem;
	color: var(--swim);
	display: none;
}

.err-msg.show {
	display: block;
}

/* === GAME SCREEN === */
#game-screen {
	display: none;
}

#game-screen.active {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

/* Opponents */
#opponents {
	padding: 0.65rem 1rem;
	display: flex;
	gap: 0.65rem;
	overflow-x: auto;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
	scrollbar-width: thin;
}

.opp-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.7rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	flex-shrink: 0;
	min-width: 96px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.opp-card.is-turn {
	border-color: var(--swim);
	box-shadow: 0 0 14px var(--swim-glow);
}

.opp-card.is-knocked {
	border-color: var(--gold);
	box-shadow: 0 0 14px rgba(255, 208, 96, 0.2);
}

.opp-card.eliminated {
	opacity: 0.28;
}

.opp-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-size: 0.85rem;
	flex-shrink: 0;
}

.opp-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.opp-name {
	font-size: 0.7rem;
	font-weight: 600;
	max-width: 76px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: center;
}

.opp-bottom {
	display: flex;
	align-items: center;
	gap: 5px;
}

.opp-cards {
	display: flex;
	gap: 2px;
}

.opp-lives {
	display: flex;
	gap: 3px;
}

.life-pip {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--swim);
	box-shadow: 0 0 5px var(--swim-glow);
}

.life-pip.empty {
	background: rgba(255, 255, 255, 0.1);
	box-shadow: none;
}

/* Playing cards */
.pcard {
	width: 82px;
	height: 118px;
	background: #fff;
	border-radius: 9px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	position: relative;
	flex-shrink: 0;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, outline 0.1s;
	display: flex;
	flex-direction: column;
	padding: 5px 7px;
	user-select: none;
}

.pcard .cr {
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1.15;
}

.pcard .cb {
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1.15;
	transform: rotate(180deg);
	align-self: flex-end;
	margin-top: auto;
}

.pcard .cm {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 2.1rem;
	pointer-events: none;
}

.pcard.red {
	color: #cc2222;
}

.pcard.black {
	color: #111;
}

.pcard.back {
	background: repeating-linear-gradient(45deg, #1a2d5a 0px, #1a2d5a 5px, #1e3368 5px, #1e3368 10px);
	border-color: #2a4090;
	cursor: default;
}

.pcard.back::after {
	content: '';
}

.pcard:not(.back):hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.pcard.selected {
	transform: translateY(-12px) !important;
	box-shadow: 0 0 0 3px var(--swim), 0 12px 28px rgba(224, 82, 82, 0.5) !important;
}

.pcard.pick-me {
	outline: 2px dashed rgba(224, 82, 82, 0.6);
	outline-offset: 3px;
}

.pcard.pick-center {
	outline: 2px dashed rgba(61, 220, 132, 0.7);
	outline-offset: 3px;
}

/* Small card backs for opponents */
.pcard-sm {
	width: 22px;
	height: 32px;
	border-radius: 4px;
	background: repeating-linear-gradient(45deg, #1a2d5a 0px, #1a2d5a 3px, #1e3368 3px, #1e3368 6px);
	border: 1px solid #2a4090;
	flex-shrink: 0;
}

/* Card animations */
@keyframes cardDeal {
	0% {
		opacity: 0;
		transform: translate(-18px, -22px) scale(0.82) rotate(-6deg);
	}

	100% {
		opacity: 1;
		transform: translate(0, 0) scale(1) rotate(0deg);
	}
}

@keyframes cardSwap {
	0% {
		opacity: 0.5;
		transform: scale(0.88) rotate(-4deg);
	}

	55% {
		transform: scale(1.07) rotate(1.5deg);
	}

	100% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
}

.pcard.anim-deal {
	animation: cardDeal 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pcard.anim-swap {
	animation: cardSwap 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Center — takes remaining space, scrolls if needed */
#center-area {
	flex: 1;
	min-height: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	overflow-y: auto;
}

.center-label {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

#center-row {
	display: flex;
	align-items: center;
}

#center-cards {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

/* Deck stack — absolute, far left of center area */
#deck-stack {
	position: absolute;
	left: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	width: 82px;
	height: 118px;
	display: none;
}

.deck-layer {
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(45deg, #1a2d5a 0px, #1a2d5a 5px, #1e3368 5px, #1e3368 10px);
	border-radius: 9px;
	border: 1px solid #2a4090;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.knock-indicator {
	font-size: 0.78rem;
	color: var(--gold);
	font-weight: 600;
	background: rgba(255, 208, 96, 0.08);
	border: 1px solid rgba(255, 208, 96, 0.2);
	padding: 0.3rem 0.8rem;
	border-radius: 100px;
	animation: pulse 1.5s ease infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.55;
	}
}

/* My area — sticks to bottom via flexbox */
#my-area {
	flex-shrink: 0;
	border-top: 1px solid var(--border);
	padding: 0.7rem 1rem 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	background: var(--bg);
}

.my-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.my-name-lives {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.82rem;
	font-weight: 600;
}

.my-pts {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--swim);
}

.opp-pts {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--swim);
}

.my-lives {
	display: flex;
	gap: 3px;
}

.turn-pill {
	font-size: 0.72rem;
	font-weight: 700;
	padding: 0.18rem 0.6rem;
	border-radius: 100px;
	background: rgba(224, 82, 82, 0.14);
	border: 1px solid rgba(224, 82, 82, 0.28);
	color: var(--swim);
	animation: pulse 1.5s ease infinite;
}

.wait-pill {
	font-size: 0.72rem;
	color: var(--muted);
}

#my-cards {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
}

/* Actions */
#actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	justify-content: center;
	margin-top: 0.4rem;
}

.act-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 1rem;
	border-radius: 100px;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	border: 1px solid var(--border);
	cursor: pointer;
	background: var(--surface-h);
	color: var(--text);
	transition: opacity 0.15s, transform 0.15s, background 0.15s;
}

.act-btn:hover:not(:disabled) {
	opacity: 0.85;
	transform: translateY(-1px);
}

.act-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	transform: none !important;
}

.act-btn.primary {
	background: var(--swim);
	border-color: var(--swim);
	color: #fff;
}

.act-btn.knock-btn {
	background: rgba(255, 208, 96, 0.1);
	border-color: rgba(255, 208, 96, 0.3);
	color: var(--gold);
}

.act-btn.cancel-btn {
	color: var(--muted);
}

.act-hint {
	font-size: 0.73rem;
	color: var(--muted);
	text-align: center;
	width: 100%;
}

/* Overlays */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(7, 11, 20, 0.92);
	backdrop-filter: blur(10px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.overlay-box {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--border);
	border-radius: 24px;
	padding: 2rem 2rem 1.75rem;
	max-width: 540px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
}

.overlay-title {
	font-family: 'Fraunces', serif;
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 0.3rem;
}

.overlay-sub {
	font-size: 0.83rem;
	color: var(--muted);
	margin-bottom: 1.5rem;
}

.scores-grid {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.score-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.85rem;
	border-radius: 12px;
	background: var(--surface-h);
}

.score-row.loser {
	background: rgba(224, 82, 82, 0.08);
	border: 1px solid rgba(224, 82, 82, 0.18);
}

.score-row.winner-row {
	background: rgba(61, 220, 132, 0.08);
	border: 1px solid rgba(61, 220, 132, 0.18);
}

.score-row.feuer-row {
	background: rgba(255, 208, 96, 0.08);
	border: 1px solid rgba(255, 208, 96, 0.22);
}

.score-name {
	flex: 1;
	font-size: 0.88rem;
	font-weight: 600;
}

.score-cards {
	display: flex;
	gap: 4px;
}

.score-pts {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--muted);
	min-width: 45px;
	text-align: right;
}

.score-lives {
	display: flex;
	gap: 3px;
}

.score-tag {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 100px;
}

.score-tag.loser-tag {
	background: rgba(224, 82, 82, 0.15);
	color: var(--swim);
}

.score-tag.feuer-tag {
	background: rgba(255, 208, 96, 0.15);
	color: var(--gold);
}

.score-tag.elim-tag {
	background: rgba(255, 255, 255, 0.06);
	color: var(--muted);
}

/* Settings section */
.settings-sep {
	margin-top: 0.9rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--border);
}

.mode-toggle {
	display: flex;
	gap: 0.4rem;
	margin-bottom: 0.65rem;
}

.mode-toggle .btn {
	flex: 1;
	padding: 0.45rem 0.6rem;
	font-size: 0.8rem;
	border-radius: 10px;
}

.rounds-stepper {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.stepper-label {
	font-size: 0.77rem;
	color: var(--muted);
	font-weight: 600;
	flex: 1;
}

.stepper-count {
	font-size: 1.05rem;
	font-weight: 700;
	min-width: 2.5ch;
	text-align: center;
	color: var(--text);
}

.stepper-btn {
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	line-height: 1;
}

.settings-readonly {
	font-size: 0.8rem;
	color: var(--muted);
	margin-top: 0.25rem;
}

.settings-readonly strong {
	color: var(--text);
}

/* Kick button */
.kick-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--muted);
	font-size: 0.78rem;
	padding: 3px 6px;
	border-radius: 6px;
	transition: color 0.15s;
	line-height: 1;
}

.kick-btn:hover {
	color: var(--swim);
}

/* Open lobbies list */
.lobby-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.7rem;
	border-radius: 12px;
	background: var(--surface-h);
	border: 1px solid var(--border);
	transition: border-color 0.15s;
}

.lobby-item+.lobby-item {
	margin-top: 0.4rem;
}

.lobby-item-info {
	flex: 1;
	min-width: 0;
}

.lobby-item-host {
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lobby-item-meta {
	font-size: 0.74rem;
	color: var(--muted);
	margin-top: 0.15rem;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

.lobby-mode-badge {
	font-size: 9px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 100px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	white-space: nowrap;
}

.lobby-mode-lives {
	background: rgba(224, 82, 82, 0.1);
	border: 1px solid rgba(224, 82, 82, 0.22);
	color: var(--swim);
}

.lobby-mode-rounds {
	background: rgba(61, 220, 132, 0.1);
	border: 1px solid rgba(61, 220, 132, 0.22);
	color: var(--green);
}

@media (max-width: 620px) {
	.pcard {
		width: 66px;
		height: 96px;
		padding: 4px 6px;
		border-radius: 8px;
	}

	.pcard .cr,
	.pcard .cb {
		font-size: 0.75rem;
	}

	.pcard .cm {
		font-size: 1.65rem;
	}

	#my-cards {
		gap: 0.6rem;
	}

	#center-cards {
		gap: 0.6rem;
	}

	#deck-stack {
		width: 66px;
		height: 96px;
		left: 0.75rem;
	}
}

@media (max-width: 420px) {
	.pcard {
		width: 54px;
		height: 78px;
		padding: 4px 5px;
		border-radius: 7px;
	}

	.pcard .cr,
	.pcard .cb {
		font-size: 0.66rem;
	}

	.pcard .cm {
		font-size: 1.3rem;
	}

	#my-cards {
		gap: 0.45rem;
	}

	#center-cards {
		gap: 0.45rem;
	}

	#actions {
		gap: 0.35rem;
	}

	.act-btn {
		padding: 0.45rem 0.8rem;
		font-size: 0.76rem;
	}

	#deck-stack {
		display: none !important;
	}
}


/**/