/*
 * CGS HTML paytable of SweetPop (src/slot/components/cgs/sweet-pop-cgs-paytable.component.ts).
 * Palette follows the game art: purple swirl panels with a gold frame, candy-pink
 * headings, lavender grid cells, green "BUY" buttons. Font: Barlow of the Betsoft
 * paytable scene, registered at runtime as 'SweetPopPaytable'.
 */

.paytable-wrapper,
.paytable-overlay {
  position: fixed;
  inset: 0;
  height: 100%;
  width: 100%;
}

.paytable-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.paytable-overlay {
  background: rgba(38, 6, 52, 0.9);
  z-index: 2;
}

.paytable-dialog {
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  overflow: hidden;
  height: 90vh;
  width: min(600px, 90vw);
  border-radius: 28px;
  border: 6px solid #ffb400;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.85),
    0 0 48px rgba(255, 110, 200, 0.45),
    0 12px 40px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  background:
    repeating-conic-gradient(
      from 0deg at 50% 38%,
      rgba(255, 255, 255, 0.06) 0deg 9deg,
      rgba(255, 255, 255, 0) 9deg 18deg
    ),
    radial-gradient(circle at 50% 38%, #b032b4 0%, #8a1e8f 40%, #5c1466 75%, #3f0b4a 100%);
  color: #fff5fb;
  font-family: 'SweetPopPaytable', 'Barlow', 'Noto Sans', 'Segoe UI', sans-serif;
  font-weight: 500;
}

.paytable {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---- toolbar ------------------------------------------------------------- */

.paytable-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 14px 16px 6px;
}

.paytable-icon {
  cursor: pointer;
  height: 18px;
  width: 18px;
  color: #ffd6f0;
  filter: drop-shadow(0 1px 2px rgba(60, 0, 70, 0.8));
}

.paytable-icon:hover {
  color: #ffc531;
}

.paytable-icon.is-hidden {
  display: none;
}

.paytable-icon svg {
  height: 100%;
  width: 100%;
}

/* ---- scroll area --------------------------------------------------------- */

.paytable-content {
  overflow: auto;
  padding: 0 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: #ff8fcf #4a0e56;
}

.paytable-content::-webkit-scrollbar {
  width: 5px;
}

.paytable-content::-webkit-scrollbar-track {
  background-color: #4a0e56;
}

.paytable-content::-webkit-scrollbar-thumb {
  background-color: #ff8fcf;
  border-radius: 50px;
}

/* ---- headings ------------------------------------------------------------ */

.paytable-tab {
  margin: 18px 0 20px;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, #fff3b0 0%, #ffc531 48%, #ff8f1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #7a1a86) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.paytable-tab + .paytable-section {
  border-top: none;
}

.paytable-section {
  padding: 18px 0 8px;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #ff9fd6, transparent) 1;
}

.section-title {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  color: #ffd6f0;
  text-shadow:
    0 2px 0 #b3178f,
    0 3px 8px rgba(60, 0, 70, 0.7);
}

/* ---- texts --------------------------------------------------------------- */

.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rule {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
  color: #fff5fb;
}

.inline-symbol {
  height: 44px;
  width: 44px;
  margin: -8px 4px;
  vertical-align: middle;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* ---- symbols & payouts --------------------------------------------------- */

.symbol-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 240, 0.18);
}

.symbol-image {
  flex: 0 0 auto;
  height: 84px;
  width: 84px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
}

.payout-cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.payout-cell {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  border-radius: 8px;
  text-align: center;
  background: linear-gradient(180deg, #d9d6ff 0%, #b8adff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.payout-count {
  font-size: 16px;
  font-weight: 700;
  color: #8a1e8f;
}

.payout-value {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  color: #3d0c4a;
}

.payout-legend {
  background: linear-gradient(180deg, #ffd6f0 0%, #ffa9dc 100%);
}

.payout-legend .payout-count,
.payout-legend .payout-value {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 13px;
  color: #7a0f5c;
}

/* ---- free spins / buy bonus --------------------------------------------- */

.scatter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.scatter-text {
  font-size: 18px;
  line-height: 1.35;
  color: #fff5fb;
}

.buy-intro {
  margin-bottom: 12px;
}

.buy-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.buy-option {
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #fff8c2;
  text-shadow: 0 2px 0 #2f6b08;
  background: linear-gradient(180deg, #9be356 0%, #5fbd21 55%, #3f9d12 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ---- footer -------------------------------------------------------------- */

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 980px) {
  .paytable-dialog {
    height: 100%;
    width: 100%;
    border-radius: 0;
    border-width: 0;
    box-shadow: none;
  }
}

@media (max-width: 500px) {
  .paytable-tab {
    font-size: 36px;
  }

  .section-title {
    font-size: 24px;
  }

  .rule,
  .scatter-text,
  .buy-option {
    font-size: 16px;
  }

  .symbol-row {
    flex-direction: column;
    align-items: stretch;
  }

  .symbol-image {
    height: 72px;
    width: 72px;
    margin: 0 auto;
  }

  .payout-cells {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }

  .payout-legend {
    grid-column: span 2;
  }
}

.top-canvas-node {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.top-canvas-panel {
  height: 100%;
}

.canvas-node {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;

  image-rendering: auto;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  outline: none;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  background-color: #000000;

  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.alert-wrapper {
  display: flex;
  position: fixed;
  height: 100%;
  width: 100%;
  z-index: 1;
  font-family: Arial, 'Helvetica Neue', sans-serif;
}

.alert-overlay {
  position: fixed;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 2;
}

.alert {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0 0 20px;
  background-color: #3a3a3a;
  border: 2px solid #4d4d4d;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(0, 0, 0, 0.35),
    0 10px 40px rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 3;
}

.alert-header {
  position: relative;
  min-height: 28px;
  padding: 16px 52px 8px;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.alert-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
  background-color: #161616;
  border: 2px solid #4d4d4d;
  border-radius: 50%;
  box-sizing: border-box;
  cursor: pointer;
}

.alert-close:hover {
  border-color: #6e6e6e;
}

.alert-close svg {
  height: 12px;
  width: 12px;
  fill: #fff;
}

.alert-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 24px 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  color: #e2e2e2;
}

.alert-actions {
  display: flex;
  justify-content: center;
}

.alert-button {
  appearance: none;
  min-width: 96px;
  padding: 9px 24px;
  background-color: #161616;
  border: 2px solid #4d4d4d;
  border-radius: 21px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.alert-button:hover {
  border-color: #6e6e6e;
}

.alert-button:active {
  transform: translateY(1px);
}

.free-rounds-panel {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  background-color: rgba(22, 22, 22, 0.85);
  border: 2px solid #4d4d4d;
  border-radius: 21px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  color: #e2e2e2;
  font-family: Arial, 'Helvetica Neue', sans-serif;
  font-size: 13px;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
}

.free-rounds-panel__label {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9a9a9a;
}

.free-rounds-panel__count {
  font-size: 15px;
  font-weight: 700;
  color: #f5c451;
  font-variant-numeric: tabular-nums;
}

.free-rounds-panel__separator {
  width: 1px;
  height: 14px;
  background-color: #4d4d4d;
}

.free-rounds-panel__value {
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.free-rounds-panel__value--win {
  color: #f5c451;
}

.free-rounds-popup-amount {
  font-size: 30px;
  font-weight: 700;
  color: #f5c451;
  font-variant-numeric: tabular-nums;
}

.win-cap-popup-amount {
  font-size: 30px;
  font-weight: 700;
  color: #f5c451;
  font-variant-numeric: tabular-nums;
}

.betsoft-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;

  /* Blocking backdrop: while a dialog is shown the overlay must swallow every
     user action so nothing reaches the game canvas underneath (e.g. spamming
     SPIN through an FRB-finished dialog). It sits above the canvas (z-index),
     captures pointer input, and kills touch gestures / text selection. */
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.betsoft-alert-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 410px;
  min-height: 230px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: Arial, sans-serif;
  text-align: center;
}

.betsoft-alert-title {
  font-size: 24px;
  font-weight: bold;
}

.betsoft-alert-text {
  font-size: 18px;
  line-height: 1.5;
  /* Multi-line dialog texts (e.g. FRB launch greeting + rounds counter). */
  white-space: pre-line;
}

.betsoft-alert-buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.betsoft-alert-button {
  padding: 10px 36px;
  font-size: 14px;
  font-weight: bold;
  color: #000;
  background: #00fd67;
  border: 1px solid #00d858;
  border-radius: 4px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition:
    background 0.2s,
    border-color 0.2s;
}

/* Icon buttons (refresh balance). The icon is an inline SVG, so centering is
   pure geometry — no font metrics involved — and `align-self` keeps the button
   the same height as the word buttons standing next to it. */
.betsoft-alert-button--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 24px;
}

.betsoft-alert-button--icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.betsoft-alert-button:hover {
  background: #00d858;
  border-color: #00b349;
}

.betsoft-alert-button--loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.betsoft-alert-button--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: betsoft-btn-spin 0.6s linear infinite;
}

@keyframes betsoft-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* RC-specific overrides on top of betsoft-alert.css (compound selectors win over
   the base single-class rules regardless of load order). RC needs its three
   buttons on one row (reference layout), so widen the dialog and disable wrap. */
.betsoft-alert-dialog.betsoft-rc-dialog {
  width: auto;
  max-width: 640px;
}

.betsoft-alert-buttons.betsoft-rc-buttons {
  flex-wrap: nowrap;
}

/* Equal-width buttons; long labels ("Confirm and Keep") wrap to two lines. */
.betsoft-alert-buttons.betsoft-rc-buttons .betsoft-alert-button {
  flex: 1 1 0;
  white-space: normal;
}

/* Custom-dialog message wraps within the dialog even without explicit <br>. */
.betsoft-rc-custom-text {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Interval Selection carousel (‹ 16 minutes 40 seconds ›). */
.betsoft-rc-interval {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #fff;
  font-family: Arial, sans-serif;
}

.betsoft-rc-interval-value {
  min-width: 180px;
  text-align: center;
  font-size: 16px;
  padding: 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  margin-top: 4px;
}

.betsoft-rc-interval-arrow {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
  /* Stretch to the value box height and center the glyph so the arrows sit on the
     same line as the text instead of dropping below the baseline. */
  display: flex;
  align-items: center;
  align-self: stretch;
}

