/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Body & Table Layout */
  body {
    font-family: Arial, sans-serif;
    background: #006400;
    color: white;
    text-align: center;
    padding: 20px;
  }
  
  .table {
    background: #228B22;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    margin: auto;
    border-radius: 15px;
    box-shadow: 0 0 15px black;
  }
  
  /* Title */
  h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px black;
    text-decoration: underline;
  }
  
  /* Balance & Betting */
  .balance {
    margin-bottom: 15px;
    font-size: 20px;
  }
  .betting {
    margin-bottom: 20px;
  }
  .betting input {
    padding: 8px;
    font-size: 18px;
    width: 150px;
    border-radius: 5px;
    border: none;
    margin-right: 10px;
  }
  .betting button {
    padding: 10px 20px;
    font-size: 18px;
    background: gold;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    font-weight: bold;
  }
  .betting button:hover {
    box-shadow: 0 0 10px gold;
    transform: scale(1.1);
    text-decoration: underline;
  }
  
  /* Dealer & Player Areas */
  .dealer-area, .player-area {
    margin-bottom: 30px;
  }
  .dealer-area h2, .player-area h2 {
    text-decoration: underline;
    margin-bottom: 10px;
  }
  
  /* Cards Container */
  .cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
  }
  
  /* Card Styling with Flip Animation */
  .card {
    width: 90px;
    height: 140px;
    perspective: 1000px;
  }
  .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
  }
  .card.flip .card-inner {
    transform: rotateY(180deg);
  }
  .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid black;
    box-shadow: 3px 3px 8px black;
  }
  .card-front {
    background: white;
    color: black;
  }
  .card-back {
    background: red;
    transform: rotateY(180deg);
  }
  
  /* Controls Styling */
  .controls {
    margin: 20px 0;
  }
  .controls button {
    padding: 10px 15px;
    font-size: 18px;
    margin: 0 5px;
    border: none;
    border-radius: 8px;
    background: gold;
    color: black;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    font-weight: bold;
  }
  .controls button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px gold;
    text-decoration: underline;
  }
  .controls button:active {
    transform: scale(0.95);
  }
  
  /* Message Display */
  #message {
    margin-top: 15px;
    font-size: 22px;
    font-style: italic;
  }
  
  /* Win/Loss Banner */
  .banner {
    font-size: 32px;
    font-weight: bold;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    animation: fadeIn 1s ease-in-out;
  }
  .banner.win {
    background: rgba(0, 255, 0, 0.7);
    color: black;
  }
  .banner.lose {
    background: rgba(255, 0, 0, 0.7);
    color: white;
  }
  .hidden {
    display: none;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* Style for the How to Play button */
#rulesBtn {
    padding: 12px 20px;
    font-size: 18px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    margin: 20px auto;
    display: block;
    text-decoration: none;
    font-weight: bold;
  }
  
  #rulesBtn:hover {
    background: #0056b3;
    transform: scale(1.05);
    text-decoration: underline;
  }
  
  /* Modal Overlay */
  .modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100; /* On top of other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Semi-transparent background */
    padding: 20px;
  }
  
  /* Modal Content Box */
  .modal-content {
    background-color: #fefefe;
    margin: 5% auto;  /* 5% from the top and centered */
    padding: 30px;    /* Increased padding for more spacing */
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    color: #333;
    text-align: left;
    line-height: 1.6;  /* Increased line height for readability */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
  }
  
  /* Modal Title */
  .modal-content h2 {
    margin-bottom: 15px;
    text-align: center;
    text-decoration: underline;
  }
  
  /* Modal Paragraphs and Lists */
  .modal-content p,
  .modal-content ul,
  .modal-content li {
    margin-bottom: 10px;
    font-size: 16px;
  }
  
  /* Close Button */
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  
  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
  }
  
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
  }