@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap');

:root {
	--main-border-width: 1px;
	--main-border-radius: 4px;
	--main-tab-padding: 5px;
}

/* General formatting. */

* {
	font-family: "Roboto", sans-serif;
}

body {
	margin: 0;
	background-color: gray;
}

nav {
	display: flex;
}

span {
	display: flex;
	align-items: center;
}

p {
	margin: 0;
}

ul {
	margin-top: 0;
}

hr {
	margin: 6px 10px 6px 10px;
}

code {
	font-family: Consolas;
	background-color: #ddd;
}

.hidden {
	display: none !important;
}

input[type='checkbox'],
input[type='radio'] {
	margin: 0;
}

input[type='number']:not(#seed) {
	width: 35px;
}

header,
main {
	width: 500px;
	padding: 20px;
	margin: 20px auto 20px auto;
	text-align: center;
	box-shadow: 5px 5px 20px #333;
}

header,
main,
.popup {
	border-radius: 10px;
	background-color: white;
}

header p {
	font-weight: bold;
	font-size: 2em;
}

#main-nav p,
label,
.tracks-tab p,
#clear-track-overrides,
#sidebar .option,
#sidebar-toggle {
	user-select: none;
}

/* Main tabs. */

#main-nav > div {
	width: 130px;
	border-top-style: solid;
	border-right-style: solid;
	border-left-style: solid;
	border-width: var(--main-border-width);
	border-color: black;
	border-top-left-radius: var(--main-border-radius);
	border-top-right-radius: var(--main-border-radius);
	margin-right: 5px;
	padding: var(--main-tab-padding);
	padding-bottom: calc(var(--main-tab-padding) - var(--main-border-width) - 2px);
}

#main-nav > div:not(.selected) {
	background-color: darkgray;
}

#main-nav p {
	font-size: 1.1em;
}

.bottom-border-cover {
	display: none;
}

.selected .bottom-border-cover {
	position: relative;
	display: block;
	background-color: white;
	height: calc(var(--main-border-width) + 2px);
	top: calc(var(--main-tab-padding) - 1px);
	width: calc(100% + 2 * var(--main-tab-padding));
	left: calc(-1 * var(--main-tab-padding));
	z-index: 1;
}

/* Options view. */

#options-view {
	border-style: solid;
	border-width: var(--main-border-width);
	border-color: black;
	border-top-right-radius: var(--main-border-radius);
	border-bottom-left-radius: var(--main-border-radius);
	border-bottom-right-radius: var(--main-border-radius);
	padding: 10px;
}

#options-view section > div {
	margin-bottom: 5px;
}

#options-view section > div:last-child {
	margin-bottom: 0;
}

/* Option block formatting. */

.sub-options {
	padding-left: 20px;
}

#rando-type span,
#outputs > :last-child,
#magic-code-options > span,
.sub-options:not(#magic-code-options),
#difficulty > span {
	display: flex;
	gap: 10px;
	row-gap: 0;
}

#sequence-break-options,
#magic-code-list {
	flex-wrap: wrap;
}

#sequence-break-options > * {
	width: 120px;
	text-align: left;
}

#clear-rom {
	width: 22px;
	height: 22px;
	padding: 0;
}

#outputs {
	display: flex;
	gap: 10px;
}

#magic-code-list > * {
	width: 180px;
	text-align: left;
}

#adventure2-probability-display,
#peak-track-difficulty-display {
	display: inline;
}

#track-vehicles {
	margin-top: 5px;
}

#track-options nav {
	display: flex;
	flex-direction: column;
}

#randomize {
	font-size: 16px;
	margin-top: 10px;
	padding: 6px 16px;
}

/* Track overrides tabs. */

.tracks-tab,
.track-clear {
	padding: 1px;
	margin: 2px;
	border: 1px solid #555;
	background-color: #ccc;
	border-radius: 4px;
}

.tracks-tab {
	width: 37px;
}

.tracks-tab.race-type {
	width: 90px;
}

.tracks-tab:hover,
.track-clear:hover {
	background-color: #eee;
}

.tracks-tab.selected {
	background-color: #fff;
	box-shadow: rgb(45, 45, 45) 0 0 2px;
}

.tracks-tab.modified {
	background-color: rgb(68, 216, 68);
}

.tracks-tab.modified:hover {
	background-color: rgb(119, 240, 119);
}

.tracks-tab.modified.selected,
.tracks-tab.modified.selected:hover {
	background-color: rgb(177, 255, 177);
	box-shadow: rgb(15, 55, 28) 0 0 2px;
}

.track-clear {
	width: 85px;
	margin-left: auto;
}

/* Tooltips. */

*[tooltip] {
	position: relative;
}

*[tooltip]::before,
*[tooltip]::after {
	display: block;
	position: absolute;
	z-index: 100;
	animation-name: tooltip-animation;
	animation-duration: 1.5s;
}

*[tooltip]:hover::before,
*[tooltip]:hover::after {
	pointer-events: none;
	left: 20%;
}

*[tooltip]:has(*[tooltip]:hover):hover::before,
*[tooltip]:has(*[tooltip]:hover):hover::after {
	opacity: 0;
}

*[tooltip]:hover::before {
	content: "";
	width: 0; 
	height: 0; 
	top: 100%;
	border-style: solid;
	border-width: 6px 0 0 6px;
	border-color: transparent transparent transparent #333;
}

*[tooltip]:hover::after {
	content: attr(tooltip);
	font-family: "Roboto", sans-serif;
	font-size: 0.9em;
	font-weight: normal;
	width: max-content;
	max-width: 200px;
	top: calc(100% + 5px);
	text-align: left;
	background-color: #333;
	border-radius: 5px;
	border-top-left-radius: 0;
	color: white;
	padding: 5px 10px 5px 10px;
}

.tooltip {
	position: absolute;
	font-family: "Roboto", sans-serif;
	font-size: 0.9em;
	font-weight: normal;
	width: max-content;
	max-width: 200px;
	text-align: left;
	background-color: #333;
	border-radius: 5px;
	color: white;
	padding: 5px 10px 5px 10px !important;
}

@keyframes tooltip-animation {
	0% {
		opacity: 0;
	}
	66% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

/* Buttons */

button {
	appearance: none;
	background-color: #2ea44f;
	border: 1px solid rgba(27, 31, 35, .15);
	border-radius: 6px;
	box-shadow: rgba(27, 31, 35, .1) 0 1px 0;
	box-sizing: border-box;
	color: #fff;
	cursor: pointer;
	display: inline-block;
	font-family: "Segoe UI";
	font-size: 14px;
	font-weight: bold;
	padding: 4px 10px;
	position: relative;
	text-align: center;
	text-decoration: none;
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
	vertical-align: middle;
}

button:focus:not(:focus-visible):not(.focus-visible) {
	box-shadow: none;
	outline: none;
}

button:hover {
	background-color: #2c974b;
}

button:focus {
	box-shadow: rgba(46, 164, 79, .4) 0 0 0 3px;
	outline: none;
}

button:disabled {
	background-color: #94d3a2;
	border-color: rgba(27, 31, 35, .1);
	color: rgba(255, 255, 255, .8);
	cursor: default;
}

button:active {
	background-color: #298e46;
	box-shadow: rgba(20, 70, 32, .2) 0 1px 0 inset;
}

#options-view button {
	margin: 0 5px 0 5px;
}

/* Sidebar */

aside {
	position: absolute;
	top: 0;
	right: 0;
	overflow: hidden;
	height: 100vh;
	width: 250px;
	z-index: 2;
}

aside * {
	cursor: default;
}

aside.collapsed {
	pointer-events: none;
}

aside.collapsed #sidebar {
	transform: translateX(0);
	opacity: 0;
}

aside.collapsed #sidebar-toggle {
	pointer-events: auto;
	color: white;
	text-shadow: 0 0 3px black;
}

#sidebar {
	display: block;
	position: fixed;
	height: 100vh;
	width: 250px;
	left: 100%;
	background-color: #eee;
	overflow-y: scroll;
	transform: translateX(-100%);
	transition: transform .4s, opacity .6s;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

#sidebar::-webkit-scrollbar {
	display: none;
}

#sidebar p {
	font-family: Roboto, sans-serif;
	text-align: left;
	padding: 5px 0 5px 15px;
}

#sidebar > p {
	font-size: 30px;
	background-color: #666;
	color: white;
}

#sidebar div p.title {
	font-size: 20px;
	background-color: #4b5;
	color: white;
}

#sidebar div .option {
	padding-left: 25px;
}

#sidebar .option.selected {
	font-weight: bold;
}

#sidebar .option:hover {
	background-color: #ccc;
}

#sidebar a {
	text-decoration: none;
}

#sidebar a .option {
	color: black;
}

#sidebar-toggle {
	position: fixed;
	right: 10px;
	font-size: 32px;
	z-index: 1;
	color: black;
	transition: .5s;
}

/* Banner. */

#outdated-banner {
	background-color: yellow;
	text-align: center;
}

#outdated-banner p {
	padding: 10px;
	font-size: 20px;
}

/* Popups. */

.popup {
	top: 10vh;
	width: 700px;
	max-width: 80vw;
	max-height: 80vh;
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	padding: 30px;
	z-index: 101;
    overflow-y: auto;
	box-shadow: 0 0 20px #333;
}

.popup h1 {
	margin-top: 0;
}

.popup h2 {
	font-size: 20px;
}

.popup p {
	margin: 10px 0 10px 0;
}

#popup-grayout {
	display: block;
	position: fixed;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	z-index: 100;
	background-color: rgba(0, 0, 0, 0.5);
}

.popup button {
	font-size: 18px;
	padding: 8px 20px;
	margin: 10px;
}
