/* ============================================================
   bottom-sheet.css — Drag-to-dismiss number entry sheet
   ============================================================ */

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 250;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}
.bottom-sheet.is-open {
  visibility: visible;
  opacity: 1;
}

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.bottom-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: 720px;
  margin: 0 auto;
  max-height: 92dvh;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-top: 1px solid var(--line-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 4px 16px calc(20px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  will-change: transform;
  touch-action: none;
}
.bottom-sheet.is-open .bottom-sheet__panel {
  transform: translateY(0);
}
.bottom-sheet.is-dragging .bottom-sheet__panel {
  transition: none;
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--ink-3);
  border-radius: 2px;
  margin: 8px auto 4px;
  opacity: 0.6;
}

.bottom-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.bottom-sheet__head h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* -- Quick color buttons ------------------------------------ */
.quick-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.color-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink);
  transition: transform 0.1s, background 0.15s;
}
.color-quick:active { transform: scale(0.97); }
.color-quick__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.color-quick--red    { border-color: rgba(212, 54, 74, 0.4); }
.color-quick--red .color-quick__dot   { background: var(--red); }
.color-quick--red:hover  { background: rgba(212, 54, 74, 0.1); }
.color-quick--black  { border-color: rgba(255, 255, 255, 0.15); }
.color-quick--black .color-quick__dot { background: #1a1a1a; border: 1px solid #444; }
.color-quick--black:hover { background: rgba(255, 255, 255, 0.05); }
.color-quick--green  { border-color: rgba(26, 122, 77, 0.5); }
.color-quick--green .color-quick__dot { background: var(--green); }
.color-quick--green:hover { background: rgba(26, 122, 77, 0.15); }

/* -- Replay row --------------------------------------------- */
.replay-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.replay-label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.replay-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.replay-chips::-webkit-scrollbar { display: none; }
.replay-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: #fff;
  flex-shrink: 0;
  border: 2px solid transparent;
  background: var(--bg-2);
  transition: transform 0.1s, border-color 0.15s;
}
.replay-chip:active { transform: scale(0.92); }
.replay-chip--red   { background: var(--red); }
.replay-chip--black { background: #2a2a2a; }
.replay-chip--green { background: var(--green); }
.replay-chip:empty {
  background: var(--bg-2);
  border: 1px dashed var(--line);
  cursor: default;
}

/* -- Number grid -------------------------------------------- */
.number-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.num-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-md);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
}
.num-cell:active { transform: scale(0.94); }
.num-cell--red   { background: linear-gradient(160deg, #e8506b 0%, #a91b2d 100%); }
.num-cell--black { background: linear-gradient(160deg, #2c2c2c 0%, #0a0a0a 100%); }
.num-cell--green { background: linear-gradient(160deg, #2bbd7a 0%, #126b41 100%); }

.num-cell__count {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  line-height: 1;
}

/* Zero and 00 take a full row, wider than tall — like a real roulette table */
.num-cell--tall {
  grid-column: 1 / -1;
  aspect-ratio: 3 / 1;
  max-height: 64px;
  font-size: var(--fs-xl);
}

.bottom-sheet__hint {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-align: center;
  margin-top: 4px;
  line-height: 1.4;
}

/* -- Replay chip disabled when empty ---------------------- */
.replay-chips:empty + .replay-label,
.replay-chips:empty::before {
  content: "Tap a number below to start — replays will appear here.";
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.replay-chips:not(:empty) + .replay-label,
.replay-chips:not(:empty) ~ * { /* no-op */ }
