/* Maze game styles (Chase Scene) */

/*	Custom colors by Yavin */

:root {
  --maze-bg-hi: #263b5a;     /* board floor gradient, upper */
  --maze-bg-lo: #0b182b;     /* board floor gradient, lower */
  --maze-rim: #22304a;       /* board edge band */
  --maze-grid-line: rgba(148, 196, 236, 0.05);
  --wall-face: #b5bcbc;      /* light gray wall top face (flat = seam-free) hsl(180 5% 72.4%) */
  --wall-lit: #e2e6e3;       /* opaque white top/left lighting highlight */
  --wall-band: #6e7070;      /* hard extruded shadow facet, offset 2.5px hsl(180 0.9% 43.5%) */
  --panel-before-rotation: #00f5ea;     /* laser door, passable */
  --panel-after-rotation: #ff2d55;  /* laser door, locked */
  
  
  --wall-top: #b4bbbb; /* hsl(180 5% 72%); */
  --wall-3d-to-right: #7c8383; /* hsl (180 3% 50%); */
  --wall-3d-below: #6d6f6f; /* hsl(180 1% 43%); */
  
}

#killer-token {
	transition: transform 0.15s ease-in-out;
	position: absolute; /* allows killer and player tokens to overlap in the same cell */
	z-index: 2;
}

#killer-token.moving-down {
	transform: translate(0, 35px);
}

#killer-token.moving-left {
	transform: translate(-35px, 0);
}

#killer-token.moving-right {
	transform: translate(35px, 0);
}

#killer-token.moving-up {
	transform: translate(0, -35px);
}

#killer-token.spinning-clockwise {
	transform: rotate(1turn);
}

#killer-token.spinning-counterclockwise {
	transform: rotate(-1turn);
}

#killer-token.thwarted {
	animation: shake .3s ease;
}

#maze {
	flex: none;
	border: 1px solid var(--maze-rim);
	border-radius: 2px;
	background: linear-gradient(180deg, var(--maze-bg-hi) 0%, var(--maze-bg-lo) 100%);
	box-shadow:
		inset 0 0 40px rgba(2, 8, 14, 0.55),
		0 14px 34px rgba(0, 0, 0, 0.6),
		0 0 22px rgba(4, 14, 24, 0.8);
	margin-bottom: 2rem;
}

#maze-container {
	position: relative; /* absolutely position #animation-overlay inside it */
	display: flex;
	flex-direction: row;
	justify-content: center;
}

.maze-cell {
	flex: none;
	width: 32px;
	height: 32px;
	text-align: center;
	user-select: none;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: all 0.1s ease-in;
	
	/*	Temporary, for "SAFETY" marker */
	color: white;
	font-family: Arial, sans-serif;
}

.maze-cell:not(:has(img)):hover {
	
	/*	This style is applied only to a cell that does NOT contain the player's token; otherwise,
		on a touchscreen, the cell the player occupies would always be lit up cyan. */
	background-color: rgba(0, 245, 234, 0.1) !important;
	box-shadow: inset 0 0 0 1px rgba(0, 245, 234, 0.28);
}

.maze-column-divider {
	flex: none;
	width: 9px; /* formerly 3px; */
	margin-left: -3px;
	margin-right: -3px;
	height: 32px;
	background-image: url("images/maze-column-divider.fw.png");
}

.maze-column-divider.wall {
	background-image: url("images/maze-vertical-wall.fw.png");
}

.maze-column-divider,
.maze-row-divider,
.maze-intersection {
	background-size: contain;
	background-repeat: no-repeat;
}

.maze-column-divider.door.lower {
	background-image: url("images/maze-rotating-panel-bottom-before-turning.fw.png");
}

.maze-column-divider.door.upper {
	background-image: url("images/maze-rotating-panel-top-before-turning.fw.png");
}

.maze-column-divider.frozen-door.lower {
	background-image: url("images/maze-rotating-panel-bottom-after-turning.fw.png");
}

.maze-column-divider.frozen-door.upper {
	background-image: url("images/maze-rotating-panel-top-after-turning.fw.png");	
}

#maze-game-death-count {
	color: rgb(255, 107, 128);
	font-family: var(--font-mono);
	font-size: 1.25rem;
	font-weight: 700;
	text-align: center;
}

#maze-game-death-count-box {
	border: 1px solid rgba(255, 42, 75, 0.35);
	background: linear-gradient(145deg, rgba(9, 34, 45, 0.94), rgba(3, 13, 22, 0.94));
	padding: 0.5rem;
}

#maze-game-death-count-label {
	color: rgba(218, 239, 242, 0.6);
	font-size: 0.5rem;
	font-family: var(--font-mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

#maze-game-instructions-button {
	border: 1px solid rgba(0, 255, 204, 0.22);
	font-family: var(--font-mono);
	color: var(--color-light-grey);
}

#maze-game-restart-button {
	border: 1px solid var(--color-brand-cyan-50);
	color: white;
}

#maze-game-top-buttons {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

#maze-game-top-buttons > * {
	flex: none;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

#maze-game-top-buttons button {
	font-family: var(--font-mono);
	font-size: 0.875rem;
	padding: 0.25em 1em;
	background-color: rgb(12, 22, 34);
	transition: all 0.3s ease;
}

#maze-game-top-buttons button:hover {
	background-image: none;
	background-color: var(--color-brand-cyan-20);
	color: white;
}

.maze-intersection {
	flex: none;
	width: 9px;
	height: 9px;
	
	/*	Negative top and bottom margins are taken care of by the parent element, a div with the
		class "maze-row-of-dividers." Only left and right margins need to be applied here. */
	margin-left: -3px;
	margin-right: -3px;
}

.maze-intersection:last-child {
	margin-right: 0;
}

.maze-intersection.above-door.below-door,
.maze-intersection.to-left-of-door.to-right-of-door {
	background-image: url("images/maze-intersection-in-middle-of-rotating-panel-large-version.fw.png");
}

.maze-intersection.above-frozen-door.below-frozen-door,
.maze-intersection.to-left-of-frozen-door.to-right-of-frozen-door {
	background-image: url("images/maze-intersection-in-middle-of-rotating-panel-after-turning.fw.png");
}

.maze-intersection.above-wall {
	background-image: url("images/maze-intersection-with-wall-below.fw.png");
}

.maze-intersection.below-wall {
	background-image: url("images/maze-intersection-with-wall-above.fw.png");
}

.maze-intersection.above-wall.below-wall {
	background-image: url("images/maze-intersection-with-walls-above-and-below.fw.png");
}

.maze-intersection.to-left-of-wall {
	background-image: url("images/maze-intersection-with-wall-to-right.fw.png");	
}
	
.maze-intersection.to-right-of-wall {
	background-image: url("images/maze-intersection-with-wall-to-left.fw.png");
}

.maze-intersection.to-left-of-wall.to-right-of-wall {
	background-image: url("images/maze-intersection-with-walls-to-left-and-right.fw.png");
}

.maze-row-divider {
	flex: none;
	width: 32px;
	background-image: url("images/maze-row-divider.fw.png");
}

.maze-row-divider.door.left {
	background-image: url("images/maze-left-half-of-rotating-panel-before-turning.fw.png");
}

.maze-row-divider.door.right {
	background-image: url("images/maze-right-half-of-rotating-panel-before-turning.fw.png");
}

.maze-row-divider.frozen-door.left {
	background-image: url("images/maze-left-half-of-rotating-panel-after-turning.fw.png");
}

.maze-row-divider.frozen-door.right {
	background-image: url("images/maze-right-half-of-rotating-panel-after-turning.fw.png");
}

.maze-row-divider.wall {
	background-image: url("images/maze-horizontal-wall.fw.png");
}

.maze-row-of-cells.flex-parent-horizontal {
	 overflow-x: visible; /* allows animated player/killer token to go outside row without disappearing */
}

.maze-row-of-cells:nth-child(4n) .maze-cell:nth-child(6n),
.maze-row-of-cells:nth-child(4n + 2) .maze-cell:nth-child(6n - 2) {
	background-color: rgba(56, 88, 130, 0.1);
}

.maze-row-of-cells:nth-child(4n) .maze-cell:nth-child(8n),
.maze-row-of-cells:nth-child(4n + 2) .maze-cell:nth-child(8n - 2) {
	background-color: rgba(3, 10, 20, 0.14);
}

.maze-row-of-dividers {
	height: 9px;
	margin-top: -3px;
	margin-bottom: -3px;
}

.maze-row-of-dividers.flex-parent-horizontal {
	 overflow-x: visible; /* so that leftmost intersections don't get cut off */
}

#player-token {
	transition: transform 0.2s ease-in-out;
	position: absolute; /* allows player and killer tokens to overlap in the same cell */
	z-index: 3;
}

#player-token.moving-down {
	transform: translate(0, 35px);
}

#player-token.moving-left {
	transform: translate(-35px, 0);
}

#player-token.moving-right {
	transform: translate(35px, 0);
}

#player-token.moving-up {
	transform: translate(0, -35px);
}

#player-token.spinning-clockwise {
	transform: rotate(1turn);
}

#player-token.spinning-counterclockwise {
	transform: rotate(-1turn);
}

.spinner {
	position: absolute;
	transition: transform 0.2s ease-in;
	visibility: hidden;
}

.spinner.rotated-clockwise {
	visibility: visible;
	transform: rotate(0.25turn);
}

.spinner.rotated-counterclockwise {
	visibility: visible;
	transform: rotate(-0.25turn);
}

#spinner-horizontal {
	width: 73px;
	height: 9px;
	background-image: url("images/maze-spinner-horizontal.fw.png");
}

#spinner-vertical {
	width: 9px;
	height: 73px;
	background-image: url("images/maze-spinner-vertical.fw.png");
}

.wall {
	position: relative;
	z-index: 3; /* put walls on top of cell background colors/images */
}

