/* Make html/body fill the entire viewport, no scrolling. */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Prevent scrolling */
  font-family: Arial, Helvetica, Nimbus Sans L, Liberation Sans, FreeSans, sans-serif;
}

/* Flex container for the entire page. */
body {
  display: flex;
  flex-direction: column;
}

/* The navbar is naturally at the top (flex: 0 0 auto). */

/* The main content is flexible to fill remaining space. */
#mainContent {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative; /* so that #diceRollerContainer can fill it */
  min-height: 0; /* crucial for preventing overflow issues in flex layouts */
}

/* The dice area should flex-grow and fill the available space
   above the selection UI. */
#diceRollerContainer {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 0; /* crucial for preventing overflow issues in flex layouts */
}

/* This is where Three.js puts its canvas. */
#diceRoller {
  width: 100%;
  height: 100%;
}

/* The swipe overlay, absolutely positioned within #diceRollerContainer. 
   Subtract 120px from the bottom so it doesn't cover the selection UI. */
.center_field {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 120px; /* or match the .selectionUI height */
  z-index: 2;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Style the text in the center field. */
.center_field p {
  color: #000;
  font-size: 1.3rem;
  text-align: center;
  margin: 0;
}

/* The start overlay is fixed on top of everything until hidden. */
#startOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The white content box in the overlay. */
.overlay-content {
  background: #fff;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  max-width: 400px;
  width: 90%;
}

/* Button in top-right of overlay */
.info-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}
.info-button:hover {
  color: #000;
}

/* The selection UI is a fixed-height area at the bottom of #mainContent. */
#selectionUI {
  flex: 0 0 auto;
  height: 120px; /* or your desired fixed height */
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem;
  z-index: 3;
  overflow-y: auto; /* Allow scrolling on mobile when panel expands */
}

/* Footer is below everything else. */
footer {
  flex: 0 0 auto;
  z-index: 9999;
}

.credits{
  font-size:.8rem;
}
/* Buttons color classes */
.btn-blue {
  background-color: #00a3e0 !important;
  color: #fff !important;
}
.btn-green {
  background-color: #78be20 !important;
  color: #fff !important;
}
.btn-maroon {
  background-color: #8c1d40 !important;
  color: #fff !important;
  border:0 !important;
}
.btn-gold {
  background-color: #ffc627 !important;
  color: #000 !important;
  border:0 !important;

}

.equal-btn {
  text-align: center;
  width: 100% !important;
}

#desktopSelection .col-3 > .btn.equal-btn {
  display: block !important;
  width: 100% !important;
}

.dice-result {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #333;
}

/* Indicate unselected state */
.btn:not(.selected) {
  background-color: #bfbfbf !important;
  color:#000 !important;
}

/* Remove focus outlines. */
.btn:focus,
.btn:active:focus,
.btn:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Mobile Circle Buttons */
.circle-buttons-row {
  display: flex;
  justify-content: space-around;
  margin: 0.5rem auto;
  max-width: 300px;
}

.btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  margin: 0 8px;
  padding: 0;
}

.btn-circle:not(.selected) {
  opacity: 0.6;
}

.btn-circle:focus {
  outline: none;
}

/* Toggle Arrow */
.toggle-arrow-container {
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}

.toggle-arrow {
  background: none;
  border: none;
  color: #555;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 1rem;
  transition: transform 0.3s ease;
}

.toggle-arrow.active {
  transform: rotate(180deg);
}

/* Expandable Panel */
.expandable-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #eee;
}

.expandable-panel.open {
  max-height: 500px; /* Large enough to fit all content */
  transition: max-height 0.5s ease;
}

/* Expanded Button Row */
.expanded-button-row {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #eee;
  justify-content: space-between;
}

.mobile-expanded-btn {
  flex: 0 0 40%;
  margin-right: 0.75rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
}

.mobile-result {
  flex: 0 0 55%;
  font-size: 1rem;
  padding: 0.25rem;
  color: #333;
  text-align: left;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

/* Basic styles for the shake overlay (permission prompt) */
#shakePermissionOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none; /* initially hidden */
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#shakePermissionOverlay .overlay-content {
  background: #fff;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
#shakePermissionOverlay button {
  margin: 0.5rem;
}

/* Instructions area */
#instructions {
  text-align: center;
  display: none;
}
#instructions p {
  margin-bottom: 10px;
}

/* Mobile vs Desktop elements */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  
  #selectionUI {
    height: auto;
    min-height: 90px;
    max-height: 65vh; /* Limit maximum height on mobile */
  }
  
  .center_field {
    bottom: 110px; /* Adjust for smaller selection UI */
  }
  footer .py-2 {
    padding-top: 0.15rem !important;
    padding-bottom: 0.15rem !important;
    font-size: 0.8rem;
  }
  .circle-buttons-row {
    margin: 0.25rem auto; /* Changed from 0.5rem */
  }
  
  /* Reduce margin on the toggle arrow */
  .toggle-arrow-container {
    margin-top: 0.1rem; /* Changed from 0.25rem */
  }
}

@media (max-width: 576px) {
  .center_field p {
    font-size: 1.1rem;
  }
  
  .mobile-expanded-btn {
    font-size: 0.9rem;
    padding: 0.3rem 0.4rem;
  }
  
  .mobile-result {
    font-size: 0.9rem;
  }
  
  .btn-circle {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* Floating Action Button for rolling dice */
.roll-fab {
  position: absolute;  /* Keep as absolute */
  top: 10px;           /* Position from top instead of bottom */
  left: 20px;          /* Position from left instead of right */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #212529; /* Bootstrap dark color */
  color: white;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
}

/* Keep other styles the same */

/* Adjust position for mobile screens */
@media (max-width: 768px) {
  .roll-fab {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    top: 10px;     /* Keep consistent top position */
    left: 15px;    /* Slight adjustment for smaller screens */
  }
}

@media (max-width: 576px) {
  .roll-fab {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    top: 8px;      /* Small adjustment for very small screens */
    left: 12px;
  }
}
/* Add this to your styles.css file */

.gesture-images {
  margin-top: 15px;
  text-align: center;
}

.gesture-img {
  max-width: 150px;
  max-height: 150px;
  margin: 0 auto;
  display: block;
}

/* Make instructions visible by default */
#instructions {
  display: block;
  text-align: center;
}

/* Responsive adjustments for gesture images */
@media (max-width: 768px) {
  .gesture-img {
    max-width: 120px;
    max-height: 120px;
  }
}

@media (max-width: 576px) {
  .gesture-img {
    max-width: 100px;
    max-height: 100px;
  }
}

/* Make superscripts (the registered trademark) a bit smaller. */
sup{
  font-size: 0.5em !important;
  top: -0.75em !important;
}