@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');
.bangers-regular {
  font-family: "Bangers", system-ui;
  font-weight: 400;
  font-style: normal;
}

body {
  font-family: "Open Sans", sans-serif;
  font-family: 'Orbitron', sans-serif;
  font-optical-sizing: auto;  
  margin: 0;
  padding: 0;
  background: #161616;
  
}

.main-container {    
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  margin: 1% 2.5%;
  background-image: url(space/alienbg.jpg);
  background-size: cover; 
  background-repeat: no-repeat;
  background-position: top;
  border-radius: 1%;
  background-attachment: fixed;
}

.environment-wrapper { 
  display: flex;
  flex-direction: column;
  padding: 0% 2.5%;
}

.environment-banner {  
}

.environment-container {
  margin:0 auto;
  border-radius:1.5vw; 
  display:flex;
  flex-direction:column;
  margin:0;
  padding:0;
  
}
.environment-container h2 {
  
}

.intro { 
  padding: 0 0% 0% 0;
  margin: 0 0 1% 0;
  font-size: 1.2vw; 
}

.intro p {
  padding: 0;     
  font-family: "Open Sans", sans-serif;
  background: #00c2ff;
  color: white;
  padding: 0.5% 1%;
  border-radius: 10px;
  margin: 0 0;
  display: none;
}

.supertotal { 
  display: flex;
  flex-direction: row;
  width: 100%; 
  font-family: "Open Sans", sans-serif;
}

.total1 {     display: flex;
  flex-direction: column;
  width: 100%;
}
.total2 {      
  display: flex;
  flex-direction: column;
  width: 100%;
}

.technical-panel, .persona-panel, .prompt-engineering {
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2% 4%;
  margin: 0% 2% 2% 0%;
}

.technical-panel {
  background: #00c2ff;
}

.persona-panel {
  background: #00c2ff;
}

.prompt-engineering {
  background: #00c2ff;
}

.total2 .technical-panel {
  background: #fc296e;
  
}

.total2 .persona-panel {
  background: #fc296e;
}

.total2 .prompt-engineering {
  background: #fc296e;
}

.prompt-engineering {
  display: flex;
  flex-direction: column;
}

.prompt-engineering .setting {
  display: flex;
  flex-direction: column;
}

.prompt-engineering select {
  width: 100%; 
  border: none;
  border-radius: 5px;
  background-color: #ffffff;
  color: #00c2ff;
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 2%;
}

.prompt-engineering textarea {
  width: 100%; 
  border: none;
  border-radius: 5px;
  background-color: #ffffff;
  color: #00c2ff;
  font-family: 'Orbitron', sans-serif;
}

.output-group {
  display: flex;
  flex-direction: column;
  
}

.settings-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto 5%;
}

.setting {
  display: flex; 
  display: row;
  align-content: center;
  margin: 1% 0 0 0;
}

.setting label {
  color: #ffffff; 
  width: 40%;
}
.setting input {
  color: #ffffff; 
  width: 40%;
}

.setting input[type="range"] { 
}

.setting input[type="number"] {
  width: 70px; 
  border: none;
  border-radius: 5px;
  background-color: #ffffff;
  color: #00c2ff;
  font-family: 'Orbitron', sans-serif;
}

.slider-container { 
}


header {
  margin: 0 0 1%; 
}

header h1 {
  margin:0; 
  padding: 0;
}

header p {
  margin:0; 
  padding: 0;     
  font-family: "Open Sans", sans-serif;
}

h2 { 
  margin:0; padding: 0;
  color: #000000;
  font-family: 'Orbitron', sans-serif;
}

h3 { 
  margin:0; padding: 0;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
}




select {
  width: 50%; 
  margin:0;
  border: none;
  border-radius: 5px; 
}

textarea {
  width: 50%; 
  padding: 0%;
  margin:0;
  border: none;
  border-radius: 5px; 
  resize: vertical;
}


.settings-control-panel {
  display: flex;
  justify-content: space-between; 
}

.copy-button, .reset-button {
  width: 98%;
  margin: 2% 0;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  transition: background-color 0.3s ease;
}

.copy-button {
  background-color: #3498db;
  color: white;
}

.copy-button:hover {
  background-color: #2980b9;
}

.reset-button {
  background-color: #e74c3c;
  color: white;
}

.reset-button:hover {
  background-color: #c0392b;
}

.run-panel { 
  border-radius: 5px; 
  margin: 0% 0 2% 0;
  width: 99%;
}

.run-panel h3 {display: none;}

.task-buttons {
  display: flex;
  gap: 2%;
  margin: 0; 
}

.task-button {
  padding: 1%;
  margin: 0% 0;
  border: none;
  background-color: #2980b9;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  transition: background-color 0.3s ease;
}

.task-button:hover {
  background-color: #fc296e;
}

.output-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  border: 1px solid #ccc;
  background: #ffffff;
}

.output-column {
  background: #ffffff; 
  height: auto; 
  min-height: 250px;
  width: 90%;
  margin: 2% auto;
  padding: 3%;
}

.chat-container {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 2%;
  margin: 2% 0;
  font-family: "Open Sans", sans-serif;
}

.chat-interface {
  height: 300px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 20px;
}

.user-message, .ai-message {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 5px;
  max-width: 80%;
}

.user-message {
  background-color: #e6f2ff;
  align-self: flex-end;
  margin-left: auto;
}

.ai-message {
  background-color: #f0f0f0;
  align-self: flex-start;
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.chat-submit {
  padding: 10px 20px;
  border: none;
  background-color: #4CAF50;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  transition: background-color 0.3s ease;
}

.chat-submit:hover {
  background-color: #45a049;
}

.error-message {
  color: red;
  font-size: 1vw;
  margin-top: 5px;
}

.prompts-container {
  display: none;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f0f0f0;
  border-radius: 5px;
}

.prompts-container h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.prompt-content {
  background-color: #ffffff;
  padding: 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.prompt-content h4 {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 1vw;
}

.navigation-bar {
  display: flex;
  justify-content: space-around;
  padding: 0px;
  background-color: #f0f0f0;
  margin-bottom: 20px;
  
}
.nav-button {
  padding: 0.5vw 1vw;
  background-color: #00c2ff;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  border-radius: 5px;
  width: 24%;
  font-size: 1.3vw;
  text-transform: uppercase; 
  letter-spacing: -1px;
}
.nav-button:hover {
  background-color: #e72a68;
}
.nav-button.active {
  background-color: #fc296e;
  font-weight: bold;
}
.welcome-content {
  text-align: center;
  padding: 50px;
}

/* Add this CSS to your stylesheet */

#content-area {
  margin:0;
  padding:0;
}

.top-section {
  display:flex;
  flex-direction: row;
  margin-bottom: 1% 2%; 
}

.left-element {
  display: flex;
  flex-direction: row;
  gap: 0;  
  width: 64%; 
  box-sizing: border-box;
  align-items: flex-start;  
}

.hero {
  background-image: url(space/solohero.png);
  background-size: contain; 
  background-repeat: no-repeat;
  background-position: center;
  width: 33%;   
  height: 100%;
  margin: 0;
  padding:0;
}

.environment-display {
  padding: 0;
  margin: 0; 
  width: 65%;  
  background-image: url(space/texture.jpg);
  box-shadow: inset 0 0 0 2px #2c2f33; /* Simulates a border with the box-shadow property */
  
}

.princess {
  background-image:url(space/soloprincess.png);
  background-size: cover; 
  background-repeat: no-repeat;
  background-position: center;
  width: 33%;   
  height: 100%;
  margin: 0;
  padding:0;
}

.heroandprincess {
  background-image: url(space/heroandprincess.png);
  background-size: contain; 
  background-repeat: no-repeat;
  background-position: center;
  width: 33%;   
  height: 100%;
  margin: 0;
  padding:0;
}

.grid-row {
  display:flex; 
}

.grid-cell { 
  width: 10%;
  height: 10%;
  display: flex;
  justify-content: center;
  align-items: center; 
  border: 0.1vw dotted #8b8b8b;
  background: rgb(93 93 93 / 90%);
  font-size: 2.5vw; /* Adjust based on your preference */
  aspect-ratio: 1 / 1; /* Ensures each cell is square */
  line-height: 10%;
}

.revealed-cell {   
  background-color:rgb(253 31 64 /10%);
  color:#ffffff;
  border:0.1vw solid rgb(139 37 52 / 20%);
}
.hidden-cell {     
  color:#1a1a1a; 
}
.path-cell {  
  background-color:rgba(240, 35, 76, 0.7);
  border: 0.1vw solid #ec4848;
}
.current-cell {  
  background-color:#fc6294;
  box-shadow:0 0 1vw rgb(253 31 64 / 60%);
  
}




/* Legend styles */

/* Settings Overlay */
#settings-overlay {
  display: block; /* Initially visible */
  position: fixed; /* Stay in place */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 100; /* Ensure it's above other elements */
  opacity: 0; /* Initially hidden using opacity */
  pointer-events: none; /* Prevent clicks until toggled */
  transition: opacity 0.3s ease-in-out; /* Smooth transition */
}

#settings-overlay.active {
  opacity: 1;
  pointer-events: auto; /* Allow clicks when active */
}

#settings-overlay .legend {
  position: absolute;
  top: 4.2vw;
  left: 4vw; 
  background: #373737;
  border-radius: 5px;
  padding: 0.5% 1.5%;
  color: white;
  width: 89%; /* Adjust width as needed */
  max-height: 80%; /* Adjust max height as needed */
  overflow-y: auto; /* Add vertical scroll if content exceeds max height */
  border: 0.1vw solid rgba(0, 0, 0, 0.5);
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;   
  margin:0; 
  font-family:"Open Sans",sans-serif;
}

.legend-group { 
  margin: 5% 2%;
}

.legend .custom-emoji {
  display: inline-block;
  width: 1.50vw;
  height: 1.50vw;
  vertical-align: middle;
  margin-right: 0.5vw;
}

.reward-input, .count-input {
  background-color: #2c2f33;
  border-top: 0.1vw solid #1c1c1d;
  border-left: 0.1vw solid #1c1c1d;
  border-right: 0.1vw solid #5e5d5d;
  border-bottom: 0.1vw solid #5e5d5d;
  border-radius: 0;
}

.count-input { 
}

.input-label {
} 

.input-label { 
} 


.legend-item {   
  margin: 0.8vw 0% 0.4vw;
  background: #1c1c1c;
  padding: 4% 4%;
  color: white;
  width: 92%;
  border-radius: 1vw;
}


div.input-label {    
  font-size: 1.3vw; 
  margin: 0 0 0 0;
  line-height: 1.2vw;
  white-space: nowrap; /* Prevents text from wrapping to the next line */
  overflow: hidden; /* Ensures that overflow content is hidden */
  text-overflow: ellipsis; /* Adds ellipsis (...) if text overflows */
  height: 1.5vw; 
}

/* Toggle switch styles */
.switch {
  position: relative;
  display: inline-block;
  width: 35%;
  height: 0.5VW;
  margin: 0 1vw 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0; 
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 35%;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  width: 45%;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.0vw;
  width: 1.0vw;
  left: 0vw;
  bottom: -0.5vw;
  background-color: white;
  transition: .4s;
  border: 1px solid #cecece;
}

input:checked + .slider {
  background-color: #7289da;
}

input:checked + .slider:before {
  transform: translateX(1.8vw);
}

.slider.round {
  border-radius: 2.2vw;
}

.slider.round:before {
  border-radius: 50%;
}

/* Adjust the legend item to accommodate the switch */
.legend-item .data-fields-inputs {
  display: flex;
  align-items: center;
  
}

.legend-item .data-fields-inputs .switch {
  margin-left: 0.5vw;
}

.legend-group h4 {
  margin:0; 
  font-size:1.2vw;
  padding-bottom: 0; 
  background: rgb(18 18 18 / 70%);
  color: white;
  padding: 0.2vw 0.4vw 0.3vw; 
  text-transform: uppercase;
  text-align: center;
  width: 97%;
}

input[type="number"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.number-input-wrapper {
  display: inline-flex;
  align-items: center;
  width: 100%;
}

.number-input-wrapper button {
  width: 1.9vw;
  height: 1.9vw;
  padding: 0 2%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0vw solid #7289da;
  background-color: #2c2f33;
  cursor: pointer;
  font-size: 1.2vw;
  user-select: none;
  color: #ffffff; 
}

.number-input-wrapper input[type="number"] {
  text-align: center; 
  margin: 0 4%;
  width: 100%;
  height: 1.3vw;
  font-size: 1.2vw;
  background-color: #2c2f33;
  color: #ffffff;
  padding: 0.2vw 0;
  border-radius: 0.5vw;
}

.legend-item .data-fields-inputs {
  display: flex;
  align-items: center;
}

.legend-item .data-fields-inputs .number-input-wrapper {
  flex: 1;
  margin: 0 1.5vw 0 0;
}


input.fake-input {
  font-size: 0.0vw;   
  width: 50%; 
  color: #ffffff; 
  box-sizing: border-box;
  padding: 0.85vw 0.25vw 0.1vw 0.10vw;
  margin: 0;
  border: 0.0vw dotted #2c2f33;
  text-align: right; 
  background: transparent;
}


.data-fields{
  display:flex;
  flex-direction:column;
  margin:0 0 0 0; 
  
}
.data-fields-titles {
  width:100%;
  margin:0 0 -2% 0;
  display:flex;
  flex-direction:row;
  z-index:10; 
  
}

.data-fields-titles #rolechanger { 
  margin-top: 3%;
}

.data-fields-titles div {
  display:block;
  width:100%;
  margin:0.5vw 0 0.2vw 0.6vw;
  padding: 0 2%;
  font-family:"Open Sans",sans-serif;
  font-size: 0.9vw;
  text-align: center; 
  text-align: left; font-size: 0.9vw;
}
.data-fields-inputs{
  display:flex;
  flex-direction:row; 
  justify-content: center;
  align-content: center;
  padding-left: 5%;
}


#data-science {  
  width: 100%; 
}


/*Montecarlo*/
#monte-carlo-results {
  background-color: #2f3136;
  border-radius: 1vw;
  padding: 2%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  color: white;
  overflow-y: hidden; 
  font-family: 'Courier New', Courier, monospace;
  margin-bottom: 1vw;  
}

#monte-carlo-results h4 {
  margin-top: 0;
  color: #99aab5;
  font-size: 1.5vw;
  border-bottom: 0.4vw solid #7289da;
  padding-bottom: 1vw;
  margin-bottom: 1vw;
}

#monte-carlo-results p {
  font-size: 1.2vw;
  margin: 0;
  padding: 0.5vw 0;
}

#monte-carlo-results span {
  color: #ffffff; /* Make the results values stand out */
}

#data-wide {
  display: flex; 
  flex-display: row;
  width: 100%;
}

#episode-history {
  background-color:#2f3136;
  border-radius:1vw;
  padding:2%;
  box-shadow:0 2px 10px rgba(0,0,0,0.3);
  color:white; 
  overflow-y:hidden;
  width: 30%; 
  font-family:'Courier New',Courier,monospace;
}

#episode-history h3 {
  margin-top:0;
  color:#99aab5;
  font-size:2vw;
  border-bottom:0.4vw solid #7289da;
  padding-bottom:1vw;
  margin-bottom:2vw;  
}
.episode-history-content{
  overflow-y:auto;
}
.episode-history-content div {
  font-size: 1.2vw;
  margin:0;
  padding: 0.8vw 0;
  border-bottom:0.1vw solid #4f4f4f;
}

.q-table-display {
  background-color:#2f3136;
  border-radius:1vw;
  padding:2%;
  box-shadow:0 2px 10px rgba(0,0,0,0.3);
  width: 70%; 
  margin: 0 0 0 1%;
  font-size:1.2vw;
}
.q-table-display h3 {
  margin-top:0;
  color:#99aab5;
  font-size:2vw;
  border-bottom:0.4vw solid #7289da;
  padding-bottom:1vw;
  margin-bottom:2vw;
}
.q-table {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(14vw,1fr));
  gap:1vw;
  
  color:#b9bbbe;
  font-family:'Courier New',Courier,monospace;
  
  overflow-y:auto;
}

.q-table-container h4 {font-size: 1.5vw;}

.q-table-item {
  background-color:#3a3f44;
  border-radius:1vw;
  padding:1vw;
  border:0.2vw solid #444;
  box-shadow:0 0.2vw 0.5vw rgba(0,0,0,0.2);
  
} 
.q-table-item pre{
  margin:5px 0 0;
  white-space:pre-wrap;
  word-wrap:break-word;
  font-size:1.0vw;
  color:#ffffff;
  background: rgba(0, 0, 0, 0.2);
  padding: 5%;
}


.middle-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vw;
}

.status-display {
  flex: 1;
  background-color: #2f3136;
  border-radius: 1vw; 
  text-align: center;
  font-weight: bold;
  margin-right: 0;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 1.6vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: url(space/bar.png);
  background-size: cover;
  height: 7vw;
  
  /* Vertical center align the text */
  display: flex;         /* Use flexbox layout */
  align-items: center;   /* Center align items vertically */
  justify-content: center; /* Center align items horizontally (for safety) */
}

.q-learning-controls {
  display:flex; 
  flex-direction: column;
  width: 15%;
  gap: 0; 
}
.control-button {
  background-color:#2f3136;
  color:#ffffff;
  border:none;
  padding: 1vw 1vw;  
  cursor:pointer;
  transition: background-color 0.3s ease,transform 0.3s ease;
  font-size: 1.1vw;
  margin: 0.4vw 0.5vw 0;
  width: 100%;
  text-align: center;
  text-transform: uppercase; 
  align-content: center;
  justify-content: center; 
  bottom: 0;
  position: relative;
  display: flex;
}

#close-settings { 
  background-color:#e62161;
  color:#ffffff;
  border:none;
  padding: 1vw 1vw;  
  cursor:pointer;
  transition: background-color 0.3s ease,transform 0.3s ease;
  font-size: 1.5vw;
  margin: 1.4vw 0.5vw 0;
  width: 95%;
  text-align: center;
  text-transform: uppercase;
  border-radius: 0.5vw;
  align-content: center;
  justify-content: center; 
  bottom: 0;
  position: relative;
  display: flex;
}

.control-button#start-learning { 
}
.control-button#start-learning:hover {
  background-color:#e72a68;
}

.control-button:hover {
  background-color:#e72a68; 
}
.control-button:active {
  transform:translateY(0);
}

.control-button:disabled {
  opacity: 0.5; /* This is already in your JS, but you can add it here for consistency */
  cursor: not-allowed; /* Change cursor to indicate it's not clickable */
  /* Add any other styling you want for the disabled button, like a different background color */
}

.monster-win {
  animation: pulse-green 0.5s;
}
.monster-lose {
  animation: pulse-red 0.5s;
}

@keyframes pulse-green {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(0, 255, 0, 0.5); }
}

@keyframes pulse-red {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(255, 0, 0, 0.5); }
}

.leaderboard-display {
  display: flex; 
  padding: 0 0 0.4%;  
  border-bottom: 2px solid #2c2f33;
  background: rgba(0, 0, 0, 0.1);
}

.leaderboard-display .nickname {
  font-size: 1.7vw;  
  color: #ffffff;
  margin: 0;
  padding: 0;
  display: flex; 
  writing-mode: vertical-rl; /* This makes the text vertical */
  text-orientation: upright; /* Ensures that the text remains upright */
  font-weight: bold;
  letter-spacing: -0.6vw;  
  /* Stroke effect using text-shadow */
  text-shadow: 
  -1px -1px 0 #000000,  /* Top-left shadow */
  1px -1px 0 #000000,  /* Top-right shadow */
  -1px  1px 0 #000000,  /* Bottom-left shadow */
  1px  1px 0 #000000,  /* Bottom-right shadow */
  0px  0px 5px rgba(0, 0, 0, 0.5);  /* Soft shadow for more depth */
}


.leaderboard-display .scores {
  width: 11.8vw;
  font-size: 0.9vw;
  background: rgba(0,0,0,0.3);
  color: white;
  margin: 0 1% 0 1%;
  padding: 1.5% 5.8%;   
  height: 4.5vw;   
  align-content: center;
  justify-items: center;
}

.leaderboard-display .scores b {
  font-size: 1.2vw;
}


.leaderboard-display h3 {
  margin: 0 0 0%;
  color: #111111;
  font-size: 1.4vw;  
  font-weight: bold; 
  
}

.leaderboard-display ol {
  margin: 0;
  padding: 0;
  display: flex;
  margin: 0 0 0 0;
  flex-direction: row;  
}

.leaderboard-display li { 
  margin: 0 1% 0 0;
  padding: 0;
  display: flex; 
  flex-direction: row;  
}

.leaderboard-display b {font-size: 0.9vw;}

.individual-leaderboard { 
  margin:0;
  padding:0 1% 0 0%;
  width: 50%; 
}
.expanded-leaderboard { 
  padding:0 0 0 1%;
  width: 50%; 
  border-left: 1px solid black;
}

.leaderboard-display li:last-child {
  border-bottom: none;
}

#leaderboard-display {
  overflow: hidden;
  max-height: none; /* Allow it to display its full height by default */
  opacity: 1;
  transition: max-height 0.5s ease, opacity 0.5s ease;
}
.hide-lb {
  position: absolute;
  top: 0.5%;
  right: 1%;
  font-size: 1.8vw;
  display: block; 
  border: 0;
  width: 1.8vw;
  height: 1.8vw; 
}

.hide-lb a {
  position: relative; /* Ensure the link's internal content is positioned correctly */
  border: 0;
  display: flex; /* Use flex to center the content */
  align-items: center; /* Center vertically */
  justify-content: center; /* Center horizontally */ 
  width: 100%; /* Ensure the link fills the container */
  height: 100%; /* Ensure the link fills the container */
  text-decoration: none; /* Remove underline or any other text decoration */
  outline: none; /* Remove any default outline on focus */
  cursor: pointer; /* Ensure the cursor changes to a pointer (hand) */
  z-index: 1;
}

.hide-lb a:active,
.hide-lb a:focus {
  outline: none; /* Ensure no outline appears when the link is focused or clicked */
}
#system-info {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  z-index: 1000;
}

#system-info.show {
  opacity: 1;
  visibility: visible;
}

.glow-effect {
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.7);
  border: 2px solid yellow;
}

.disabled-input {
  opacity: 0.5;
  pointer-events: none;
}

.disabled-spinner {
  opacity: 0.5;
  pointer-events: none;
}
.custom-emoji { 
  display: inline-block;
  background-size: cover;
  background-repeat: no-repeat;
  vertical-align: middle;
}
/* When there's only one emoji in the cell */
.grid-cell:not(:empty):not(:has(+ .custom-emoji)) .custom-emoji {
  width: 3vw;
  height: 3vw;
  max-width: 3rem;
  max-height: 3rem;
}

/* When there are multiple emojis in the cell */
.grid-cell:has(> .custom-emoji + .custom-emoji) .custom-emoji {
  width: 1.5vw; 
  height: 1.5vw; 
  max-width: 1.5rem; 
  max-height: 1.5rem; 
  display: flex;
  background-size: contain;
}






#q-table-display {
  background-color: #1b1b1b;
  color: #00c2ff;  
}

#q-table-display h3 {
  color: #ffffff;
  font-weight: bold; 
}




/** Combat **/
#combat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black; 
  z-index: 1000;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  padding: 2vw;
  box-sizing: border-box;
}

#all-combat-entities {
  display: flex;
  justify-content: space-between; 
  height: 35vw; 
  background: url('space/alienbg4.jpg') black no-repeat;
  background-size: cover; 
}

#player-combat-entities, #enemy-combat-entities {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 48%;
  margin-top: 5%;
}

.combat-entity {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  border: 0.3vw solid #ffd700;
  border-radius: 1vw;
  padding: 1vw 1vw 1vw 3vw;
  margin-bottom: 1vw;
  box-shadow: 0 0 2vw rgba(255, 215, 0, 0.3);
  height: 8vw;
  width: 80%;
  margin-left: 10%;
}

.combat-entity#monster-display {
  margin-left: 0%;
}

.entity-image { 
  width: 30%;
  margin-right: 1vw;
}

.entity-image img {
  width: 18%;
  height: auto;
  border-radius: 0.5vw;
  filter: drop-shadow(0 0 0.5vw rgba(255, 255, 255, 0.3));
  position: absolute;
  margin-left: -5%;
  margin-top: -7.5%;
  
}

.entity-stats {
  width: 50%;
  margin-left: 14%;
}

.entity-name {
  font-size: 1.8vw;
  font-weight: bold;
  margin-bottom: 0.5vw;
  text-shadow: 0.2vw 0.2vw 0.2vw rgba(0, 0, 0, 0.7);
}

#combat-overlay .hp-bar{
  height: 1.2vw;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.55vw;
  overflow: hidden;
  margin-bottom: 0.5vw;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4136 0%, #ff6b6b 100%);
  transition: width 0.5s ease-in-out;
}

.hp-text {
  font-size: 1.1vw;
  margin-bottom: 0.5vw;
}

.energy-blocks {
  display: flex;
  gap: 0.3vw;
}

.energy-block { 
  width: 1.5vw;
  height: 1.5vw;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.3vw;
}

.energy-block.filled {
  background: linear-gradient(135deg, #ffdc00 0%, #ffd700 100%);
  box-shadow: 0 0 0.5vw rgba(255, 220, 0, 0.7);
}

#turn-order-display {
  background: rgba(0, 0, 0, 0.7);
  border: 0.2vw solid #4a90e2;
  border-radius: 1vw;
  font-size: 1.5vw; 
  text-align: center;
  margin: 0.8vw 0;
  box-shadow: 0 0 1.5vw rgba(74, 144, 226, 0.3);
  width: 40%;  
  left: 55%;
  position: absolute;
  margin: 0.5vw 0 0 0vw;
  padding: 0;
  height: 6%;
  display: flex; /* Add this */
  justify-content: center; /* Align horizontally */
  align-items: center; /* Align vertically */
}


.lives-display, .combat-lives-display {
  font-size: 3vw;
  padding: 1% 1.5%;
  background: none; 
  position: absolute;
}

#combat-overlay .combat-lives-display {
  color: white; 
  width: 100%;
  text-transform: uppercase;  
  width: 40%;
  margin: 0.5vw 0 0 1vw;
  padding: 0;
  font-size: 1.5vw; 
  height: 6%;
  display: flex; /* Add this */ 
  align-items: center; /* Align vertically */
}

#cancel-item {
  background: linear-gradient(135deg, #ff4136 0%, #ff6b6b 100%) !important;
}

#cancel-item:hover {
  background: linear-gradient(135deg, #f22525 0%, #ef190d 100%) !important;
}

#item-menu {  
  border: 0.3vw solid #ffd700;
  border-radius: 1vw;
  padding: 1vw;
  z-index: 1100; /* Higher than combat-overlay */
  color: #ffffff; 
  box-shadow: 0 0 2vw rgba(255, 215, 0, 0.5);
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  width: 30%; 
  top: 35%;
  left: 35%; 
}



#item-menu h3 {
  font-size: 1.8vw;
  margin-bottom: 1vw;
}

#item-menu button {
  display: block;
  width: 100%;
  padding: 0.8vw;
  margin: 0.5vw 0;
  font-size: 1.3vw;
  cursor: pointer;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: white;
  border: none;
  border-radius: 0.5vw;
  transition: all 0.3s ease;
}

#item-menu button:hover { 
  box-shadow: 0 0.4vw 0.8vw rgba(74, 144, 226, 0.5);
  background: linear-gradient(135deg, #357abd 0%, #4a90e2 100%);
}


.item-entry {
  display: flex;
  align-items: center;
  margin-bottom: 1vw;
}

.item-entry img.inventory-icon {
  width: 3vw; /* Adjust size as needed */
  height: 3vw;
  margin-right: 1%;
  vertical-align: middle;
}


.particle {
  position: absolute;
  width: 1.5vw;
  height: 1.5vw;
  border-radius: 50%;
  pointer-events: none;
}






.death-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

.death-animation img {
  max-width: 80%;
  max-height: 80%;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}
.death-description {
  color: #ff0000;
  font-size: 2.5vw;
  text-align: center; 
  font-weight: bold;
  text-shadow: 2px 2px 4px #000000;
  animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
  from { opacity: 0.8; }
  to { opacity: 1; }
}


.death-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.death-container {
  background-color: #111;
  border: 2px solid #f00;
  border-radius: 10px;
  padding: 20px;
  max-width: 70%;
  text-align: center;
  box-shadow: 0 0 20px #f00;
}

.death-image {
  max-width: 60%;
  border-radius: 5px;
  margin-bottom: 0.2vw;
  float: left;
  margin-right: 1.5vw;
}

.death-description {
  color: #fff;
  font-size: 2vw;
  line-height: 2.5vw;
  margin-bottom: 2vw;
  text-shadow: 0 0 5px #f00; 
  margin: 0;
}

.death-buttons {
  display: flex;
  justify-content: center;
  gap: 2vw;
}

.death-button {
  background-color: #300;
  color: #fff;
  border: none;
  padding: 0.5vw 2vw;
  font-size: 1.5vw;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 5px;
  margin-top: 1vw;
}

.death-button:hover {
  background-color: #500;
  transform: scale(1.05);
}

.restart-button {
  background-color: #060;
}

.restart-button:hover {
  background-color: #090;
}

.quit-button {
  background-color: #600;
}

.quit-button:hover {
  background-color: #900;
}








/*Inventory*/
/* Inventory styles */
.inventory-wrapper {
  position: relative;
  z-index: 10;
  
  color: white;
}

.inventory-toggle {
  padding: 8px;
  cursor: pointer;
  background-color: #f0f0f0;
  border: 0px dotted #ccc;
  border-radius: 4px;
  background: url(space/bag.png);
  background-size: contain;
  background-repeat: no-repeat;
  font-size:0;
  width: 15vw;
  height: 16vw;
  position: absolute;
  margin-left: -18vw;
  margin-top: 22vw;
}

.inventory {
  position: absolute;
  top: 100%; /* Position right below the toggle button */
  left: 0;
  background: rgb(21 21 21 / 60%);
  border: 1px solid #182731;  
  overflow-y: auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000; /* Ensure it's above other elements */
  
}

.inventory-item {  
  cursor: move;  
  
}
.inventory-item:hover {
  background-color: #ffd700;
}

.inventory-item[draggable="true"] {
  border: 0.3vw dashed #ccc;
  margin: 1vw;
  width: 4vw; 
  font-size: 1.5vw;
}

.inventory-item.dragging {
  opacity: 0.5; /* Lower opacity when dragging */
}



/* Visibility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}


.trash-icon  {  
}


img.trash-icon  {
  width: 60%;
  margin: 5% 20% 0;
  text-align: center;
}

.inventory-icon { 
  width: 4vw;
  height: 4vw;
}

.inventory span {
  position: absolute;
  right:20%;  
  background: rgb(0 0 0 / 50%);
  padding: 0.2vw 0.3vw;
  font-size: 1vw;
}

/* Visibility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}


/* Visibility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}


/*ENERGY BARS*/
.bar {
  width: 100%;
  height: 0.5vw;
  background-color: #ddd;
  position: absolute;
  top: 0;
  left: 0;
}
.bar-fill {
  height: 100%;
  transition: width 0.3s ease-in-out;
}
.character-hp .bar-fill {
  background-color: #3498db;
  
}
.monster-hp .bar-fill {
  background-color: #e74c3c;
}

.energy-bar {
  position: absolute;
  top: -0.5vw;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 0.4vw;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 0.2vw;
  overflow: hidden;
  z-index: 10;
}

.hero-energy {
  top: -0.5vw; 
}

.energy-block {
  width: 20%;
  height: 2vw;
  float: left;
  background-color: #2c2f33;
  transition: background-color 0.3s ease-in-out;
}

.energy-block.filled {
  background-color: #4CAF50;
}


/* Portal Energy Bar Styles */
.portal-energy {
  position: absolute; /* Position the bar within the portal cell */
  top: 12%;          /* Place it at the bottom of the cell */
  left: 0;           /* Align it to the left */
  width: 100%;       /* Make it span the full width of the cell */
  height: 0.4vw;
  background-color: #ccc; /* Gray background */
  border-radius: 3px;   /* Slightly rounded corners */
  overflow: hidden;    /* Prevents the fill from extending beyond the bar */
}

.portal-energy .bar-fill {
  height: 100%;          /* Fill the entire height of the bar */
  background-color: #007bff; /* Blue fill color */
  width: 100%;          /* Initial width - will be adjusted with JavaScript */
  transition: width 0.3s ease; /* Smooth width transition for visual effect */
}

.portal-hp {
  position: absolute; 
  top: 0;             /* Place it at the top of the cell */
  left: 0;           
  width: 100%;      
  height: 0.4vw;       
  background-color: #ccc;
  border-radius: 3px;   
  overflow: hidden;   
}

.portal-hp .bar-fill {
  height: 100%;         
  background-color: #d9534f; /* Red for HP */
  width: 100%;         
  transition: width 0.3s ease;
}

.grid-cell.active-portal .portal-energy .bar-fill {
  background-color: #28a745; /* Green for active portal */
}

.grid-cell.destroyed-portal .portal-energy {
  display: none; /* Hide the energy bar when the portal is destroyed */
}


/* Rocket HP Bar Styles */
.rocket-hp {
  position: absolute; 
  bottom: 0;        
  left: 0;          
  width: 100%;     
  height: 0.4vw;     
  background-color: #ccc; 
  border-radius: 3px;   
  overflow: hidden;    
}

.rocket-hp .bar-fill {
  height: 100%;          
  background-color: #d9534f; /* Red for HP */ 
  width: 100%;          
  transition: width 0.3s ease; 
}

/* Rocket Energy Bar Styles */
.rocket-energy {
  position: absolute;
  top: 12%; 
  left: 0;           
  width: 100%;       
  height: 0.4vw;      
  background-color: #ccc; 
  border-radius: 3px;  
  overflow: hidden;    
}

.rocket-energy .bar-fill {
  height: 100%;          
  background-color: #5cb85c; /* Green for energy */ 
  width: 100%;           
  transition: width 0.3s ease;
}



/* Combat Log */
.combat-log-container { 
  height: 15vw;
  overflow-y: auto; 
  padding: 0.2vw 0.4vw;
  border: 0.2vw solid #7289da;
  border-radius: 1vw;
  font-size: 1.3vw;
  margin: 0.8vw 0;
  box-shadow: 0 0 2vw rgba(114, 137, 218, 0.3);
  
}

.combat-log-entry {
  margin: 0;
  padding: 0;
  border-radius: 0.5vw;
  background-color: rgba(114, 137, 218, 0.1);
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease-out;
  display: flex;
  align-items: center;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-1vw); }
  to { opacity: 1; transform: translateX(0); }
}

.combat-log-icon { 
  margin-right: 0.8vw;
}

.combat-log-content {
  flex-grow: 1;
}

.combat-log-timestamp { 
  color: #99aab5;
  margin-right: 0.5vw;
}

.combat-log-turn-indicator { 
  color: #7289da;
  margin-right: 0.5vw;
  
}

.combat-log-damage { color: #ff6b6b; }
.combat-log-healing { color: #4cd137; }
.combat-log-special { color: #feca57; }
.combat-log-item { color: #54a0ff; }
.combat-log-monster { color: #5f27cd; }
.combat-log-hero { color: #48dbfb; }
.combat-log-princess { color: #ff9ff3; }
.combat-log-environment { color: #1dd1a1; }
.combat-log-regular { color: #dcdde1; }

.combat-log-icon {
  font-size: 1.5vw; /* Slightly larger icons */
  margin-right: 0.8vw;
  display: inline-block;
  vertical-align: middle;
}

.combat-log-entry:nth-child(even) {
  background-color: rgba(114, 137, 218, 0.05);
}

.combat-log-entry:hover {
  transform: translateX(0.3vw);
  background-color: rgba(114, 137, 218, 0.2);
}

#combat-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1vw;
  padding: 1vw;
  background: rgba(0, 0, 0, 0.7);
  border: 0.2vw solid #ffd700;
  border-radius: 1vw;
  box-shadow: 0 0 2vw rgba(255, 215, 0, 0.3);
  font-size: 2.5vw;
  
}

.combat-action-btn {
  padding: 0.5vw 1.5vw;
  font-size: 1.2vw;
  cursor: pointer;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: white;
  border: none;
  border-radius: 0.5vw;
  transition: all 0.3s ease;
  text-shadow: 0.1vw 0.1vw 0.2vw rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center; 
}

.combat-action-btn:hover {
  transform: translateY(-0.2vw);
  box-shadow: 0 0.4vw 0.8vw rgba(74, 144, 226, 0.5);
  background: linear-gradient(135deg, #2c8deb 0%, #1c7ef1 100%);
}

.combat-action-btn::before {
  content: attr(data-emoji);
  margin-right: 0.5vw;
  font-size: 1.5vw;
}



.total-points {
  font-size: 18px;
  font-weight: bold;
  padding: 10px;
  /* Add any other styling you need */
}




.active-entity {
  border: 3px solid yellow; /* Example: highlight with a yellow border */
}







/* Duel Overlay */
#duel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover; 
  background-position: center;
  z-index: 1000; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Center vertically */
  background: rgba(0, 0, 0, 0.9); 
  padding: 1vw; /* Reduced padding */
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5); 
}

/* Countdown Timer */
#duel-countdown {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10vw;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 20px #000;
  animation: pulse 1s infinite;
  z-index: 1010; /* Ensure it's above other elements */
}

/* Instructions and Feedback */
#duel-overlay #duel-instructions {
  position: absolute;
  top: 50vw; /* Closer to the bottom */
  left: 50%; 
  transform: translateX(-50%);
  font-size: 1.2vw; /* Smaller font */
  color: #FFA500; 
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 0.5vw 1vw; /* Reduced padding */
  border-radius: 1vw;
  animation: fadeInOut 3s ease-in-out;
  z-index: 1001;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}


#duel-overlay #duel-scene {
  background: url(space/background-duel01.jpg);
  background-size: cover;
  background-position-y: bottom;
  width: 100%;
  height: 40vw;
  position: relative; /* Ensure the scene div can position its children */
  margin-bottom: 1vw;
}

/* Character and Pirate Container */
#duel-overlay #duel-characters {
  display: flex;
  justify-content: space-around;
  width: 140%;
  position: absolute;
  bottom: 0; /* Position at the bottom of the scene div */
  left: 50%;
  transform: translateX(-50%); /* Center the container horizontally */
  padding-bottom: 1vw;
}

/* Character and Pirate Sprites */
#duel-overlay #duel-characters img {
  width: 19vw; /* Slightly smaller sprites */
  height: auto;
}

/* HP Bars Container */
#duel-overlay #duel-hp-bars {
  display: flex;
  justify-content: space-around;
  width: 90%;
  margin-bottom: 0.5vw; /* Reduced margin */
  position: absolute;
  top: 4%;
}

/* HP Bar Containers */
#duel-overlay #player-hp-bar-container, #pirate-hp-bar-container {
  width: 40%; 
  background-color: #444;
  border-radius: 0.25vw; /* Reduced border radius */
  overflow: hidden;
  box-shadow: 0 0 0.5vw 0.2vw rgba(0, 0, 0, 0.5);
  height: 2.0vw;
}

/* HP Bars */
#duel-overlay .hp-bar { 
  background-color: #e72a2a; /* Green for player, red for pirate */
  transition: width 0.3s ease-in-out;
  text-align: center;
  font-size: 1.4vw;
  color: #fff; 
  height: 5vw;
  font-weight: bold;
}

#duel-overlay #player-hp-bar { 
}

#duel-overlay #pirate-hp-bar {
  background-color: #FF0000; 
}

/* Accuracy Bars Container */
#duel-overlay #duel-accuracy-bars {
  display: flex;
  justify-content: space-around;
  width: 90%;
  margin-bottom: 1vw;
}

/* Accuracy Bar */
#player-accuracy-bar, #pirate-accuracy-bar {
  width: 40%;
  height: 2.5vw;
  background: linear-gradient(to right, 
  #001428 0%,     /* Deep blue */
  #002c5a 20%,    /* Medium blue */
  #0054ac 35%,    /* Light blue */
  #0084ff 45%,    /* Bright blue */
  #ff3300 48%,    /* Intense red */
  #ff3300 52%,    /* Intense red */
  #0084ff 55%,    /* Bright blue */
  #0054ac 65%,    /* Light blue */
  #002c5a 80%,    /* Medium blue */
  #001428 100%    /* Deep blue */
  );
  border-radius: 0.25vw;
  overflow: hidden;
  position: relative;
  border: 1px solid #0084ff;
  box-shadow: 0 0 5px rgba(0, 132, 255, 0.5);
}

/* Accuracy Bar Overlay */
#player-accuracy-bar::before, #pirate-accuracy-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
  linear-gradient(90deg, 
  rgba(255, 255, 255, 0.1) 0%, 
  rgba(255, 255, 255, 0) 100%
  ),
  repeating-linear-gradient(
  0deg,
  transparent,
  transparent 1px,
  rgba(0, 132, 255, 0.1) 1px,
  rgba(0, 132, 255, 0.1) 2px
  );
  pointer-events: none;
}

/* Accuracy Indicator */
#player-accuracy-indicator, #pirate-accuracy-indicator {
  position: absolute;
  top: 0;
  width: 1vw;
  height: 100%;
  background-color: white;
  border-radius: 2px;
  transition: box-shadow 0.2s ease;
}

/* Glowing effect for indicator when near middle */
#player-accuracy-indicator.glow, #pirate-accuracy-indicator.glow {
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8),
  0 0 20px 6px rgba(255, 51, 0, 0.6);
}

/* Energy Bar */
#duel-tension-bar {
  width: 36%;
  height: 1.5vw; /* Smaller energy bar */
  background-color: #444;
  margin-bottom: 2vw; /* Reduced margin */
  border-radius: 0.25vw; /* Reduced border radius */
  overflow: hidden;
  box-shadow: 0 0 1vw 0.2vw rgba(255, 255, 0, 0.5);
  position: absolute;
  top: 8%;
  left: 9.5%;
}

#duel-tension-fill {
  height: 100%;
  background-color: #FFFF00; /* Yellow for energy */
  border-radius: 0.25vw;
  transition: width 0.1s linear; 
}

/* Duel Log */
#duel-log {
  width: 80%;
  height: 20vw; /* Smaller log area */
  background-color: rgb(36 33 47 / 70%);
  color: white;
  padding: 0.2vw 0vw;
  overflow-y: scroll;
  border-radius: 1vw;
  font-size: 1vw;
  box-shadow: 0 0 1vw 0.2vw rgba(0, 0, 0, 0.5);
}

#duel-log p {
  font-size: 22vw;
  margin:0; 
  padding:0;
  font-family: 'Arial', sans-serif;
}

/* Duel Log - Dialog and Special Messages */
#duel-log .dialog {
  color: #00FFFF; /* Cyan for dialog */
}

#duel-log .special {
  color: #ed1eed; /* Magenta for special messages */
}

/* Fire Button */
#fire-button {
  font-size: 2vw; /* Smaller button font */
  padding: 0.75vw 1.5vw; /* Reduced button padding */
  background-color: #FF4500; /* Orangered */
  color: white;
  border: none;
  border-radius: 1vw;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 0 1vw 0.2vw rgba(255, 69, 0, 0.7);
  animation: subtlePulse 2s infinite;
  position: absolute;
  top: 58.1%;
  left: 46.7%;
  width: 7vw;
}

#fire-button:hover {
  background-color: #FF6347; /* Tomato */
}

/* Duel Summary */
#duel-summary {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 3vw 5vw;
  border-radius: 2vw;
  text-align: center;
  box-shadow: 0 0 2vw 0.5vw rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  z-index: 1002;
}

#duel-summary.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#duel-summary h2 {
  font-size: 3vw; /* Smaller heading font */
  margin-bottom: 1.5vw; /* Reduced margin */
  color: #FFD700; /* Gold */
}

#duel-summary p {
  font-size: 1.5vw; /* Smaller paragraph font */
  margin-bottom: 1.5vw; /* Reduced margin */
}

#duel-summary #continue-button {
  font-size: 2vw; /* Smaller button font */
  padding: 0.75vw 2vw; /* Reduced button padding */
  background-color: #008000; /* Green */
  color: white;
  border: none;
  border-radius: 1vw;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 0 1vw 0.2vw rgba(0, 128, 0, 0.7);
}

#duel-summary #continue-button:hover {
  background-color: #006400; /* Dark green */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Damage Pop-up */
.damage-popup {
  position: absolute;
  font-size: 4.5vw; /* Adjust size as needed */
  font-weight: bold;
  color: red;
  text-shadow: 0 0 0.5vw black;
  animation: damagePopupAnimation 1s ease-out; /* Add a fade-out animation */
  z-index: 1003; /* Ensure it's above other duel elements */
}

@keyframes damagePopupAnimation {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5vw); } /* Move up and fade out */
}

#round-display {
  position: absolute;
  top: 1.5vw;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2vw;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  background-color: rgba(0,0,0,0.7);
  padding: 0.2vw 0.5vw;
  border-radius: 2px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#bullet-counts {
  display: flex;
  justify-content: space-between;
  width: 90%;
  margin-top: 3vw;
  position: absolute;
}

#player-bullet-count, #pirate-bullet-count {
  font-size: 1.5vw;
  color: #fff;
  background-color: rgba(0,0,0,0.7);
  padding: 0.2vw 0.3vw;
  border-radius: 5px;
}

#duel-text {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4vw;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 10px #000;
  text-align: center;
  z-index: 1100;
}

#round-summary {
  position: absolute;
  top: 14%;
  left: 37%;
  transform: translate(-50%, -50%); 
  color: #fff;
  padding: 0vw;
  border-radius: 10px;
  text-align: left;
  z-index: 1100;
  width: 80vw;
}

#round-summary #agent-score { 
  position: absolute; 
  left: 31%;
  width: 30%;
}

#round-summary #pirate-score { 
  position: absolute; 
  left: 77%;
  width: 30%;
}

#round-summary h2 {
  font-size: 2vw;
  margin-bottom: 10px;
}

#round-summary p {
  font-size: 1.5vw;
  margin: 0.2 0;
}

#pirate-intro {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #FFF;
  z-index: 1000;
}

#pirate-intro img {
  width: 30vw;
  height: auto;
  margin-bottom: 2vw;
}

#pirate-intro h2 {
  font-size: 3vw;
  margin-bottom: 1vw;
  color: white;
}

#pirate-intro p {
  font-size: 2vw;
}



@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes subtlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* duel scoreboard */
#duel-scoreboard {
  position: absolute;
  top: 8vw;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.5vw 0.5vw;
  border-radius: 0.5vw;
  font-family: 'Arial', sans-serif;
  font-size: 1.2vw;
  display: flex;
  justify-content: space-between;
  width: 14vw;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  z-index: 500;
}

.score-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 45%;
}

.score-column h3 {
  margin: 0 0 1vw 0;
}

#player-current-score, #pirate-current-score {
  font-size: 2vw;
  font-weight: bold;
  margin-bottom: 0.5vw;
}

#player-current-score {
  color: #4CAF50;  /* Green for player */
}

#pirate-current-score {
  color: #F44336;  /* Red for pirate */
}

#player-rounds, #pirate-rounds {
  font-size: 1vw;
  text-align: center;
}

.duel-log-container {
  overflow-y: auto;
  padding: 0.2vw 0.4vw;
  border: 0.2vw solid #ffd700;
  border-radius: 1vw;
  font-size: 1.3vw;
  margin: 0.8vw 0 2vw;
  box-shadow: 0 0 2vw rgba(255, 215, 0, 0.3);
  background-color: rgba(0, 0, 0, 0.7);
}

.duel-log-entry {
  margin: 0.4vw 1vw;
  padding: 0.0vw;
  border-radius: 0.5vw;
  display: flex;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2vw;
  letter-spacing: -0.1vw;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-0.5vw); }
  to { opacity: 1; transform: translateY(0); }
}

.duel-log-icon { 
  margin-right: 0.8vw;
  width: 1vw;
}

.duel-log-content {
  flex-grow: 1;
}

.duel-log-timestamp, .duel-log-round {
  coor: silver;
  margin-right: 0.5vw;
  opacity: 0.7;
}

.duel-log-message {
  
}

.duel-log-attack { background-color: rgba(255, 0, 0, 0.2); }
.duel-log-defend { background-color: rgba(0, 0, 255, 0.2); }
.duel-log-focus { background-color: rgba(255, 255, 0, 0.2); }
.duel-log-taunt { background-color: rgba(255, 165, 0, 0.2); }
.duel-log-special { background-color: rgba(128, 0, 128, 0.2); }
.duel-log-result { background-color: rgba(0, 255, 0, 0.2); }
.duel-log-regular { background-color: rgba(255, 255, 255, 0.1); }

#final-score {
  margin: 0;
  padding:0;
  background: black;
  color: white;
  position: absolute;
}

#final-score h2 {
  margin: 0;
  padding:0;
}

#final-score p {
  margin: 0;
  padding:0;
}

#final-score h3 {
  margin: 0;
  padding:0;
}






/* INTRO */ 
.super-fullscreen-overlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 1);
z-index: 100; 
margin: 0;
padding: 0; 
}

.fullscreen-overlay {
position: absolute;
margin: 0 10%;
top: 0;
left: 0;
width: 80%;
height: 100%;
z-index: 101;  
perspective: 100vw;
}

#comic-panel { 
height: calc(100vw * 0.3575); 
background-size: contain; 
background-position: top;
background-repeat: no-repeat;
opacity: 0;
transform: scale(1.1) rotateX(10deg);
transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.25, 0.1, 0.32, 1.09);
overflow: hidden; 
}

/* Text for the panels */
#comic-panel-text {
position: absolute;
top: 1vw;
margin-top: 0.1vw;
right: 0;
padding: 0.3vw 1vw;
color: #000000;
font-size: 1.2vw;
text-align: left;
opacity: 0;
transform: translateY(-10px);
transition: opacity 1.2s ease, transform 1.2s ease;
background: #ffffff;
border-radius: 0px;
font-family: bangers;
border: 0.3vw solid black;
z-index: 102; 
}

/* Panel Transitions */
.panel-transition {
opacity: 1;
transform: scale(1) rotateX(0);
}


/* Smooth Lighting and Glow Effects */
.character.astra {
    /* Apply the glow effect using drop-shadow */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7)) 
            drop-shadow(0 0 20px #E91E63); /* Adjust glow size and color */

    /* Optionally add an animation for pulsating glow */
    animation: glowEffect 2s infinite alternate ease-in-out;
}

/* Animation for pulsating glow */
@keyframes glowEffect {
    from {
        filter: drop-shadow(0 0 5px #E91E63) 
                drop-shadow(0 0 10px #E91E63); /* Smaller glow at start */
    }
    to {
        filter: drop-shadow(0 0 15px rgb(255 71 134)) 
                drop-shadow(0 0 30px rgb(232 3 81)); /* Larger glow at peak */
    }
}


/* Text Animations */
@keyframes fadeInText {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}

/* Button Styles */
#comic-controls {
position: relative; 
margin-top: 0%;
margin-left: 55%;
transform: translateX(-50%);
display: flex;
gap: 2vw;

}

.comic-btn {
background-color: rgb(255 255 255 / 20%);
color: #fff;
padding: 1vw 1.5vw;
border: none;
cursor: pointer;
font-size: 1.8vw;
transition: background-color 0.3s ease, transform 0.3s ease;
backdrop-filter: blur(5px);
text-transform: uppercase;
letter-spacing: 1.5px;
border-radius: 1vw;
}

.comic-btn:hover {
background-color: rgba(255, 255, 255, 0.5);
transform: scale(1.1);
}

/* Cinematic Zoom */
@keyframes zoomIn {
from {
transform: scale(1.1);
}
to {
transform: scale(1);
}
}

#comic-panel.zoomIn {
animation: zoomIn 2s ease forwards;
}

/* Character Animations */
.character {
position: absolute;
bottom: 10%; 
left: 50%; 
width: 100%; 
height: auto;
opacity: 0;
transform: translateY(30px);  
z-index: 1000; 
  background-size: contain;
background-repeat: no-repeat; 
image-rendering: crisp-edges;   
transition: opacity 1.5s ease, transform 1.5s ease;
}

.character-show {
opacity: 1;
transform: translateY(0); 
}

#landing-page {
    /* Remove display: none; */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Bring to the front */
    /* Optional: For debugging */
    background-color: rgba(0, 0, 0, 0.5);
}

#landing-page h1 {
    color: white; /* Ensure contrast */
    font-size: 4rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    animation: fadeInText 2s ease-out forwards;
    /* Optional: For debugging */
    border: 2px solid red;
}

#landing-page button {
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    /* Optional: For debugging */
    border: 2px solid blue;
}

#landing-page button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}


/* Smooth Fade-In Transitions */
#comic-panel.fadeIn {
animation: fadeIn 2s ease forwards;
}

@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

/* Lighting Effects for Key Panels */
#comic-panel[background='stellar_transformation.jpg'] {
background: radial-gradient(circle, rgba(255, 240, 128, 1), rgba(0, 0, 0, 0.8)), url('stellar_transformation.jpg');
}

#comic-panel[background='princess_revealed.jpg'] {
background: radial-gradient(circle, rgba(255, 255, 128, 1), rgba(0, 0, 0, 0.9)), url('princess_revealed.jpg');
}

#comic-dialogue p.shortcut::after {
content: "";
position: absolute;  
transform: translateX(-50%); 
width: 0;
height: 0; 
}
 
/** CONTENT USED FOR CREATING ARROWS 
RIGHT {  
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

LEFT { 
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

TOP { 
top: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}

BOTTOM { 
bottom: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}
**/

#comic-dialogue {
position: relative; 
margin: 0;
padding: 0;
opacity: 0;
transform: translateY(2vw);
transition: opacity 1.2s ease, transform 1.2s ease;  
animation: fadeInText 0.8s ease forwards;
top: 0;
left: 0;  
}

#comic-dialogue p {    
top: 0;
left: 0;
font-family: "Bangers", system-ui; 
font-size: 1.2vw;  
color: #f6f9fa; 
background: white;
margin: 0;
padding: 1vw;      
display: inline-block;  
border-radius: 1vw; 
box-shadow: 0 0.2vw 0.4vw rgba(0, 0, 0, 0.3); 
letter-spacing: 0.1vw;
}

#comic-dialogue strong { 
font-weight: normal; 
margin-right: 0.4vw;
width: 5vw;
margin-top: -2.3vw;
  position: absolute;
  font-size: 1.8vw;
}

#comic-dialogue span { 
display: inline-block;   
margin-left: 0.5vw;
} 

#comic-dialogue p.stella-dialogue strong {  
  color: #e72a68;  
} 
#comic-dialogue p.ace-dialogue strong {  
  color: #03A9F4;  
} 
#comic-dialogue p.mysterious_voice-dialogue strong {   
  color: #673AB7;  
} 


#landing-page { 
  background: black; 
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
background-image: url('intro.jpg');
  background-size: cover;
}

#landing-page h1 { 
  border: 0; 
}

#landing-page button { 
  background: black;
  text-align: center;
}



/* ---------------------- */
/* Cape Canaveral Scene */
/* ---------------------- */
.cape_canaveral_1959#comic-panel-text { 
width: 75%;
}


/* ---------------------- */
/* Parking Lot Scene */
/* ---------------------- */
.parking_lot .ace { 
height: 85.64%; 
top: 14%; 
left: 44%; 
background-image: url('ace.png'); 
}

.parking_lot .character.stella {
display: none;
}

.parking_lot#comic-panel-text { 
width: 35%;
top: -0%;
left: 2%;
}

/** Parking Lot ACE DIALOGUES **/
.parking_lot#comic-dialogue p#ace-dialogue-0 {
position: absolute;
margin-top: -44%;
margin-left: 50%;
width: 40vw; 
}

.parking_lot#comic-dialogue p#ace-dialogue-0::after {
bottom: -1vw;
left: 32%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.parking_lot#comic-dialogue p#ace-dialogue-2 {
position: absolute;
margin-top: -30%;
margin-left: 70%;
width: 15vw; 
}

.parking_lot#comic-dialogue p#ace-dialogue-2::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

/** Parking Lot STELLA DIALOGUES **/
.parking_lot#comic-dialogue p#stella-dialogue-1 {
position: absolute;
margin-top: -31%;
margin-left: 10%;
width: 30vw; 
}

.parking_lot#comic-dialogue p#stella-dialogue-1::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.parking_lot#comic-dialogue p#stella-dialogue-3 {
position: absolute;
margin-top: -20%;
margin-left: 18%;
width: 20vw; 
}

.parking_lot#comic-dialogue p#stella-dialogue-3::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}
 


/* ---------------------- */
/* Rocket Launch Scene */
/* ---------------------- */
.rocket_launch#comic-panel-text { 
width: 12%;
top: -0%;
left: 2%;
}
.rocket_launch .ace { 
height: 85.64%; 
top: 14%; 
left: 44%; 
background-image: url('ace_rocket_launch.png');  
}

.rocket_launch .stella { 
height: 85.64%; 
top: 14%; 
left: 34%; 
background-image: url('stella_rocket_launch.png');  
}

.rocket_launch#comic-dialogue p#ace-dialogue-0 {
position: absolute;
margin-top: -42%;
margin-left: 45%;
width: 40vw; 
}

.rocket_launch#comic-dialogue p#ace-dialogue-0::after {
bottom: -1vw;
left: 30%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.rocket_launch#comic-dialogue p#stella-dialogue-1 {
position: absolute;
margin-top: -35%;
margin-left: 25%;
width: 20vw; 
}

.rocket_launch#comic-dialogue p#stella-dialogue-1::after {
bottom: -1vw;
left: 80%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.rocket_launch#comic-dialogue p#ace-dialogue-2 {
position: absolute;
margin-top: -28%;
margin-left: 70%;
width: 20vw; 
}

.rocket_launch#comic-dialogue p#ace-dialogue-2::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

.rocket_launch#comic-dialogue p#stella-dialogue-3 {
position: absolute;
margin-top: -21%;
margin-left: 10%;
width: 20vw; 
}

.rocket_launch#comic-dialogue p#stella-dialogue-3::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.rocket_launch#comic-dialogue p#ace-dialogue-4 {
position: absolute;
margin-top: -15%;
margin-left: 70%;
width: 12vw; 
}

.rocket_launch#comic-dialogue p#ace-dialogue-4::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}



/* ---------------------- */
/* Cosmic Anomaly Scene */
/* ---------------------- */
.cosmic_anomaly#comic-panel-text { 
width: 12%;
top: -0%;
left: 2%;
}
.cosmic_anomaly .ace { 
height: 85.64%; 
top: 14%; 
left: 54%; 
background-image: url('ace_cosmic_anomaly.png');  
}

.cosmic_anomaly .stella { 
height: 85.64%; 
top: 14%; 
left: 40%; 
background-image: url('stella_cosmic_anomaly.png');  
}

.cosmic_anomaly#comic-dialogue p#ace-dialogue-0 {
position: absolute;
margin-top: -43.5%;
margin-left: 55%;
width: 40vw; 
}

.cosmic_anomaly#comic-dialogue p#ace-dialogue-0::after {
bottom: -1vw;
left: 30%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.cosmic_anomaly#comic-dialogue p#stella-dialogue-1 {
position: absolute;
margin-top: -21%;
margin-left: 10%;
width: 20vw; 
}

.cosmic_anomaly#comic-dialogue p#stella-dialogue-1::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.cosmic_anomaly#comic-dialogue p#ace-dialogue-2 {
position: absolute;
margin-top: -12.5%;
margin-left: 65%;
width: 20vw; 
}

.cosmic_anomaly#comic-dialogue p#ace-dialogue-2::after {
top: -1vw;
left: 25%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}

/* ---------------------- */
/* Stellar Transformation Scene */
/* ---------------------- */
 
.stellar_transformation#comic-panel-text { 
width: 12%;
top: -0%;
left: 2%;
}
.stellar_transformation .ace { 
height: 85.64%; 
top: 14%; 
left: 54%; 
background-image: url('ace_stellar_transformation.png');  
}

.stellar_transformation .stella_transforming { 
height: 105.64%; 
top: -5.8%; 
left: 14%; 
background-image: url('astra_stellar_transformation.png');  
z-index: 10000;
}
 

.stellar_transformation .mysterious_voice { 
height: 85.64%; 
top: 11.9%; 
left: 14.4%; 
background-image: url('mysterious_voice_stellar_transformation.png');  
}

.stellar_transformation#comic-dialogue p#stella-dialogue-0 {
position: absolute;
margin-top: -32.5%;
margin-left: 19%;
width: 10vw; 
}

.stellar_transformation#comic-dialogue p#stella-dialogue-0::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.stellar_transformation#comic-dialogue p#ace-dialogue-1 {
position: absolute;
margin-top: -38.5%;
margin-left: 58%;
width: 30vw; 
}

.stellar_transformation#comic-dialogue p#ace-dialogue-1::after {
bottom: -1vw;
left: 41%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.stellar_transformation#comic-dialogue p#mysterious_voice-dialogue-2 {
    position: absolute;
    margin-top: -18.5%;
    margin-left: 18%;
    width: 30vw;


    /* Bubble style */
    color: rgba(255, 255, 255, 0.9); /* Faded white text */
    font-size: 2vw; /* Scales with viewport width */
    font-style: italic;
    text-align: center;

    /* Mysterious glow effect */
    box-shadow: 0 0 2vw rgba(255, 255, 255, 0.8), 0 0 7vw rgba(0, 0, 255, 0.9); /* Outer glow */
    
    /* Bubble background effect */
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent dark background */
    border-radius: 50%; /* Circular/oval shape */
    border: 2px solid rgba(255, 255, 255, 0.7); /* Light border for added contrast */
    
    /* Wavy/distorted border for cosmic effect */
    filter: url(#wavy-effect); /* Assuming you have an SVG filter applied */
    
    /* Fade-in effect */
    opacity: 0; /* Start invisible */
    transform: translateY(20px); /* Start slightly below */
    transition: opacity 2s ease, transform 2s ease;
   padding: 2vw;
}

/* Adding a keyframe for a subtle wavy effect on the bubble */
@keyframes waveAnimation {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); } /* Gentle float up */
    100% { transform: translateY(0) scale(1); }
}

/* Apply the animation */
.stellar_transformation #comic-dialogue p#mysterious_voice-dialogue-2.appear {
    opacity: 1;
    transform: translateY(0);
    animation: waveAnimation 4s infinite ease-in-out; /* Infinite subtle floating */
}


.stellar_transformation#comic-dialogue p#mysterious_voice-dialogue-1::after {
bottom: -1vw;
left: 41%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}



/* ---------------------- */
/* Princess Revealed Scene */
/* ---------------------- */
.princess_revealed {
}
.princess_revealed_transformation#comic-panel-text { 
width: 12%;
top: -0%;
left: 2%;
}
.princess_revealed .astra { 
height: 120.64%; 
top: -18%; 
left: 0%; 
background-image: url('astra_princess_revealed.png');  
}
.princess_revealed .ace { 
height: 150.64%; 
top: -48%; 
left: 40%; 
background-image: url('ace_princess_revealed.png');  
}

.princess_revealed#comic-dialogue p#ace-dialogue-0 {
position: absolute;
margin-top: -38.5%;
margin-left: 70%;
width: 30vw; 
}

.princess_revealed#comic-dialogue p#ace-dialogue-0::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

.princess_revealed#comic-dialogue p#astra-dialogue-1 {
position: absolute;
margin-top: -29.5%;
margin-left: 34%;
width: 15vw; 
}

.princess_revealed#comic-dialogue p#astra-dialogue-1::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

.princess_revealed#comic-dialogue p#ace-dialogue-2 {
position: absolute;
margin-top: -15.5%;
margin-left: 82%;
width: 20vw; 
}

.princess_revealed#comic-dialogue p#ace-dialogue-2::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}


.princess_revealed#comic-dialogue p#astra-dialogue-3 {
position: absolute;
margin-top: -9.5%;
margin-left: 4%;
width: 25vw; 
}

.princess_revealed#comic-dialogue p#astra-dialogue-3::after {
top: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}


/* ---------------------- */
/* Void Imperium Scene */
/* ---------------------- */
.void_imperium#comic-panel-text { 
width: 32%;
top: -0%;
left: 2%;
}

.void_imperium {
}
.void_imperium .astra { 
height: 85.64%; 
top: 15%; 
left: 0%; 
background-image: url('astra_void_imperium.png');  
}
.void_imperium .ace { 
height: 100.64%; 
top: 0%; 
left: 30%; 
background-image: url('ace_void_imperium.png');  
z-index: 1001;
}


.void_imperium#comic-dialogue p#astra-dialogue-0 {
position: absolute;
margin-top: -12.5%;
margin-left: 1%;
width: 25vw; 
}

.void_imperium#comic-dialogue p#astra-dialogue-0::after {
top: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}


.void_imperium#comic-dialogue p#ace-dialogue-1 {
position: absolute;
margin-top: -15.5%;
margin-left: 52%;
width: 20vw; 
}

.void_imperium#comic-dialogue p#ace-dialogue-1::after {
top: -1vw;
left: 25%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}


/* ---------------------- */
/* Kidnap Scene */
/* ---------------------- */
.kidnap#comic-panel-text { 
width: 32%;
top: -0%;
left: 2%;
}
 
.kidnap .astra { 
height: 115.64%; 
top: -10%; 
left: 20%; 
background-image: url('astra_kidnap.png');  
}
.kidnap .ace { 
height: 100.64%; 
top: 0%; 
left: 50%; 
background-image: url('ace_kidnap.png');  
z-index: 1001;
}

.kidnap#comic-dialogue p#astra-dialogue-0 {
position: absolute;
margin-top: -32.5%;
margin-left: 9%;
width: 20vw; 
}

.kidnap#comic-dialogue p#astra-dialogue-0::after {
bottom: -1vw;
left: 90%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

.kidnap#comic-dialogue p#ace-dialogue-1 {
position: absolute;
margin-top: -28.5%;
margin-left: 79%;
width: 20vw; 
}

.kidnap#comic-dialogue p#ace-dialogue-1::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

.kidnap#comic-dialogue p#void_captain-dialogue-2 {
position: absolute;
margin-top: -22.5%;
margin-left: 5%;
width: 10vw; 
}

.kidnap#comic-dialogue p#void_captain-dialogue-2::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.kidnap#comic-dialogue p#ace-dialogue-3 {
position: absolute;
margin-top: -12.5%;
margin-left: 65%;
width: 10vw; 
}

.kidnap#comic-dialogue p#ace-dialogue-3::after {
top: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}



/* ---------------------- */
/* Void Fight Scene */
/* ---------------------- */ 
.void_fight#comic-panel-text { 
width: 32%;
top: -0%;
left: 2%;
}
 
 
.void_fight .ace { 
height: 100.64%; 
top: 0%; 
left: 46%; 
background-image: url('ace_void_fight.png');  
z-index: 1001;
}

 

.void_fight .void_soldiers { 
height: 110.64%; 
top: -10%; 
left: 0%; 
background-image: url('void_soldier_void_fight.png');  
z-index: 1000;
}


.void_fight#comic-dialogue p#void_soldier-dialogue-0 {
position: absolute;
margin-top: -32.5%;
margin-left: 30%;
width: 10vw; 
}

.void_fight#comic-dialogue p#void_soldier-dialogue-0::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.void_fight#comic-dialogue p#ace-dialogue-1 {
position: absolute;
margin-top: -30.5%;
margin-left: 90%;
width: 15vw; 
}

.void_fight#comic-dialogue p#ace-dialogue-1::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}

.void_fight#comic-dialogue p#void_soldier-dialogue-2 {
position: absolute;
margin-top: -22.5%;
margin-left: -5%;
width: 10vw; 
}

.void_fight#comic-dialogue p#void_soldier-dialogue-2::after {
top: 50%; 
right: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-left: 1.5vw solid #f2ecee;
}

.void_fight#comic-dialogue p#ace-dialogue-3 {
position: absolute;
margin-top: -10.5%;
margin-left: 55%;
width: 15vw; 
}

.void_fight#comic-dialogue p#ace-dialogue-3::after {
top: -1vw;
left: 80%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-bottom: 1.5vw solid #f2ecee;
}


/* ---------------------- */
/* Desperation Scene */
/* ---------------------- */
.desperation#comic-panel-text { 
width: 12%;
top: 20%;
left: 5%;
}
 
.desperation .ace { 
height: 100.64%; 
top: 0%; 
left: 16%; 
background-image: url('ace_desperation.png');  
z-index: 1001;
}

.desperation .void_soldiers { 
height: 75.64%; 
top: -10%; 
left: 55%; 
background-image: url('portal_desperation.png');  
z-index: 1002;
}

.desperation#comic-dialogue p#ace-dialogue-0 {
position: absolute;
margin-top: -20.5%;
margin-left: 45%;
width: 35vw; 
}

.desperation#comic-dialogue p#ace-dialogue-0::after {
top: 50%; 
left: -1vw;
transform: translateY(-50%);  
border-top: 1vw solid transparent;
border-bottom: 1vw solid transparent;
border-right: 1.5vw solid #f2ecee;
}


/* ---------------------- */
/* Car Transformation Scene */
/* ---------------------- */
.ace_transformation#comic-panel-text { 
width: 45%;
top: -0%;
left: -5%;
}
 
 
.ace_transformation .ace { 
height: 100.64%; 
top: 0%; 
left: 46%; 
background-image: url('ace_ace_transformation.png');  
z-index: 1001;
}

.ace_transformation .chevy1 { 
height: 65.64%; 
top: 10%; 
left: 10%; 
background-image: url('chevy1_ace_transformation.png');  
z-index: 1000;
}


.ace_transformation#comic-dialogue p#mysterious_voice-dialogue-0 {
    position: absolute;
    margin-top: -20.5%;
    margin-left:-10%;
    width: 30vw;


    /* Bubble style */
    color: rgba(255, 255, 255, 0.9); /* Faded white text */
    font-size: 2vw; /* Scales with viewport width */
    font-style: italic;
    text-align: center;

    /* Mysterious glow effect */
    box-shadow: 0 0 2vw rgba(255, 255, 255, 0.8), 0 0 7vw rgba(0, 0, 255, 0.9); /* Outer glow */
    
    /* Bubble background effect */
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent dark background */
    border-radius: 50%; /* Circular/oval shape */
    border: 2px solid rgba(255, 255, 255, 0.7); /* Light border for added contrast */
    
    /* Wavy/distorted border for cosmic effect */
    filter: url(#wavy-effect); /* Assuming you have an SVG filter applied */
    
    /* Fade-in effect */
    opacity: 0; /* Start invisible */
    transform: translateY(20px); /* Start slightly below */
    transition: opacity 2s ease, transform 2s ease;
   padding: 2vw;
}

.ace_transformation#comic-dialogue p#mysterious_voice-dialogue-0::after {
display: none;
}

.ace_transformation#comic-dialogue p#ace-dialogue-1 {
position: absolute;
margin-top: -42.5%;
margin-left: 55%;
width: 35vw; 
}

.ace_transformation#comic-dialogue p#ace-dialogue-1::after {
bottom: -1vw;
left: 50%;
transform: translateX(-50%);  
border-left: 1vw solid transparent;
border-right: 1vw solid transparent;
border-top: 1.5vw solid #f2ecee;
}

 

 

/* ---------------------- */
/* Hero Rising Scene */
/* ---------------------- */
 
.hero_rise#comic-panel-text { 
width: 45%;
top: -0%;
left: -5%;
}
 
 
.hero_rise .ace { 
height: 45.64%; 
top: 40%; 
left: 18%; 
background-image: url('ace_hero_rise.png');  
z-index: 1001;
}

.hero_rise .chevy2 { 
height: 85.64%; 
top: 10%; 
left: 27%; 
background-image: url('starship_hero_rise.png');  
z-index: 1000;
}

/* ---------------------- */
/* Universe  Scene */
/* ---------------------- */
.universe#comic-panel-text { 
width: 45%;
top: -0%;
left: -5%;
}

.universe .ace { 
height: 95.64%; 
top: 15%; 
left: 8%; 
background-image: url('ace_universe.png');  
z-index: 1000;
}

.universe .starship { 
height: 65.64%; 
top: 10%; 
left: 42%; 
background-image: url('starship_universe.png');  
z-index: 1000;
}

/* ---------------------- */
/* Add this to your mini.css file */
/* ===== 2025 SOPHISTICATED LANDING PAGE ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --primary-bg: rgba(0, 0, 0, 0.4);
  --glass-light: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --success-green: #10b981;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.25);
  --border-radius: 16px;
  --max-container-width: 1288px;
}

/* Container Constraint */
body {
  max-width: var(--max-container-width);
  margin: 0 auto;
}

#initial-landing-page {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-container-width);
  height: 100vh;
  z-index: 99999;
  
  /* Preserve the user's beautiful background */
  background-image: url('intro.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
  /* Dark overlay for text readability */ 
  background-blend-mode: multiply;
  
  /* Perfect centering */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
}

/* Main Title - 2025 Typography Hierarchy */
#initial-landing-page h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--text-primary);
  margin: 0 0 3rem 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  
  /* Subtle depth without overdoing it */
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  
  /* Minimal animation - just a gentle fade in */
  opacity: 0;
  animation: fadeInUp 1.2s ease-out 0.3s forwards;
}

/* Loading Indicator - Clean Glass Design */
#loading-indicator {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-secondary);
  
  /* Modern glassmorphism - subtle and clean */
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1rem 2rem;
  margin-bottom: 3rem;
  
  /* Minimal shadow */
  box-shadow: 0 8px 32px var(--shadow-light);
  
  /* Subtle pulse - not overwhelming */
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.6s forwards, subtlePulse 2s ease-in-out infinite;
}

/* Button Container */
.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.9s forwards;
}

/* 2025 Button Design - Clean and Modern */
#initial-landing-page button {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  
  /* Clean sizing */
  padding: 1rem 2.5rem;
  min-width: 240px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  
  /* Modern glassmorphism button */
  background: var(--glass-light);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  
  /* Clean transitions - no bouncing or scaling */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Subtle shadow */
  box-shadow: 0 4px 16px var(--shadow-medium);
  
  /* Icon spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Primary Button Accent */
#play-intro-btn {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: white;
}

/* Secondary Button */
#start-adventure-btn {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

/* Hover States - Subtle and Professional */
#initial-landing-page button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow-medium);
}

#play-intro-btn:hover {
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

#start-adventure-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Disabled State */
#initial-landing-page button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#initial-landing-page button:disabled:hover {
  transform: none;
  box-shadow: 0 4px 16px var(--shadow-medium);
}

/* Active State */
#initial-landing-page button:active {
  transform: translateY(0);
}

/* Animations - Minimal and Purposeful */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtlePulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Responsive Design - Mobile First */
/* Responsive Design - Mobile First */
@media (min-width: 768px) {
  .landing-buttons {
    flex-direction: row;
    gap: 1rem; /* Reduced from 1.5rem for natural spacing */
    justify-content: center;
  }
}

@media (max-width: 767px) {
  #initial-landing-page {
    padding: 1.5rem;
  }
  
  #initial-landing-page h1 {
    margin-bottom: 2rem;
  }
  
  #loading-indicator {
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
    margin-bottom: 2rem;
  }
  
  .landing-buttons {
    align-items: center;
  }
  
  #initial-landing-page button {
    width: 100%;
    max-width: 280px;
    /* NO margin auto here either */
  }
}

/* Accessibility - Respect User Preferences */
@media (prefers-reduced-motion: reduce) {
  #initial-landing-page h1,
  #loading-indicator,
  .landing-buttons {
    animation: none;
    opacity: 1;
  }
  
  #loading-indicator {
    animation: none;
  }
  
  #initial-landing-page button {
    transition: opacity 0.2s ease;
  }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  #initial-landing-page button {
    border: 2px solid white;
  }
  
  #loading-indicator {
    border: 1px solid white;
  }
}

/* Container width constraint for all elements */
.main-container {
  max-width: var(--max-container-width);
  margin: 0 auto;
}

/* Hide main container initially */
.main-container {
    display: none;
}

/* ===== LARGE SCREEN CONSTRAINT - CAP GROWTH AT 1288PX ===== */
@media (min-width: 1289px) {
  
  /* ===== LANDING PAGE FIXES ===== */
  #initial-landing-page h1 {
    font-size: 4.5rem; /* Cap at the max value from clamp */
  }
  
  /* ===== MAIN GAME INTERFACE FIXES ===== */
  
  /* Grid cells - prevent them from becoming huge */
  .grid-cell {
    font-size: 2.5rem; /* Cap emoji size */
    border-width: 0.1rem; /* Keep border consistent */
  }
  
  /* Character art containers */
  .hero, .princess, .heroandprincess {
    width: 33%;
    max-width: 425px; /* Calculated: 33% of 1288px */
  }
  
  /* Environment display */
  .environment-display {
    width: 65%;
    max-width: 837px; /* Calculated: 65% of 1288px */
  }
  
  /* Font sizes - cap all viewport-relative typography */
  .intro {
    font-size: 1rem; /* Cap from 1.2vw */
  }
  
  /* Legend and input elements */
  .legend .custom-emoji {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  div.input-label {
    font-size: 0.9rem;
    line-height: 1.2rem;
    height: 1.5rem;
  }
  
  .legend-group h4 {
    font-size: 1rem;
  }
  
  .number-input-wrapper button {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 1rem;
  }
  
  .number-input-wrapper input[type="number"] {
    height: 1.3rem;
    font-size: 1rem;
  }
  
  /* Status display */
  .status-display {
    font-size: 1.6rem;
    height: 7rem; /* Cap from 7vw */
  }
  
  /* Control buttons */
  .control-button {
    padding: 1rem;
    font-size: 0.8rem;
    margin: 0.4rem 0.5rem 0;
  }
  
  #close-settings {
    padding: 0.5rem;
    font-size: 1.5rem;
    margin: 1.4rem 0.5rem 0;
  }
  
  /* Combat overlay elements */
  #all-combat-entities {
    height: 35rem; /* Cap from 35vw */
  }
  
  .combat-entity {
    padding: 1rem 1rem 1rem 3rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 2rem rgba(255, 215, 0, 0.3);
    height: 8rem;
  }
  
  .entity-name {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 0.2rem 0.2rem 0.2rem rgba(0, 0, 0, 0.7);
  }
  
  #combat-overlay .hp-bar {
    height: 1.2rem;
    margin-bottom: 0.5rem;
  }
  
  .hp-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
   
  
  /* Duel overlay elements */
  #duel-countdown {
    font-size: 10rem; /* Cap from 10vw */
  }
  
  #duel-overlay #duel-scene {
    height: 40rem; /* Cap from 40vw */
  }
  
  #duel-overlay #duel-characters img {
    width: 19rem; /* Cap from 19vw */
  }
  
  #duel-overlay #player-hp-bar-container, 
  #duel-overlay #pirate-hp-bar-container {
    height: 2rem; /* Cap from 2vw */
  }
  
  #duel-overlay .hp-bar {
    font-size: 1.4rem;
    height: 5rem;
  }
  
  #player-accuracy-bar, #pirate-accuracy-bar {
    height: 2.5rem;
  }
  
  #duel-tension-bar {
    height: 1.5rem;
  }
  
  #duel-log {
    height: 20rem; /* Cap from 20vw */
    font-size: 1rem;
  }
  
  #fire-button {
    font-size: 2rem;
    padding: 0.75rem 1.5rem;
    width: 7rem;
  }
  
  /* Leaderboard elements */
  .leaderboard-display .nickname {
    font-size: 1.7rem;
    letter-spacing: -0.6rem;
  }
  
  .leaderboard-display .scores {
    width: 11.8rem;
    font-size: 0.9rem;
    padding: 1.5% 5.8%;
    height: 4.5rem;
  }
  
  .leaderboard-display .scores b {
    font-size: 1.2rem;
  }
  
  .leaderboard-display h3 {
    font-size: 1.4rem;
  }
  
  /* Episode history and Q-table displays */
  #monte-carlo-results h4 {
    font-size: 1.5rem;
    border-bottom: 0.4rem solid #7289da;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  
  #monte-carlo-results p {
    font-size: 1.2rem;
    padding: 0.5rem 0;
  }
  
  #episode-history h3,
  .q-table-display h3 {
    font-size: 2rem;
    border-bottom: 0.4rem solid #7289da;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
  }
  
  .episode-history-content div {
    font-size: 1.2rem;
    padding: 0.8rem 0;
    border-bottom: 0.1rem solid #4f4f4f;
  }
  
  .q-table {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
  }
  
  .q-table-container h4 {
    font-size: 1.5rem;
  }
  
  .q-table-item {
    border-radius: 1rem;
    padding: 1rem;
    border: 0.2rem solid #444;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
  }
  
  .q-table-item pre {
    font-size: 1rem;
  }
  
  /* Inventory elements */
  .inventory-toggle {
    width: 15rem;
    height: 16rem;
    margin-left: -18rem;
    margin-top: 22rem;
  }
  
  .inventory-item[draggable="true"] {
    border: 0.3rem dashed #ccc;
    margin: 1rem;
    width: 4rem;
    font-size: 1.5rem;
  }
  
  .inventory-icon {
    width: 4rem;
    height: 4rem;
  }
  
  .inventory span {
    padding: 0.2rem 0.3rem;
    font-size: 1rem;
  }
  
  /* Energy bars */
  .bar {
    height: 0.5rem;
  }
  
  .energy-bar {
    top: -0.5rem;
    width: 80%;
    height: 0.4rem;
    border-radius: 0.2rem;
  }
  
  .energy-block {
    height: 2rem;
  }
  
  /* Portal and rocket bars */
  .portal-energy,
  .portal-hp,
  .rocket-hp,
  .rocket-energy {
    height: 0.4rem;
    border-radius: 3px;
  }
  
  /* Comic dialogue elements */
  #comic-dialogue p {
    font-size: 1.2vw;
    padding: 1rem; 
    letter-spacing: 0.1rem;
  }
  
  #comic-dialogue strong {
    margin-right: 0.4rem;
    width: 5rem;
    margin-top: -2.3rem;
    font-size: 1.8rem;
  }
  
  #comic-dialogue span {
    margin-left: 0.5rem;
  }
  
  /* Death overlay elements */
  .death-description {
    font-size: 2rem;
    line-height: 2.5rem;
    margin-bottom: 2rem;
  }
  
  .death-button {
    padding: 0.5rem 2rem;
    font-size: 1.5rem;
    margin-top: 1rem;
  }
  
  /* Hide/show elements */
  .hide-lb {
    font-size: 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
  }
  
  /* Combat log elements */
  .combat-log-container {
    height: 15rem;
    padding: 0.2rem 0.4rem;
    border: 0.2rem solid #7289da;
    border-radius: 1rem;
    font-size: 1.3rem;
    margin: 0.8rem 0;
    box-shadow: 0 0 2rem rgba(114, 137, 218, 0.3);
  }
  
  .combat-log-icon {
    margin-right: 0.8rem;
  }
  
  .combat-log-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
  }
  
  /* Lives display */
  .lives-display, .combat-lives-display {
    font-size: 3rem;
    padding: 1% 1.5%;
  }
  
  #combat-overlay .combat-lives-display {
    width: 40%;
    margin: 0.5rem 0 0 1rem;
    font-size: 1.5rem;
    height: 6%;
  }
  
  /* Turn order display */
  #turn-order-display {
    font-size: 1.5rem;
    margin: 0.5rem 0 0 0rem;
    width: 40%;
    left: 55%;
    height: 6%;
  }
  
  /* Damage popup */
  .damage-popup {
    font-size: 4.5rem;
    animation: damagePopupAnimation 1s ease-out;
  }
  
  @keyframes damagePopupAnimation {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-5rem); }
  }
  
  /* Duel summary */
  #duel-summary {
    padding: 3rem 5rem;
    border-radius: 2rem;
    box-shadow: 0 0 2rem 0.5rem rgba(0, 0, 0, 0.8);
  }
  
  #duel-summary h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
  }
  
  #duel-summary p {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  #duel-summary #continue-button {
    font-size: 2rem;
    padding: 0.75rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 1rem 0.2rem rgba(0, 128, 0, 0.7);
  }
}

/* ===== LUCASARTS-STYLE ANIMATED LOADING ===== */
@keyframes rocket-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-8px) rotate(-5deg); }
  60% { transform: translateY(-4px) rotate(5deg); }
}

@keyframes alien-wobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(5deg) scale(1.1); }
  75% { transform: rotate(-5deg) scale(0.9); }
}

@keyframes wrench-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes satellite-orbit {
  0% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(4px) rotate(90deg); }
  50% { transform: translateX(0) rotate(180deg); }
  75% { transform: translateX(-4px) rotate(270deg); }
  100% { transform: translateX(0) rotate(360deg); }
}

@keyframes robot-dance {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg) translateY(-2px); }
  50% { transform: rotate(0deg) translateY(-4px); }
  75% { transform: rotate(-10deg) translateY(-2px); }
}

@keyframes loading-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.loading-icon {
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

.loading-icon.rocket { animation: rocket-bounce 2s infinite ease-in-out; }
.loading-icon.alien { animation: alien-wobble 3s infinite ease-in-out; }
.loading-icon.wrench { animation: wrench-spin 2s infinite linear; }
.loading-icon.satellite { animation: satellite-orbit 4s infinite ease-in-out; }
.loading-icon.robot { animation: robot-dance 1.5s infinite ease-in-out; }
.loading-icon.pulse { animation: loading-pulse 1s infinite ease-in-out; }

#loading-indicator {
  transition: all 0.3s ease-out;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0.5rem 0;
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  width: 0%;
  transition: width 0.3s ease-out;
  border-radius: 2px;
}
 
  /*
    This CSS rule defines a container that is positioned far off the visible screen.
    The browser will still process its content (the <img> tags),
    causing the images to be downloaded and cached. This works alongside your
    existing JavaScript preloader.
  */
  .secret-preloader-container {
    position: absolute;
    left: -9999px; 
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  } 