/* Prevent horizontal scrolling from overflowing elements */
/*html, body { overflow-x: hidden; }*/

html { 
  overflow-y: scroll; 
}

body {
  font-family: system-ui, sans-serif, 'Titan One';
  background: linear-gradient(lightblue, white);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  color: #fff;
}

#game {
  width: 100%;
  margin: auto;
  padding: 5px;
  text-align: center;
  box-sizing: border-box;
}

#game-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

h1 {
  font-family: 'Bagel Fat One';
  font-size: 1.5em;
  padding: 0px;
  margin: 0;
  line-height: 1;
}

#status {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 8px;
  width: 95%;
  font-size: 0.85rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.controls button, #play-again-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: darkorange;
  color: white;
  border: none;
  border-radius: 4px;
}

#table {
  position: relative;
  background: #06661e;
  border-radius: 10px;
  margin: 0 auto;
  padding: 10px 4px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
  border: 2px solid darkorange;
  min-height: 520px;
}

/* TOP ROW ALIGNMENT */
.top-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  width: 100%;
}

.pile-group {
  display: flex;
  gap: 1.5vw;
}

.foundation-group {
  display: flex;
  gap: 1vw; /* Keeps the 4 boxes evenly spaced */
}

/* TABLEAU ALIGNMENT */
.tableau-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 350px;
}

/* 
  Strict 13vw width ensures 7 items fit perfectly across 100vw.
  flex-shrink: 0 ensures the browser does not crush the 4th foundation box.
*/
.pile-slot, 
.tableau-col {
  width: 13vw;
  max-width: 55px;
  height: 18.2vw; /* Maintains card ratio */
  max-height: 77px;
  border-radius: 4px;
  box-sizing: border-box;
  flex-shrink: 0; 
}

/* Visible borders for empty spaces */
.tableau-col {
  min-height: 200px;
  border: 1.5px dashed rgba(255,255,255,0.4); 
  position: relative;
}

.pile-slot {
  border: 1.5px dashed rgba(255,255,255,0.4);
  position: relative;
}

/* CARD SIZING AND TOUCH */
.card {
  width: 13vw;
  max-width: 55px;
  height: 18.2vw;
  max-height: 77px;
  border-radius: 4px;
  position: absolute;
  touch-action: none; /* Crucial for preventing screen pulling during drag */
  box-shadow: 1px 1px 4px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

.card.face-down {
  background-color: #1a2a6c;
  border: 1px solid #fff;
  background-size: contain !important;
  background: url("assets/cards/back2.svg");
}

/* GAME OVER MODAL */
#game-over {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /*background: rgba(0, 0, 0, 0.85);*/
  background: rgba(0, 0, 0, 0.40);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #2c3e50;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid darkorange;
  width: 80%;
}

.modal-content h2 {
  font-family: 'Bagel Fat One';
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: #f1c40f;
}

.fountain-card {
  position: fixed;
  width: 45px;
  height: 63px;
  pointer-events: none;
  z-index: 999;
}

.screen-content img {
  width: 100%;   /* 100% of the screen width */
}


.about { width:75%; margin:0 auto; color:black; font-size: 1em;  }
  
.about h2,h3,h4 {
    font-family: 'Bagel Fat One';
    color:#228B22;
} 
   
.footer
{
    margin: 0 auto;
    color: black;
    width: 100%;
    text-align:center;
}

.footer h4,h5 {
    margin: 0 auto;
/*    font-family: 'Bagel Fat One'; */
    font-family: courier;
}


/*   Mobile edits @@@@@@@@@@@@@@@@@@@@@@*/

#game-line, #scores {
    display:none;
}

#mobile-scores {
    position: absolute;
    right: 25px; 
    top: 40px;
    background: rgba(0, 0, 0, 0.4);
    display:block;
}

  /* 1. The Hidden Toggle */
  #menu-toggle { display: none; }

  /* 2. Hamburger Icon Styling */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 21px; 
    gap: 5px;
    cursor: pointer;

    position: fixed; 
    top: 20px;
    left: 20px;
    z-index: 1001;
  }

  .hamburger span {
    display: block;
    height: 12px;
    width: 100%;
    /*background-color: #333;*/
    /*background-color: lime;*/
    background-color: white;
    border-radius: 3px;
    transition: all 0.1s linear;
  }

  /* 3. Hamburger to "X" Animation */
  #menu-toggle:checked + .hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  #menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }
  #menu-toggle:checked + .hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* 4. Flyout Menu Side Panel */
  .flyout-nav {
    position: fixed;
    top: 0;
    left: -100%; /* Hidden off-screen */
    width: 100%;
    height: 100%;
    background: darkgreen;
    transition: left 0.1s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1000;
    padding-top: 80px;
  }

  #menu-toggle:checked ~ .flyout-nav {
    left: 0; /* Slides into view */
  }

  /* Menu Content */
  .flyout-nav ul { list-style: none; padding: 0; }
  .flyout-nav a {
    display: block;
    padding: 15px 40px;
    color: white;
    text-decoration: none;
    font-size: 1.2em;
    /*font-size: 1.9em;*/

    /*transition: background 0.2s;*/
    transition: background 0.1s;
  }
  .flyout-nav a:hover { background: #333; }

  /* Background Overlay */
  .overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /*background: rgba(0,0,0,0.5);*/
    background: rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    /*transition: 0.3s;*/
    transition: 0.1s;
    z-index: 999;
  }
  #menu-toggle:checked ~ .overlay {
    opacity: 1;
    visibility: visible;
  }

 .flyout-nav ul li {
    text-align: center;
}

/*@@@@@@@@@@@@@@@@@@@@  Mobile edits end */


/* @@@@@@@@@@@@@@@@@@@@@@@@@@@@ ADS START */


#gdc_mobile_ad {
    width:320px;
    height:50px;
    margin: 0 auto;
    margin-top:5px; 
}

.gdc_ads {
    width:150px;
    height:400px;
    text-align:center;
    display:none;  
    
}

.gdc_ads_no_img {
    width:150px;
    height:400px;
    text-align:center;
    border: dashed thin;
    display:none; 
    
}   
    
#gdc_ads_left {
    margin-left:10px;
    margin-top: 150px;
    float:left;
}   
    
#gdc_ads_right {
    margin-right:10px;
    margin-top: 150px;
    float:right;
}


/* ADS END @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */

