/* Control bar (New game · Undo · Hint · time and moves) and the New game
   menu, on the game page. */

.header-slot {
  display: flex;
  align-items: center;
  margin-left: auto;
}

/* ---- Control bar (ControlBar.dc.html) ----------------------------------- */

.controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px 10px;
  background: var(--chrome);
  color: var(--chrome-fg);
  border-top: 1px solid var(--chrome-line);
}

.cbtn {
  position: relative;
  flex: 1 1 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--chrome-line);
  border-radius: 10px;
  background: var(--btn);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.cbtn:hover {
  background: var(--btn-hover);
}

.cbtn:disabled {
  opacity: 0.38;
  cursor: default;
}

.cbtn:disabled:hover {
  background: var(--btn);
}

.cbtn.pressed,
.cbtn.pressed:hover {
  background: var(--chrome-fg);
  color: var(--chrome);
}

/* Badge on Undo and Hint: how many are in stock, or "Buy" when none are
   left (both gold; tapping then opens the points shop). */
.cbadge {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.cbadge.buy {
  padding: 0 6px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* Undo or Hint with nothing to do. */
.cbtn.shake {
  animation: shake 0.3s ease-in-out;
}

/* "Undo used 25 points · 45 left": above the bottom bar, below the header
   buttons. */
.points-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 90;
  width: max-content;
  margin: 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--menu);
  border: 1px solid var(--chrome-line);
  color: var(--chrome-fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: pop 0.15s ease-out both;
}

.controls.compact .points-note {
  top: calc(100% + 10px);
  bottom: auto;
}

/* Points pill in the header: left of time and moves on desktop, next to the
   menu button on phones. */
.header-slot {
  gap: 12px;
}

.points {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

button.points {
  position: relative; /* anchors the one-time tip */
  padding-right: 5px;
  cursor: pointer;
}

/* Phones and tablets: the pill sits right next to the menu button's tap
   area (about 12px from its lines) instead of a full header gap away. */
.l-phone .header-slot,
.l-tablet .header-slot {
  margin-right: -16px;
}

/* "+" inside the pill: tap to open the points shop. */
.pplus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

/* Tip below the pill, arrow pointing up at the "+": shown once by itself
   (.show), then on hover. */
.shop-tip {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 95;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--chrome-fg);
  color: var(--chrome);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: pop 0.2s ease-out both;
}

.shop-tip.show,
.points.tip-seen:focus-visible .shop-tip {
  display: block;
}

@media (hover: hover) {
  .points.tip-seen:hover .shop-tip {
    display: block;
  }
}

.shop-tip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 12px;
  width: 10px;
  height: 10px;
  background: var(--chrome-fg);
  transform: rotate(45deg);
}

button.points:hover {
  background: rgba(246, 198, 96, 0.26);
}

.points-label {
  font-weight: 600;
}

.cbtn.active,
.cbtn.active:hover {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.stats {
  margin-left: auto;
  padding-left: 6px;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.stat-time {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-moves {
  font-size: 11px;
  font-weight: 500;
  color: var(--chrome-muted);
}

.controls.no-timer .stat-time {
  display: none;
}

.controls.compact {
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}

.controls.compact .cbtn {
  flex: none;
}

.controls.small .cbtn {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.controls.small .stat-time {
  font-size: 13px;
}

/* New game menu (option D): cards per draw, then game type, then "Deal cards". */
.ng-menu {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  z-index: 100;
  width: 260px;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--chrome-line);
  border-radius: 12px;
  background: var(--menu);
  color: var(--chrome-fg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: pop 0.15s ease-out both;
}

.controls.compact .ng-menu {
  left: 0;
  top: calc(100% + 8px);
  bottom: auto;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
}

.ng-label {
  padding: 2px 6px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--chrome-muted);
}

.ng-menu .seg button {
  flex: 1;
  padding: 7px 0;
}

.ng-divider {
  height: 1px;
  margin: 10px 4px;
  background: var(--chrome-line);
}

.ng-types {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ng-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ng-opt:hover {
  background: var(--btn);
}

.ng-opt[aria-checked='true'] {
  background: var(--btn);
}

/* Radio dot: empty ring, gold filled dot when chosen. */
.ng-radio {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid var(--chrome-muted);
  border-radius: 50%;
}

.ng-opt[aria-checked='true'] .ng-radio {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px);
}

.ng-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--chrome-muted);
}

.ng-deal {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--chrome-fg);
  color: var(--chrome);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.ng-deal:hover {
  opacity: 0.9;
}

/* Desktop (1024px and up): time and moves, then the points pill, sit just
   left of New game; the hamburger menu takes the far-right spot. */
.l-wide .controls.compact .points {
  order: -1;
  margin-right: 4px;
}

.l-wide .controls.compact .stats {
  order: -1;
  margin-left: 0;
  padding: 0 6px 0 0;
}
