html, body {
  zoom: 100%;
}

/* Modal Header: Title + Close Button */

/* Title Bar and Text */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1f1e1e;
  padding: 10px 20px 10px 16px;
}

.modal-header h2 {
  margin: 0; /* remove default margin */
  font-size: 18px;
  font-weight: bold;
}

.modal-close {
  display: none; /* 👈 Hides the X by default */
  color: #aaa;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 20px;
}

.modal-close:hover,
.modal-close:focus {
  color: #333;
}

/* 
   By default, .modal-body is not forced into a two-column layout.
   We only add the two-column layout when we do: 
   modalBody.classList.add("settings-layout");
*/
.modal-body {
  /* no special layout here by default */
  padding: 20px;
  /* you can set a min-height if you want at least some vertical space:
     min-height: 150px; 
  */
}

/* Make the Settings Modal narrower */
/* Restrict the entire settings modal width */
.modal.settings-modal-wrapper .modal-content {
  max-width: 550px;
  margin: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  position: fixed;
  background: #fff;
  border-radius: 8px;
}

.modal.settings-modal-wrapper .modal-body {
  padding: 0 !important;
}

/* --- Settings Modal Sidebar Layout --- */
.modal-body.settings-layout {
  display: flex;
  min-height: 300px;
  background-color: #fff;
  border-radius: 0;
  overflow: hidden;
}

/* Sidebar styles */
.modal-settingsidebar {
  width: 150px; /* fixed width */
  background-color: #2c3e50;
  color: white;
}

.modal-settingsidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-settingsidebar li {
  padding: 12px 16px;
  text-indent: 10px;
  border-bottom: 1px solid #34495e;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}

.modal-settingsidebar li:hover {
  background-color: #34495e;
}

/* Main content panel (first shown when Settings is clicked) */
.modal-settingscontent {
  flex: 1;
  overflow-y: auto;
  color: #333;
  justify-content: center;
  margin-top: 0px;
  padding: clamp(8px, 4vw, 20px);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Updated slider styling with clamp() + horizontal padding for spacing */

/* Container for each row:
   <div class="slider-row">
     <div class="volume-label">Master Volume <span class="volume-value">100</span></div>
     <input type="range" ...>
   </div>
*/

.slider-row {
  display: flex;
  flex-direction: column;
  /* space at bottom to separate rows */
  margin-bottom: clamp(8px, 2vw, 20px);
  /* left/right padding so slider doesn't hug the modal edges */
  padding-left: clamp(8px, 2vw, 24px);
  padding-right: clamp(8px, 2vw, 24px);
}

/* The label row with the volume name and numeric value on a single line */
.volume-label {
  display: flex;
  justify-content: space-between;
  font-size: clamp(14px, 1.8vw, 16px);
  margin-bottom: clamp(4px, 1vw, 10px);
  color: #2c2c2c;
}

.volume-label .volume-value {
  margin-left: 8px;
  font-weight: bold;
  font-size: clamp(14px, 1.8vw, 16px);
  color: #4f4f4f;
}

/* The slider track & thumb styling */
.slider-row input[type="range"] {
  width: 100%;
  height: clamp(4px, 1.2vw, 80px);
  margin-top: clamp(2px, 0.5vw, 4px);
  border-radius: 5px;
  background: #ddd;        /* track color */
  accent-color: #8B4513;   /* thumb color in modern browsers */
  outline: none;
  cursor: pointer;         /* pointer when hovering slider */
}

/* Cross-browser thumb styling (Chrome, Firefox, Edge) */
.slider-row input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  border-radius: 20%;
  background: #29333b;
  border: 2px solid #29333b;
  cursor: pointer;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 20%;
  background: #29333b;
  border: 2px solid #29333b;
  cursor: pointer;
}
.slider-row input[type="range"]::-ms-thumb {
  width: 17px;
  height: 17px;
  border-radius: 20%;
  background: #29333b;
  border: 2px solid #29333b;
  cursor: pointer;
}

/* Settings Tab - Display Locked & Unlocked Card Decks */
#card-style-status h3 {
  margin-top: 16px;
  font-size: 18px;
  color:black;
}

#card-style-status ul {
  list-style-type: none;
  padding: 0;
  margin-bottom: 12px;
  color:black;
}

#card-style-status li {
  padding: 4px 0;
  color:black;
}

#unlocked-deck-list,
#locked-deck-list {
  color: black;
  font-weight: 500;
  margin-left: 10px;
}

#settings-content h3 {
  color: #333;
}

#unlocked-deck-list li,
#locked-deck-list li {
  color: #333;
  font-weight: normal;
}

.deck-list-group {
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

.deck-list-group ul {
  list-style: disc;
  padding-left: 20px;
}

.deck-list-group li {
  color: #333 !important; /* 👈 this forces black even if something else overrides it */
}

.reset-content p {
  color: #333;
  font-size: 16px;
  text-align: center;
  margin: 0 0 10px 0;
}

.reset-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.reset-buttons button {
  font-size: 16px;  /* Make text larger */
  padding: 10px 20px;  /* Increase button padding */
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: #007BFF;  /* Default blue color */
  color: white;
  transition: background-color 0.2s ease-in-out;
}

.reset-buttons button:hover {
  background-color: #0056b3;  /* Darker blue on hover */
}

/* If you want to make the No button a different color */
#reset-no {
  background-color: #1B2A49;  /* Red */
}

#reset-no:hover {
  background-color: #0F1A30;  /* Darker red on hover */
}

/*                              */
/* Style for Introduction Modal */
/*                              */
/* --- Introduction Modal --- */
#introduction-modal .modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

#introduction-modal .modal-header h2 {
  margin-top: 0;
  font-size: 24px;
  color: #2c3e50;
}

#introduction-modal .modal-body p {
  font-size: 16px;
  color: #555;
  margin-bottom: 20px;
}

#intro-next {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#intro-next:hover {
  background-color: #219150;
}

html, body {
  zoom: 100%;
}

/* ------- Deck Styles Modal ------- */
#deck-styles-modal .modal-content {
  padding: 0;
  margin: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  position: fixed;
  background: #fff;
  border-radius: 8px;
}

#deck-styles-modal .modal-body {
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Scrolling panel with clean edge and visible scrollbar */
#deck-styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  justify-content: center;
  column-gap: 12px;
  row-gap: 12px;
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Show scrollbar properly */
#deck-styles-grid::-webkit-scrollbar {
  width: 10px;
}

#deck-styles-grid::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

#deck-styles-grid::-webkit-scrollbar-track {
  background: transparent;
}

/* Deck preview card */
.deck-option {
  width: 90px;
  height: 120px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease-in-out;
  display: inline-block;
  background-size: 120%;
  background-position: center center;
  background-repeat: no-repeat;
  margin: 0 auto;
  border: 2px solid #000;
}

.deck-option:hover {
  transform: scale(1.2);
}

.deck-option.selected {
  border: 4px solid #c8f902;
}

/* Locked style */
.deck-option.locked {
  filter: grayscale(100%);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Save Button */
#save-deck-style {
  display: block;
  margin: 5px auto 24px auto; /* 👈 More bottom margin */
  padding: 12px;
  background: #27ae60;
  color: white;
  border: none;
  cursor: pointer;
}

/* Unlock message */
.deck-info-text {
  text-align: center;
  font-size: 14px;
  color: #888;
  margin-top: 16px;   /* More spacing above */
  margin-bottom: 12px; /* More spacing below */
}


/* 🔒 LOCKED DECKS */
.deck-option.locked {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: not-allowed;
}

/* 💾 DECK SAVE TEXT */
.deck-save-text {
    color: #4d4b4b;
	font-size: 18px;
    text-align: center;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 4px;
}

/* ℹ️ DECK INFO TEXT */
.deck-info-text {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin-top: 12px;
}

/* WIN MODAL */
/* WIN MODAL (MAIN CONTAINER) */
#win-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center;
    z-index: 10001;
    min-height: 80vh; /* Increased modal height */
    color: black; /* Ensure black text inside */
}

/* 📜 TEXT INSIDE WIN MODAL */
/*  You won!  */
#win-modal h2 {
    color: black; /* Dark gray for contrast */
	margin-top: 18px;
}

/*  (other text)  */
#win-modal p {
    color: black; /* Ensure black text */
	margin-top: 5px;
}

/* 🎥 VIDEO CONTAINER */
#video-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

/* 📺 AD VIDEO */
#win-ad-video {
    display: block;
    max-width: 100%; /* Make video responsive */
    margin: 15px auto; /* Center the video */
}

/* 🕒 WAIT TEXT UNDER VIDEO */
#ad-wait-text {
    font-size: 14px;
    color: gray;
}

/* 🎴 SPINNING CARD */
#spin-card {
  width: 180px;  /* 125% of 180px */
  height: 260px; /* 125% of 260px */
  border-radius: 12px;
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: bold;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 120%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin: 20px auto; /* ✅ Centers horizontally */
}


/* ❓ QUESTION MARK SPINNING */
#spin-question {
    position: absolute;
    font-size: 64px;
    font-weight: bold;
    left: 50%;
    transform: translateX(-50%);
    animation: question-spin 2.5s ease-in-out forwards;
}

/* 🔄 ANIMATION: QUESTION MARK */
@keyframes question-spin {
    0% { transform: rotate(0deg); opacity: 1; }
    90% { transform: rotate(720deg); opacity: 0; }
    100% { opacity: 0; }
}

/* 🔄 ANIMATION: SPINNING CARD */
@keyframes spin-reveal {
    0% { background-color: #eee; transform: rotateY(0deg); }
    100% { background-color: #eee; transform: rotateY(1080deg); }
}

/* 🎴 SPINNING CARD ANIMATION (CLASS) */
.spin-animation {
    animation: spin-reveal 4s ease-in-out forwards;
}

/* ▶️ NEXT BUTTON (DISABLED BY DEFAULT) */
#next-step-btn {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #ccc; /* Default gray (unclickable) */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: not-allowed; /* Show unclickable cursor */
    transition: background-color 0.3s ease-in-out;
	display: block; /* Ensure it’s visible */
	margin-top: 15px;
	margin-bottom: 15px;
}

/* 🔓 NEXT BUTTON ENABLED STATE */
#next-step-btn.enabled {
    background-color: #27ae60; /* Green when enabled */
    cursor: pointer;
}

/* 🔲 NEXT BUTTON HOVER STATE */
#next-step-btn.enabled:hover {
    background-color: #219150;
}

/* 🎮 SETTINGS BUTTON */
#settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* ⚙️ SETTINGS ICON */
#settings-icon {
    fill: white; /* Default icon color */
    transition: fill 0.2s ease-in-out;
}

/* 🎨 SETTINGS ICON HOVER */
#settings-btn:hover #settings-icon {
    fill: #f39c12; /* Orange on hover */
}

#next-game-btn {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
  margin-bottom: 15px;
}

#next-game-btn:hover {
  background-color: #219150;
}

.all-unlocked-message {
    text-align: center;
    font-size: 18px;
    color: #27ae60;
    padding: 20px;
}

.resetgame-modal .modal-content{
  pointer-events: auto;
  padding: 0px;
  border-radius: 8px;
  z-index: 10001;
}

#playerNameInput {
  font-size: 22px;
  padding: 0px;
  width: 80%;
  max-width: 400px;
  margin: 10px auto;
  display: block;
  border-radius: 8px;
  border: 2px solid #ccc;
  text-align: center;
}

/* Reset Options CSS */
.reset-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 0px;
}

.reset-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 0px;
}

.reset-button {
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #f0f0f0;
  color: #333;
  transition: background-color 0.2s ease;
  width: 240px;
  max-width: 90%;
  text-align: center;
}

.reset-button:hover {
  background-color: #ddd;
}

.modal-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-menu li {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-menu li:hover {
  background-color: #2e465c;
}

.modal-main {
  flex: 1;
  padding: 24px;
  background-color: #f9f9f9;
}

/* Reset Game modal – make thinner */
.modal.resetgame-modal .modal-content {
  max-width: 420px;
  margin: 0 auto;
}

/* Welcome Back modal – make even thinner if desired */
.modal.welcome-modal .modal-content {
  max-width: 450px;
  margin: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  position: fixed;
  background: #fff;
  border-radius: 8px;
}

/* unlocked card next game button */
#next-game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-tab:hover,
.settings-tab.active {
  background-color: #34495e;
  color: white;
}

.modal-settingsidebar li {
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-settingsidebar li:hover,
.modal-settingsidebar li.active {
  background-color: #34495e;
  color: white;
}

@media (min-width: 481px) {
  #deck-styles-modal .modal-content {
    width: 560px;
    max-width: 100%;
  }

  #deck-styles-grid {
    grid-template-columns: repeat(5, 90px);
    column-gap: 12px;
    row-gap: 12px;
  }

  .deck-option {
    width: 90px;
    height: 120px;
  }
}


.story-video {
  background-position: center;
  max-width: clamp(95%, 30vw, 200px); /* Responsive width */
  height: auto;
  margin-bottom: 0 !important;
  transform: translateZ(0);
}


/* Stats */
.stats-modal .modal-body {
  padding-top: 6px !important;
}


.stats-content p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.stats-image {
  flex-shrink: 0;
}

.stats-character {
  position: absolute;
  bottom: 10px;
  right: 10px;
  max-width: clamp(100px, 30vw, 150px); /* Responsive width */
  height: auto;
  margin-bottom: 0 !important;
}

.stats-row {
  font-size: 16px;
  margin-bottom: 10px;
}

.stats-row .label {
  color: #333;
}

.stats-row .value {
  font-weight: bold;
  margin-left: 6px; /* 👈 move number slightly away from label */
}

.stats-modal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.stats-tabs {
  display: flex;
  justify-content: space-around;
  border-bottom: 3px solid #d0d0d0;
  padding-bottom: 2px;
}

.stats-tab-btn {
  flex: 1;
  font-weight: bold;
  font-size: 15px;
  padding: 8px 0;
  border: none;
  background-color: #468ccb;
  color: white;
  border-right: 2px solid white;
  cursor: pointer;
}

.stats-tab-btn:last-child {
  border-right: none;
}

.stats-tab-btn.selected {
  background-color: white;
  color: #000;
  border-bottom: 4px solid #468ccb;
}

.stats-layout-fixed {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 300px; /* ✅ Fixed height to match layout */
}

.stats-left {
  flex: 1;
  padding-right: 15px;
  font-size: 15px;
}

.stats-right {
  width: 180px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.stats-character {
  max-height: 240px;
  object-fit: contain;
}

.stats-row {
  margin: 5px 0;
}

.label {
  font-weight: 500;
}

.value {
  font-weight: bold;
  margin-left: 4px;
}

.stats-quote-text {
  font-style: italic;
  font-size: 14px;
  text-align: center;
  color: #444;
  margin-top: -1px;
  margin-bottom: -2px;
}

/* Shop */
.store-modal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.store-tabs {
  display: flex;
  justify-content: space-around;
  border-bottom: 3px solid #d0d0d0;
  padding-bottom: 2px;
}

.store-tab-btn {
  flex: 1;
  font-weight: bold;
  font-size: 15px;
  padding: 8px 0;
  border: none;
  background-color: #468ccb;
  color: white;
  border-right: 2px solid white;
  cursor: pointer;
}

.store-tab-btn:last-child {
  border-right: none;
}

.store-tab-btn.selected {
  background-color: white;
  color: #000;
  border-bottom: 4px solid #468ccb;
}

.store-layout-fixed {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 300px; /* Fixed height */
}

.store-left {
  flex: 1;
  padding-right: 15px;
  font-size: 15px;
}

.store-right {
  width: 180px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.store-character {
  position: absolute;
  bottom: 10px;
  right: 10px;
  max-width: clamp(100px, 30vw, 150px); /* Responsive width */
  height: auto;
  margin-bottom: 0 !important;
  z-index: 1; /* lower than the grid */
}

.store-button {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 14px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.store-row {
  margin: 5px;
  color: #444;
}

.modal.store-modal .modal-content {
  width: 450px;
  max-width: 90vw;
  margin: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  position: fixed;
  background: #fff;
  border-radius: 8px;
}

.store-modal .modal-body {
  padding-top: 6px !important;
}

.store-quote-text {
  font-style: italic;
  font-size: 14px;
  text-align: center;
  color: #444;
  margin-top: -1px;
  margin-bottom: -2px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 4 columns */
  gap: 6px; /* spacing between cards */
  justify-items: center;
}


.store-left {
	margin-left: -7px;
  max-width: 640px;
}


.store_coin-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

.store-card {
  background: #fff;
  border-radius: 10px;
  padding: 7px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 10; /* higher than the shopkeeper */
}

.store-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.store-card-label {
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

.store-card-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.store-card-button {
  background-color: #3db83d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.store-card-button:hover {
  background-color: #32a832;
}
