/* ========== Reset & Base ========== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	font-family: 'Almendra', serif;
	background-color: #1a1a1a;
	color: #e0e0e0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
img {
	-webkit-user-drag: none;
}
.hidden {
	display: none !important;
}
/* ========== Popup (Boss Info) ========== */
#infoPopup table {
	margin: 0 auto;
}
#infoPopup th, #infoPopup td {
	padding-right: 15px;
}
.res-icon {
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 6px;
}
.popup-window {
	position: fixed;
	background: #000;
	border: 1px solid #333;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	padding: 20px;
	max-height: 80vh;
	overflow-y: auto;
	z-index: 10000;
	width: auto;
	max-width: 90vw;
}
.popup-sections {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}
.popup-section {
	flex: 1 1 200px;
	min-width: 180px;
	max-width: 260px;
}
.popup-section table {
	width: 100%;
	table-layout: fixed;
}
.popup-section table td:first-child, .popup-section table th:first-child {
	width: 40%;
}
.popup-window::-webkit-scrollbar {
	width: 6px;
}
.popup-window::-webkit-scrollbar-track {
	background: #1a1a1a;
	border-radius: 3px;
}
.popup-window::-webkit-scrollbar-thumb {
	background: #8f7e4f;
	border-radius: 3px;
	border: 1px solid #1a1a1a;
}
.popup-window::-webkit-scrollbar-thumb:hover {
	background: #bfa96c;
	box-shadow: 0 0 2px #bfa96c;
}
tr.sep-row td {
	border-top: 1px solid #8f7e4f;
	padding-top: 0;
}
.popup-close {
	position: absolute;
	top: 4px;
	right: 4px;
	background: transparent;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
}
/* ========== Containers & Panels ========== */
.container {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 1200px;
}
.selection-panel {
	background: #2d2d2d;
	border-radius: 10px;
	padding: 50px;
	margin-bottom: 20px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.3);
	border: 2px solid #4a5568;
	width: 95%;
	max-width: 800px;
}
.form-group {
	margin-bottom: 20px;
	text-align: center;
}
label {
	display: block;
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #e9d292;
}
/* Side-by-side Earth + Players */
.form-row {
	display: flex;
	justify-content: center;
	gap: 30px;
	flex-wrap: wrap;
}
.form-row .form-group {
	margin-bottom: 10px;
}
/* ========== Form Elements ========== */
select {
	font-family: 'Almendra', serif;
	font-size: 24px;
	padding: 14px 20px;
	border: 2px solid #4a5568;
	border-radius: 5px;
	background-color: #2d2d2d;
	color: #e0e0e0;
	cursor: pointer;
	min-width: 240px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238f7e4f'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px;
	transition: border-color 0.2s;
}
select:focus {
	outline: none;
	border-color: #8f7e4f;
}
/* Buttons */
button {
	font-family: 'Almendra', serif;
	font-size: 28px;
	font-weight: 700;
	padding: 14px 28px;
	background: linear-gradient(135deg, #8f7e4f, #cbb576);
	color: #1a1a1a;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
button:hover {
	background: linear-gradient(135deg, #8f7e4f, #cbb576);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(191,169,108,0.3);
}
/* ========== Map Area ========== */
.map-layout {
	width: 90vw;
	max-width: 2000px;
	display: grid;
	grid-template-columns: 30% 50%;
	gap: 16px;
	align-items: start;
}
.map-container {
	flex: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 400px;
	position: relative;
	overflow: hidden;
	height: 100vh;
}
.image-wrapper {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.5);
	background-color: #2d2d2d;
	overflow: hidden;
}
.map-image {
	width: 100%;
	max-width: 100%;
	/* height: auto; */
	display: block;
}
.map-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.map-overlay, .overlay-icon {
	pointer-events: auto !important;
}
/* Map controls */
.back-button, .reset-markers-button {
	position: absolute;
	padding: 8px 16px;
	font-size: 14px;
	background: rgba(45,45,45,0.9);
	border: 1px solid #4a5568;
	color: #e0e0e0;
	z-index: 100;
}
.back-button {
	top: 20px;
	left: 20px;
}
.reset-markers-button {
	bottom: 20px;
	right: 20px;
}
.back-button:hover, .reset-markers-button:hover {
	background: rgba(45,45,45,1);
	transform: none;
	box-shadow: none;
}
 
 
.error-message {
	color: #fc8181;
	font-size: 18px;
	text-align: center;
	padding: 20px;
	margin-top: 20px;
}
/* ========== Markers & Labels ========== */
.map-marker {
	position: absolute;
	width: 28px;
	height: 28px;
	background-color: rgba(255,255,255,0.7);
	border-radius: 50%;
	cursor: pointer;
	transform: translate(-50%, -50%);
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 10px;
	font-weight: bold;
	color: #1a1a1a;
	text-shadow: 0 0 2px rgba(255,255,255,0.4);
	border: 2px solid rgba(255,255,255,0.3);
	transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
	pointer-events: auto;
	user-select: none;
	z-index: 50;
}
.map-marker:hover {
	background-color: rgba(255,253,129,0.9);
	border-color: #ccd368;
	transform: translate(-50%, -50%) scale(1.1);
}
.map-marker.church {
	background-color: rgba(208,227,103,0.8);
	border-color: #eadf46;
}
.map-marker.rise {
	background-color: rgba(129,236,252,0.8);
	border-color: #5575f6;
}
.map-marker.church:hover {
	background-color: rgb(200,209,79);
}
.map-marker.rise:hover {
	background-color: rgb(129,205,252);
}
#seedImage {
	width: 75%;
	box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.seed-display {
	font-size: 24px;
	font-weight: 700;
	color: #68d391;
	margin-top: 20px;
	text-align: center;
	text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
	z-index: 10;
	min-height: 30px;
}
/* ========== Overlay Icons & Labels ========== */
.overlay-icon {
	position: absolute;
	height: 40px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 60;
}
.overlay-label {
	position: absolute;
	transform: translate(-50%, -65%);
	white-space: normal;
	text-align: center;
	font-size: 13px;
	color: #e0e0e0;
	text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000,1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
	pointer-events: none;
	z-index: 60;
	max-width: 62px;
	overflow-wrap: break-word;
	line-height: 1em;
}
.icon-church, .icon-fort, .icon-great-church {
	min-height: 55px !important;
}
.icon-sorcerer\'s-rise {
	min-height: 65px !important;
}
.icon-evergaol {
	max-height: 35px !important;
}
/* ========== Seed Info (bottom-left) ========== */
.seed-info {
	position: absolute;
	bottom: 20px;
	left: 20px;
	display: flex;
	align-items: flex-start;
	background: rgba(0,0,0,0.5);
	padding: 8px 12px;
	border-radius: 6px;
	z-index: 200;
}
.seed-info img {
	width: auto;
	height: 110px;
	border-radius: 4px;
	flex-shrink: 0;
}
.seed-info-text {
	margin-top: 2rem;
	margin-left: 20px;
	color: #e0e0e0;
	font-family: 'Almendra', serif;
}
.seed-info-text .seed-id {
	font-size: 18px;
	font-weight: 700;
}
.seed-info-text .seed-event {
	font-size: 14px;
	margin-top: 4px;
	opacity: 0.85;
}
.boss-overlay {
	position: absolute;
	bottom: 60px;
	left: 10px;
	width: 150px;
	height: auto;
	pointer-events: auto;
	z-index: 20;
}
.boss-event-text {
	position: absolute;
	bottom: 70px;
	left: 30px;
	color: #fff;
	font-size: 14px;
	text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000,1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
	pointer-events: none;
	z-index: 21;
}
/* ========== Night Circles ========== */
.circle-wrapper {
	position: absolute;
	width: 60px;
	height: 60px;
	transform: translate(-50%, -50%);
	pointer-events: auto;
}
.circle-icon {
	display: block;
	width: 100%;
	height: 100%;
}
.circle-label {
	position: absolute;
	transform: translate(-50%, -50%);
	max-width: 60px;
	white-space: normal;
	text-align: center;
	font-size: 9.5px;
	color: #fff;
	text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000,1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
	pointer-events: auto;
	z-index: 101;
}
/* ========== Map Instructions ========== */
.map-instructions {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	background: rgba(0,0,0,0.6);
	color: #fff;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: 0.9rem;
	z-index: 50;
}
.map-instructions ul {
	margin: 0.5rem 0 0 1rem;
	padding: 0;
}
/* ========== Left Info Pane ========== */
.left-info {
	grid-column: 1;
	background: rgba(0,0,0,0.85);
	border: 1px solid #000;
	border-radius: 10px;
	padding: 12px;
	color: #e6dfd0;
	box-shadow: 0 4px 10px rgba(0,0,0,.35);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: stretch;
	width: 100%;
	box-sizing: border-box;
}
.info-tabs {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 12px;
}
.info-tab {
	background: #000;
	color: #e6dfd0;
	border: none;
	border-radius: 6px;
	padding: 8px;
	font-size: 16px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.info-tab.active {
	background: #8f7e4f;
	color: #1a1a1a;
}
.info-tab:hover {
	background: #c5ae6e;
	color: #e6dfd0;
	box-shadow: none;
}
#infoTables {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.info-table {
	width: 100%;
	height: 100%;
	margin: 0;
	box-sizing: border-box;
}
/* ========== Boss & Nightfarer Grids ========== */
.boss-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
	margin-bottom: 20px;
}
/* Base tile (greyed) shared by Boss & Nightfarer */
.boss-option {
	width: 150px;
	text-align: center;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 8px;
	padding: 4px;
	transition: border-color 0.2s, transform 0.2s, background 0.2s;
	background: #2d2d2d;
	opacity: 0.5;
}
.boss-option img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
	filter: grayscale(100%) brightness(0.8);
}
.boss-option span {
	display: block;
	margin-top: 4px;
	font-size: 16px;
	color: #e0e0e0;
}
.boss-option:hover {
	transform: translateY(-2px);
}
.boss-option.selected {
	border-color: #8f7e4f;
	opacity: 1;
	/* keep background as dark tile;
	image goes full color */
}
.boss-option.selected img {
	filter: none;
}
/* ========== Players Radio (button-style) ========== */
.radio-group {
	display: flex;
	justify-content: center;
	gap: 20px;
	font-size: 18px;
	color: #e0e0e0;
}
.radio-group input[type="radio"] {
	display: none;
}
.radio-group label {
	display: inline-block;
	padding: 12px 24px;
	background: #2d2d2d;
	color: #aaa;
	font-weight: 700;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
	font-family: 'Almendra', serif;
	border: 2px solid #4a5568;
}
.radio-group label:hover {
	background: #3a3a3a;
}
.radio-group input[type="radio"]:checked + label {
	background: linear-gradient(135deg, #8f7e4f, #d1bd87);
	color: #1a1a1a;
	border: none;
}

.weapons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  padding: 5px;
}

.weapon-tile {
  text-align: center;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weapon-tile img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 4px;
}

.weapon-tile span {
  font-size: 1rem;
  color: #e6dfd0;
  line-height: 1.1;
}

/* Weapon popup inside the existing #infoPopup */
.weapon-pop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.weapon-pop-header img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: contain;
}
.weapon-pop-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}
.weapon-pop-class {
  font-size: 0.8rem;
  opacity: 0.85;
}
.weapon-status {
  display: inline-block;
  margin: 6px 0 8px;
  padding: 4px 8px;
  border: 1px solid #8f7e4f;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #e6dfd0;
}
.weapon-mini {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 8px;
}
.weapon-mini td {
  padding: 4px 6px;
  border-bottom: 1px solid #4a3a20;
}
.scaling-wrap { margin-top: 6px; }
.scaling-line { margin: 2px 0; }
.scaling-line .grade {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  border: 1px solid #8f7e4f;
  border-radius: 4px;
  margin-right: 6px;
  padding: 0 4px;
}

.weapon-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 8px;
  padding: 4px 8px;
  border: 1px solid #8f7e4f;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #e6dfd0;
}
.weapon-status img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 2px;
}

.left-info {
	grid-column: 1;
	background: rgba(20,18,14,.85);
	border: 1px solid #3b2f1a;
	border-radius: 10px;
	padding: 12px;
	color: #e6dfd0;
	box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.info-table {
	width: 100%;
	border-collapse: collapse;
}
.info-table th, .info-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #4a3a20;
	text-align: left;
}
.info-table th {
	text-align: center;
	background: #2a2418;
}
.right-spacer { grid-column: 3; }
@media (max-width: 980px) {
	.map-layout { grid-template-columns: 1fr; }
	#mapContainer { grid-column: 1; }
	.right-spacer { display: none; }
}

.icon-spawn-point {width: 50px; height:auto;}



.spell-section {
  margin-bottom: 20px;
}
.spell-section > h2 {
  margin-bottom: 12px;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  padding-bottom: 4px;
}
.spell-tier-block {
  margin-bottom: 16px;
}
.spell-tier-block > h3 {
  margin-bottom: 8px;
}
.spell-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.weapon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.weapon-tile img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.weapon-tile span {
  text-align: center;
  font-size: 0.85rem;
}

#spellsGrid {               /* stack the two sections vertically */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spell-section {            /* section wrapper */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spell-section h3 {         /* section title */
  margin: 0;
}

.tier-group {               /* each tier block within a section */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-header {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 2px 0;
}

.spell-grid {               /* the actual cards grid */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
