/**
 * Piškvorky / tic-tac-toe — vzhľad zladený s game-page (freecell.zone / vuqq).
 * Zachované triedy: .wrapper2, .dialogs, .game2, .scores, … (game.js).
 */

u {
	text-decoration: none;
}

.game-page--tic-tac-toe .wrapper2 {
	position: relative;
	text-align: center;
	padding: 0.5rem 0 1rem;
}

.game-page--tic-tac-toe .container2 {
	position: relative;
	top: auto;
	transform: none;
	max-width: 31.25rem;
	margin-left: auto;
	margin-right: auto;
	padding: 0 0.75rem 1rem;
	z-index: 1;
}

.game-page--tic-tac-toe .container2::after {
	clear: both;
	content: "";
	display: block;
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .container2 {
		max-width: 20rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .container2 {
		max-width: 20rem;
	}
}

@media screen and (max-height: 420px) {
	.game-page--tic-tac-toe .container2 {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 0.75rem;
		max-width: 100%;
		height: auto;
	}
}

/* Skóre */
.game-page--tic-tac-toe .scores {
	float: none;
	display: block;
	width: 100%;
	margin-top: 1.25rem;
	cursor: default;
}

.game-page--tic-tac-toe .scores .row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.game-page--tic-tac-toe .scores .col {
	float: none;
	width: auto;
	flex: 1 1 28%;
	min-width: 5.5rem;
	max-width: 10rem;
	padding: 0.65rem 0.5rem;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 0.65rem;
	box-sizing: border-box;
}

.game-page--tic-tac-toe .scores h2 {
	margin: 0 0 0.35rem;
	font-size: clamp(0.7rem, 2.8vw, 0.8125rem);
	font-weight: 600;
	line-height: 1.25;
	color: #475569;
	text-transform: none;
	letter-spacing: 0;
}

.game-page--tic-tac-toe .scores h2 .char {
	font-family: ui-sans-serif, system-ui, sans-serif;
	font-weight: 700;
}

.game-page--tic-tac-toe .scores u {
	font-family: ui-sans-serif, system-ui, sans-serif;
	font-size: clamp(1.35rem, 5vw, 1.75rem);
	font-weight: 700;
	color: #15202b;
	display: block;
}

@media screen and (max-height: 420px) {
	.game-page--tic-tac-toe .scores {
		float: none;
		width: auto;
		max-width: 9.5rem;
		margin-top: 0;
		position: relative;
		top: auto;
		transform: none;
	}

	.game-page--tic-tac-toe .scores .row {
		flex-direction: column;
		gap: 0.35rem;
	}

	.game-page--tic-tac-toe .scores .col {
		margin-bottom: 0;
		min-width: 0;
		flex: none;
	}
}

/* Mriežka */
.game-page--tic-tac-toe .game2 {
	float: none;
	display: inline-block;
	width: auto;
	min-width: 0;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 0.75rem;
	box-shadow: 0 4px 20px rgba(21, 32, 43, 0.08);
	overflow: hidden;
}

.game-page--tic-tac-toe .game2 .row {
	display: flex;
}

.game-page--tic-tac-toe .game2 .row::after {
	display: none;
}

.game-page--tic-tac-toe .game2 .row .col {
	float: none;
	flex: 0 0 auto;
	height: 10rem;
	width: 10rem;
	position: relative;
	cursor: pointer;
	transition: background-color 0.2s ease;
	border-bottom: 2px solid #e2e8f0;
	border-right: 2px solid #e2e8f0;
	color: #15202b;
	font-size: clamp(3rem, 18vw, 8rem);
	box-sizing: border-box;
}

.game-page--tic-tac-toe .game2 .row .col:last-child {
	border-right: none;
}

.game-page--tic-tac-toe .game2 .row:last-child .col {
	border-bottom: none;
}

.game-page--tic-tac-toe .game2 .row .col:hover {
	background-color: #f8fafc;
}

.game-page--tic-tac-toe .game2 .row .col:active {
	background-color: #e2e8f0;
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .game2 .row .col {
		height: 6.25rem;
		width: 6.25rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .game2 .row .col {
		height: 6.25rem;
		width: 6.25rem;
	}
}

@media screen and (max-height: 420px) {
	.game-page--tic-tac-toe .game2 {
		position: relative;
		top: auto;
		transform: none;
		float: none;
		flex: 0 0 auto;
	}

	.game-page--tic-tac-toe .game2 .row .col {
		height: 6.25rem;
		width: 6.25rem;
	}
}

/* Výherná animácia */
@-webkit-keyframes tt-blink {
	from {
		background-color: rgba(251, 191, 36, 0.55);
	}
	to {
		background-color: transparent;
	}
}

@-moz-keyframes tt-blink {
	from {
		background-color: rgba(251, 191, 36, 0.55);
	}
	to {
		background-color: transparent;
	}
}

@keyframes tt-blink {
	from {
		background-color: rgba(251, 191, 36, 0.55);
	}
	to {
		background-color: transparent;
	}
}

.game-page--tic-tac-toe .game2 .row .col.blink {
	-webkit-animation: tt-blink 0.25s 3;
	-moz-animation: tt-blink 0.25s 3;
	animation: tt-blink 0.25s 3;
}

/* X / O v bunkách */
.game-page--tic-tac-toe .game2 .row .col u {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
}

.game-page--tic-tac-toe .game2 .row .col u.o:after {
	content: "";
	border: solid #c2410c;
	border-radius: 50%;
	border-width: 0.65rem;
	height: 58%;
	width: 58%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateY(-50%) translateX(-50%);
	-webkit-animation: tt-o 0.25s;
	-moz-animation: tt-o 0.25s;
	animation: tt-o 0.25s;
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .game2 .row .col u.o:after {
		border-width: 0.45rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .game2 .row .col u.o:after {
		border-width: 0.45rem;
	}
}

@-webkit-keyframes tt-o {
	from {
		height: 85%;
		width: 85%;
	}
	to {
		height: 58%;
		width: 58%;
	}
}

@-moz-keyframes tt-o {
	from {
		height: 85%;
		width: 85%;
	}
	to {
		height: 58%;
		width: 58%;
	}
}

@keyframes tt-o {
	from {
		height: 85%;
		width: 85%;
	}
	to {
		height: 58%;
		width: 58%;
	}
}

@-webkit-keyframes tt-x {
	from {
		height: 85%;
		width: 14%;
	}
	to {
		height: 58%;
		width: 10%;
	}
}

@-moz-keyframes tt-x {
	from {
		height: 85%;
		width: 14%;
	}
	to {
		height: 58%;
		width: 10%;
	}
}

@keyframes tt-x {
	from {
		height: 85%;
		width: 14%;
	}
	to {
		height: 58%;
		width: 10%;
	}
}

.game-page--tic-tac-toe .game2 .row .col u.x:before,
.game-page--tic-tac-toe .game2 .row .col u.x:after {
	content: "";
	background-color: #15202b;
	height: 58%;
	width: 10%;
	position: absolute;
	top: 50%;
	left: 50%;
	-webkit-animation: tt-x 0.25s;
	-moz-animation: tt-x 0.25s;
	animation: tt-x 0.25s;
}

.game-page--tic-tac-toe .game2 .row .col u.x:before {
	transform: translateY(-50%) translateX(-50%) rotate(45deg);
}

.game-page--tic-tac-toe .game2 .row .col u.x:after {
	transform: translateY(-50%) translateX(-50%) rotate(-45deg);
}

/* Dialógy */
.game-page--tic-tac-toe .dialogs {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 99;
	height: 100%;
	width: 100%;
}

.game-page--tic-tac-toe .dialogs .cover {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	background-color: rgba(15, 23, 42, 0.78);
	opacity: 1;
	z-index: 1 !important;
}

.game-page--tic-tac-toe .submenu__list,
.game-page--tic-tac-toe .header__nav-list_inner,
.game-page--tic-tac-toe .nav__options .options {
	z-index: 999 !important;
}

.game-page--tic-tac-toe .dialogs .pick,
.game-page--tic-tac-toe .dialogs .end {
	position: relative;
	z-index: 2;
	top: 50%;
	transform: translateY(-50%);
	padding: 0.9375rem 0.75rem;
}

.game-page--tic-tac-toe .dialogs .pick .msg,
.game-page--tic-tac-toe .dialogs .end .msg {
	margin: 0 0 1.25rem;
	color: #f8fafc;
	font-size: clamp(1.5rem, 6vw, 2.75rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .dialogs .pick .msg,
	.game-page--tic-tac-toe .dialogs .end .msg {
		font-size: 1.5rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .dialogs .pick .msg,
	.game-page--tic-tac-toe .dialogs .end .msg {
		font-size: 1.5rem;
	}
}

.game-page--tic-tac-toe .dialogs .pick button,
.game-page--tic-tac-toe .dialogs .end button {
	position: relative;
	border: 2px solid rgba(248, 250, 252, 0.35);
	border-radius: 1rem;
	outline: none;
	background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
	color: #15202b;
	font-size: clamp(3rem, 14vw, 6rem);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
	height: 10rem;
	width: 10rem;
	margin: 0 0.35rem 0.5rem;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.game-page--tic-tac-toe .dialogs .pick button:last-child,
.game-page--tic-tac-toe .dialogs .end button:last-child {
	margin-right: 0;
}

.game-page--tic-tac-toe .dialogs .pick button:hover,
.game-page--tic-tac-toe .dialogs .end button:hover {
	background: #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
	transform: translateY(-1px);
}

.game-page--tic-tac-toe .dialogs .pick button:active,
.game-page--tic-tac-toe .dialogs .end button:active {
	transform: translateY(0);
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .dialogs .pick button,
	.game-page--tic-tac-toe .dialogs .end button {
		height: 6.25rem;
		width: 6.25rem;
		font-size: 3.25rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .dialogs .pick button,
	.game-page--tic-tac-toe .dialogs .end button {
		height: 6.25rem;
		width: 6.25rem;
		font-size: 3.25rem;
	}
}

.game-page--tic-tac-toe .dialogs .pick button.o:after,
.game-page--tic-tac-toe .dialogs .end button.o:after {
	content: "";
	border: solid #c2410c;
	border-radius: 50%;
	border-width: 0.65rem;
	height: 58%;
	width: 58%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateY(-50%) translateX(-50%);
	-webkit-animation: tt-o 0.25s;
	-moz-animation: tt-o 0.25s;
	animation: tt-o 0.25s;
}

@media screen and (max-width: 520px) {
	.game-page--tic-tac-toe .dialogs .pick button.o:after,
	.game-page--tic-tac-toe .dialogs .end button.o:after {
		border-width: 0.45rem;
	}
}

@media screen and (max-height: 620px) {
	.game-page--tic-tac-toe .dialogs .pick button.o:after,
	.game-page--tic-tac-toe .dialogs .end button.o:after {
		border-width: 0.45rem;
	}
}

.game-page--tic-tac-toe .dialogs .pick button.x:before,
.game-page--tic-tac-toe .dialogs .end button.x:before {
	content: "";
	background-color: #15202b;
	height: 58%;
	width: 10%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateY(-50%) translateX(-50%) rotate(45deg);
	-webkit-animation: tt-x 0.25s;
	-moz-animation: tt-x 0.25s;
	animation: tt-x 0.25s;
}

.game-page--tic-tac-toe .dialogs .pick button.x:after,
.game-page--tic-tac-toe .dialogs .end button.x:after {
	content: "";
	background-color: #15202b;
	height: 58%;
	width: 10%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateY(-50%) translateX(-50%) rotate(-45deg);
	-webkit-animation: tt-x 0.25s;
	-moz-animation: tt-x 0.25s;
	animation: tt-x 0.25s;
}

.game-page--tic-tac-toe .dialogs .end {
	display: none;
}

.game-page--tic-tac-toe .dialogs .end button.replay {
	font-size: 2rem;
	line-height: 1;
	border-radius: 999px;
	width: 3.5rem;
	height: 3.5rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* === Tmavá téma (trieda dark-theme na body) === */
body.game-page--tic-tac-toe.dark-theme .game2 {
	background: #1e293b;
	border-color: #334155;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

body.game-page--tic-tac-toe.dark-theme .game2 .row .col {
	border-color: #334155;
	color: #f8fafc;
}

body.game-page--tic-tac-toe.dark-theme .game2 .row .col:hover {
	background: #273549;
}

body.game-page--tic-tac-toe.dark-theme .game2 .row .col:active {
	background: #334155;
}

body.game-page--tic-tac-toe.dark-theme .game2 .row .col u.x:before,
body.game-page--tic-tac-toe.dark-theme .game2 .row .col u.x:after {
	background-color: #f1f5f9;
}

body.game-page--tic-tac-toe.dark-theme .scores .col {
	background: #273549;
	border-color: #334155;
}

body.game-page--tic-tac-toe.dark-theme .scores h2 {
	color: #cbd5e1;
}

body.game-page--tic-tac-toe.dark-theme .scores u {
	color: #f8fafc;
}

body.game-page--tic-tac-toe.dark-theme .dialogs .cover {
	background-color: rgba(2, 6, 23, 0.82);
}
