/* Coinflip Casino Theme */
.coinflip-container {
  display: flex;
  justify-content: center; /* center the form on the page */
  align-items: flex-start;
  background: radial-gradient(circle, #1a0000 0%, #000000 100%);
  min-height: 100vh; /* full viewport height */
}
.coinflip-form-container {
  background: linear-gradient(135deg, #300000, #4b1a1a);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
  border: 2px solid gold;
  font-family: 'Segoe UI', sans-serif;
  color: #ffd700;
  display: flex;           /* two-column layout */
  gap: 24px;               /* space between columns */
  min-width: 800px;      /* minimum width for small screens */
}

.coinflip-left,
.coinflip-right {
  flex: 1;                 /* equal width columns */
  min-width: 0;            /* prevents flex overflow */
}

.coinflip-left {
  max-width: 300px;
}
.coinflip-right {
  min-width: 460px;
}

/* Keep your existing styles (button, inputs, etc.) unchanged */
.page-info {
  text-align: center;
  margin-top: 20px;
  color: #ffefc2 !important;
}

/* Optional: style the right column */
.coinflip-previous-bets {
  background-color: rgba(0, 0, 0, 0.4);
  border: 2px solid gold;
  padding: 16px;
  border-radius: 10px;
  color: #ffefc2;
  min-height: 320px;
}

.coinflip-form-container h2 {
  color: #ffefc2;
  text-align: center;
  margin-bottom: 16px;
  font-weight: bold;
}

.coinflip-form-container h3 {
  color: #ffefc2;
  text-align: left;
  margin-bottom: 16px;
  font-weight: bold;
}


.coinflip-form-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-shadow: 1px 1px 3px #000;
}

.coinflip-form-group {
  margin-bottom: 16px;
}

.coinflip-label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #ffefc2;
  background-color: #4b1a1a;
}

.coinflip-input,
.coinflip-select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #b8860b;
  background: #1e1e1e;
  color: #fff;
  font-size: 1rem;
}

.coinflip-input::placeholder {
  color: #aaa;
}

.coinflip-button {
  width: 100%;
  padding: 12px;
  background: radial-gradient(circle, #ffd700 0%, #ff8c00 100%);
  color: #000;
  font-weight: bold;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  transition: transform 0.2s ease-in-out;
}

.coinflip-button:hover {
  transform: scale(1.05);
  background: radial-gradient(circle, #fffacd 0%, #ff8c00 100%);
}

.coinflip-result {
    display: none;
}

.coinflip-result > p {
    margin: 8px 0;
    font-size: 1rem;
    color: #ffefc2;
}

.coinflip-result-data {
    color: #ffd700;
    display: none;
}

.coinflip-loaded-bet {
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid gold;
  padding: 16px;
  border-radius: 10px;
  margin-top: 20px;
  color: #ffd700;
}

.coinflip-loaded-bet > p,
.coinflip-loaded-bet > span,
.coinflip-loaded-bet > h3 {
    margin: 8px 0;
    font-size: 1rem;
    color: #ffefc2;
}

.coinflip-participants-list {
  margin-top: 8px;
  padding-left: 20px;
}

.coinflip-action-buttons {
  margin-top: 16px;
}

.coinflip-action-buttons > button {
  margin-right: 10px;
  padding: 8px 16px;
  background: crimson;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}

.coinflip-action-buttons > button:hover {
  background: darkred;
}

/* Container for heads/tails buttons */
.coinflip-buttons {
  display: flex;
  justify-content: center;
  gap: 16px; /* spacing between buttons */
  margin-top: 12px;
}

/* Round casino-style buttons */
.coinflip-button[data-side] {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: bold;
  background: radial-gradient(circle, #ffd700 0%, #ff8c00 100%);
  color: #000;
  border: 2px solid gold;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  transition: transform 0.2s ease-in-out, background 0.3s;
}

/* Hover effect */
.coinflip-button[data-side]:hover {
  transform: scale(1.1);
  background: radial-gradient(circle, #fffacd 0%, #ff8c00 100%);
}

/* Optional: make each side visually distinct */
.coinflip-button[data-side="heads"] {
  background: radial-gradient(circle, #87ceeb 0%, #1e90ff 100%);
  color: #fff;
}

.coinflip-button[data-side="heads"]:hover {
  background: radial-gradient(circle, #b0e0e6 0%, #1e90ff 100%);
}

.coinflip-button[data-side="tails"] {
  background: radial-gradient(circle, #ff6347 0%, #b22222 100%);
  color: #fff;
}

.coinflip-button[data-side="tails"]:hover {
  background: radial-gradient(circle, #ffa07a 0%, #b22222 100%);
}

.pagination-controls {
  padding-top: 12px;
}

.pagination-controls > button {
  padding: 8px 12px;
  background: radial-gradient(circle, #ffd700 0%, #ff8c00 100%);
  color: #000;
  font-weight: bold;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  transition: transform 0.2s ease-in-out;
}

/* add disabled state */
.pagination-controls > button:disabled {
  background: #555;
  color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination-controls > button:hover {
  transform: scale(1.05);
  background: radial-gradient(circle, #fffacd 0%, #ff8c00 100%);
}

.coinflip-previous-bets-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.coinflip-previous-bets-list li {
  display: grid;
  grid-template-columns: 0.5fr 1fr 1fr 1.8fr; /* tighter first 3, wider date */
  padding: 6px 10px;
  border-bottom: 1px solid #333;
  align-items: center;
  column-gap: 12px; /* small spacing between columns */
}

.coinflip-previous-bets-list .bet-header {
  font-weight: bold;
  background: #222;
  color: #fff;
}

.coinflip-previous-bets-list .bet-row:nth-child(even) {
  background: #111;
}

.coinflip-previous-bets-list .col-amount a {
  color: #2196F3;
  text-decoration: none;
}


/* Mobile / small-touch styles */
@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
  /* Stack columns vertically and reduce padding/gaps for small screens */
  .coinflip-form-container {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    min-width: 0;
    width: calc(100% - 32px);
    margin: 16px auto;
    border-radius: 10px;
  }

  .coinflip-left,
  .coinflip-right {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .coinflip-left {
    max-width: none;
  }
  .coinflip-right {
    min-width: 0;
  }

  /* Slightly smaller headings to fit mobile */
  .coinflip-form-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }
  .coinflip-form-container h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    text-align: center;
  }

  .coinflip-form-group {
    margin-bottom: 12px;
  }

  /* Inputs take full width and have slightly larger tap targets */
  .coinflip-input,
  .coinflip-select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
  }

  /* Heads/Tails button row — tighter spacing and centered */
  .coinflip-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
  }

  /* Smaller round buttons for mobile but still large enough for touch */
  .coinflip-button[data-side] {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Keep hover styles harmless on touch devices — still allow active feedback */
  .coinflip-button[data-side]:active {
    transform: scale(0.98);
  }

  /* Action buttons (join / cancel) stack and stretch full width for easier tapping */
  .coinflip-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }
  .coinflip-action-buttons > button {
    width: 100%;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
  }

  /* Previous bets list: simplify layout to single column rows */
  .coinflip-previous-bets {
    min-height: auto;
    padding: 12px;
  }
  .coinflip-previous-bets-list li {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
    border-bottom: 1px solid #222;
    row-gap: 6px;
    align-items: start;
  }
  .coinflip-previous-bets-list .bet-header {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
  }

  /* Pagination controls: wrap and use larger tap targets */
  .pagination-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 10px;
  }
  .pagination-controls > button {
    flex: 1 1 48%;
    min-width: 120px;
    padding: 10px;
  }

  /* Tighten result and loaded bet spacing */
  .coinflip-result,
  .coinflip-loaded-bet {
    margin-top: 12px;
    padding: 12px;
  }

  /* Ensure primary rectangular buttons remain usable on mobile */
  .coinflip-button:not([data-side]) {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }
}
