.shapes-game {
	--shapes-tile: min(42vw, 24vh, 9.5rem);
	--shapes-tile-gap: 0.45rem;
	max-width: 800px;
	margin: 0 auto;
	padding: 1rem 0.75rem 1.5rem;
	font-family: inherit;
	color: #1a1a1a;
	-webkit-tap-highlight-color: transparent;
}

.shapes-game,
.shapes-game * {
	-webkit-tap-highlight-color: transparent !important;
}

.shapes-game__gate {
	padding: 1rem 0.85rem 1.25rem;
	border-radius: 10px;
	background-color: #f4f7fb;
}

.shapes-game__partner {
	margin: 0 0 1.25rem;
	text-align: center;
}

.shapes-game__partner-name {
	font-size: 1.8rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	line-height: 1.2;
}

.shapes-game__partner-logo img {
	display: block;
	max-height: 90px;
	height: auto;
	width: auto;
	margin: 0 auto;
}

.shapes-game__title,
.shapes-game__end-title {
	margin: 0 0 0.75rem;
	font-size: 1.5rem;
	line-height: 1.2;
	text-align: center;
}

.shapes-game__closing {
	margin: 0 0 12px;
	font-size: 14px;
	font-style: italic;
	text-align: center;
}

.shapes-game__how-to {
	margin: 10px auto 1.25rem;
	max-width: 600px;
	width: 100%;
}

.shapes-game__how-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #1a5276;
	color: #fff;
	border: 1px solid #154360;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
}

.shapes-game__how-toggle:hover,
.shapes-game__how-toggle:focus {
	background: #154360;
}

.shapes-game__how-icon {
	font-size: 18px;
	margin-left: 8px;
}

.shapes-game__how-content {
	padding: 10px 14px 6px;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 4px 4px;
	font-size: 14px;
	line-height: 1.5;
	background: #fff;
}

.shapes-game__prize {
	margin: 0 auto 1.25rem;
	padding: 0;
	width: 100%;
	max-width: 500px;
	text-align: center;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.shapes-game__prize-image {
	display: inline-flex;
	width: auto;
	max-width: 100%;
	margin: 0 auto 15px;
	background-color: rgba(255, 255, 255, 0.85);
	padding: 8px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

.shapes-game__prize-frame {
	display: block;
	max-width: 100%;
	border: 2px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	box-sizing: border-box;
}

.shapes-game__prize-img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(300px, 100%);
	margin: 0 auto;
	border: 0;
}

.shapes-game__prize-description {
	text-align: center;
	font-size: 16px;
	line-height: 1.6;
	font-weight: 400;
	color: #333;
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	padding: 15px 20px;
	background-color: rgba(255, 255, 255, 0.85);
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

.shapes-game__prize-description p {
	margin: 0 0 0.75rem;
}

.shapes-game__prize-description p:last-child {
	margin-bottom: 0;
}

.shapes-game__form {
	display: grid;
	gap: 0.85rem;
	max-width: 500px;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.shapes-game__terms-block {
	text-align: left;
	padding: 14px 16px;
	background: #e8e8e8;
	border-radius: 6px;
}

.shapes-game__checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.4;
	min-height: 44px;
	padding: 4px 0;
}

.shapes-game__checkbox-row input[type="checkbox"] {
	margin-top: 3px;
	width: 20px;
	height: 20px;
	min-width: 20px;
	flex-shrink: 0;
}

.shapes-game__optin {
	margin: 8px 0 0;
}

.shapes-game__required {
	color: #b32d2e;
}

.shapes-game__required-note {
	margin: 2px 0 0;
	font-size: 14px;
	font-style: italic;
	color: #666;
}

.shapes-game__details-title {
	margin: 0 0 0.75rem;
	font-size: 1.2rem;
	text-align: center;
}

.shapes-game__field {
	display: grid;
	gap: 0.3rem;
	font-weight: 600;
}

.shapes-game__field input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	font-size: 1rem;
	border: 1px solid #c5c5c5;
	border-radius: 8px;
}

.shapes-game__error {
	margin: 0;
	color: #922b21;
	font-weight: 600;
}

.shapes-game__start,
.shapes-game__again,
.shapes-game__donate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.7rem 1.25rem;
	border: 0;
	border-radius: 10px;
	font-size: 1.05rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
}

.shapes-game__form > .shapes-game__start {
	justify-self: center;
}

.shapes-game__start,
.shapes-game__donate {
	background: #1a5276;
	color: #fff;
}

.shapes-game__start.is-disabled {
	background: #ccc;
	color: #fff;
	opacity: 0.6;
}

.shapes-game__again {
	background: #e8e8e8;
	color: #1a1a1a;
}

.shapes-game__countdown {
	text-align: center;
	padding: 2rem 0;
}

.shapes-game__countdown-number {
	font-size: 4.5rem;
	font-weight: 800;
	line-height: 1;
	color: #1e3a5f;
	animation: shapes-countdown-pulse 1s ease-in-out infinite;
}

.shapes-game__countdown-label {
	margin: 0.5rem 0 0;
	font-size: 1.15rem;
	font-weight: 700;
}

.shapes-game__play:not([hidden]) {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	min-height: 0;
}

.shapes-game__hud {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.25rem 0.75rem;
	margin: 0;
	font-weight: 700;
	font-size: 0.88rem;
	flex: 0 0 auto;
}

.shapes-game__target-wrap {
	margin: 0;
	text-align: center;
	flex: 0 0 auto;
	background: #1a5276;
	color: #fff;
	border-radius: 12px;
	padding: 0.5rem 0.65rem 0.7rem;
}

.shapes-game__target-label {
	margin: 0 0 0.4rem;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
}

.shapes-game__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 8%;
	box-sizing: border-box;
	background: #f4f7fb;
	border: 2px solid #1e3a5f;
	border-radius: 10px;
}

.shapes-game__tile--target {
	width: var(--shapes-tile);
	height: var(--shapes-tile);
	margin: 0 auto;
	pointer-events: none;
	padding: 2%;
	background: #12344d;
	border: 3px solid #f4d03f;
	box-shadow: none;
}

.shapes-game__tile--target .shapes-game__svg {
	width: 100%;
	height: 100%;
}

.shapes-game__answers {
	flex: 0 0 auto;
	background: #eef4f8;
	border: 2px dashed #1a5276;
	border-radius: 12px;
	padding: 0.45rem 0.5rem 0.6rem;
}

.shapes-game__answers-label {
	margin: 0 0 0.45rem;
	text-align: center;
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1a5276;
}

.shapes-game__options {
	display: grid;
	grid-template-columns: var(--shapes-tile) var(--shapes-tile);
	grid-template-rows: var(--shapes-tile) var(--shapes-tile);
	gap: var(--shapes-tile-gap);
	width: calc(var(--shapes-tile) * 2 + var(--shapes-tile-gap));
	height: calc(var(--shapes-tile) * 2 + var(--shapes-tile-gap));
	max-width: 100%;
	margin: 0 auto;
}

.shapes-game__tile--option {
	cursor: pointer;
	min-height: 0;
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	color: inherit;
	padding: 2%;
	background: #fff;
	border-color: #5d8aa8;
	border-width: 2px;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	outline: none;
	box-shadow: none;
}

.shapes-game__tile--option *,
.shapes-game__tile--option svg,
.shapes-game__tile--option .shapes-game__svg {
	pointer-events: none;
}

.shapes-game__tile--option:hover,
.shapes-game__tile--option:active,
.shapes-game__tile--option:focus,
.shapes-game__tile--option:focus-visible,
.shapes-game__tile--option:focus-within {
	outline: none !important;
	box-shadow: none !important;
}

.shapes-game__svg {
	width: 100%;
	height: 100%;
	display: block;
}

.shapes-game__tile--option.is-ok {
	border-color: #1e8449;
	background: #e8f6ee;
	animation: shapes-bounce 0.45s ease;
}

.shapes-game__tile--option.is-bad {
	border-color: #922b21;
	background: #f8e6e4;
	animation: shapes-shake 0.4s ease;
}

.shapes-game__tile--option.is-disabled {
	opacity: 0.45;
	cursor: default;
	position: relative;
}

.shapes-game__tile--option.is-disabled::after {
	content: "";
	position: absolute;
	left: 18%;
	right: 18%;
	top: 50%;
	height: 3px;
	background: #5a6f86;
	transform: rotate(-28deg);
	pointer-events: none;
}

.shapes-game__end-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin-top: 1rem;
}

.shapes-game__end-stats {
	text-align: center;
	font-weight: 600;
}

.shapes-game__rank {
	margin: 1rem auto 0;
	max-width: 28rem;
	padding: 0.75rem 1rem;
	text-align: center;
	font-size: 1.05rem;
	font-weight: 800;
	background: #fff3cd;
	border: 2px solid #ffc107;
	border-radius: 6px;
	color: #856404;
}

.shapes-game__summary {
	margin-top: 0.85rem;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
}

.shapes-game__summary p {
	margin: 0.25rem 0;
}

.shapes-game__sponsor {
	margin-top: 1rem;
}

@keyframes shapes-countdown-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.06); opacity: 0.85; }
}

@keyframes shapes-bounce {
	0% { transform: scale(1); }
	40% { transform: scale(1.06); }
	100% { transform: scale(1); }
}

@keyframes shapes-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

@media (min-width: 700px) {
	.shapes-game {
		--shapes-tile: min(28vh, 10.5rem);
	}
}
