body {
    font-family: 'Luckiest Guy', cursive;
    background-color: #1d1d1d;
    margin: 0;
    padding: 20px;
    text-align: center;
}

h1 {
    color: #ffffff;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.rules-section-item {
 grid-area: rules;
 background-color: #036418;
 padding: 10px;
 border-radius: 10px;
 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
 text-align: center;
 align-items: center;
 width: 100%;
 max-width: 400px;
 color: white;
}

.rules-section-item ol li, .description, .rules-section-item ul li {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.rules-section-item ol li, .rules-section-item ul li {
    text-align: justify;
    font-size: 0.9em;
}

ol, ul {
    list-style-position: inside;
    padding: 5px;
    margin: 5px;
}

ol li, ul li {
    padding: 5px 0;
}

.description {
    text-align: justify;
}

.game-table-container {
    position: relative;
    display: inline-block;
    margin-top: 20px;
}

.table-background {
  width: 700px; /* or your desired size */
  height: 500px;
  background-image: url('/assets/table.avif');
  background-size: cover;      /* or 'contain' depending on your needs */
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 20px;         /* optional: for rounded corners like a table */
  border: 2px solid #743105; /* optional: for a border around the table */
}

.data-container,
.player-container {
    position: absolute;
    color: white;
    left: 50%;
    transform: translateX(-52%);
    padding: 8px 16px;
    border-radius: 8px;
}

.dealer-container {
    position: absolute;
    width: 700px; /* Match your .table-background width */
    height: 80px; /* Adjust as needed */    
    top: 60px;
    transform: translateX(-3.5%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
}

.deck-image {
    position: absolute;
    right: 45px; 
    top: 70px; 
    z-index: 2; 
}

.player-container {
    display: flex;
    flex-direction: row;
    justify-content: center; /* center items horizontally */
    align-items: center; /* vertically center items */
    gap: 150px;           /* space between items */
    position: absolute;
    color: white;
    left: 55%;
    transform: translateX(-74%);
    padding: 8px 16px;
    border-radius: 8px;
    top: 390px;

}

.data-container   { top: 200px; }
.player-container { bottom: 0px; }

.controls {
    margin-top: 20px;
}

.controls button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #036418;
    color: white;
}

.controls button:hover {
    background-color: #3d2802;
}

#dealer-hand, #player-hand {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.card {
    width: 50px;
    height: 75px;
    background-color: #ffffff;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none !important;
}

h3, #message {
    color: #ffffff;
    font-size: 1.2em;
    margin: 10px 0;
}

h1, .hand-title, p {
    font-family: 'Luckiest Guy', cursive;
}

main {
 grid-area: main;
}

.big-container-game {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas: 
     "main main rules";
    align-items: center;
    justify-content: center;
    margin-top: 50px;
}

footer {
    font-family: 'Courier New', Courier, monospace;
    position: fixed;
    background-color: #1d1d1d;
    text-align: center;
    padding: 0px;
    font-size: 12px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;   
    width: 100%;
    left: 0;
    bottom: 0;
}

#developer-info {
    margin-right: 20px;
    font-family: 'Courier New', Courier, monospace;
}

#return-link {
    margin-left: 20px;
    cursor: pointer;
    position: relative;
    left: 45vw;
}

footer a {
    color: rgb(255, 255, 255);
    text-decoration: none;
}


@media (max-width: 600px) {                    /* modo portrait */
    h1 {
    font-size: 1.8em !important;
    }
    h3, p {
    font-size: 1em !important;
    }
    .big-container-game {
        grid-template-columns: 1fr;
        grid-template-areas: 
         "main"
         "rules";
    }
    .game-table-container {
    height: 70vh !important;
    }
  .game-main-item {
    height: 75vh !important; 
    width: 90vw !important;
    right: 1vw !important;  
  }
  main, .game-table-container, .table-background {
    position: relative !important;
    width: 95vw !important;
    right: 4px !important;
  }
  .rules-section-item {
    position: relative !important;
    right: 0vw !important;
    transform: translateY(0%) !important;
    width: 90vw !important;
    margin: 50px auto !important;
    box-sizing: border-box;
  }

  .controls button {
    margin: 0 5px !important;
    padding: 10px 15px !important;
  }
  .dealer-container {
    position: relative !important;
    right: 320px !important;
    top: -500px !important;
    transform: none !important;
  }
  #dealer-hand {
    position: relative !important;
    right: -135px !important;
  }
  #player-hand {
    left: -5px !important;
  }
  .data-container {
    width: 85% !important;
  }
  .player-container {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: -200px !important;
  }
  .card {
    width: 40px !important;
    height: 60px !important;
  }
  .player-hand-title {
    position: relative !important;
    bottom: 20vh !important;
    left: 0vw !important;
  }
    footer {
    font-size: 0.6em !important;
  }
  #developer-info {
    position: relative !important;
    right: 8vw !important;
  }
  #return-link {
    left: 0vw !important;
 }
 .deck-image {
    right: 30px; 
    top: 62px; 
}
}

@media (max-width: 1200px) and (max-height: 500px) {                    /* modo landscape */
  h1 {
    font-size: 1.6em !important;
    margin-bottom: 50px !important;
  }
  h3, p {
    font-size: 0.7em !important;
  }
  #showControls {
    display: none !important;
  }
  .card {
    width: 40px !important;
    height: 60px !important;
  }
 .big-container-game{
    margin: 10px auto !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr 1fr !important;
    grid-template-areas:
     "main rules"
     "main rules"
     "main rules";
    width: 90vw !important;
    height: 90vh !important;
  }
  .game-main-item, .game-table-container, .table-background {
    height: 80vh !important; 
    width: 40vw !important;
    right: 1vw !important;  
  }
  .game-main-item {
    bottom: 15vh !important;
    position: relative !important;
  }
  .card {
    width: 30px !important;
    height: 40px !important;
  }
  .rules-section-item {
    position: relative !important;
    right: 0vw !important;
    top: 7vh !important;
    width: 40vw !important;
    margin: 0 auto !important;
    box-sizing: border-box;
    font-size: 0.7em !important;
  }
  .dealer-container {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: -79vh !important;
    right: 0 !important;
    width: auto !important;
    height: auto !important;
  }
  #dealer-hand {
    position: relative !important;
    right: 0px !important;
  }
  #player-hand {
    left: -5px !important;
  }
  .data-container {
    width: 85% !important;
    top: 130px !important;
  }
  .player-container {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: -120px !important;
  }
  .player-hand-title {
    position: relative !important;
    bottom: 110px !important;
    left: 0vw !important;
  }
  footer {
    font-size: 0.6em !important;
  }
  #developer-info {
    margin-right: 20px !important;
  }
  #return-link {
    left: 40vw !important;
 }
 .deck-image {
    right: 15px; 
    top: 50px; 
}
}