/* style.css - 《国殇》web prototype */

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

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #0c0d11;
	/* iOS（含 12.x）：position:fixed 锁死页面，禁掉橡皮筋回弹 / 下拉刷新 /
	   长按文字选择与「存储图片/拷贝」菜单；安卓侧同样受益。 */
	position: fixed;
	left: 0;
	top: 0;
	overscroll-behavior: none;
	touch-action: manipulation;
	-webkit-text-size-adjust: 100%;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

/* 输入框仍要能选中/移动光标（iOS 上禁用 user-select 会让 IME 光标异常）。 */
input, textarea {
	-webkit-user-select: text;
	user-select: text;
}

body {
	font-family: "Segoe UI", system-ui, sans-serif;
	color: #e6e0cc;
}

.stage {
	width: 100%;
	height: 100%;
	display: block;
}

/* 画布上的 IME 输入（登录/房间/聊天/卡组名/卡名）：默认放到屏幕外、1px 不可见。
   移动端 netImeShow() 会把 inline 样式改写成目标输入框的真实位置并显示。 */
.net-ime {
	position: fixed;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
	border: 0;
	padding: 0;
	margin: 0;
	outline: none;
	z-index: -1;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	/* 移动端可见时：半透明深色底 + 亮字，贴在画布输入框上（画布文字在其后）。 */
	color: #f2ecd8;
	font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
	resize: none;
	overflow: hidden;
	white-space: nowrap;
}

/* ---- 画布触摸 ----
   保留浏览器滚动手势（卡组/好友/排行列表用单指滑动），只禁掉双击缩放与点按延迟。 */
#game {
	display: block;
	width: 100%;
	height: 100%;
	cursor: default;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

.noscript {
	padding: 1rem;
	text-align: center;
	color: #e6e0cc;
}

/* ---- 联机轻提示 ---- */
.net-toast {
	position: fixed;
	top: 13%;
	left: 50%;
	transform: translateX(-50%) translateY(-10px) scale(0.97);
	background: rgba(23, 26, 33, 0.96);
	border: 1px solid #8a6d2f;
	border-radius: 0;
	color: #e6e0cc;
	font-size: 13.5px;
	padding: 9px 18px 11px;
	z-index: 90;
	opacity: 0;
	pointer-events: none;
	overflow: hidden;
	transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.net-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.net-toast-text { display: inline-block; }
.net-toast-bar {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 0%;
	background: linear-gradient(90deg, rgba(224, 184, 89, 0.45), #e0b859);
	pointer-events: none;
}

/* ---- 新版本更新条 ---- */
.net-update {
	position: fixed;
	top: 122px;
	left: 50%;
	transform: translateX(-50%) translateY(-14px) scale(0.98);
	display: flex;
	align-items: center;
	/* iOS 12 的 flex 不支持 gap：用子项外边距代替（margin-left 只在非首项生效）。 */
	max-width: calc(100vw - 24px);
	padding: 9px 10px 9px 14px;
	background: linear-gradient(180deg, rgba(38, 32, 20, 0.98), rgba(23, 26, 33, 0.98));
	border: 1px solid #c9a24a;
	border-radius: 9px;
	box-shadow: 0 12px 38px rgba(0, 0, 0, 0.55), 0 0 22px rgba(224, 184, 89, 0.14);
	color: #f2e7c8;
	font-size: 13px;
	line-height: 1.4;
	z-index: 92;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.12);
}
.net-update.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0) scale(1);
	pointer-events: auto;
}
/* iOS 12 没有 flex gap：用相邻兄弟外边距实现 10px 间距。 */
.net-update > * + * { margin-left: 10px; }
.net-update[hidden] { display: none; }
.net-update-dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e0b859;
	box-shadow: 0 0 10px rgba(224, 184, 89, 0.9);
	animation: netUpdatePulse 1.6s ease-in-out infinite;
}
@keyframes netUpdatePulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.55; transform: scale(0.8); }
}
.net-update-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.net-update-btn {
	flex: 0 0 auto;
	padding: 5px 13px;
	border: 1px solid #e0b859;
	border-radius: 6px;
	background: linear-gradient(180deg, rgba(224, 184, 89, 0.30), rgba(224, 184, 89, 0.14));
	color: #ffe9b0;
	font: inherit;
	font-size: 12.5px;
	cursor: pointer;
	transition: background 0.16s, box-shadow 0.16s, transform 0.16s;
}
.net-update-btn:hover {
	background: linear-gradient(180deg, rgba(224, 184, 89, 0.48), rgba(224, 184, 89, 0.24));
	box-shadow: 0 0 14px rgba(224, 184, 89, 0.35);
	transform: translateY(-1px);
}
.net-update-close {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #9a8f74;
	font: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.net-update-close:hover { color: #f2e7c8; background: rgba(255, 255, 255, 0.08); }
@media (max-width: 560px) {
	.net-update { flex-wrap: wrap; justify-content: center; text-align: center; }
	.net-update-text { white-space: normal; }
}
