@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap');

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

#home {
    background-color: #000a;
    border-color: #555;
    border-radius: 10px;
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 5px 5px #000a;
    cursor: pointer;
    fill: #fff;
    height: 30px;
    right: 1rem;
    padding: 5px;
    position: fixed;
    bottom: 1rem;
    width: 30px;
    z-index: 99;
}

body {
    background-color: #222;
		background: linear-gradient(45deg,
																#666eea 0%,
																#764ba2 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    font-family: 'Ubuntu', sans-serif;
    height: 100vh;
    overflow: hidden;
    place-content: center;
    place-items: center;
}

.container {
	background-color: #667eea;
	border-radius: 20px;
	box-shadow: 0 10px 30px #0004;
	padding: 40px;
	text-align: center;
}

.dice {
	aspect-ratio: 1 / 1;
	background-color: #111;

	border-radius: 8px;
	border-style: solid;
	border-width: 1px;

	border-top-color: #fff;
	border-right-color: #444;
	border-bottom-color: #444;
	border-left-color: #fff;

	cursor: pointer;
	margin: 20px auto;
	position: relative;
	
	transition-duration: 100ms;	
	transition-property: transform;

	width: 100px;
}

.dice:hover {
	transform: scale(1.05);
}

.dice.rolling {
	animation-duration: 500ms;
	animation-iteration-count: infinite;
	animation-name: roll;	
	animation-timing-function: ease-in-out;
}

.result {
	font-size: 48px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.face {
	height: 100%;
	position: relative;
	width: 100%;
}

.dot {
	--dist: 10%;

	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg,
															#000 0%,
															#222 50%,
															#fff 100%);
	border-radius: 100%;
	box-shadow: inset -1px -1px #fff;
	position: absolute;
	width: 16px;
}

.dot.center {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.dot.mid {
	top: 50%;
	transform: translateY(-50%);
}

.dot.top {
	top: var(--dist);
}

.dot.bottom {
	bottom: var(--dist);
}

.dot.right{
	right: var(--dist);
}

.dot.left {
	left: var(--dist);
}

.roll-btn {
	background-color: transparent;
	border-color: #fff;
	border-radius: 8px;
	border-style: solid;
	border-width: 3px;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	padding: 10px 20px;
}

.roll-btn:disabled {
	background-color: #ccc;
	cursor: not-allowed;
}

.hidden {
	display: none;
}

@keyframes roll {
	0% {
		transform: rotate(0deg) scale(1);
	}
	25% {
		transform: rotate(90deg) scale(1.1);
	}
	50% {
		transform: rotate(180deg) scale(0.9);
	}
	75% {
		transform: rotate(270deg) scale(1.1);
	}
	100% {
		transform: rotate(360deg) scale(1.0);
	}
}
