:root{
  --bg:#0b0b0c;
  --btn-size-center: 52vmin;
  --btn-size-side: 26vmin;
  --gap: 4vmin;
  --accent: #e8e8e8;
}

html,body{
  height:100%;
  margin:0;
  background:var(--bg);
  color:var(--accent);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Full-screen "screens" */
.screen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4vmin;
  box-sizing:border-box;
}

/* Hidden helper */
.hidden{ display:none; }

#menu{
  gap:var(--gap);
  flex-direction:row;
}

/* Buttons reset */
button.btn{
  background:transparent;
  border:none;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  cursor:pointer;
  -webkit-user-select:none;
  user-select:none;
}

/* Center (largest) */
button.center{
  width:var(--btn-size-center);
  height:var(--btn-size-center);
  flex:0 0 var(--btn-size-center);
}

/* Side buttons */
button.side{
  width:var(--btn-size-side);
  height:var(--btn-size-side);
  flex:0 0 var(--btn-size-side);
}

/* Make images fill their button while preserving aspect */
button img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  pointer-events:none;
}

/* Packs menu layout */
#packsMenu .packs-inner{
  width:100%;
  max-width:560px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Booster pack button a bit smaller than center main */
button.large{
  /* make the booster pack really big on screen */
  width:64vmin;
  height:64vmin;
  flex:0 0 64vmin;
  max-width:720px;
  max-height:720px;
}

/* Reveal view */
.reveal-inner{
  width:100%;
  height:100%;
  max-width:640px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2vmin;
}

.card-slot{
  /* enlarge the revealed card area to match the bigger pack */
  width:92vmin;
  max-width:920px;
  aspect-ratio: 3/4;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  overflow:hidden;
}

.card-btn{
  width:92%;
  height:92%;
  background:transparent;
  border:none;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.card-btn img{
  width:100%;
  height:100%;
  object-fit:contain;
  border-radius:6px;
}

/* small hint text */
#revealHint{
  color:rgba(255,255,255,0.8);
  font-size:3.6vmin;
  text-align:center;
  opacity:0.9;
}

/* Ensure layout fits single viewport height on small screens */
@media (max-height:520px){
  :root{
    --btn-size-center: 40vmin;
    --btn-size-side: 20vmin;
  }
  .card-slot{ width:64vmin; }
  #revealHint{ font-size:4.2vmin; }
}

/* Gallery styles */
.gallery-inner{
  width:100%;
  max-width:920px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:2vmin;
  padding:2vmin;
  box-sizing:border-box;
}
.gallery-header{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.gallery-title{
  font-size:5vmin;
  font-weight:600;
  color:var(--accent);
}
.gallery-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:2vmin;
  width:100%;
  /* allow vertical scrolling to browse all cards */
  max-height: calc(100vh - 22vmin);
  overflow-y: auto;
  padding-right: 2vmin;
  box-sizing: content-box;
  -webkit-overflow-scrolling: touch;
}
.gallery-item{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:8px;
  padding:4%;
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio: 3/4;
  overflow:hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.gallery-item img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  pointer-events:none;
  border-radius:4px;
}
@media (max-width:640px){
  .gallery-grid{ grid-template-columns: repeat(3, 1fr); }
  .gallery-title{ font-size:4.6vmin; }
}

/* count badge for multiples in gallery */
.gallery-item{
  position:relative;
}
.gallery-badge{
  position:absolute;
  right:6px;
  top:6px;
  min-width:26px;
  height:26px;
  padding:0 6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.6);
  color:var(--accent);
  border-radius:14px;
  font-size:3.2vmin;
  font-weight:600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events:none;
}