.island-game-open {
	overflow: hidden;
}

[data-island-game-trigger] {
	display: block;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: default;
	outline: none;
}

[data-island-game-trigger]:focus-visible {
	border-radius: 50%;
	box-shadow: 0 0 0 4px #fff, 0 0 0 7px #ef7d32;
}

.island-game-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: clamp(12px, 3vw, 36px);
	background: rgba(0, 42, 63, 0.88);
	backdrop-filter: blur(8px);
}

.island-game-overlay[hidden] {
	display: none;
}

.island-game-panel {
	position: relative;
	width: min(1240px, 100%);
	padding: clamp(18px, 3vw, 34px);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 24px;
	background: #fffaf0;
	box-shadow: 0 30px 90px rgba(0, 25, 38, 0.45);
	color: #002a3f;
}

.island-game-panel::before {
	position: absolute;
	inset: 0 0 auto;
	height: 7px;
	background: linear-gradient(90deg, #ef7d32 0 34%, #18a7a0 34% 67%, #f3c860 67%);
	content: "";
}

.island-game-header {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 18px;
}

.island-game-kicker {
	margin: 0 0 5px;
	color: #ef7d32;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.25em;
	text-transform: uppercase;
}

.island-game-title {
	margin: 0;
	color: #002a3f;
	font-size: clamp(27px, 4vw, 52px);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 0.95;
}

.island-game-score {
	-webkit-user-select: none;
	user-select: none;
	flex: 0 0 auto;
	min-width: 122px;
	padding: 10px 16px;
	border: 1px solid rgba(0, 42, 63, 0.25);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-align: center;
	text-transform: uppercase;
}

.island-game-close {
	position: absolute;
	z-index: 2;
	top: 17px;
	right: 17px;
	display: grid;
	width: 38px;
	height: 38px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: #002a3f;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 23px;
	line-height: 1;
}

.island-game-close:hover,
.island-game-close:focus-visible {
	background: #ef7d32;
	outline: none;
}

.island-game-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: 16px;
	align-items: stretch;
}

.island-game-stage {
	position: relative;
	overflow: hidden;
	border: 2px solid #002a3f;
	border-radius: 16px;
	background: #9ee5e2;
	box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.55);
	cursor: pointer;
	touch-action: manipulation;
}

.island-game-canvas {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 300px;
	object-fit: fill;
	image-rendering: pixelated;
}

.island-game-message {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(430px, calc(100% - 32px));
	padding: 15px 18px;
	transform: translate(-50%, -50%);
	border: 1px solid rgba(0, 42, 63, 0.22);
	border-radius: 12px;
	background: rgba(255, 250, 240, 0.94);
	box-shadow: 0 10px 30px rgba(0, 42, 63, 0.18);
	color: #002a3f;
	font-size: clamp(14px, 2vw, 18px);
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
}

.island-game-message small {
	font-size: 0.72em;
	font-weight: 600;
}

.island-game-message[hidden] {
	display: none;
}

.island-game-scoreboard {
	-webkit-user-select: none;
	user-select: none;
	display: flex;
	min-width: 0;
	padding: 16px;
	flex-direction: column;
	border: 1px solid rgba(0, 42, 63, 0.2);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 25px rgba(0, 42, 63, 0.08);
}

.island-game-scoreboard-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(0, 42, 63, 0.1);
}

.island-game-scoreboard-heading p {
	margin: 0;
	color: #002a3f;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.island-game-scoreboard-heading span {
	padding: 3px 6px;
	border-radius: 999px;
	background: #ecf8f6;
	color: #137d65;
	font-size: 9px;
	font-weight: 700;
	white-space: nowrap;
}

.island-game-scoreboard-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 12px 0;
}

.island-game-scoreboard-stats div {
	padding: 9px 6px;
	border-radius: 10px;
	background: #fff7ea;
	text-align: center;
}

.island-game-scoreboard-stats strong,
.island-game-scoreboard-stats span {
	display: block;
}

.island-game-scoreboard-stats strong {
	color: #ef7d32;
	font-size: 17px;
	font-variant-numeric: tabular-nums;
}

.island-game-scoreboard-stats span {
	margin-top: 2px;
	color: rgba(0, 42, 63, 0.6);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.island-game-scoreboard-list {
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: auto;
}

.island-game-scoreboard-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 4px;
	border-bottom: 1px dashed rgba(0, 42, 63, 0.11);
	font-variant-numeric: tabular-nums;
}

.island-game-scoreboard-list li:last-child {
	border-bottom: 0;
}

.island-game-scoreboard-list li span {
	color: rgba(0, 42, 63, 0.48);
	font-size: 10px;
	font-weight: 700;
}

.island-game-scoreboard-list li strong {
	color: #002a3f;
	font-size: 13px;
	letter-spacing: 0.08em;
}

.island-game-scoreboard-list .island-game-scoreboard-empty {
	display: block;
	padding: 12px 4px;
	border: 0;
	color: rgba(0, 42, 63, 0.52);
	font-size: 11px;
	font-style: italic;
	line-height: 1.4;
	text-align: center;
}

.island-game-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-top: 14px;
	color: rgba(0, 42, 63, 0.72);
	font-size: 13px;
}

.island-game-footer p {
	margin: 0;
}

.island-game-key {
	display: inline-block;
	margin: 0 3px;
	padding: 3px 8px;
	border: 1px solid rgba(0, 42, 63, 0.28);
	border-bottom-width: 3px;
	border-radius: 5px;
	background: #fff;
	color: #002a3f;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

@media (max-width: 1020px) {
	.island-game-layout {
		grid-template-columns: 1fr;
	}

	.island-game-scoreboard {
		display: none;
	}
}

@media (max-width: 640px) {
	.island-game-overlay {
		padding: 8px;
	}

	.island-game-panel {
		padding: 22px 12px 14px;
		border-radius: 16px;
	}

	.island-game-header {
		display: block;
		padding-right: 42px;
	}

	.island-game-score {
		display: inline-block;
		margin-top: 12px;
	}

	.island-game-close {
		top: 12px;
		right: 12px;
	}

	.island-game-canvas {
		height: auto;
		min-height: 0;
		aspect-ratio: 8 / 3;
	}

	.island-game-footer {
		display: block;
		text-align: center;
	}

	.island-game-footer p + p {
		margin-top: 7px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.island-game-overlay {
		backdrop-filter: none;
	}
}

.island-game-tip {
	position: absolute;
	top: 18px;
	left: 50%;
	z-index: 3;
	padding: 9px 14px;
	transform: translateX(-50%);
	border: 1px solid rgba(0, 42, 63, 0.22);
	border-radius: 999px;
	background: rgba(255, 250, 240, 0.96);
	box-shadow: 0 8px 20px rgba(0, 42, 63, 0.14);
	color: #002a3f;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	pointer-events: none;
}

.island-game-tip strong {
	display: inline-block;
	margin: 0 2px;
	padding: 1px 6px 2px;
	border: 1px solid rgba(0, 42, 63, 0.25);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: #fff;
}

.island-game-tip[hidden] {
	display: none;
}
