html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  /* REMOVED: overflow: hidden; was here, causing the bug */
  background-color: #1a1a1d;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  text-align: center;
  font-size: 16px;
  transition: background-image 0.5s ease-in-out;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #f0f0f0;
  white-space: normal;
}
body.auth-background {
    background-image: url('images/scenario--10.png');
    background-size: cover;
    background-position: top center;
}
body.collection-background {
    background-color: #2d2b4c;
    overflow-y: auto; /* Allow scrolling on collection page */
}
body.play-background {
   background-image: url('images/scenario--11.png');
   overflow-y: auto; /* FIX: Allow scrolling on the play/setup page */
}
body.terms-background {
   background-color: #1a1a1d;
   overflow-y: auto;
}
#pageContainer {
    height: 100%;
    margin: 0 auto;
    position: absolute;
    width: 100%;
}
/* --- Navigation --- */
.sidenav {
  height: 90%;
  width: 0;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  background-color: #111;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
}

.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 25px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.sidenav a:hover {
  color: #f1f1f1;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

.sidenav .sign-out-link {
    color: #ff4d4d;
    margin-top: 20px;
}
.sidenav .sign-out-link:hover {
    color: #ff8080;
}
.sidenav-footer {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
}

.sidenav-footer a {
    font-size: .8rem;
    color: #818181;
    padding: 8px;
    display: inline-block;
}
.privacy-content, .terms-content {
  text-align:left;
  margin-left: 15%;
  margin-right: 15%;
}
#main {
  transition: margin-left .5s;
  position: relative; /* Added for animation overlay positioning */
}


.container {
  padding: 0px;
  width: 100%;
  height: 100vh;
  margin-top: 0px;
  display: flex;
  flex-direction: column;
  background-image: url('images/game-background.png');
  background-size:cover;
  background-position: center;
}

.page-content {
    padding: 70px 20px 20px 20px;
    animation: fadeIn 0.5s ease-in-out;
}

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

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #c5c6c7;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    color: #66fcf1;
}

.placeholder-content {
    background-color: #1f2833;
    border-radius: 8px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #45a29e;
}

.collection-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
  padding: 15px;
  background-color: rgba(31, 40, 51, 0.5);
  border-radius: 8px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.collection-controls input,
.collection-controls select {
  background-color: rgba(0, 0, 0, 0.3);
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
  min-width: 180px;
}

.collection-controls input:focus,
.collection-controls select:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 10px rgba(111, 66, 193, 0.5);
}

.collection-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.card.collection-card {
    width: 14rem;
    margin: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    
}

.card.collection-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 15px rgba(102, 252, 241, 0.2);
}

.collection-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 95%;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-radius: 0.15rem;
  height:10%;
  margin: 0.15rem auto 0 auto;
}

.collection-card-points {
  position: static;
  background-image: url('images/gold.png');
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: .15rem 0 0 0;
  z-index: 5;
  flex-shrink: 0;
  width:15%;
  height:100%;
  align-content: center;
  display: grid;
  place-items: center;
}

.collection-card-title-container {
  padding: 0.1rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.collection-card-title-text {
  font-weight: bold;
  font-size: 0.8rem;
  line-height: 1.1;
  color: #333;
  white-space: normal;
  text-align: left;
  padding: 0.05rem 0;
}

.collection-card-image {
  flex: 1 1 auto;
  min-height: 0;
  width: 95%;
  object-fit: cover;
  border-radius: 0.15rem;
  margin: 0.15rem auto;
  position: relative;
  z-index: 2;
  object-position: center top;
  padding: 0.15rem;
  height: 45%;
}

.collection-card-info-container {
    box-sizing: border-box;
    padding: 0.15rem;
    background-color: #fff;
    border: #000 solid 0.05rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: .6rem;
    width: 95%;
    margin: 0 auto 0.15rem auto;
    height: 35%;
    color: #333;
}

.collection-card-passive-text {
    font-style: italic;
    line-height: 1.2;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align:left;
    font-size: .65rem;
}

.collection-card-emoji-line {
  font-size: .8rem;
  line-height: 1;
  flex-shrink: 0;
  position: absolute;
  z-index: 2;
  color: #333;
  padding: 0.25rem 0;
  bottom: 0;
  right: 1%;
}


#setupSection {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  max-width: 1200px;
  margin: 20px auto;
  text-align: center;
  color: #333;
}
#setupSection h3 {
  color: #333;
  margin-bottom: 25px;
  font-size: 1.8rem;
}
#setupSection input[type="text"] {
  width: 80%;
  max-width: 300px;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#setupSection input[type="text"]::placeholder {
  color: #aaa;
}

#setupSection input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#setupSection button {
  background-image: linear-gradient(#007bff, #61adff);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  display: inline-block;
  min-width: 150px;
  margin-bottom: 15px;
  box-shadow: 1px 1px 3px #111;
}

#setupSection button:hover {
  background-color: #0056b3;
}

#setupSection button:active {
  transform: scale(0.98);
}

#setupSection button:last-of-type { 
  background-image: linear-gradient(45deg, #6f42c1, #a963f7);
  color: #fff;
}
#setupSection button:last-of-type:hover {
  background-color: #545b62;
}

#leaderOptions {
  margin-bottom: 25px;
}

.pyramid-row {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0;
  gap: 0.25rem;
}

.card {
  width: 4rem;
  aspect-ratio: 2 / 2.8;
  font-size: 0.55rem; 
  border-radius: 0.25rem;
  border: 0.125rem solid #333;
  box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.15);
  background-image: url('images/background.png');
  background-size: cover;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  margin: 0.15rem;
  box-sizing: border-box;
  overflow: hidden;
}

.card > * {
  position: relative;
  z-index: 2;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 95%;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-radius: 0.15rem;
  height:10%;
  margin: 0.15rem auto 0 auto;
}
.card-points {
  position: static;
  background-image: url('images/gold.png');
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  border-radius: .15rem 0 0 0;
  z-index: 5;
  flex-shrink: 0;
  width:12%;
  height:100%;
  align-content: center;
}
.card-title-container {
  padding: 0.1rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.pyramid-board .card:not(.leader) .card-title-container {
    display: none; 
}

.card-title-text {
  font-weight: bold;
  font-size: 0.7rem;
  line-height: 1.1;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align:left;
  width: 100%;
  padding: 0.05rem 0;
}

.card-image {
  flex: 1 1 auto;
  min-height: 0;
  width: 95%;
  object-fit: cover;
  border-radius: 0.15rem;
  margin: 0.15rem auto;
  position: relative;
  z-index: 2;
  object-position: center top;
  padding: 0.15rem;
}
.card-image-opponent {
  flex: 1 1 auto;
  min-height: 0;
  width: 85%;
  object-fit: contain;
  border-radius: 0.15rem;
  margin: 0.15rem auto;
  position: relative;
  z-index: 2;
  object-position: center;
  padding: 0.15rem;
}

.card-image.image-focus-top { object-position: center top; }
.card-image.image-focus-bottom { object-position: center bottom; }

.card.selected-for-move {
  outline: 0.15rem solid #ffc107;
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 0 8px #ffc107;
  z-index: 20;
}

.empty-slot.movable-to-slot {
  border-color: #ffc107;
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  cursor: pointer;
}

.empty-slot.movable-to-slot:hover {
  background-color: rgba(255, 193, 7, 0.2);
}

#leaderOptions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}
.leader-option-info-container {
    box-sizing: border-box;
    padding: 0.15rem;
    background-color: #fff;
    border: #000 solid 0.05rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: .6rem;
    width: 95%;
    margin: 0 auto 0.15rem auto;
    height: 30%;
    color: #333;
}
.leader-info-container {
    padding: 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.4rem;
    background-color: #fff;
    width: 95%;
    margin: 0 auto 0.15rem auto;
    height: 30%;
    box-sizing: border-box;
    color: #333;
    border: #000 solid 0.05rem;
}
.leader-passive-text {
    font-style: italic;
    line-height: 1.2;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card .leader-passive-text {
  flex-shrink: 1;
  min-height: 0;
}

.leader-option-emoji-line, .emoji-line {
  font-size: 1rem;
  line-height: 1.1;
  flex-shrink: 0;
  position: absolute;
  z-index: 2;
  color: #333;
  padding: 0.25rem 0;
  right: 1%;
  bottom:0%;
}

.emoji-line {
    font-size: 0.45rem;
    flex-shrink: 1;
    padding: 0.1rem 0;
    bottom: 0;
    position: absolute;
    right: 1%;
}

.leader-option-card {
  width: 10rem;
  margin: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  font-size: 0.75rem;
}
.leader-option-card .card-title-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    text-align:left;
}
.leader-option-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.leader-option-card.selected {
  outline: 0.2rem solid #4CAF50;
  box-shadow: 0 0 15px #4CAF50;
  transform: scale(1.05);
}

.card.leader {
  border-width: 0.15rem;
  border-color: #333;
  background-color: #333;
}
.card.leader::before {
  background-color: #333;
}

#handCards .card .character-info-container {
  display: none;
}
#handCards .card .emoji-line {
  position: relative;
  bottom: auto;
  padding: 0.1rem 0;
  font-size: 0.9rem;

}
.character-info-container {
    padding: 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: .3rem;
    background-color: #fff;
    width: 95%;
    margin: 0 auto 0.15rem auto;
    height: 30%;
    box-sizing: border-box;
    color: #333;
    border: #000 solid 0.05rem;
}
.character-passive-text {
    font-style: italic;
    text-align: left;
    line-height: 1;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  overflow: visible;
  padding: 4px;
  position: relative;
}

.card-row .card {
  margin-left: -2.25rem;
  z-index: 1;
  transition: transform 0.2s, z-index 0s 0.1s;
}

.card-row .card:hover {
  transform: scale(1.2) translateY(-10px);
  z-index: 10;
  transition-delay: 0s;
}

.card-row .card:first-child {
  margin-left: 0;
}
.leader-options-row .card {
  margin-left: 0.5rem;
  z-index: 1;
  transition: transform 0.2s, z-index 0s 0.1s;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #222;
  color: white;
  padding: 10px 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 50px;
  box-sizing: border-box;
  min-height: 40px;
}
.rulebook-content {
  margin: 0 5%;
}
.rulebook-content ul {
  text-align: left;
  margin: 0 10%;
}
.rulebook-content ol {
  text-align: left;
  margin: 0 10%;
}
.menu-toggle { font-size: 1.5rem; cursor: pointer; }
.game-title { 
  display: flex;
  margin: 0 auto; 
}
.game-code { font-size: clamp(.6rem, .8rem, 1rem); font-style: italic; }

.player-box {
  background-color: rgba(34, 34, 34, 0.85);
  color: white;
  padding: 6px 12px;
  border: 1px solid #555;
  border-radius: 6px;
  z-index: 999;
  font-weight: bold;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  text-align: left;
}

.player-box span { display: block; }

.player-box.player-box-active-turn {
  border-color: #28a745;
  border-width: 2px;
  background-color: rgba(40, 167, 69, 0.2);
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.player-score {
  font-size: 0.75rem;
  font-weight: normal;
  margin-top: 3px;
  color: #f0f0f0;
}

/* --- NEW: Game Grid Layout --- */
.game-grid {
    display: grid;
    grid-template-columns: 200px 1fr 200px; /* 3 columns: side, center, side */
    height: calc(100vh - 70px); /* Full height minus navbar and padding */
    width: 100%;
    gap: 15px;
    padding: 0 15px;
    box-sizing: border-box;
}

.side-column {
    display: flex;
    flex-direction: column;
    justify-content: center; /* This will space out the items */
    align-items: center;
    gap: 20px;
    padding: 20px 0; /* Add some vertical padding */
}

#center-column {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center the board vertically */
}

#boardsAreaContainer {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hand {
    width: 100%;
    z-index: 100; /* Give hands a fixed height */
    flex-shrink: 0;
}

.opponent-hand-area {
    /* No longer absolutely positioned */
}

.player-hand-area {
    /* No longer absolutely positioned */
}

/* --- DECK PILE STYLES --- */
.deck-pile {
    position: relative;
    width: 6rem; /* Match the width of board cards */
    aspect-ratio: 2 / 2.8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent the pile from shrinking */
    background-image: url(images/background.png);
    border-radius: 0.25rem;
    border: 0.125rem solid #333;
}

.deck-pile img {
    width: 100%;
    height: 100%;
    opacity: 0.7;
    object-fit: contain;
    background-image: url(images/background.png);
}

.deck-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.5);
}


.close-modal-btn {
  position: absolute;
  top: -5%;
  right: 3%;
  font-size: 2em;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s;
}
#joinGameCodeInput {
    background-color: rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
  color: #fff;
}
.pyramid-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.modal-move-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  margin-top: 10px;
  width: 100%;
}

.modal-move-btn:hover {
  background-color: #0056b3;
}
.card-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.card-modal-content {
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background-color: #333;
}

.card-modal .modal-card {
    width: 20rem;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.modal-ability-description {
    color: #f1f1f1;
    text-align: left;
    width:90%;
    margin: 0 auto;
}

.card-modal-close-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  background-color: transparent;
  border-radius: 50%;
  border: none;
  font-size: 2rem; color: #aaa;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 2px;
  z-index: 10;
}
.card-modal-close-btn:hover {
  color: #fff;
}

.card.selected-for-play {
  outline: 0.15rem solid dodgerblue;
  transform: scale(1.15) translateY(-5px);
  box-shadow: 0 0 10px dodgerblue;
  z-index: 25;
}

.empty-slot {
  width: 4rem;
  aspect-ratio: 2 / 2.8;
  border: 0.1rem dashed #aaa;
  background-color: rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 1.25rem;
  box-sizing: border-box;
  border-radius: 0.25rem;
}

.empty-slot.playable-slot {
  border-color: #4CAF50;
  background-color: rgba(76, 175, 80, 0.1);
  cursor: pointer;
  color: #4CAF50;
}
.empty-slot.playable-slot:hover { background-color: #dcedc8; }


.card.scheme {
    border-color: #31004f;
    background-color: rgba(79, 0, 118, 0.3);
}
.card.scheme::before { background-color: rgba(79, 0, 118, 0.3); }

#handCards .card {
  width: 6rem;
  font-size: 0.8rem;
}

#handCards.card-row > .card { margin-left: -3rem; }
#handCards.card-row > .card:hover { transform: scale(1.20) translateY(-1.25rem); z-index: 30; transition-delay: 0s; }
#gameSection.targeting-active .card:not(.valid-target) {
  opacity: 0.6;
  pointer-events: none;
}

#gameSection.targeting-active .empty-slot {
   opacity: 0.6;
   pointer-events: none;
}

#gameSection.targeting-active .valid-target {
  opacity: 1;
  outline: 3px solid #dc3545;
  box-shadow: 0 0 15px #dc3545;
  cursor: crosshair !important;
  transform: scale(1.05);
  pointer-events: auto;
}
.modal-activate-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  margin-top: 10px;
  width: 100%;
}

.modal-activate-btn:hover {
  background-color: #218838;
}

.modal-activate-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}
.card-effects {
  font-size: 0.4rem;
  position: absolute;
  top: 1px; right: 1px;
  display: flex; flex-direction: column; align-items: flex-end;
}
.effect-badge {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.05rem 0.15rem; border-radius: 0.15rem;
  margin-bottom: 0.1rem; font-size: 0.35rem;
  white-space: nowrap;
}

.emoji-line.inherited-abilities { opacity: 0.6; font-size: smaller; }

.custom-notification {
  position: fixed;
  bottom: -100px; left: 50%;
  transform: translateX(-50%);
  background-color: #333; color: white;
  padding: 15px 25px; border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: bottom 0.5s ease-in-out;
  min-width: 280px; max-width: 90%;
  text-align: center; font-size: 0.95rem;
  display: flex; justify-content: space-between; align-items: center;
}
.custom-notification.visible { bottom: 10%; }
.custom-notification.info { background-color: #007bff; color: white; }
.custom-notification.success { background-color: #28a745; color: white; }
.custom-notification.error { background-color: #dc3545; color: white; }
.custom-notification.warning { background-color: #ffc107; color: #212529; }
#customNotificationMessage { margin: 0; margin-right: 15px; flex-grow: 1; }
.custom-notification-close-btn {
  background: none; border: none; color: inherit;
  font-size: 1.5rem; font-weight: bold;
  cursor: pointer; padding: 0 5px; line-height: 1;
}
.analyze-modal-content {
  background-color: #333;
  color: white;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #555;
  text-align: center;
  max-width: 90%;
  position:relative;
}

.analyze-modal-content h3 {
  margin-top: 0;
}

#analyzeCardContainer {
  padding: 20px 0;
  gap: 15px;
  flex-wrap: wrap;
}

.analyze-card {
  width: 120px;
  font-size: 14px;
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analyze-card:active {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 0 15px dodgerblue;
}

.modal-confirm-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 15px;
}

.modal-confirm-btn:hover {
  background-color: #0056b3;
}
.auth-button.google-signin-btn {
color: #444;
background-image: linear-gradient(45deg, #fff, #fff);
display: flex;
justify-content: center;

}
.google-logo {
  width: 1rem;
  height: 1rem;
  margin: 0 1% 0 0;
}
#authPage {
  background-color:rgba(251, 251, 251, 95%);
  width: 60%;
  color: #f0f0f0;
  animation: fadeIn 0.5s ease-in-out;
  padding: 3% 3% 3%;
  border-radius: 12px;
  margin: 10% auto;
  text-align: center;
  border: 1px solid #2a4755;
  flex-direction: column;
}
.image-logo-auth {
  width:40%;
  margin:0 auto 2% auto;
  position: relative;
   
}
.image-logo-nav {
  max-width: 45px; 
  display:none;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.auth-button {
  padding: 2% 2%;
  font-size: 1rem;
  font-weight: bold;
  color: #ffffff;
  background-image: linear-gradient(45deg, #2a4755, #3344a2);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: auto;
  min-width: 35%;
  margin: 0 auto;

}



.auth-button:hover {

  transform: translateY(-3px);

  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);

  filter: brightness(1.1);

}



.auth-modal-content {

  background-color: #1f2833;

  color: white;

  padding: 30px;

  border-radius: 12px;

  border: 1px solid #45a29e;

  text-align: center;

  width: 90%;

  max-width: 400px;

  position: relative;

}



.auth-modal-content h4 {

  font-size: 1.8rem;

  color: #66fcf1;

  margin-top: 0;

  margin-bottom: 25px;

}

#usernameInput input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 14px;
  font-size: 1rem;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: all 0.3s ease; 
}

.auth-modal-content input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 14px;
  font-size: 1rem;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}



.auth-modal-content input::placeholder {

  color: #888;

}



.auth-modal-content input:focus {

  outline: none;

  border-color: #6f42c1;

  box-shadow: 0 0 15px rgba(111, 66, 193, 0.5);

}



.auth-modal-content button[type="submit"] {

  width: 100%;

  padding: 14px;

  font-size: 1.1rem;

  font-weight: bold;

  color: #ffffff;

  background-image: linear-gradient(45deg, #6f42c1, #a963f7);

  border: none;

  border-radius: 6px;

  cursor: pointer;

  transition: all 0.3s ease;

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

}



.auth-modal-content button[type="submit"]:hover {

  transform: translateY(-2px);

  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);

}

#usernameModal .modal-confirm-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #ffffff;
  background-image: linear-gradient(45deg, #6f42c1, #a963f7);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-top: 15px;
}

#usernameModal .modal-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

#usernameModal .modal-confirm-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}


#quitGameBtn {
    background-color: #c82333;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin: 1% 20px 1% auto;
}

#quitGameBtn:hover {
    background-color: #a71d2a;
    transform: scale(1.05);
}

#quitGameBtn:active {
    transform: scale(0.98);
}
#endTurnBtn {
    background-image: linear-gradient(45deg, #2a4755, #3344a2);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin: 1%;
}

#endTurnBtn:hover {
    background-color: #4b66ff;
    transform: scale(1.05);
}

#endTurnBtn:active {
    transform: scale(0.98);
}
.deck-builder-main {
    max-width: 1400px;
    margin: 0 auto;
}

.deck-builder-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.deck-builder-controls select, .deck-builder-controls button {
    padding: 10px 15px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #444;
    background-color: rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}
.deck-builder-controls button:hover {
    background-color: #6f42c1;
    border-color: #a963f7;
}

.deck-builder-interface {
    display: flex;
    gap: 20px;
}

.deck-builder-column {
    flex: 1;
    background-color: rgba(26, 26, 29, 0.7);
    border-radius: 8px;
    padding: 15px;
    height: 70vh;
    display: flex;
    flex-direction: column;
}

.deck-builder-column h3 {
    text-align: center;
    color: #66fcf1;
    margin-top: 0;
}

.deck-card-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px;
}

.deck-card-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.deck-card-entry:hover {
    background-color: rgba(111, 66, 193, 0.4);
}

.deck-card-entry .card-name {
    font-weight: bold;
}

.deck-card-entry .card-count {
    font-style: italic;
    color: #aaa;
}

.current-deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#deckNameInput {
    flex-grow: 1;
    margin-right: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    font-size: 1rem;
}

#deckCardCount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #66fcf1;
}

#saveDeckBtn {
    width: 30%;
    min-width: 35px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    background-image: linear-gradient(45deg, #28a745, #218838);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

#saveDeckBtn:hover {
    filter: brightness(1.1);
}
.card.player-card {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.card.opponent-card {
  border-color: rgb(228, 84, 31);
  box-shadow: 0 0 5px rgb(242, 159, 44);
}

.card.leader.player-card {
    border-width: 0.2rem;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.7);
}

.card.leader.opponent-card {
    border-width: 0.2rem;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.7);
}

/* --- NAME BOX HIDING LOGIC --- */
#gameSection > .mobile-name-boxes {
    display: none !important;
}

/* --- MEDIA QUERIES FOR RESPONSIVE DESIGN --- */

@media (max-aspect-ratio: 3/4) {
  .leader-slot {
    width: 6rem;
    height: calc(6rem * 1.4);
  }

  .leader-passive-text, .character-passive-text {
    text-align: left;
    white-space: normal;
    
  }
  .leader-option-info-container {
    font-size: .8rem;
  }
}
@media (max-width: 768px) {
  .auth-form-container form:first-of-type {
    border-right: none;
  }
  
  /* Show the mobile container and style it */
  #gameSection > .mobile-name-boxes {
      display: flex !important;
  }

  /* These more specific selectors will now hide the original boxes on mobile */
  #gameSection #opponent-column > #opponentNameBox {
      display: none !important;
  }

  #gameSection #player-column > #yourNameBox {
      display: none !important;
  }

  .page-content {
    padding: 50px 20px 20px 20px;
    animation: fadeIn 0.5s ease-in-out;
}
  .player-box {
    min-width: none;
  }
  /* This container will hold the buttons at the bottom of the player column */
.action-buttons-container {
    display: flex;
    justify-content: space-between; /* Pushes buttons to the left and right */
    width: 100%;
    padding: 5px 10px; /* Adds some spacing around the buttons */
    box-sizing: border-box;
}
.opponent-hand-area {
  display:none;
}

/* We just need to ensure the buttons have appropriate sizing */
#quitGameBtn, #endTurnBtn {
    margin: 0; /* Resets any desktop margin */
    flex-basis: 30%; /* Makes each button take up nearly half the container width */
    font-size: 0.9rem;
}
  #opponent-column.side-column {
    flex-direction: row;
    width: 80%;
  }
    .navbar .game-title,
    .navbar #userSection {
        display: none;
    }
    .game-grid {
    display: flex;
    flex-direction:column;
    width: 100%;
    gap: 15px;
    padding: 0 15px;
    box-sizing: border-box;
}
  .leader-option-card {
    width: 10rem;
    max-width: 300px;
  }
  .card.player-card {
    width:2.9rem;
  }
.deck-pile {
  display:none;
}
.side-column {
  gap: 0px; 
  padding: 0px;
}
.empty-slot {
  width:2.5rem;
  height: calc(2.5rem * 1.4);
}
.card.opponent-card {
  width:2.8rem;
}
.card.leader {
  width: 4rem;
  height: calc(5rem * 1.4);
}
  #gameBoard .card-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 95%;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 0.15rem;
    height:20%;
    margin:0 auto;
}
  #leaderOptions {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
#gameBoard .card-points {
  font-size:.5rem;
  width:30%;
  margin: 0 auto;
}
#gameBoard .card-title-text {
  font-size: .7rem;
}
#gameBoard .card-header {
  max-height: 18px;
}
#opponentHand.card-row > .card {
  width:3rem;
}
.deck-builder-interface {
  flex-direction:column;
}
.deck-pile {
  display: none;
}
#deckSelector {
  width: 70%;
}
.pyramid-row {
  margin: 0;
  gap:0;
}
.hand.card.card-points {
  font-size:.7rem;
}
.auth-button {
  font-size: .8rem;
  width: auto;
  white-space: nowrap;
  padding: 4%;
}
.auth-button.google-signin-btn {
  width: auto;
  white-space: nowrap;
  padding: 4%;
}
#authPage {
  width:75%;
  margin: 20% auto;
}
#usernameForm input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 14px;
    font-size: 1rem;
    margin-bottom: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}
#handCards .card-points {
  font-size: 0.7rem; /* Example size */
  width:30%;
}
#handCards .card-header {
  height:20%; /* Example size */
}
#handCards .card-title-text {
  font-size: 0.6rem; /* Example size */
}
.analyze-modal-content {
  width: 80%;
}
.play-mode-container {
    position: static;
    /* bottom: 10px; */
    display: flex;
    flex-direction: column;
    /* margin: 0 auto; */
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    padding-top: 15px;
    box-shadow: 5px 0px 20px rgba(0, 0, 0, 1);
}
.play-mode-box {
    display: flex;
    justify-content: center;
    gap: 2%;
}
/* -------- */
.collection-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
  padding: 15px;
  background-color: rgba(31, 40, 51, 0.5);
  border-radius: 8px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.collection-controls input,
.collection-controls select {
  background-color: rgba(0, 0, 0, 0.3);
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
  min-width: 180px;
}

.collection-controls input:focus,
.collection-controls select:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 10px rgba(111, 66, 193, 0.5);
}

.collection-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.card.collection-card {
    width: 10rem;
    cursor: pointer;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    margin:0;
    
}

.card.collection-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 15px rgba(102, 252, 241, 0.2);
}

.collection-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 95%;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-radius: 0.15rem;
  height:15%;
  margin: 0.15rem auto 0 auto;
}

.collection-card-points {
  position: static;
  background-image: url('images/gold.png');
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: .15rem 0 0 0;
  z-index: 5;
  flex-shrink: 0;
  width:15%;
  height:100%;
  align-content: center;
  display: grid;
  place-items: center;
}

.collection-card-title-container {
  padding: 0.1rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.collection-card-title-text {
  font-weight: bold;
  font-size: 0.7rem;
  line-height: 1.1;
  color: #333;
  white-space: normal;
  text-align: left;
  padding: 0.05rem 0;
}

.collection-card-image {
  flex: 1 1 auto;
  min-height: 0;
  width: 95%;
  object-fit: cover;
  border-radius: 0.15rem;
  margin: 0.15rem auto;
  position: relative;
  z-index: 2;
  object-position: center top;
  padding: 0.15rem;
  height: 45%;
}

.collection-card-info-container {
    box-sizing: border-box;
    padding: 0.15rem;
    background-color: #fff;
    border: #000 solid 0.05rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: .6rem;
    width: 95%;
    margin: 0 auto 0.15rem auto;
    height: 35%;
    color: #333;
}

.collection-card-passive-text {
    font-style: italic;
    line-height: 1.1;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align:left;
    font-size: .5rem;
}

.collection-card-emoji-line {
  font-size: .6rem;
  line-height: 1;
  flex-shrink: 0;
  position: absolute;
  z-index: 2;
  color: #333;
  padding: 0.25rem 0;
  bottom: 0;
  right: 1%;
}
}
@media (max-aspect-ratio: 4/5) {
  #boardsAreaContainer { flex-direction: column; }
  .pyramid-board { flex: 1; width: 100%; }
  .leader-zone { flex-direction: row; }
  #handCards .card { width: 5rem; }
  #handCards.card-row > .card { margin-left: -2rem; }
  #gameSection > .hand {
    flex: 0 0 auto;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 4.5rem;
    padding: 0.25rem 0;
    margin-left: 8%;
}
  .card-modal .card {
    width: 12rem;
    font-size: .8rem;
    cursor: default;
    transform: none !important;
    margin-bottom: 15px;
}
}

.profile-content {
    background-color: #1f2833;
    border-radius: 8px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #45a29e;
    text-align: left;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    color: #66fcf1;
    font-size: 1.8rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #45a29e;
    padding-bottom: 5px;
}

.profile-section p {
    font-size: 1.1rem;
    color: #f0f0f0;
    margin-bottom: 10px;
}

.recent-games-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
}

.recent-games-table th,
.recent-games-table td {
    border: 1px solid #45a29e;
    padding: 10px;
    text-align: left;
    color: #f0f0f0;
}

.recent-games-table th {
    background-color: #2a4755;
    font-weight: bold;
    color: #66fcf1;
}

.recent-games-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1);
}

.recent-games-table tr:hover {
    background-color: rgba(102, 252, 241, 0.1);
}

.recent-games-table .win {
    color: #28a745;
    font-weight: bold;
}

.recent-games-table .loss {
    color: #dc3545;
    font-weight: bold;
}

.recent-games-table .draw {
    color: #ffc107;
    font-weight: bold;
}


/* --- ADDED: Animation System Styles --- */
.animation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5000; /* Ensure it's on top of everything */
  pointer-events: none; /* Allows clicks to go through the overlay */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.turn-banner {
    padding: 15px 50px;
    background-color: rgba(17, 17, 17, 0.85);
    color: #66fcf1;
    font-size: 2.5rem;
    font-weight: bold;
    border-radius: 12px;
    border: 2px solid #66fcf1;
    box-shadow: 0 0 25px rgba(102, 252, 241, 0.5);
    opacity: 0; /* Initially hidden for GSAP animation */
    transform: scale(0.5); /* Initially small for GSAP animation */
}

/* Helper class to lift a card out of the document flow for animation */
.card-is-animating {
    position: fixed;
    z-index: 5001; /* Ensure the animating card is on top of the overlay */
    pointer-events: none;
}

