*,
*::after,
*::before {
	box-sizing: border-box;
}

:root {
	font-size: 16px;
	--color-text: #000;
	--color-bg: #ddd;
	--color-link: #888;
	--color-link-hover: #000;
}

body {
	margin: 0;
	color: var(--color-text);
	background: radial-gradient(circle at center, #1f8f4d 0%, #0c4b27 55%, #042411 100%);
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow: hidden;
}

/* Page Loader */
.js .loading::before,
.js .loading::after {
	content: '';
	position: fixed;
	z-index: 1000;
}

.js .loading::before {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--color-bg);
}

.js .loading::after {
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	opacity: 0.4;
	background: var(--color-link);
	animation: loaderAnim 0.7s linear infinite alternate forwards;

}

/* @keyframes loaderAnim {
	to {
		opacity: 1;
		transform: scale3d(0.5,0.5,1);
	}
} */

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	cursor: pointer;
}

a:hover {
	color: var(--color-link-hover);
	outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
	/* Provide a fallback style for browsers
	 that don't support :focus-visible */
	outline: none;
	background: lightgrey;
}

a:focus:not(:focus-visible) {
	/* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
	background: transparent;
}

a:focus-visible {
	/* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
	outline: 2px solid red;
	background: transparent;
}

main {
	display: flex;
	flex-direction: column;
	height: 100vh;
}

.unbutton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
}

.unbutton:focus {
	outline: none;
}

.frame {
	color: var(--color-title);
	padding: 1.5rem;
	display: grid;
	grid-template-columns: auto auto 1fr;
	grid-template-rows: auto;
	grid-template-areas: 'title prev sponsor';
	justify-content: start;
	grid-gap: 2rem;
	z-index: 1000;
}

.frame a:not(.frame__title-back) {
	white-space: nowrap;
	overflow: hidden;
	position: relative;
}

.frame a:not(.frame__title-back)::before {
	content: '';
	height: 1px;
	width: 100%;
	background: currentColor;
	position: absolute;
	top: 90%;
	transition: transform 0.3s;
	transform-origin: 0% 50%;
}

.frame a:not(.frame__title-back):hover::before {
	transform: scaleX(0);
	transform-origin: 100% 50%;
}

.frame__title {
	grid-area: title;
	display: flex;
}

.frame__title-main {
	font-size: 1rem;
	margin: 0;
	font-weight: normal;
}

.frame__title-back {
	position: relative;
	display: flex;
	align-items: flex-end;
	margin-bottom: 0.15rem;
}

.frame__title-back span {
	display: none;
}

.frame__title-back svg {
	fill: currentColor;
}

.frame__prev {
	grid-area: prev;
}

/* .content {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
} */

canvas {
	position: absolute;
	top: 0;
	left: 0;
}
.bottom-controls {
	position: absolute;
	bottom: 1.5rem;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 1.25rem;
	z-index: 10001;
}

.score-display {
	position: absolute;
	top: 1.5rem;
	left: 1.5rem;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #f6f9f6;
	font-weight: 600;
	letter-spacing: 0.02em;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
	z-index: 10002;
}

.score-display span {
	display: inline-block;
	min-width: 2rem;
}

.casino-button {
	padding: 0.75rem 1.75rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-radius: 9999px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.05) 100%);
	backdrop-filter: blur(6px);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.casino-button:hover {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.12) 100%);
	border-color: rgba(255, 255, 255, 0.55);
	transform: translateY(-2px);
}

.casino-button:active {
	transform: translateY(0);
}

.casino-button--active {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.18) 100%);
	border-color: rgba(255, 255, 255, 0.7);
}

.casino-button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.dice-counter {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: rgba(0, 0, 0, 0.35);
	border-radius: 9999px;
	padding: 0.35rem 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.dice-counter__btn {
	min-width: 3rem;
	padding: 0.5rem 0.75rem;
	font-size: 1.5rem;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
}

.dice-counter__value {
	min-width: 2.5rem;
	text-align: center;
	font-size: 1.25rem;
	font-weight: 700;
	color: #f6f9f6;
}
