/* ==========================================================================
   Version A — roll.css (F3)
   Styles for "Roll the reel": header dice button and options popover
   ========================================================================== */

.roll-dice-btn {
  position: relative;
  transition: transform var(--dur-fast) var(--ease);
}

.roll-dice-btn:hover {
  color: var(--text-1);
}

.roll-dice-btn.is-rolling svg {
  animation: dice-spin var(--dur-slow) var(--ease);
}

@keyframes dice-spin {
  0% {
    transform: rotate(0deg) scale(0.9);
  }
  50% {
    transform: rotate(180deg) scale(1.15);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roll-dice-btn.is-rolling svg {
    animation: none;
  }
  .roll-dice-btn {
    transition: none;
  }
}

.popover--roll {
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
}

.roll-popover {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.roll-popover__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.roll-popover__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.roll-popover__icon {
  color: var(--text-2);
  display: flex;
  align-items: center;
}

.roll-popover__title {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
}

.roll-popover__desc {
  margin: 0;
  font-size: var(--fs-12);
  color: var(--text-2);
  line-height: 1.4;
}

.roll-popover__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) 0;
}

.roll-popover__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.roll-popover__row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roll-popover__row-label {
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--text-1);
}

.roll-popover__row-hint {
  font-size: var(--fs-12);
  color: var(--text-3);
}

.roll-popover__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.roll-popover__count {
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.roll-popover__roll-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
}

@media (max-width: 899px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  [data-dialog-close],
  button[data-dialog-close],
  .dialog__close,
  .sheet__close {
    width: var(--hit, 44px) !important;
    height: var(--hit, 44px) !important;
    min-width: var(--hit, 44px) !important;
    min-height: var(--hit, 44px) !important;
  }

  .sheet--roll .roll-popover,
  .dialog--roll .roll-popover {
    width: 100%;
    padding: var(--space-2) 0;
  }

  .sheet--roll .roll-popover__title-row,
  .dialog--roll .roll-popover__title-row,
  .sheet--roll .roll-popover__title,
  .dialog--roll .roll-popover__title {
    display: none;
  }

  .roll-popover__row {
    min-height: var(--hit, 44px);
    padding: var(--space-2) 0;
  }

  .roll-popover__footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin-top: var(--space-2);
  }

  .roll-popover__roll-btn {
    width: 100%;
    min-height: var(--hit, 44px);
    justify-content: center;
  }
}
