/* --- BASE LAYOUT --- */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #0f1722;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

/* --- HILO GAME LAYOUT --- */
.hilo-container {
  display: flex;
  background-color: #1a2230;
  border-radius: 10px;
  padding: 20px;
  gap: 20px;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  max-width: 1100px;
  width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* --- LEFT PANEL --- */
.hilo-left {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 230px;
}

/* Inputs & Buttons */
.amount-section label { font-weight: 600; }
.amount-input { display: flex; justify-content: space-between; align-items: center; background: #0e131b; border-radius: 8px; padding: 5px; }
.amount-input input { width: 80px; border: none; background: transparent; color: #fff; font-weight: bold; font-size: 16px; text-align: center; }
.amount-controls button { background: #1f2a38; border: none; color: #ccc; font-weight: 600; padding: 5px 8px; border-radius: 6px; cursor: pointer; }

.option { background: #202a39; border: none; color: #fff; border-radius: 8px; padding: 10px; text-align: left; cursor: pointer; transition: background 0.2s; }
.option:hover { background: #2b3546; }

.skip-btn, .bet-btn { border: none; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.skip-btn { background: #2c333f; color: #ccc; }
.bet-btn { background: #ff002b; color: #000; }

.demo-note { font-size: 12px; color: #aaa; text-align: center; }

/* --- CENTER PANEL --- */
.hilo-center { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 600px; margin-left: auto; margin-right: auto; }
.choice-buttons { display: flex; align-items: center; justify-content: space-between; gap: 40px; width: 100%; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 140px; height: 140px; border-radius: 12px; cursor: pointer; text-align: center; }
.choice.hi { background: linear-gradient(180deg, #a2ff00, #333300); }
.choice.lo { background: linear-gradient(180deg, #00b7ff, #003344); }

/* --- CARD SLOT --- */
.card-slot { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  margin-bottom: 40px;
}
.card-slot img { width: 180px; height: 260px; border-radius: 10px; box-shadow: 0 0 15px rgba(0,0,0,0.5); }

/* --- ADJUSTED SKIP BUTTON --- */
.skip-small {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c333f;
  border: none;
  color: #ccc;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  z-index: 10;
}

/* --- PROFIT INFO --- */
.profit-info { margin-top: 20px; display: flex; justify-content: center; gap: 20px; width: 100%; flex-wrap: wrap; }
.profit-box { background: #1d2533; padding: 15px 25px; border-radius: 8px; text-align: center; flex: 1; min-width: 120px; }
.profit-box span { color: #aaa; font-size: 12px; }
.profit-box p { margin: 5px 0 0; color: #00ffb7; font-weight: bold; }

/* --- Drawn Cards Area --- */
.drawn-cards-area-wrapper { position: relative; width: 100%; }
.drawn-cards-area { 
  margin-top: 20px; 
  background: #0e131b; 
  border-radius: 8px; 
  height: 140px; 
  width: 100%; 
  display: flex; 
  align-items: center; 
  overflow-x: auto; 
  overflow-y: hidden; 
  gap: 5px; 
  padding: 5px; 
  box-shadow: inset 0 0 8px rgba(0,0,0,0.3); 
  scroll-behavior: smooth; 
  flex-wrap: nowrap;        /* always no wrap */
}
.drawn-cards-area::-webkit-scrollbar { height: 8px; }
.drawn-cards-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.drawn-cards-area::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }

.scroll-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(200,200,200,0.2); border-radius: 50%; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 2; }
.scroll-arrow.left { left: -15px; }
.scroll-arrow.right { right: -15px; }

/* --- MOBILE LAYOUT --- */
@media (max-width: 900px) {
  main { padding: 10px; }

  .hilo-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;  
    margin-top:60px;
    padding: 10px;
    width: 100%;
  }

  .mobile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
    overflow-x: visible;
  }

  .card-slot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
  }

  .card-slot img {
    width: 120px;
    height: 180px;
    border-radius: 10px;
  }

  .choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
  }

  .choice.hi, .choice.lo {
    width: 120px;
    height: 88px;
    font-size: 12px;
  }

  /* --- Drawn cards area behaves like desktop --- */
.drawn-cards-area-wrapper {
  width: 100%;
  height: 100%;
  margin-top: 50px;
  overflow: hidden;        /* hide overflow of inner flex */
  position: relative;
  box-sizing: border-box;
}

.drawn-cards-area {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 6px;
  height: 100px;
  box-sizing: border-box;

  /* Crucial: prevent flex from growing beyond wrapper */
  max-width: 100%;
  overflow: hidden;
}

.drawn-cards-area img {
  width: 60px;
  height: 84px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Optional: scroll new cards left instead of expanding container */
.drawn-cards-area.scroll-left {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}


  .drawn-cards-area div div {
    width: 60px;
    font-size: 10px;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .profit-info {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
  }

  .profit-box {
    padding: 10px 15px;
    min-width: 80px;
  }

  .hilo-left {
    width: 100%;
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hilo-left input,
  .hilo-left .bet-btn,
  .hilo-left .amount-section .amount-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 44px;
    font-size: 16px;
    padding: 0 10px;
  }

  .skip-small { 
    bottom: -10px; 
    width: 90px; 
  }
}
