/* 引入本地 Zaio 字体 */
@font-face {
	font-family: "Zaio";
	src: url("../../assets/fonts/Zaio.otf") format("opentype");
	font-weight: normal;
	font-style: normal;
}

/* 使用 Google Fonts 的现代字体 */
:root {
	--font-main: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
		sans-serif;
	--font-title: "ZCOOL XiaoWei", "Noto Sans SC", cursive, sans-serif;
}

button,
input {
	font-family: var(--font-main);
}

/* CSS */
.button-9 {
	appearance: button;
	backface-visibility: hidden;
	background-color: #4a64f7;
	border-radius: 6px;
	border-width: 0;
	box-shadow: rgba(50, 50, 93, 0.1) 0 0 0 1px inset,
		rgba(50, 50, 93, 0.1) 0 2px 5px 0, rgba(0, 0, 0, 0.07) 0 1px 1px 0;
	box-sizing: border-box;
	color: #fff;
	cursor: pointer;
	font-family: var(--font-main);
	font-size: 80%;
	height: 25px;
	line-height: 1.15;
	margin: 0px 0 0;
	outline: none;
	overflow: visible;
	position: relative;
	text-align: center;
	text-transform: none;
	transform: translateZ(0);
	transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
	width: 5.5rem;
}

.button-9::after {
	content: "";
	border-radius: 6px;
	position: absolute;
	z-index: -1;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	box-shadow: rgba(50, 50, 93, 0.15) 0 4px 10px 0,
		rgba(0, 0, 0, 0.1) 0 2px 4px 0, 0 0 15px rgba(74, 100, 247, 0.3);
	opacity: 0;
	transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.button-9:disabled {
	cursor: default;
}

.button-9:focus {
	box-shadow: rgba(50, 50, 93, 0.1) 0 0 0 1px inset,
		rgba(50, 50, 93, 0.2) 0 6px 15px 0, rgba(0, 0, 0, 0.1) 0 2px 2px 0,
		rgba(50, 151, 211, 0.3) 0 0 0 4px;
}

/* 🎨 创建/加入按钮样式优化 */
#create,
#join {
	overflow: visible !important;
	font-weight: bold !important;
}

#create::after,
#join::after {
	box-shadow: rgba(50, 50, 93, 0.15) 0 4px 10px 0,
		rgba(0, 0, 0, 0.1) 0 2px 4px 0, 0 0 15px rgba(74, 100, 247, 0.3) !important;
}

/* 🎨 创建/加入按钮 hover 效果 - 反向颜色变化 */
#create:hover,
#join:hover {
	transform: translateY(-1px) scale(1.02) !important;
	background-color: white !important;
	color: #4a64f7 !important;
	border: 2px solid #4a64f7;
}

#create:hover::after,
#join:hover::after {
	opacity: 1 !important;
}

/* 🎮 游戏内按钮 ::after 伪元素 */
#hint-input button::after,
#guess-section button::after,
#startGameBtn::after {
	border-radius: 8px !important;
	box-shadow: 0 6px 20px rgba(74, 100, 247, 0.5),
		0 3px 10px rgba(74, 100, 247, 0.3), 0 0 20px rgba(74, 100, 247, 0.4) !important;
}

/* 🎮 游戏内按钮 hover 效果 */
#hint-input button:hover,
#guess-section button:hover,
#startGameBtn:hover {
	transform: translateY(-2px) scale(1.05) !important;
	background-color: #3a54e7 !important;
}

#hint-input button:hover::after,
#guess-section button:hover::after,
#startGameBtn:hover::after {
	opacity: 1 !important;
}

/* 🔁 下一轮按钮 ::after 伪元素 */
#nextRoundBtn::after {
	border-radius: 8px !important;
	box-shadow: 0 6px 20px rgba(255, 111, 0, 0.5),
		0 3px 10px rgba(255, 153, 102, 0.3), 0 0 20px rgba(255, 111, 0, 0.4) !important;
}

/* 🔁 下一轮按钮特殊 hover 效果 */
#nextRoundBtn:hover {
	transform: translateY(-2px) scale(1.05) rotate(20deg) !important;
	background: linear-gradient(135deg, #ff9966 0%, #ff6f00 100%) !important;
}

#nextRoundBtn:hover::after {
	opacity: 1 !important;
}

body {
	font-family: var(--font-main);
	margin: 0;
	padding: 0;
	background: linear-gradient(to bottom, #ffcc70, #ff9966); /* 橘色渐变背景 */
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
}

/* 主内容区域往上靠，减少顶部留白 */
.container {
	text-align: center;
	background-color: white;
	padding: 20px 30px 30px 30px;
	border-radius: 16px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
	width: 500px;
	margin-top: 65px; /* ✅ 往上移 */
	margin-bottom: 25px;
	position: relative; /* 添加相对定位 */
	z-index: 1; /* 设置较低的 z-index 值 */
}

/* 让房间输入面板更靠近标题 */
#connection-button {
}

#connection-panel {
	margin-top: 0;
	margin-bottom: 20px;
	justify-content: space-between;
}

#connection-status {
	padding-left: 2px;
}

/* 🎯 弧线区域容器 */
.dimension {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 auto 10px;
	padding: 15px 10px;
	width: 90%;
	max-width: 400px;
	flex-shrink: 0;
	box-sizing: border-box;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.9) 0%,
		rgba(248, 250, 255, 0.95) 100%
	);
	border-radius: 0 0 20px 20px;
	box-shadow: 0 4px 20px rgba(74, 100, 247, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05),
		inset 0 1px 0 rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(74, 100, 247, 0.1);
	position: relative;
	overflow: visible;
}

.dimension::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(
		to right,
		#5a7ae7 0%,
		#9b88ff 25%,
		#ffcc70 50%,
		#ff9966 75%,
		#ff7a7e 100%
	);
	border-radius: 0;
	z-index: 0;
	pointer-events: none;
}

/* 确保 dimension 内的元素在装饰条之上 */
.dimension > * {
	position: relative;
	z-index: 1;
}

/* 🖼️ 弧线画布样式 */
canvas {
	border: none;
	border-radius: 12px;
	background: transparent;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
	transition: filter 0.3s ease;
}

canvas:hover {
	filter: drop-shadow(0 4px 8px rgba(74, 100, 247, 0.15));
}

#left-label {
	/* 调大增加labels间距 */
	margin-right: 20px;
	flex-shrink: 0;
}

#right-label {
	margin-left: 20px;
	flex-shrink: 0;
}

.dimension img {
	width: 24px; /* 调整为适合您布局的大小 */
	height: auto;
	vertical-align: middle;
}

/* 🎚️ 现代化猜测滑条样式 */
#guessSlider {
	width: 75%;
	margin-top: 10px;
	margin-bottom: 15px;
	margin-left: 15px;
	margin-right: 15px;
	-webkit-appearance: none;
	appearance: none;
	height: 12px;
	background: linear-gradient(
		to right,
		#5a7ae7 0%,
		#9b88ff 25%,
		#ffcc70 50%,
		#ff9966 75%,
		#ff7a7e 100%
	);
	border-radius: 10px;
	outline: none;
	cursor: pointer;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	position: relative;
}

#guessSlider:hover {
	transform: scaleY(1.1);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
		0 4px 12px rgba(74, 100, 247, 0.2);
}

#guessSlider:active {
	transform: scaleY(1.15);
}

/* WebKit 滑块按钮 (Chrome, Safari, Edge) */
#guessSlider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 28px;
	height: 28px;
	background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
	border: 3px solid #4a64f7;
	border-radius: 50%;
	cursor: grab;
	box-shadow: 0 4px 12px rgba(74, 100, 247, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15),
		inset 0 2px 4px rgba(255, 255, 255, 0.8);
	transition: all 0.2s ease;
	position: relative;
}

#guessSlider::-webkit-slider-thumb:hover {
	transform: scale(1.15);
	border-color: #ff6f00;
	box-shadow: 0 6px 16px rgba(255, 111, 0, 0.5), 0 3px 8px rgba(0, 0, 0, 0.2),
		inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

#guessSlider::-webkit-slider-thumb:active {
	cursor: grabbing;
	transform: scale(1.2);
	border-color: #ff6f00;
	box-shadow: 0 8px 20px rgba(255, 111, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Firefox 滑块按钮 */
#guessSlider::-moz-range-thumb {
	width: 24px;
	height: 24px;
	background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
	border: 3px solid #4a64f7;
	border-radius: 50%;
	cursor: grab;
	box-shadow: 0 4px 12px rgba(74, 100, 247, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15),
		inset 0 2px 4px rgba(255, 255, 255, 0.8);
	transition: all 0.2s ease;
}

#guessSlider::-moz-range-thumb:hover {
	transform: scale(1.15);
	border-color: #ff6f00;
	box-shadow: 0 6px 16px rgba(255, 111, 0, 0.5), 0 3px 8px rgba(0, 0, 0, 0.2);
}

#guessSlider::-moz-range-thumb:active {
	cursor: grabbing;
	transform: scale(1.2);
	border-color: #ff6f00;
}

/* Firefox 轨道 */
#guessSlider::-moz-range-track {
	height: 12px;
	background: linear-gradient(
		to right,
		#5a7ae7 0%,
		#9b88ff 25%,
		#ffcc70 50%,
		#ff9966 75%,
		#ff7a7e 100%
	);
	border-radius: 10px;
}

#control-panel {
	display: grid;
	grid-template-columns: 3fr 4fr; /* 7列网格：左侧3列，右侧4列 */
	grid-template-rows: auto auto; /* 2行自适应高度 */
	gap: 10px;
	margin-left: 50px;
	margin-right: 50px;
	margin-bottom: 20px;
}

/* 创建按钮占左侧3列，全高 */
#create {
	grid-column: 1 / 2;
	grid-row: 1 / 3; /* 跨越两行 */
	height: 100%; /* 使按钮填充整个区域 */
	font-size: 19px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 15px;
	width: auto; /* 覆盖之前的宽度设定 */
}

#join {
	font-size: 11.3px;
}

/* 右侧区域容器 */
#connection-area {
	grid-column: 2 / 3;
	grid-row: 1 / 3;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* 输入和加入按钮行 */
#input-row {
	display: grid;
	grid-template-columns: 2.5fr 1.5fr; /* 2.5:1.5比例 */
	gap: 8px;
	width: 100%;
}

/* 🎯 房间号输入框样式 */
#roomId {
	width: 100%;
	box-sizing: border-box;
	padding: 0 12px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	font-family: var(--font-main);
	outline: none;
	transition: all 0.3s ease;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	height: 25px;
}

#roomId:focus {
	border-color: #4a64f7;
	box-shadow: 0 3px 10px rgba(74, 100, 247, 0.2);
	background: white;
	transform: translateY(-1px);
}

#roomId::placeholder {
	color: #aaa;
	opacity: 0.8;
}

#join {
	width: 100%;
	padding: 0 10px;
}

/* 状态行 */
#status-row {
	text-align: left;
	padding: 0 5px;
}

/* 🎯 连接状态文本样式 */
#connection-status {
	display: inline-block;
	font-size: 13px;
	padding: 3px 8px;
	border-radius: 4px;
	font-weight: 500;
	background: rgba(240, 240, 240, 0.5);
	transition: all 0.3s ease;
}

#game-step {
	font-style: italic;
	margin-top: 30px;
	margin-bottom: 20px;
}

/* 底部规则区域 */
#rules {
	background-color: white;
	border-radius: 12px;
	padding: 15px 35px;
	margin-bottom: 20px;
	display: inline-block; /* ✅ 根据内容自动适应宽度 */
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	font-size: 15px;
	line-height: 1.6;
	color: #333;
	max-width: 90%;
}

#rules-title {
	margin-top: 13px;
}

#title {
	font-family: "Zaio";
	font-size: 75px;
	justify-content: center;
	align-items: center;
	letter-spacing: -0.1em;
	display: inline-block;
	margin: 0 auto;
	width: fit-content;
	max-width: 100%;
	pointer-events: none;
}

#title svg {
	font-family: "Zaio";
	fill: #ff6f00; /* 默认文字颜色 */
	transform: translateY(10px); /* 整体向下移动 */
	display: block;
	max-width: 100%;
	height: auto;
	overflow: visible;
}

#title text {
	pointer-events: auto;
}

#title path {
	pointer-events: none;
}

#title textPath tspan {
	transition: fill 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
		transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 从左到右依次应用延迟 */
#title textPath tspan:nth-child(1) {
	transition-delay: 0s;
}
#title textPath tspan:nth-child(2) {
	transition-delay: 0.05s;
}
#title textPath tspan:nth-child(3) {
	transition-delay: 0.1s;
}
#title textPath tspan:nth-child(4) {
	transition-delay: 0.15s;
}
#title textPath tspan:nth-child(5) {
	transition-delay: 0.2s;
}
#title textPath tspan:nth-child(6) {
	transition-delay: 0.25s;
}
#title textPath tspan:nth-child(7) {
	transition-delay: 0.3s;
}
#title textPath tspan:nth-child(8) {
	transition-delay: 0.35s;
}
#title textPath tspan:nth-child(9) {
	transition-delay: 0.4s;
}
#title textPath tspan:nth-child(10) {
	transition-delay: 0.45s;
}

#title text:hover tspan {
	fill: #ffa000;
	transform: scale(1);
}

/* ⏰ 时间设置面板样式 */
#time-settings {
	font-family: var(--font-main);
}

#time-settings h3 {
	color: #333;
	font-weight: 600;
}

#time-settings label {
	color: #555;
	font-size: 14px;
}

#time-settings input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	background: rgba(74, 100, 247, 0.2);
	outline: none;
	border-radius: 5px;
	height: 6px;
}

#time-settings input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #4a64f7;
	cursor: pointer;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#time-settings input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #4a64f7;
	cursor: pointer;
	border-radius: 50%;
	border: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#time-settings span {
	color: #4a64f7;
	font-weight: 600;
	font-size: 14px;
}

/* 🎯 提示词输入框样式 */
#hintBox {
	width: 70%;
	padding: 0 15px;
	border: 2px solid #ff9966;
	border-radius: 8px;
	font-size: 16px;
	font-family: var(--font-main);
	outline: none;
	transition: all 0.3s ease;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 2px 8px rgba(255, 153, 102, 0.2);
	height: 40px;
	box-sizing: border-box;
	margin-right: 7px;
}

#hintBox:focus {
	border-color: #ff6f00;
	box-shadow: 0 4px 12px rgba(255, 111, 0, 0.3);
	background: white;
}

#hintBox::placeholder {
	color: #ffab70;
	opacity: 0.7;
}

/* 🎮 游戏内按钮特定样式 */
#hint-input button,
#guess-section button,
#startGameBtn,
#nextRoundBtn {
	height: 40px !important;
	font-size: 15px !important;
	padding: 0 20px !important;
	border-radius: 8px !important;
	width: auto !important;
	margin: auto !important;
	overflow: visible !important;
}

/* ⏰ 倒计时样式 */
#countdown {
	margin-top: 20px !important;
	margin-bottom: 10px !important;
}

/* 🎨 左右标签对立配色 */
#left-label {
	background: linear-gradient(135deg, #5a7ae7 0%, #7b94f7 100%);
	padding: 10px 18px;
	border-radius: 12px;
	color: white;
	font-weight: 700;
	font-size: 15px;
	box-shadow: 0 4px 15px rgba(90, 122, 231, 0.5),
		0 2px 5px rgba(90, 122, 231, 0.3);
	min-width: 100px;
	text-align: center;
	transition: all 0.3s ease;
	border: 2px solid rgba(255, 255, 255, 0.4);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#left-label:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(90, 122, 231, 0.6),
		0 3px 8px rgba(90, 122, 231, 0.4);
}

#right-label {
	background: linear-gradient(135deg, #ff7a7e 0%, #ffaa8e 100%);
	padding: 10px 18px;
	border-radius: 12px;
	color: white;
	font-weight: 700;
	font-size: 15px;
	box-shadow: 0 4px 15px rgba(255, 122, 126, 0.5),
		0 2px 5px rgba(255, 122, 126, 0.3);
	min-width: 100px;
	text-align: center;
	transition: all 0.3s ease;
	border: 2px solid rgba(255, 255, 255, 0.4);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#right-label:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(255, 122, 126, 0.6),
		0 3px 8px rgba(255, 122, 126, 0.4);
}

/* 🎯 猜测区域提示词醒目样式 */
#guess-section p {
	background: linear-gradient(135deg, #ff9966 0%, #ff6f00 100%);
	padding: 8px 16px;
	border-radius: 10px;
	margin: 15px auto;
	width: fit-content;
	max-width: 60%;
	box-sizing: border-box;
	box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4),
		0 2px 8px rgba(255, 153, 102, 0.3);
	border: 2px solid rgba(255, 255, 255, 0.5);
	animation: pulse 2s ease-in-out infinite;
}

#guess-section p {
	font-size: 16px;
	font-weight: 700;
	color: white;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	letter-spacing: 0.5px;
}

#guess-section #hint {
	font-size: 19px;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.3);
	display: inline-block;
	padding: 3px 12px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	margin-left: 8px;
}

/* 🌟 脉动动画效果 */
@keyframes pulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 6px 20px rgba(255, 111, 0, 0.4),
			0 3px 10px rgba(255, 153, 102, 0.3);
	}
	50% {
		transform: scale(1.02);
		box-shadow: 0 8px 25px rgba(255, 111, 0, 0.6),
			0 4px 15px rgba(255, 153, 102, 0.5);
	}
}

/* 🔄 模式切换按钮样式 */
a[href="singleplayer.html"]:hover,
a[href="index.html"]:hover,
a[href="question-editor.html"]:hover {
	background: #4a64f7 !important;
	color: white !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(74, 100, 247, 0.3) !important;
}
