/* ========== 全局重置 ========== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	min-height: 100vh;
	color: #e0e0e0;
}

.hidden {
	display: none !important;
}

/* ========== 容器 ========== */
.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px;
}

/* ========== 头部 ========== */
.header {
	text-align: center;
	padding: 30px 0 20px;
}

.header-inner .logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.logo-icon {
	font-size: 36px;
}

.header h1 {
	font-size: 32px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 4px;
}

.subtitle {
	margin-top: 10px;
	font-size: 14px;
	color: #8ea0c0;
}

/* ========== 模式选择界面 ========== */
.menu-screen {
	padding: 20px 0 40px;
}

.menu-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	justify-content: center;
}

.menu-card {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	padding: 32px 28px;
	width: 300px;
	text-align: center;
	transition: transform 0.25s ease, border-color 0.25s ease;
}

.menu-card:hover {
	transform: translateY(-4px);
	border-color: rgba(106, 141, 255, 0.5);
}

.card-icon {
	font-size: 48px;
	margin-bottom: 16px;
}

.menu-card h2 {
	font-size: 20px;
	color: #fff;
	margin-bottom: 8px;
}

.menu-card p {
	font-size: 13px;
	color: #8ea0c0;
	margin-bottom: 20px;
	line-height: 1.6;
}

.card-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.select-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	color: #b0b8c8;
}

.select-label select {
	background: rgba(0, 0, 0, 0.3);
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 13px;
	cursor: pointer;
}

.select-label select option {
	background: #1a1a2e;
	color: #e0e0e0;
}

.room-join {
	display: flex;
	gap: 8px;
}

.room-join input {
	flex: 1;
	background: rgba(0, 0, 0, 0.3);
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
	text-align: center;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.room-join input::placeholder {
	color: #5a6a80;
	letter-spacing: 0;
	text-transform: none;
}

.room-join input:focus {
	outline: none;
	border-color: #6a8dff;
}

/* ========== 按钮 ========== */
.btn {
	display: inline-block;
	padding: 10px 24px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
}

.btn-primary {
	background: linear-gradient(135deg, #6a8dff, #5a7ae0);
	color: #fff;
	width: 100%;
}

.btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(106, 141, 255, 0.35);
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.1);
	color: #c0c8d8;
	border: 1px solid rgba(255, 255, 255, 0.15);
	width: 100%;
}

.btn-secondary:hover {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ========== 游戏界面 ========== */
.game-screen {
	padding: 10px 0 30px;
}

.game-layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	justify-content: center;
	flex-wrap: wrap;
}

/* 左侧信息栏 */
.game-info {
	width: 220px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.info-card {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 14px 16px;
}

.info-label {
	font-size: 12px;
	color: #6a7a90;
	margin-bottom: 6px;
}

.info-value {
	font-size: 16px;
	font-weight: 600;
	color: #e0e0e0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.room-code {
	font-size: 22px;
	letter-spacing: 4px;
	color: #6a8dff;
	font-family: "Courier New", monospace;
}

.info-hint {
	font-size: 11px;
	color: #5a6a80;
	margin-top: 4px;
}

.score-display {
	font-size: 24px;
	font-weight: 700;
	color: #6a8dff;
	font-family: "Courier New", monospace;
	letter-spacing: 4px;
}

.players-display {
	font-size: 13px;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.stone-indicator {
	font-size: 20px;
	line-height: 1;
}

.game-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

/* 棋盘区域 */
.board-area {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

#board {
	background: #dcb775;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	max-width: 100%;
	height: auto;
}

.game-status {
	min-height: 28px;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	padding: 6px 20px;
	border-radius: 6px;
	transition: all 0.3s ease;
}

.game-status.win {
	background: rgba(106, 141, 255, 0.2);
	color: #6a8dff;
}

.game-status.waiting {
	background: rgba(255, 200, 80, 0.15);
	color: #ffc850;
}

.game-status.thinking {
	background: rgba(255, 255, 255, 0.08);
	color: #8ea0c0;
}

/* ========== 胜负结果弹窗 ========== */
.result-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.result-modal.hidden {
	display: none !important;
}

.result-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
}

.result-card {
	position: relative;
	background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 20px;
	padding: 40px 48px;
	text-align: center;
	max-width: 380px;
	width: 90%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: resultPop 0.3s ease;
}

@keyframes resultPop {
	from { transform: scale(0.85); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.result-icon {
	font-size: 64px;
	margin-bottom: 12px;
	line-height: 1;
}

.result-title {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 6px;
}

.result-title.win {
	color: #6a8dff;
}

.result-title.lose {
	color: #ff6a6a;
}

.result-title.draw {
	color: #ffc850;
}

.result-subtitle {
	font-size: 14px;
	color: #8ea0c0;
	margin-bottom: 20px;
}

.result-score {
	font-size: 32px;
	font-weight: 700;
	color: #fff;
	font-family: "Courier New", monospace;
	letter-spacing: 6px;
	margin-bottom: 24px;
}

.result-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
	.container {
		padding: 10px;
	}

	.header {
		padding: 20px 0 10px;
	}

	.header h1 {
		font-size: 24px;
		letter-spacing: 2px;
	}

	.subtitle {
		font-size: 12px;
	}

	.game-layout {
		flex-direction: column;
		align-items: center;
		gap: 12px;
	}

	.game-info {
		width: 100%;
		max-width: 500px;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}

	.info-card {
		flex: 1;
		min-width: 140px;
		padding: 10px 12px;
	}

	.info-value {
		font-size: 14px;
	}

	.room-code {
		font-size: 18px;
		letter-spacing: 3px;
	}

	.game-actions {
		flex-direction: row;
		width: 100%;
	}

	.game-actions .btn {
		flex: 1;
		padding: 8px 16px;
		font-size: 13px;
	}

	.menu-card {
		width: 100%;
		max-width: 360px;
		padding: 24px 20px;
	}

	.card-icon {
		font-size: 36px;
	}

	.menu-card h2 {
		font-size: 18px;
	}

	#board {
		width: 100%;
		max-width: 500px;
	}

	.game-status {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.header h1 {
		font-size: 20px;
		letter-spacing: 1px;
	}

	.menu-cards {
		gap: 16px;
	}

	.menu-card {
		padding: 20px 16px;
	}

	.game-info {
		flex-direction: column;
	}

	.info-card {
		min-width: 100%;
	}

	.game-actions .btn {
		font-size: 12px;
		padding: 8px 10px;
	}

	#board {
		max-width: calc(100vw - 24px);
	}
}
