@font-face {
	font-family: 'Zpix';
	src: url('/donkeyrace/fonts/zpix.woff2') format('woff2'),
	     url('/donkeyrace/fonts/zpix.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

*, *::before, *::after, input, button, select, textarea {
	font-family: 'Zpix', monospace, sans-serif !important;
	-webkit-font-smoothing: none;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: pixelated;
}

html, body{
	margin:0;
	width:100%;
	height:100%;
	overflow:hidden;
	background:#000000;
	font-family: 'Zpix', monospace, sans-serif;
}

.viewport{
	width:100vw;
	height:100vh;
	display:grid;
	place-items:center;
}

/* ================= Stage ================= */

.stage{
	position:relative;
	aspect-ratio:9 / 16;
	width:min(100vw, calc(100vh * 9 / 16));
	height:min(100vh, calc(100vw * 16 / 9));
	box-sizing: border-box;
	outline: 1px dashed rgba(255,255,255,.6);
	overflow:visible;
}

/* ================= 内容 ================= */

#divLoginIn{
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000000;
}

.tab-nav{
	display: flex;
	flex-direction: row;
	align-items: flex-end;
	width: 100%;
	height: 44px;
	background: transparent;
	padding: 0 12px;
	box-sizing: border-box;
	gap: 6px;
	flex-shrink: 0;
	z-index: 20;
}

.tab-btn{
	flex: 1;
	height: 34px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-bottom: none;
	border-radius: 0 !important;
	outline: none;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
	box-sizing: border-box;
	opacity: 0.55;
	position: relative;
	user-select: none;
	background: #000000;
	color: rgba(255, 255, 255, 0.7);
}

.tab-btn:hover{
	opacity: 0.85;
}

.tab-btn.active{
	height: 40px;
	margin-bottom: -2px;
	opacity: 1;
	z-index: 30;
	background: #000000;
	border: 2px solid #ffffff;
	border-bottom: 2px solid #000000;
	color: #ffffff;
}

.tab-content{
	flex: 1;
	width: 100%;
	height: calc(100% - 44px);
	position: relative;
	overflow: hidden;
	padding: 0 12px 12px 12px;
	box-sizing: border-box;
}

.tab-pane{
	position: absolute;
	inset: 0 12px 12px 12px;
	width: auto;
	height: auto;
	display: flex;
	box-sizing: border-box;
	overflow: auto;
	padding: 14px;
	z-index: 1;
	pointer-events: none;
	transition: z-index 0.2s ease, opacity 0.2s ease;
	background: #000000;
}

.tab-pane.active{
	z-index: 10;
	pointer-events: auto;
}

/* frame_0 */
#frame_0{
	background: #000000;
	border: 2px solid #ffffff;
	border-radius: 0;
	color: #ffffff;
	box-sizing: border-box;
	padding: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: safe center;
	gap: 10px;
	overflow-y: auto;
}

#frame_0 > *:first-child{
	margin-top: auto;
}

#frame_0 > *:last-child{
	margin-bottom: auto;
}

#frame_0 .frame0-log-item{
	padding: 2px 4px;
	border-radius: 0;
	background: transparent;
	border: 0;
	color: #ffffff;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	width: 100%;
	box-sizing: border-box;
	word-break: break-word;
}

#frame_0 .frame0-start-btn{
	height: 38px;
	border: 1px solid #ffffff;
	border-radius: 8px;
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	padding: 0 16px;
	cursor: pointer;
	background: transparent;
	align-self: center;
	transition: background 0.2s, color 0.2s;
}

#frame_0 .frame0-start-btn:hover{
	background: #ffffff;
	color: #000000;
}

#frame_0 .frame0-controls-wrap{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	padding: 0;
	background: transparent;
	border: 0;
	width: 100%;
	box-sizing: border-box;
}

/* frame_1 */
#frame_1{
	background: #000000;
	border: 2px solid #ffffff;
	border-radius: 0;
	color: #ffffff;
	box-sizing: border-box;
	padding: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: safe center;
	gap: 10px;
	overflow-y: auto;
}

#frame_1 .game-info-card{
	width: min(320px, 100%);
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 8px;
	padding: 12px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: #ffffff;
}

#frame_1 .game-player-card{
	padding: 10px 12px;
}

#frame_1 .game-room-card{
	max-height: calc(100% - 70px);
}

#frame_1 .game-head{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#frame_1 .game-title{
	color: #f2f6ff;
	font-size: 15px;
	font-weight: 700;
	margin: 0;
}

#frame_1 .game-status{
	color: rgba(242, 246, 255, 0.85);
	font-size: 13px;
	font-weight: 600;
	margin: 0;
}

#frame_1 .game-self-info{
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: #ffffff;
}

#frame_1 .game-self-label{
	color: rgba(255, 255, 255, 0.7);
	font-weight: 600;
}

#frame_1 .game-self-nickname{
	color: #ffffff;
	font-weight: 700;
}

#frame_1 .game-section-subtitle{
	color: rgba(255, 255, 255, 0.8);
	font-size: 13px;
	font-weight: 700;
	margin-top: 4px;
}

#frame_1 .game-member-wrap,
#frame_1 .game-player-status-wrap{
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.25);
	padding: 8px;
	border-radius: 6px;
	box-sizing: border-box;
	max-height: 200px;
	overflow-y: auto;
}

#frame_1 .lobby-item,
#frame_1 .game-player-status-item,
#frame_1 .game-empty{
	width: 100%;
	padding: 8px 10px;
	border-radius: 6px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	box-sizing: border-box;
	text-align: center;
}

#frame_1 .game-player-status-item{
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	text-align: left;
}

#frame_1 .game-player-status-item-self{
	background: rgba(255, 255, 255, 0.1);
	border-color: #ffffff;
}

#frame_1 .game-player-name{
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

#frame_1 .game-player-index{
	color: rgba(255, 255, 255, 0.9);
	font-size: 12px;
	font-weight: 700;
	margin-left: 6px;
	min-width: 18px;
	text-align: right;
}

#frame_1 .game-dot-online,
#frame_1 .game-dot-offline{
	width: 8px;
	height: 8px;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

#frame_1 .game-dot-online{
	background: #3ddc84;
}

#frame_1 .game-dot-offline{
	background: #ff4d4f;
}

#frame_1 .game-card-actions{
	display: flex;
	justify-content: center;
	padding-top: 4px;
}

#frame_1 .game-end-btn{
	height: 36px;
	border: 1px solid #ffffff;
	border-radius: 8px;
	color: #ffffff;
	background: transparent;
	font-size: 13px;
	font-weight: 700;
	padding: 0 16px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

#frame_1 .game-end-btn:hover{
	background: #ffffff;
	color: #000000;
}

/* frame_2 */
#frame_2{
	background: #000000;
	border: 2px solid #ffffff;
	border-radius: 0;
	color: #ffffff;
	box-sizing: border-box;
	padding: 12px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 14px;
	overflow: auto;
}

#frame_2 .options-end-btn,
#frame_2 .options-logout-btn{
	width: min(200px, 80%);
	height: 42px;
	border: 1px solid #ffffff;
	border-radius: 8px;
	color: #ffffff;
	background: transparent;
	font-size: 14px;
	font-weight: 700;
	padding: 0 16px;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.2s ease, color 0.2s ease;
}

#frame_2 .options-end-btn:hover,
#frame_2 .options-logout-btn:hover{
	background: #ffffff;
	color: #000000;
}

/* ================= 登录界面（与 divLoginIn 保持完全一致的框架线框结构） ================= */

#divLogin{
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000000;
	z-index: 15;
}

#divLogin .tab-pane{
	border: 2px solid #ffffff;
	border-radius: 0;
	justify-content: center;
	align-items: center;
}

#divLogin .login-card{
	width: min(320px, 90%);
	padding: 20px;
	border-radius: 8px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

#divLogin .login-info-card{
	align-items: flex-start;
	max-height: 80%;
	overflow-y: auto;
}

#divLogin .login-info-text{
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
	line-height: 1.6;
	word-break: break-word;
}

#divLogin .login-section-title{
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-align: center;
}

#divLogin input{
	width: 100%;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s ease, background 0.2s ease;
}

#divLogin input:focus{
	background: rgba(255, 255, 255, 0.1);
	border-color: #ffffff;
}

#divLogin .login-card button{
	width: 100%;
	height: 40px;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: #ffffff;
	background: transparent;
	border: 1px solid #ffffff;
	border-radius: 8px;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.2s ease, color 0.2s ease;
}

#divLogin .login-card button:hover{
	background: #ffffff;
	color: #000000;
}

#divLogin .reserved-placeholder{
	color: rgba(255, 255, 255, 0.5);
	font-size: 14px;
	padding: 20px 0;
	text-align: center;
}

@media (max-width: 600px){
	#frame_1{
		scroll-behavior: smooth;
		scroll-snap-type: y mandatory;
	}

	#frame_1 .game-member-wrap,
	#frame_1 .game-player-status-wrap{
		scroll-snap-align: start;
	}

	#frame_1 .lobby-item,
	#frame_1 .game-player-status-item,
	#frame_1 .game-empty{
		scroll-snap-align: start;
	}
}
