/* Front-end */

.sammc-wrap {
  position: relative;
  --sammc-w: 440px;
  --sammc-h: 660px;
  width: min(100%, var(--sammc-w));
  margin: 0 auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.sammc-tabs {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
  pointer-events: auto;
}

.sammc-wrap button.sammc-tab {
  all: unset;
  box-sizing: border-box;
}

.sammc-tab {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.72);
  background: rgba(17,17,17,.66);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.16);
}

.sammc-tab span {
  display: inline-block;
}

.sammc-tab:hover {
  background: rgba(17,17,17,.82);
}

.sammc-tab.is-active,
.sammc-tab.sammc-tab-close {
  background: #111;
  border-color: #111;
  color: #fff;
}

.sammc-card {
  position: relative;
  z-index: 1;
  width: min(100%, var(--sammc-w));
  height: auto;
  outline: none;
  margin: 0 auto;
}

.sammc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: var(--sammc-h);
  transform-style: preserve-3d;
  transition: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  background: #ffffff;
}

.sammc-face {
  position: absolute;
  inset: 0;
  z-index: 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.sammc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sammc-missing {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .08) 10px, rgba(255, 255, 255, .03) 10px, rgba(255, 255, 255, .03) 20px);
}

.sammc-yap {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: auto;
}

.sammc-yap-hidden {
  display: none;
}

.sammc-yap-inner {
  width: 100%;
  height: 100%;
  background: transparent;
}

.sammc-yap-close,
.sammc-wrap .sammc-yap-close,
.elementor .sammc-wrap .sammc-yap-close,
.elementor-kit-1196 .sammc-wrap .sammc-yap-close {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #111 !important;
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer !important;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  line-height: 1 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  appearance: none;
  -webkit-appearance: none;
}

.sammc-yap-close:hover,
.sammc-wrap .sammc-yap-close:hover,
.elementor .sammc-wrap .sammc-yap-close:hover,
.elementor-kit-1196 .sammc-wrap .sammc-yap-close:hover {
  background: #000 !important;
  color: #fff !important;
  border: 0 !important;
}

.sammc-yap-close:focus,
.sammc-wrap .sammc-yap-close:focus,
.elementor .sammc-wrap .sammc-yap-close:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.28), 0 2px 10px rgba(0,0,0,.22) !important;
}

.sammc-yap-close span {
  display: block;
  transform: translateY(-1px);
  pointer-events: none;
}

.sammc-help {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, .6);
}

/* Actions */
.sammc-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sammc-actions-overlay {
  position: static;
  z-index: auto;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  margin-top: 10px;
  pointer-events: auto;
}

.sammc-actions-overlay > * {
  pointer-events: auto;
}

.sammc-send-to-me,
.sammc-print-order,
.sammc-read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .82);
  background: rgba(255,255,255,.96);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  color: rgba(0, 0, 0, .88);
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
}

.sammc-send-to-me:hover,
.sammc-print-order:hover,
.sammc-read-more:hover {
  border-color: rgba(0, 0, 0, .25);
}

/* For HTML game iframe */
.sammc-yap-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

/* Orientation */
.sammc-orient-landscape .sammc-stage {
  aspect-ratio: 3 / 2;
}

/* Face visibility (fake flip: swap at halfway) */
.sammc-show-front .sammc-front {
  display: block;
}

.sammc-show-front .sammc-back {
  display: none;
}

.sammc-show-back .sammc-front {
  display: none;
}

.sammc-show-back .sammc-back {
  display: block;
}

/* Hide tabs option */
.sammc-tabs-hidden .sammc-tabs {
  display: none;
}

/* =========================
   Send To Me modal (popup)
========================= */
#sammc-ledger-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

#sammc-ledger-modal.is-open {
  display: block;
}

#sammc-ledger-modal .sammc-ledger-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

#sammc-ledger-modal .sammc-ledger-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 24px));
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

#sammc-ledger-modal .sammc-ledger-x {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(20, 20, 23, .9);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

#sammc-ledger-modal .sammc-ledger-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Saved state */
.sammc-send-to-me.is-saved { opacity: .95; }

@media (max-width: 640px) {
  .sammc-send-to-me,
  .sammc-print-order,
  .sammc-read-more { font-size: 12px; padding: 9px 12px; }
}

.sammc-send-to-me.is-sent {
  opacity: .55;
  pointer-events: auto;
}

.sammc-send-to-me.is-sent::after {
  content: " ✓";
}

/* Ledger logout (this browser) */
button#sammc-ledger-logout-fab,
button.sammc-ledger-logout-fab {
  all: unset;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 999999;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #111;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
button#sammc-ledger-logout-fab:hover,
button.sammc-ledger-logout-fab:hover {
  background: #f6f6f6;
  color: #FDB63E;
}

/* Mailbox preview / embed mode */
html.sammc-mailbox-preview,
body.sammc-mailbox-preview {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
body.sammc-mailbox-preview #wpadminbar,
body.sammc-mailbox-preview #sammc-mailbox-dock,
body.sammc-mailbox-preview .sammc-ledger-logout-fab,
body.sammc-mailbox-preview #sammc-ledger-logout-fab,
body.sammc-mailbox-preview header,
body.sammc-mailbox-preview footer,
body.sammc-mailbox-preview .site-header,
body.sammc-mailbox-preview .site-footer,
body.sammc-mailbox-preview .entry-header,
body.sammc-mailbox-preview .entry-title,
body.sammc-mailbox-preview .page-header,
body.sammc-mailbox-preview .page-title,
body.sammc-mailbox-preview .post-title,
body.sammc-mailbox-preview .elementor-location-header,
body.sammc-mailbox-preview .elementor-location-footer,
body.sammc-mailbox-preview .elementor-widget-theme-post-title,
body.sammc-mailbox-preview .elementor-widget-post-title,
body.sammc-mailbox-preview .sam-ledger-wrap,
body.sammc-mailbox-preview .sam-ledger-root,
body.sammc-mailbox-preview .sammc-actions,
body.sammc-mailbox-preview .sammc-mailbox-dock-btn,
body.sammc-mailbox-preview [data-mailbox-open],
body.sammc-mailbox-preview [data-mailbox-state] {
  display: none !important;
}
body.sammc-mailbox-preview .site,
body.sammc-mailbox-preview .site-main,
body.sammc-mailbox-preview .site-content,
body.sammc-mailbox-preview .content-area,
body.sammc-mailbox-preview .entry-content,
body.sammc-mailbox-preview .post,
body.sammc-mailbox-preview article,
body.sammc-mailbox-preview .elementor,
body.sammc-mailbox-preview .elementor-section,
body.sammc-mailbox-preview .elementor-container,
body.sammc-mailbox-preview .elementor-column,
body.sammc-mailbox-preview .elementor-widget-wrap,
body.sammc-mailbox-preview .elementor-widget-shortcode,
body.sammc-mailbox-preview .elementor-shortcode {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root {
  width: 100% !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 16px 0 20px !important;
  box-sizing: border-box !important;
  background: transparent !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-wrap {
  --sammc-w: clamp(440px, 64vw, 560px);
  width: min(94vw, var(--sammc-w)) !important;
  max-width: var(--sammc-w) !important;
  margin: 0 auto !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  zoom: 1 !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-card,
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-stage,
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-tabs {
  display: block !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-card {
  box-shadow: none !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-help {
  text-align: center !important;
}
body.sammc-mailbox-preview,
body.sammc-mailbox-preview html {
  overflow: auto !important;
}
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-card,
body.sammc-mailbox-preview #sammc-mailbox-preview-root .sammc-stage {
  width: 100% !important;
  max-width: none !important;
}

.sammc-help .sammc-help-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.sammc-help .sammc-help-link:hover,
.sammc-help .sammc-help-link:focus {
  opacity: .8;
}
