/**
 * Networld Reversi - Presentation Styles
 *
 * 8x8 Board, 3D Discs, Turn Indicators, and Mobile Layout (390px+).
 *
 * @package Networld_Reversi
 */

:root {
	--nw-rev-board-bg: #15803d; /* Classic felt green */
	--nw-rev-board-border: #78350f; /* Rich wood border */
	--nw-rev-grid-line: #166534;
	--nw-rev-cell-hover: rgba(255, 255, 255, 0.15);
	--nw-rev-legal-hint: rgba(255, 255, 255, 0.35);
	--nw-rev-black-disc: #0f172a;
	--nw-rev-white-disc: #f8fafc;
	--nw-rev-radius: 12px;
}

.networld-reversi-wrap {
	max-width: 960px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	overflow-x: hidden;
}

.networld-reversi-wrap *,
.networld-reversi-wrap *::before,
.networld-reversi-wrap *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------
 * 1. Mode Switcher Tabs
 * ------------------------------------------------------------- */
.networld-reversi-tab-btn {
	padding: 10px 18px;
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	color: #334155;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.networld-reversi-tab-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.networld-reversi-tab-btn.active {
	background: #3b82f6;
	color: #ffffff;
	border-color: #2563eb;
}

.networld-reversi-panel {
	display: none;
}

.networld-reversi-panel.active {
	display: block;
}

/* -------------------------------------------------------------
 * 2. Reversi Board & Arena Container
 * ------------------------------------------------------------- */
.networld-reversi-board-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	width: 100%;
}

.networld-reversi-scoreboard {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	max-width: 520px;
	padding: 12px 20px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--nw-rev-radius);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	flex-wrap: wrap;
	gap: 10px;
}

.networld-reversi-score-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.networld-reversi-score-disc {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-block;
	box-shadow: inset 0 2px 3px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

.networld-reversi-score-disc.is-black {
	background: radial-gradient(circle at 35% 35%, #475569, #0f172a);
	border: 1px solid #000;
}

.networld-reversi-score-disc.is-white {
	background: radial-gradient(circle at 35% 35%, #ffffff, #cbd5e1);
	border: 1px solid #94a3b8;
}

.networld-reversi-score-count {
	font-size: 20px;
	font-weight: 800;
	color: #0f172a;
}

.networld-reversi-turn-badge {
	font-size: 13px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	background: #eff6ff;
	color: #1e40af;
}

/* -------------------------------------------------------------
 * 3. 8x8 Board Layout
 * ------------------------------------------------------------- */
.networld-reversi-board {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	grid-template-rows: repeat(8, minmax(0, 1fr));
	width: 100%;
	max-width: 520px;
	aspect-ratio: 1 / 1;
	background: var(--nw-rev-board-bg);
	border: 10px solid var(--nw-rev-board-border);
	border-radius: 8px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), inset 0 0 15px rgba(0, 0, 0, 0.4);
	padding: 4px;
	gap: 2px;
	user-select: none;
	touch-action: manipulation;
}

.networld-reversi-cell {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	cursor: default;
	outline: none;
	transition: background 0.15s ease;
}

.networld-reversi-cell:focus-visible {
	outline: 2px solid #38bdf8;
	outline-offset: -2px;
}

.networld-reversi-cell.is-legal {
	cursor: pointer;
}

.networld-reversi-cell.is-legal:hover {
	background: var(--nw-rev-cell-hover);
}

/* Legal Move Dot */
.networld-reversi-cell.is-legal::after {
	content: "";
	width: 24%;
	height: 24%;
	border-radius: 50%;
	background: var(--nw-rev-legal-hint);
	pointer-events: none;
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

/* -------------------------------------------------------------
 * 4. Discs Rendering & Animation
 * ------------------------------------------------------------- */
.networld-reversi-disc {
	width: 82%;
	height: 82%;
	border-radius: 50%;
	position: relative;
	transition: transform 0.35s ease, background 0.35s ease;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}

.networld-reversi-disc.is-black {
	background: radial-gradient(circle at 35% 35%, #334155, #020617);
	border: 1px solid #000;
}

.networld-reversi-disc.is-white {
	background: radial-gradient(circle at 35% 35%, #ffffff, #94a3b8);
	border: 1px solid #64748b;
}

.networld-reversi-disc.is-flipping {
	transform: scaleX(0);
}

/* -------------------------------------------------------------
 * 5. Controls & Banners
 * ------------------------------------------------------------- */
.networld-reversi-controls-bar {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 520px;
	flex-wrap: wrap;
}

.networld-reversi-pass-banner {
	width: 100%;
	max-width: 520px;
	padding: 12px 16px;
	background: #fef3c7;
	border: 1px solid #fde047;
	border-radius: 6px;
	color: #92400e;
	font-weight: 600;
	font-size: 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* -------------------------------------------------------------
 * 6. Responsive Mobile Viewport (down to 390px)
 * ------------------------------------------------------------- */
@media (max-width: 640px) {
	.networld-reversi-wrap {
		padding: 0 4px;
		max-width: 100%;
		box-sizing: border-box;
	}

	.networld-reversi-scoreboard {
		padding: 8px 12px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 6px;
		width: 100%;
		max-width: 340px;
		margin: 0 auto;
		box-sizing: border-box;
	}

	.networld-reversi-score-item {
		gap: 4px;
	}

	.networld-reversi-score-disc {
		width: 18px;
		height: 18px;
	}

	.networld-reversi-turn-badge {
		font-size: 11px;
		padding: 2px 6px;
		white-space: nowrap;
	}

	.networld-reversi-score-count {
		font-size: 14px;
	}

	.networld-reversi-board {
		width: 100%;
		max-width: 340px;
		border-width: 6px;
		padding: 2px;
		gap: 1px;
		margin: 0 auto;
		box-sizing: border-box;
	}

	.networld-reversi-nav {
		flex-direction: column;
	}

	.networld-reversi-tab-btn {
		width: 100%;
		text-align: center;
	}
}