@font-face {
	font-family: "PokemonClassic";
	src: url("fonts/Pokemon Classic.ttf") format("truetype");
}
html body {
	margin: 0;
	font-family: PokemonClassic;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen","Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-size: 0.75rem;
}
h1 {
	text-align: center;
	margin: 2em;
}

.spacer {
  margin: 2em;
}

h2 {
	text-align: center;
}
.centerhead {
	padding-bottom: 40px;
	font-size: 26px;
}
.selection-info {
	width: 100%;
	max-width: 800px;
	margin: auto;
	display: grid;
	grid-gap: 3dvh;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	align-content: center;
	align-items: center;
}
.noclick {
	pointer-events: none;
}
.selection-info {
	width: 100%;
	max-width: 800px;
	margin: auto;
	display: grid;
	grid-gap: 3dvh;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	align-items: start;
	/* top-align grid items */
}
.battle-block {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	/* centers children horizontally */
	text-align: center;
}
.battle-block.side {
	padding-bottom: 20px;
	background: #aadee6;
	box-shadow: 0 0 20px #aadee6;
	border-radius: 10px;
}
.battle-block.side.darkmode {
	background: #2A2A55;
	box-shadow: 0 0 20px #2A2A55;

}
.battle-info {
	margin-bottom: 0.5em;
}
.icon-container {
	display: flex;
	justify-content: center;
	/* center icons horizontally */
	align-items: flex-start;
	/* top-align inside container */
	gap: 0.5em;
}
.chart-list {
	margin-top: 0.5em;
	display: flex;
	flex-direction: column;
	gap: 2em;
	align-items: center;
	/* makes chart-groups center properly */
	width: 100%;
	/* take full width of battle-block */
	box-sizing: border-box;
}
.pkmn-text {
	font-family: PokemonClassic;
}
.chart-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	justify-content: center;
	align-items: center;
	padding: 10px;
	border-radius: 10px;
	width: 90%;
	/* always 90% of chart-list */
	max-width: 90%;
	/* lock it */
	margin: 0 auto;
	box-sizing: border-box;
	flex: 0 0 auto;
	/* stop flexbox from auto-resizing */
	min-width: 0;
	/* prevent children from forcing width growth */
}
.icon-stack {
	position: relative;
	width: 80px;
	height: 80px;
	margin: 0 auto;
	/* center in the grid cell */
}
.icon-stack .icon.half {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.icon-stack .icon.left {
	clip-path: polygon(-50% -50%, 50% -50%, 50% 150%, -50% 150%);
}
.icon-stack .icon.right {
	clip-path: polygon(50% -50%, 150% -50%, 150% 150%, 50% 150%);
}
/* make the image fill the icon div */
.icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	/* or cover if you want full fill */
}
.wrapper {
	width: 100%;
	max-width: 800px;
	margin: auto;
	display: grid;
	grid-gap: 30px;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	align-content: center;
	align-items: center;
}
.icon {
	border-radius: 100%;
	height: 80px;
	width: 80px;
	margin: auto;
	transition: 200ms all;
}
.icon.unselected {
	transform: scale(0.8);
}
.icon.grey {
	filter: saturate(0%);
	pointer-events: none;
}
.icon:hover {
	filter: saturate(200%);
	transform: scale(1.1);
	cursor: pointer;
}
.icon.selected {
	filter: saturate(200%);
	transform: scale(1.3);
}
.icon img {
	height: 60%;
	width: 60%;
	margin: 20%;
}
.bug {
	background: #92bc2c;
	box-shadow: 0 0 20px #92bc2c;
}
.dark {
	background: #595761;
	box-shadow: 0 0 20px #595761;
}
.dragon {
	background: #0c69c8;
	box-shadow: 0 0 20px #0c69c8;
}
.electric {
	background: #f2d94e;
	box-shadow: 0 0 20px #f2d94e;
}
.fire {
	background: #fba54c;
	box-shadow: 0 0 20px #fba54c;
}
.fairy {
	background: #ee90e6;
	box-shadow: 0 0 20px #ee90e6;
}
.fighting {
	background: #d3425f;
	box-shadow: 0 0 20px #d3425f;
}
.flying {
	background: #a1bbec;
	box-shadow: 0 0 20px #a1bbec;
}
.ghost {
	background: #5f6dbc;
	box-shadow: 0 0 20px #5f6dbc;
}
.grass {
	background: #5fbd58;
	box-shadow: 0 0 20px #5fbd58;
}
.ground {
	background: #da7c4d;
	box-shadow: 0 0 20px #da7c4d;
}
.ice {
	background: #75d0c1;
	box-shadow: 0 0 20px #75d0c1;
}
.normal {
	background: #a0a29f;
	box-shadow: 0 0 20px #a0a29f;
}
.poison {
	background: #b763cf;
	box-shadow: 0 0 20px #b763cf;
}
.psychic {
	background: #fa8581;
	box-shadow: 0 0 20px #fa8581;
}
.rock {
	background: #c9bb8a;
	box-shadow: 0 0 20px #c9bb8a;
}
.steel {
	background: #5695a3;
	box-shadow: 0 0 20px #5695a3;
}
.water {
	background: #539ddf;
	box-shadow: 0 0 20px #539ddf;
}
.ineff {
	background: #4f5754;
	box-shadow: 0 0 20px #4f5754;
}
.quadres {
	background: #974541;
	box-shadow: 0 0 20px #974541;
}
.weak {
	background: #e45751;
	box-shadow: 0 0 20px #e45751;
}
.supereff {
	background: #66f69e;
	box-shadow: 0 0 20px #66f69e;
}
.quadeff {
	background: #57b474;
	box-shadow: 0 0 20px #57b474;
}
.iconsmall {
	border-radius: 100%;
	height: 40px;
	width: 40px;
	box-shadow: none;
}
.iconsmall img {
	height: 60%;
	width: 60%;
	margin: 20%;
}




/* CSS */
.menu-container {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
}

/* Hamburger */
.hamburger {
  width: 30px;
  height: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger div {
  height: 4px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Menu */
.menu {
  position: absolute;
  top: 40px;
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 10px;
  display: none;
  flex-direction: column;
}

.menu a {
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  display: block;
}
.menu a.darkmode {
  color: #E0E0FF;
}

.menu a:hover {
  background: #eee;
}

.menu a.darkmode:hover {
  background: #2A2A55;
}

/* Animate to X */
.hamburger.active div:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active div:nth-child(2) {
  opacity: 0;
}

.hamburger.active div:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

:root {
  --header-light: #4a4e69;
  --header-dark: #c9ada7;
  --background-light: #effdff;
  --background-dark: #11112a;
}

/* Page background controlled via JS */
body {
  margin: 0;
  background: var(--background-light);
  transition: background 0.5s ease-in-out, color 0.5s ease-in-out;
  color: #333;
}

body.darkmode {
  background: var(--background-dark);
  color: #E0E0FF;
}

/* Toggle button positioning */
#themeToggle {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none; /* or whatever you want */
  box-shadow: none; /* disable any shadow */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

/* Core icon */
.darkmode_icon {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--header-light);
  transform-origin: center center;
  transition: transform 0.75s ease-in-out, background 0.3s;
}

/* hole in moon */
.darkmode_icon::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 8px;
  bottom: 4px;
  border-radius: 10px;
  background: var(--background-light);
  transition: transform 0.5s ease, left 0.25s ease, bottom 0.25s ease, background 0.3s;
}

/* Rays */
.darkmode_icon .ray {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 6px;
  background: var(--header-light);
  transform-origin: center;
  transition: transform 0.5s ease-in-out, background 0.3s;
}

.ray:nth-child(1) { transform: rotate(45deg) translateX(0); }
.ray:nth-child(2) { transform: rotate(90deg) translateX(0); }
.ray:nth-child(3) { transform: rotate(135deg) translateX(0); }
.ray:nth-child(4) { transform: rotate(180deg) translateX(0); }
.ray:nth-child(5) { transform: rotate(225deg) translateX(0); }
.ray:nth-child(6) { transform: rotate(270deg) translateX(0); }
.ray:nth-child(7) { transform: rotate(315deg) translateX(0); }
.ray:nth-child(8) { transform: rotate(360deg) translateX(0); }

/* Dark mode (applied to #themeToggle) */
#themeToggle.dark .darkmode_icon {
  transform: scale(0.6);
  background: #333333;
}
#themeToggle.dark .darkmode_icon::after {
  left: 15px;
  bottom: 8px;
  transform: scale(0);
}
#themeToggle.dark .ray:nth-child(1) { transform: rotate(45deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(2) { transform: rotate(90deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(3) { transform: rotate(135deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(4) { transform: rotate(180deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(5) { transform: rotate(225deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(6) { transform: rotate(270deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(7) { transform: rotate(315deg) translateX(-16px); }
#themeToggle.dark .ray:nth-child(8) { transform: rotate(360deg) translateX(-16px); }


/* Overlay covers entire screen */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;              /* hidden by default */
  align-items: center;        /* vertical centering */
  justify-content: center;    /* horizontal centering */
  z-index: 2000;
}

/* Popup box */
.popup {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 20px;
  max-width: 400px;
  width: 80%;
  text-align: center;
}

/* Close button (X) */
.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #555;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #000;
}

/* Dark mode menu background */
.panel.darkmode {
  background: #3a3a3a;
  color: #E0E0FF;
}