:root {
	--bg-gradient-start: #0a0a0a;
	--bg-gradient-end: #1a1a1a;
	--text-color: #f5f5f5;
	--subtext-color: #aaa;
	--panel-bg: rgba(0, 0, 0, 0.85);
	--panel-border: rgba(255, 255, 255, 0.08);
	--panel-shadow: rgba(0, 0, 0, 0.6);
	--focus-color: #ffffff;
	--accent-bg: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
	--accent-shadow: rgba(255, 255, 255, 0.8);
	--section-bg: #111;
	--section-hover-bg: #ffffff;
	--section-hover-text: #000;
	--scroll-thumb: rgba(255, 255, 255, 0.2);
	--scroll-thumb-hover: #ffffff;
}

@font-face {
    font-family: ROF;
    src: url("./fonts/Outfit-VariableFont_wght.ttf");
}


canvas {
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 1;
}

#layout {
	display: flex;
	height: 100vh;
	width: 100vw;
}

body {
	margin: 0;
	overflow: none;
	background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
	color: var(--text-color);
	font-family: ROF;
	font-weight: 300;
}

.cpanel {
	z-index: 1000000;
	background: var(--panel-bg);
	font-family: ROF;
	box-shadow: 0 8px 32px var(--panel-shadow);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--panel-border);
	font-weight: 400;
	resize: horizontal;
	overflow: auto;
	height: 100vh;
	padding: 8px;
	
	
	width: 480px;
	max-width: 100%;
	color: var(--text-color);
	box-sizing: border-box;
}

.cpanel:hover {
	box-shadow: 0 12px 48px var(--panel-shadow);
}

.cpanel input,
.cpanel select {
	border: none;
	border-bottom: 2px solid rgba(255, 255, 255, 0.2);
	background: transparent;
	outline: none;
	color: var(--text-color);
	font-size: 0.95rem;
	font-family: ROF;
	margin-top: 8px;
	margin-bottom: 16px;
	padding: 8px 4px;
	width: 100%;
	transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpanel input:focus,
.cpanel select:focus {
	border-bottom-color: var(--focus-color);
}

.cpanel label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--subtext-color);
	margin-top: 16px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

#canvas-container {
	flex-grow: 1;
	position: relative;
}

#canvas-container canvas {
	width: 100%;
	height: 100%;
	display: block;
	
}

button {
	align-items: center;
	appearance: none;
	background: var(--accent-bg);
	border-radius: 12px;
	border: none;
	box-shadow: 0 0px 2px var(--accent-shadow);
	color: #000;
	cursor: pointer;
	display: inline-flex;
	font-family: ROF;
	font-weight: 600;
	height: 48px;
	justify-content: center;
	line-height: 1;
	padding: 0 24px;
	position: relative;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	user-select: none;
	font-size: 0.95rem;
	margin-bottom: 24px;
	width: 100%;
	letter-spacing: 0.3px;
	max-width:300px;
}

button:hover {
	transform: translateY(-2px);
	box-shadow: 0 0px 24px var(--accent-shadow);
}

button:active {
	transform: translateY(0);
	box-shadow: 0 0px 24px var(--accent-shadow);
}

section {
	text-align:center;
	cursor: pointer;
	vertical-align: top;
	display: inline-block;
	border: 1px solid var(--panel-border);
	background: var(--section-bg);
	padding: 16px;
	margin: 6px;
	color: var(--text-color);
	text-shadow: 1px 1px 2px var(--text-color);
	font-weight: 400;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100px;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
	height:150px;
}

section:hover,
section:focus,
section:active {
	transform: translateY(-4px);
	background: var(--section-hover-bg);
	color: var(--section-hover-text);
	text-shadow: 1px 1px 2px var(--section-hover-text);
	box-shadow: 0 0px 24px var(--accent-shadow);
	border-color: var(--focus-color);
}
section.active {
	transform: translateY(-4px);
	background: var(--section-hover-bg);
	color: var(--section-hover-text);
	text-shadow: 1px 1px 2px var(--section-hover-text);
	box-shadow: 0 0px 24px var(--accent-shadow);
	border-color: var(--focus-color);
}

section:hover .invertable{
	filter: invert(1) !important;
	pointer-events: none;
}
.active .invertable{
	filter: invert(1) !important;
}

.spanimg {
	margin-top: 10px;
	max-width: 100px;
	max-height: 100px;
	width:100%;
	filter: grayscale(30%);
	transition: filter 0.3s ease;
}

img{
	border-radius: 12px;
}
section:hover .spanimg {
	filter: grayscale(0%);
}

hr {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	margin: 24px 0;
}

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
	background: var(--scroll-thumb);
	border-radius: 4px;
	transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--scroll-thumb-hover);
}

.popup-overlay {
	position: fixed;
	top: 50vh;
	left: 50vw;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000000;
	animation: fadeIn 0.3s ease;
	transform:translate(-50%,-50%);
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.popup {
	background: #111;
	border: 1px solid var(--panel-border);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
	border-radius: 16px;
	padding: 32px;
	text-align: center;
	max-width: 400px;
	font-family: ROF;
	animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--text-color);
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.popup h2 {
	margin: 0 0 16px 0;
	font-family: "Inter", sans-serif;
	color: var(--focus-color);
	font-weight: 600;
	font-size: 1.5rem;
	letter-spacing: -0.5px;
}

.popup p {
	margin: 20px 0;
	font-size: 1rem;
	color: var(--subtext-color);
	line-height: 1.6;
}

.popup button {
	margin-top: 16px;
}

@media (min-width: 1000px) {
	.cpanel {
		border-right: 3px solid gold;
	}
}
@media (max-width: 1000px) {
	
	.popup {
		max-width: 90%;
		width: 90%;
		font-size: 1rem;
		padding: 28px 24px;
	}
	
	.popup p {
		font-size: 1.1rem;
	}
	
	.popup h2 {
		font-size: 1.8rem;
	}
	#layout {
		flex-direction: column-reverse; /* put config BELOW canvas */
	}
	
	.cpanel {
		border-top: 3px solid gold;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 45vh;
		resize: none;
		border-radius: 0;
		padding: 24px;
		resize: both;
		margin-top: 55vh;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch; /* enables momentum scroll on iOS */
		touch-action: pan-y; /* explicitly allow vertical scroll */
		padding-bottom:120px;
	}
	
	section {
		width: 160px;   /* 1.6x 100px */
		height: 170px;
		padding: 24px;  /* slightly more padding */
		margin: 10px;   /* space them out a bit */
		font-size: 1.6em; /* optional: make text more readable */
	}
	
	canvas {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 55vh !important;
		margin: 0;
		max-height: none;
	}
	
	#canvas-container {
		position:relative;
		transform: translate(0px, -45vh);
		
	}
}

/* HTML: <div class="loader"></div> */
.loader {
  --s: 25px;
  
  --_d: calc(0.353*var(--s));
  width: calc(var(--s) + var(--_d));
  aspect-ratio: 1;
  display: grid;
}
.loader:before,
.loader:after {
  content:"";
  clip-path:polygon(var(--_d) 0,100% 0,100% calc(100% - var(--_d)),calc(100% - var(--_d)) 100%,0 100%,0 var(--_d));
  background:
    conic-gradient(from -90deg at var(--s) var(--_d),
     #fff 135deg,#666 0 270deg,#aaa 0);
  animation: l4 1.2s infinite;
}
.loader:before {
  z-index: 1;
  margin-bottom: calc(var(--_d)/-2 - 1px);
}
.loader:after {
  margin-top: calc(var(--_d)/-2 - 1px);
  animation-delay: 0.6s
}
@keyframes l4{
  0%     {transform: translate(0)}
  16.67% {transform: translate(-10px)}
  33.33% {transform: translate(10px)}
  50%,
  100%   {transform: translate(0)}
}

#loader-body{
	position:absolute;
	width:100%;
	height:100%;
	margin:0px;
	padding:0px;
	background-color: var(--bg-gradient-start);
	z-index: 9999999;
}
#dicont{
	margin-top:20%;
	margin-left:50%;
	transform:translate(-50%,-50%);
}
#aaaid{
	margin-top:30px;
}

.fade-in {
	display: block;
	opacity: 1;
	animation-name: fadeInOpacity;
	animation-iteration-count: 1;
	animation-timing-function: ease-in;
	animation-duration: 0.5s;
}
.fade-out {
	display: none;
	opacity: 0;
	animation-name: fadeOutOpacity;
	animation-iteration-count: 1;
	animation-timing-function: ease-in;
	animation-duration: 0.5s;
}

@keyframes fadeInOpacity {
	0% {
		opacity: 0;
		display: block;
	}
	100% {
		opacity: 1;
		display: block;
	}
}

@keyframes fadeOutOpacity {
	0% {
		opacity: 1;
		display: block;
	}
	100% {
		opacity: 0;
		display: none;
	}
}

h1,2,3{
	font-weight: normal;
}

/* Dropdown container */
.dropdown {
	position: relative;
	display: inline-block;
	width: 200px;
	color: var(--text-color);
	font-family: sans-serif;
}

/* Button (visible dropdown element) */
.dropdown-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: 8px;
	padding: 8px 12px;
	width: 100%;
	cursor: pointer;
	box-shadow: 0 2px 6px var(--panel-shadow);
	transition: background 0.2s ease, border-color 0.2s ease;
}

.dropdown-btn:hover,
.dropdown-btn:focus {
	border-color: var(--focus-color);
}

/* Text inside dropdown button */
.dropdown-btn span {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--text-color);
}

/* Dropdown menu container */
.dropdown-content {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: 8px;
	display: none;
	flex-direction: column;
	z-index: 10;
	box-shadow: 0 4px 10px var(--panel-shadow);
	backdrop-filter: blur(6px);
}

/* Each dropdown item */
.dropdown-content div {
	padding: 8px 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--text-color);
	transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-content div:hover {
	background: var(--section-hover-bg);
	color: var(--section-hover-text);
}

/* Flag icons */
.fi {
	border-radius: 3px;
	box-shadow: 0 0 3px var(--accent-shadow);
}

#whiteblack{
	z-index:1000000;
	display:none;
	position: fixed;
	top:0px;
	left:0px;
	border: 1px solid var(--panel-border);
	background: var(--section-bg);
	padding: 16px;
	margin: 6px;
}