@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Muli', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

.container {
  display: flex;
  width: 90vw;
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}

.panel {
  flex: 0 0 100px;
  height: 500px;
  margin-right: 5px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: all 700ms ease-in;
  scroll-snap-align: start;
}

.panel h3 {
  font-size: 24px;
  position: absolute;
  bottom: 20px;
  left: 20px;
  margin: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.panel.active {
  flex: 0 0 310px;
}

.panel.active h3 {
  opacity: 1;
  text-shadow: 1px 1px 2px black;
  transition-delay: 0.7s;
}

.overview {
  background-color: #fff;
  padding: 1rem;
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  max-height: 100%;
  transform: translateY(101%);
  overflow-y: auto;
  transition: transform 0.3s ease-in;
}

.overview p {
  color: black;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.panel.active:hover .overview {
  transform: translateY(0);
  transition-delay: 0.3s;
}

.panel.active:hover .overview p {
  opacity: 1;
  transition-delay: 0.7s;
}

/* Slot machine header styles */
body {
  font-family: Courier, monospace;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  padding-top: 150px;
  background: #000000;
  color: #333;
  display: block; /* Ensure vertical stacking */
  overflow-y: auto; /* Allow vertical scrolling */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #f9f9f9;
  padding: 1rem 2rem;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 1000px;
  width: 90%;
  margin: 0 auto;
  z-index: 10;
 /* border: 1rem black; */
  
}

/*header::before {*/
/*  content: '';*/
/*  position: absolute;*/
/*  top: -100px;*/
/*  left: -100vw;*/
/*  right: -100vw;*/
/*  bottom: 0;*/
/*  background: #000000;*/
/*  z-index: 10;*/
/*}*/

header h1 {
  margin: 0;
}

nav {
  margin-top: 0.5rem;
}

nav a {
  margin-right: 1rem;
  color: #000000;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

.sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 15rem;
  height: 30rem;
  padding: 1rem;
}

.writer {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

article {
  background: #fff;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

article h2 {
  margin-top: 0;
}

article p {
  margin-bottom: 1rem;
}

article ul {
 padding-left: 1rem; 
}

footer {
  text-align: center;
  background: #f9f9f9;
  padding: 1rem;
  margin-top: 2rem;
}

.slot-container {
  perspective: 1000px;
  display: flex;
  justify-content: center;
}

#slot-machine {
  font-size: 1.5rem;
  font-weight: lighter;
  color: #ffffff;
  display: flex;
  gap: 1rem;
  transform-style: preserve-3d;
  padding-bottom: 1rem;
}

.reel {
  position: relative;
  width: 200px;
  height: 2rem;
  transform-style: preserve-3d;
  transform-origin: center center;
  animation-fill-mode: forwards;
  background: none;
  border-radius: 8px;
  perspective: inherit;
}

.reel-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #000000, #3d3d3d);
  border: 3px solid #ffffff;
  border-radius: 8px;
  box-shadow: inset 0 2px #e3e3e3, 0 8px 12px rgba(1, 1, 1, 0.25);
  backface-visibility: hidden;
  line-height: 3.5rem;
}

.reel-face.next {
  transform: rotateX(180deg);
}

@keyframes reelRoll {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-180deg); }
}

/* Mobile styles */
@media (max-width: 600px) {
  
  body {
    padding-top: 100px; /* Adjust for mobile header height */
  }
  
  header {
    padding: 1rem;
    margin: 0 auto;
    width: 95%;
    top: 0;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
  
  nav {
    margin-top: 0.5rem;
  }
  
  nav a {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.3rem;
  }
  
  /* Slot machine mobile scaling */
  .slot-container {
    perspective: 500px;
    width: 100%;
  }
  
  #slot-machine {
    font-size: 0.85rem;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2x2 grid */
    grid-template-rows: auto auto;
    justify-items: center;
    width: 100%;
  }
  
  .reel {
    width: 42vw; /* Fit two reels side by side with gap */
    max-width: 180px;
    height: 1.5rem;
  }
  
  .reel-face {
    font-size: 0.75rem;
    border: 2px solid #ffffff;
    line-height: 1.5rem;
    padding: 0 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  article {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Expanding panels mobile styles */
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding: 170px 0;
  }
  
  /* Ensure main container for panels stacks vertically */
  body > .container {
    display: flex;
    flex-direction: column;
    width: 90%;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
    align-items: center;
    gap: 10px;
  }
  
  .container {
    flex-direction: column;
    width: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
    align-items: center;  /* Center panels horizontally */
    gap: 10px;            /* Consistent spacing between panels */
  }
  
  .panel {
    flex: 0 0 auto;
    width: 90vw;
    height: 80px;         /* Collapsed height */
    max-height: none;     /* Remove any height restrictions */
    margin-right: 0;
    margin-bottom: 0;
    scroll-snap-align: none;
    transition: height 0.5s ease-in-out, flex 0.5s ease-in-out;
  }
  
  .panel.active {
    height: 500px;        /* Expanded height - increase this number to show more */
    width: 90vw;
    flex: 0 0 auto;
    transition: height 0.5s ease-in-out, flex 0.5s ease-in-out;
  }
  
  .panel h3 {
    font-size: 18px;
    bottom: 15px;
    left: 15px;
  }
  
  .panel.active h3 {
    opacity: 1;
    text-shadow: 1px 1px 2px black;
    transition-delay: 0.5s;
  }
  
  /* On mobile, show overview on tap/click instead of hover */
  .overview {
    transform: translateY(101%);
    transition: transform 0.4s ease-in-out;
  }
  
  .panel.active .overview {
    transform: translateY(0);
    transition-delay: 0.5s;
  }
  
  .panel.active .overview p {
    opacity: 1;
    transition-delay: 0.7s;
  }
}