/* Theme Name: IT-collage tema 
Author: André Holton 
Dexcription: Grundtema för studier 
Version: 1.0 
License: GNU General Public License v2 or later 
Tags: Taggar här 
Text Domain: Grundtema 
*/

/* =========================
   General Styles
========================= */
/* Variables, set in root to use all over the webpage */
:root {
  --deep-background-color: #778899;
  --main-text-color: #FFD700;
  --wrapper-background-color: #800000;
  --accent-color: #daa520;
  --boxes-color: #333;
  --button-background-color: #000;
  --button-text-color: #FFD700;
}

.dark-theme {
  --deep-background-color: #1a1d24;       /* slightly lighter dark bg */
  --wrapper-background-color: #22262e;    /* darker wrapper contrast */
  --main-text-color: #f5f7fa;             /* off-white text */
  --accent-color: #00bcd4;
  --boxes-color: #303540;                 /* mid-dark gray, clearly visible */
  --button-background-color: #000;           /* true black buttons */
  --button-text-color: #f5f7fa;
}

.light-theme {
  --deep-background-color: #f7f9fc;       /* soft light background */
  --wrapper-background-color: #ffffff;    /* white content area */
  --main-text-color: #0e1a2b;             /* near-black */
  --accent-color: #0066cc;                /* accessible blue */
  --boxes-color: #e2e6ef;                 /* light cool gray for separation */
  --button-background-color: #333;           /* dark buttons for contrast */
  --button-text-color: #ffffff; 
}

.default-theme {
  --deep-background-color: #778899;
  --main-text-color: #FFD700;
  --wrapper-background-color: #800000;
  --accent-color: #daa520;
  --boxes-color: #333;
  --button-background-color: black;
  --button-text-color: #FFD700;
}
body {
  background-color: var(--deep-background-color);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.layout {
  display: flex;
  align-items: flex-start;
  overflow-x: auto; /* horizontal scroll instead of overlap */
}

.main {
  flex: 1;
  min-width: 0; /* allows content to shrink properly */
}

#wrapper {
  max-width: 1200px;
  width: 100%;
  padding: 20px;
  background: var(--wrapper-background-color);
  margin: 0 auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  min-height: 100vh;
}
p{
    color: var(--main-text-color);
}

/* =========================
   Attributes + Images Wrapper
========================= */
.attributes-images-wrapper {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 20px;
  width: 100%;
}

/* Attributes in 2x4 grid */
.attributes-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: 18px;
  justify-content: center;
}

/* Each attribute box */
.attribute {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--boxes-color);
  padding: 10px;
  border-radius: 8px;
  height: auto;
}

/* Attribute title */
.attribute-name {
  color: var(--main-text-color);
  font-size: 26px;
  margin-bottom: 8px;
}

/* A single row inside an attribute */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 5px 0;
}

/* Labels */
.stat-label {
  font-weight: bold;
  color: var(--main-text-color);
  font-size: 22px;
}

/* Numbers */
.statValue {
  display: inline-block;
  color: var(--main-text-color);
  font-size: 2.2em;
  min-width: 34px;
  text-align: center;
}

/* Buttons */
.buttons {
  padding: 10px 18px;
  font-size: 1.6em;
  color: var(--button-text-color);
  background-color: var(--button-background-color);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.25s;
}

.buttons:hover {
  background-color: #778899;
}

/* =========================
   Images under attributes
========================= */
/* Default: 8 per row (16 icons in 2 rows) */
.image-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 18px;
  width: 100%;
  margin-top: 25px;
}

/* Variant: 6 per row (for 12 icons) */
.image-grid.twelve {
  grid-template-columns: repeat(6, 1fr);
}

.image-box {
  background: var(--boxes-color);
  color: var(--main-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 8px;
  padding: 14px;
  height: 80px;
  position: relative;
}

.image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* =========================
   Header
========================= */
header {
  color: var(--main-text-color);
}

header h1 {
  color: var(--main-text-color);
  font-size: 40px;
  text-align: center;
}

h2 {
  color: var(--main-text-color);
  font-size: 30px;
}

h4 {
  color: black;
  font-size: 25px;
}

p {
  color: var(--main-text-color);
  font-size: 18px;
}

/* =========================
   Footer
========================= */
footer {
  width: 900px;
  background: silver;
  margin: 0 auto;
  padding: 10px;
}

footer p,
footer h4 {
  color: black;
}

/* =========================
   Navigation
========================= */


nav li {
  float: left;
}

li {
  color: #daa520;
  font-size: 20px;
}

li a {
  display: block;
  color: #ffe6ff;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

nav li a:hover {
  background-color: white;
  color: black;
}

/* =========================
   Input fields
========================= */
input[type="text"] {
  padding: 10px;
  font-size: 1.2em;
  border: 2px solid var(--boxes-color);
  border-radius: 5px;
  width: 300px;
}

input[type="text"]:focus {
  border-color: var(--main-text-color);
  outline: none;
}

/* Center character name and kin selection */
#characterName {
  display: block;
  margin: 0 auto 15px auto;
  text-align: center;
}

#characterName-label {
  display: block;
  text-align: center;
  margin: 0 auto 10px auto;
}

.kin-selection {
  text-align: center;
  margin: 20px auto;
}

.kin-selection h2 {
  margin-bottom: 15px;
}

/* =========================
   Points Left
========================= */
.points-left {
  text-align: center;
  margin: 10px auto 20px auto;
}

.points-left p {
  margin: 0;
  font-size: 32px;
  font-weight: bold;
  color: var(--main-text-color);
}

.points-left span {
  display: block;
  font-size: 72px;
  font-weight: bold;
  color: var(--main-text-color);
  line-height: 1.2;
}

/* =========================
   Kin selection buttons
========================= */
.kin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.kin-grid input[type="radio"] {
  display: none;
}

.kin-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--boxes-color);
  color: var(--main-text-color);
  font-size: 20px;
  font-weight: bold;
  padding: 18px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background 0.25s, transform 0.1s, color 0.25s;
}

.kin-grid label:hover {
  background: #444;
}

.kin-grid input[type="radio"]:checked + label {
  background: var(--main-text-color);
  color: black;
  transform: scale(1.05);
}

/* =========================
   Tooltips for image-box
========================= */
.image-box .tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: var(--main-text-color);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  border: 2px solid var(--main-text-color);
}

.image-box .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.image-box:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* =========================
   Save Character Button
========================= */
#characterForm {
  text-align: center;
  margin-top: 30px;
}

#characterForm button {
  padding: 12px 24px;
  font-size: 22px;
  font-weight: bold;
  color: var(--main-text-color);
  background-color: var(--boxes-color);
  border: 2px solid var(--main-text-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#characterForm button:hover {
  background-color: var(--main-text-color);
  color: black;
  transform: scale(1.05);
}

.hidden {
  display: none;
}

/* =========================
   Skills
========================= */
.skills-container {
  margin-top: 10px;
}

.skills-container h2 {
  color: var(--main-text-color);
  margin: 15px 0 8px 0;
  text-align: center;
  font-size: 1.2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 per row */
  gap: 12px;
  margin-bottom: 15px;
}

.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--boxes-color);
  padding: 8px;
  border-radius: 6px;
  border: 2px solid #444;
  position: relative;
  transition: border-color 0.25s, border-width 0.25s;
}

.skill-name {
  flex: 1;
  color: var(--main-text-color);
  font-size: 16px;
  font-weight: bold;
}

.skill .statValue {
  min-width: 26px;
  text-align: center;
  font-size: 18px;
  color: var(--main-text-color);
}

.skill .tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: var(--main-text-color);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  border: 2px solid var(--main-text-color);
}

.skill .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.skill:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}
/* =========================
   Login Form
========================= */
.form-container {
  max-width: 600px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-container label {
  font-weight: bold;
  color: var(--main-text-color);
  margin-bottom: 5px;
  display: block;
  font-size: 20px;
}

.form-container input[type="email"],
.form-container input[type="password"] {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 2px solid var(--boxes-color);
  border-radius: 5px;
  box-sizing: border-box;
}

.form-container button {
  width: 100%;
  padding: 12px;
  font-size: 20px;
  font-weight: bold;
  color: var(--main-text-color);
  background-color: var(--boxes-color);
  border: 2px solid var(--main-text-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.form-container button:hover {
  background-color: var(--main-text-color);
  color: black;
}

/* =========================
   Character Sheet Layout
========================= */
#character-sheet {
  display: flex;
  gap: 20px;
  margin: 20px auto;
  max-width: 1100px;
}

.attributes-column {
  flex: 2;
  padding-right: 25px;
}

.skills-column {
  margin-top: 5rem;
  flex: 1;
  font-size: 0.9rem;
}

.base-attributes {
  margin-bottom: 20px;
}

.base-attributes .attr {
  font-size: 1.1rem;
  color: var(--main-text-color);
  margin: 3px 0;
}

/* HP display */
.total-hp {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--main-text-color);
  margin: 12px 0 8px 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hp-parts {
  margin-top: 10px;
}

.hp-parts .hp-part {
  font-size: 0.95rem;
  color: #ccc;
  margin: 2px 0;
  text-align: center;
}

.base-attributes.attributes-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns */
  gap: 8px 20px;
}

.base-attributes .attr {
  font-size: 1.1rem;
  color: var(--main-text-color);
}

/* Smaller attribute + HP boxes */
.attributes-container.small-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.attributes-container.small-boxes .attribute {
  background: var(--boxes-color);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  height: auto;
}

.attributes-container.small-boxes .attribute-name {
  font-size: 14px;
  color: var(--main-text-color);
  margin-bottom: 4px;
}

.attributes-container.small-boxes .statValue {
  font-size: 18px;
  font-weight: bold;
  color: var(--main-text-color);
}

.hp-subtitle {
  margin-top: 15px;
  font-size: 1.2rem;
  text-align: center;
  color: var(--main-text-color);
}

/* HP Section */
.hp-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  gap: 15px;
}

.hp-total {
  background: var(--boxes-color);
  border: 3px solid var(--main-text-color);
  border-radius: 8px;
  padding: 15px 30px;
  text-align: center;
  color: var(--main-text-color);
}

.hp-total .hp-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.hp-total .hp-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--main-text-color);
}

.hp-parts-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* wraps if screen is too narrow */
  gap: 10px;
}

.hp-box {
  background: var(--boxes-color);
  border: 2px solid #444;
  border-radius: 6px;
  text-align: center;
  padding: 8px 12px;
  color: var(--main-text-color);
  font-size: 0.9rem;
  min-width: 80px;
  flex: 0 0 auto; /* prevent squishing */
}

.hp-box span:last-child {
  font-size: 1.4rem;
  color: var(--main-text-color);
  display: block;
  margin-top: 3px;
}

.hp-wrapper {
  display: flex;
  align-items: center; /* align body + total HP vertically */
  gap: 20px; /* space between body and total HP box */
  margin-top: 20px;
  justify-content: center; /* center the whole thing in the column */
}

.hp-body-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
}

.hp-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hp-total {
  background: var(--boxes-color);
  border: 3px solid var(--main-text-color);
  border-radius: 8px;
  padding: 15px 25px;
  text-align: center;
  color: var(--main-text-color);
  min-width: 120px;
}

.hp-total .hp-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.hp-total .hp-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--main-text-color);
}

/* =========================
   Weapon List / Product Boxes
========================= */
.product-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.product-box {
  border: 2px solid var(--main-text-color);
  background: #222; /* dark background */
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  color: var(--main-text-color);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.product-attribute {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  margin-right: 10px;
  box-sizing: border-box;
}

.product-attribute .label {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
  color: var(--main-text-color);
  font-size: 0.9rem;
}

.product-attribute .value {
  border: 1px solid #555;
  background: var(--boxes-color);
  padding: 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  color: var(--main-text-color); /* brighter var(--main-text-color for values */
  border-radius: 4px;
  width: 100%;
}

/* Bonus rows for item effects */
.bonus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.bonus-box {
  background: var(--boxes-color);
  color: var(--main-text-color);
  border: 2px solid var(--main-text-color);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  min-width: 120px;
}

.neg-box {
  background: #300;
  color: #ff8080;
  border: 2px solid #ff3333;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  min-width: 120px;
}

/* Buy button area */
.buy-row {
  margin-top: 15px;
  text-align: center;
}

.buy-button {
  background: var(--main-text-color);
  color: black;
  font-weight: bold;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.buy-button:hover {
  background: #ffcc00;
  transform: scale(1.05);
}

/* Resource display */
.resource-box {
  display: inline-block;
  margin-left: 20px;
  padding: 10px 18px;
  background: #222;
  border: 2px solid var(--main-text-color);
  border-radius: 6px;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--main-text-color);
}

.resource-box span {
  color: var(--main-text-color);
}

/* =========================
   Requirement too high (tooltips)
========================= */
.value.req-too-high {
  background: #500; /* dark red background */
  border: 2px solid red;
  color: #ff8080; /* lighter red text */
  font-weight: bold;
  position: relative; /* make tooltip positioning work */
  cursor: help;
}

.value.req-too-high .tooltip {
  position: absolute;
  bottom: 120%; /* show above */
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #ff8080;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  border: 2px solid red;
}

.value.req-too-high .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.value.req-too-high:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* =========================
   Highlight equipped weapon
========================= */
.product-box.equipped {
  border: 3px solid limegreen;
  box-shadow: 0 0 10px limegreen;
}

.equipped-label {
  background: limegreen;
  color: black;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
}
/* =========================
   Popup Modal
========================= */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* dim background */
  z-index: 1000;
}

.popup-content {
  background: var(--wrapper-background-color); /* dark red background */
  border: 3px solid var(--main-text-color); /* var(--main-text-color border */
  border-radius: 12px;
  color: var(--main-text-color);
  width: 350px;
  margin: 12% auto;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.popup-content h3 {
  font-size: 24px;
  color: var(--main-text-color);
  margin-bottom: 15px;
}

.popup-content p {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--main-text-color);
}

.popup-content input[type="password"] {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 2px solid var(--boxes-color);
  border-radius: 6px;
  margin-bottom: 15px;
  background: #222;
  color: var(--main-text-color);
}

.popup-content input[type="password"]:focus {
  border-color: var(--main-text-color);
  outline: none;
}

.popup-content button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 6px;
  border: 2px solid var(--main-text-color);
  cursor: pointer;
  transition: all 0.25s ease;
}

.popup-content button[type="submit"] {
  background-color: var(--boxes-color);
  color: var(--main-text-color);
}

.popup-content button[type="submit"]:hover {
  background-color: var(--main-text-color);
  color: black;
}

.popup-content button[type="button"] {
  background-color: #500;
  color: #ff8080;
  border: 2px solid #ff3333;
}

.popup-content button[type="button"]:hover {
  background-color: #300;
  color: #fff;
}

/* =========================
   Secondary Nav (Character Menu)
========================= */
.sub-nav {
  background-color: #222;
  border-top: 2px solid var(--main-text-color);
  border-bottom: 2px solid var(--main-text-color);
  padding: 8px 0;
  text-align: center;
}

.sub-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* wraps nicely on smaller screens */
  gap: 15px;
}

.sub-nav li {
  margin: 0;
}

.sub-nav a {
  color: var(--main-text-color);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.2s;
}

.sub-nav a:hover {
  background-color: var(--main-text-color);
  color: #222;
}

/* =========================
   Overlay Setup (Log / Fight Popup)
========================= */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

/* =========================
   Log Popup Content
========================= */
.log-popup {
  width: 80vw;
  max-width: 1200px;
  height: 80vh;
  overflow-y: auto;
  background: var(--wrapper-background-color);
  border: 3px solid var(--main-text-color);
  border-radius: 12px;
  color: var(--main-text-color);
  padding: 20px 30px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
}

/* Log text area */
.log-output {
  text-align: left;
  color: var(--main-text-color);
  font-size: 16px;
  line-height: 1.4;
  max-height: 65vh;
  overflow-y: auto;
  background: #111;
  border: 2px solid var(--main-text-color);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

/* =========================
   Close Button
========================= */
.close-btn {
  background-color: var(--main-text-color);
  color: black;
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.close-btn:hover {
  background-color: #ffcc00;
  transform: scale(1.05);
}

/* =========================
   Fight Log List
========================= */
.fight-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fight-list li {
  margin-bottom: 10px;
}

.log-item {
  width: 100%;
  background: #111;
  color: var(--main-text-color);
  border: 2px solid var(--main-text-color);
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.log-item:hover {
  background: var(--main-text-color);
  color: black;
  transform: scale(1.02);
}

/* =========================
   Alternate Popup Overlay (redeclared for safety)
========================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* =========================
   Alternate Popup Content
========================= */
.popup-content.log-popup {
  background: #222;
  color: var(--main-text-color);
  border: 3px solid var(--main-text-color);
  border-radius: 15px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 25px var(--main-text-color);
}

/* =========================
   Popup Buttons
========================= */
.popup-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.close-btn {
  background: var(--main-text-color);
  color: black;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: orange;
}

/* =========================
   Log List Styles
========================= */
.log-list {
  padding: 1em;
  max-height: 70vh;
  overflow-y: auto;
  color: white;
}

.fight-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fight-list li {
  margin: 0.5em 0;
}

.log-item {
  display: block;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: var(--main-text-color);
  padding: 10px;
  border: 2px solid #555;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* =========================
   Fight Log Popup Fix
========================= */

/* Log container area */
.log-list {
  display: block;
  width: 100%;
  min-height: 300px; /* ensures it's visible even if empty */
  max-height: 65vh; /* fits nicely in the popup */
  overflow-y: auto;
  padding: 15px;
  background: #111;
  border: 2px solid var(--main-text-color);
  border-radius: 8px;
  color: var(--main-text-color) !important;
  font-size: 16px;
}

/* Log text area */
.log-output {
  display: block;
  width: 100%;
  max-height: 65vh;
  overflow-y: auto;
  background: #111;
  border: 2px solid var(--main-text-color);
  border-radius: 8px;
  padding: 15px;
  color: var(--main-text-color);
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.5;
}

/* Popup title */
.popup-content.log-popup h3 {
  margin-top: 0;
  font-size: 28px;
  color: var(--main-text-color);
  text-align: center;
  margin-bottom: 20px;
}

/* Popup buttons area */
.popup-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

/* Fight list container */
#logList {
  display: block !important;
  color: var(--main-text-color);
  padding: 10px;
  font-size: 16px;
  overflow-y: auto;
  max-height: 60vh;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}

#logList ul.fight-list {
  display: block;
  list-style: none;
  padding: 0;
  margin: 0;
}

#logList li {
  margin-bottom: 10px;
}

/* Log list items */
#logList button.log-item,
.log-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #111;
  color: var(--main-text-color);
  border: 2px solid var(--main-text-color);
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#logList button.log-item:hover,
.log-item:hover {
  background: var(--main-text-color);
  color: black;
  transform: scale(1.02);
}

/* Fight list structure */
.fight-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.fight-list li {
  margin-bottom: 20px;
}

/* Preformatted battle log text */
.log-item pre {
  background: #000;
  color: var(--main-text-color);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px;
  margin: 0;
}

/* Popup overlay adjustments */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 99999; /* increase layer priority */
  justify-content: center;
  align-items: center;
}
/* =========================
   Top Navigation Styling
========================= */
.top-nav {
  background-color: var(--wrapper-background-color);
  border-bottom: 2px solid var(--accent-color);
  width: 100%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.top-nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.top-nav li {
  margin: 0;
}

.top-nav li a {
  display: block;
  padding: 14px 18px;
  color: var(--main-text-color);
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s;
  border-radius: 4px;
}

/* Hover effect */
.top-nav li a:hover {
  background-color: var(--accent-color);
  color: #fff;
}

/* Active link (current page) */
.top-nav li a.active {
  background-color: var(--accent-color);
  color: #fff;
}