/* ==========================================================================
   BETOOTH COINS WALLET — LUXURY MODERN COMPACT MODAL
   ========================================================================== */

/* Topbar trigger control */
.coins-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--betooth-orange, #f59e0b) 40%, transparent);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--betooth-orange, #f59e0b) 10%, transparent);
  color: var(--text-primary);
  padding: 5px 14px;
  min-height: 40px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.coins-control:hover {
  background: color-mix(in srgb, var(--betooth-orange, #f59e0b) 20%, transparent);
  border-color: color-mix(in srgb, var(--betooth-orange, #f59e0b) 75%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--betooth-orange, #f59e0b) 25%, transparent);
}
.coins-control[hidden] {
  display: none;
}
.coins-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--betooth-orange, #f59e0b) 50%, transparent));
}
.coins-control strong {
  font-variant-numeric: tabular-nums;
  color: var(--accent-orange, #f59e0b);
  margin-inline-start: 2px;
  font-weight: 700;
}
.coins-control:focus-visible,
.coins-dialog button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Modal Dialog */
.coins-dialog {
  box-sizing: border-box;
  position: fixed;
  inset-block-start: calc(var(--topbar-height, 80px) + 12px);
  inset-block-end: auto;
  inset-inline-start: auto;
  inset-inline-end: 18px;
  margin: 0;
  width: min(450px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--topbar-height, 80px) - 28px);
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%);
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--betooth-orange, #f59e0b) 30%, transparent);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 40px color-mix(in srgb, var(--betooth-orange, #f59e0b) 12%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 14.5px;
  line-height: 1.5;
  text-align: start;
  animation: coinsModalFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes coinsModalFade {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.coins-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

/* Header & Title */
.coins-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.coins-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.coins-close {
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 20px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.coins-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: scale(1.05);
}
.coins-subtitle {
  color: var(--text-muted);
  margin: 3px 0 16px;
  font-size: 13px;
}

/* Hero Chamber Card */
.coins-chamber {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 175px;
  padding: 22px;
  margin-block: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--betooth-orange, #f59e0b) 40%, transparent);
  border-radius: 16px;
  background: var(--bg-page) url('../assets/pixel/beto-coins-chamber-clean.png') no-repeat center / cover;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.75), 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.coins-chamber-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  gap: 2px;
}
.coins-chamber-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-orange, #f59e0b);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.coins-amount {
  font-size: 42px;
  font-weight: 800;
  color: var(--neutral-white, #ffffff);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--neutral-white, #ffffff) 10%, color-mix(in srgb, var(--betooth-orange, #f59e0b) 40%, white) 55%, var(--betooth-orange, #f59e0b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--betooth-orange, #f59e0b) 40%, transparent));
  letter-spacing: -0.02em;
}
.coins-chamber-sub {
  font-size: 12px;
  color: color-mix(in srgb, var(--neutral-white, #ffffff) 75%, transparent);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

/* Daily Allowance Refill Badge */
.coins-daily-refill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.refill-icon {
  font-size: 12px;
  filter: drop-shadow(0 0 5px var(--accent-primary));
}

/* Action Buttons (Store / Redeem) */
.coins-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.coins-btn-buy,
.coins-btn-redeem {
  min-height: 44px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.coins-btn-buy:hover:not(:disabled),
.coins-btn-redeem:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: color-mix(in srgb, var(--betooth-orange, #f59e0b) 50%, transparent);
  color: var(--text-primary);
}
.coins-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.coins-disabled-note {
  text-align: center;
  margin: 8px 0 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Modern Segmented Tabs */
.coins-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-block: 14px 12px;
}
.coins-tabs button {
  flex: 1;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  min-height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}
.coins-tabs button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.coins-tabs button[aria-pressed=true] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--betooth-orange, #f59e0b) 85%, transparent), var(--betooth-orange, #f59e0b));
  color: var(--neutral-white, #ffffff);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--betooth-orange, #f59e0b) 35%, transparent);
}

/* Ledger, Info & Refresh */
.coins-dialog .store-summary {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.coins-dialog .store-summary h3 {
  font-size: 14px;
  color: var(--text-primary);
  margin: 12px 0 8px;
}
.coins-dialog .content-admin-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: none;
  padding: 10px 0;
  margin: 0;
  transition: background 0.12s;
}
.coins-dialog .content-admin-row strong {
  font-size: 14px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.coins-dialog .content-admin-row p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 2px 0;
  overflow-wrap: anywhere;
}
.coins-dialog .muted {
  color: var(--text-muted);
  font-size: 11.5px;
}

.coins-dialog .store-summary button,
.coins-refresh {
  font: inherit;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.18s ease;
}
.coins-dialog .store-summary button:hover,
.coins-refresh:hover {
  background: color-mix(in srgb, var(--betooth-orange, #f59e0b) 15%, transparent);
  border-color: color-mix(in srgb, var(--betooth-orange, #f59e0b) 45%, transparent);
  color: var(--accent-orange, #f59e0b);
}
.coins-refresh {
  width: 100%;
  margin-block-start: 14px;
}

.coins-about {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  margin-block: 12px;
}
.coins-dialog [hidden] {
  display: none !important;
}

/* Responsive adjustments */
@media(max-width:600px) {
  .coins-control {
    font-size: 12.5px;
    gap: 5px;
    padding-inline: 10px;
  }
  .coins-control > span {
    max-width: 65px;
    white-space: normal;
    line-height: 1.2;
  }
  .coins-dialog {
    inset-block-start: auto;
    inset-block-end:0;
    inset-inline: 0;
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    padding: 20px;
    border-radius: 20px 20px 0 0;
  }
  .coins-amount {
    font-size: 34px;
  }
  .coins-chamber {
    min-height: 155px;
    padding: 18px;
  }
}
