.show-controls .save-card-control {
  background: linear-gradient(135deg, #f2d98c, #b98d2d);
  border-color: rgba(255, 237, 177, .88);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .26);
  color: #08271f;
  gap: 6px;
  padding: 0 13px;
  width: auto;
}

.show-controls .save-card-control[hidden] { display: none; }
.show-controls .save-card-control span { font-size: 17px; line-height: 1; }
.show-controls .save-card-control b { font-size: 10px; font-weight: 800; white-space: nowrap; }
.show-controls .save-card-control:hover { box-shadow: 0 10px 34px rgba(215, 182, 91, .34); transform: translateY(-2px); }

body.card-modal-open { overflow: hidden; }

.card-modal {
  align-items: center;
  direction: rtl;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1000;
}

.card-modal[hidden] { display: none; }

.card-modal-backdrop {
  backdrop-filter: blur(15px);
  background: rgba(1, 12, 10, .83);
  border: 0;
  inset: 0;
  position: absolute;
  width: 100%;
}

.card-modal-panel {
  background: linear-gradient(155deg, #fffdf7, #eee4ca);
  border: 1px solid rgba(231, 202, 121, .72);
  border-radius: 18px;
  box-shadow: 0 34px 110px rgba(0, 0, 0, .52);
  max-height: calc(100svh - 40px);
  max-width: 470px;
  overflow: auto;
  padding: 20px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.card-modal-heading {
  align-items: center;
  color: #0a3329;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-modal-heading span {
  color: #9b7728;
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 3px;
}

.card-modal-heading h2 { font-size: 25px; margin: 0; }

.card-modal-heading > button {
  align-items: center;
  background: rgba(9, 52, 42, .08);
  border: 0;
  border-radius: 50%;
  color: #173c33;
  display: flex;
  font-size: 23px;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.card-preview-wrap {
  align-items: center;
  aspect-ratio: 9 / 16;
  background: radial-gradient(circle at 50% 30%, #155244, #031713 72%);
  border: 1px solid #ccb164;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-preview-wrap img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.card-loading {
  color: #f0d991;
  font-size: 13px;
}

.card-loading::before {
  animation: card-spin 1s linear infinite;
  border: 2px solid rgba(240, 217, 145, .25);
  border-radius: 50%;
  border-top-color: #f0d991;
  content: "";
  display: block;
  height: 28px;
  margin: 0 auto 11px;
  width: 28px;
}

.card-modal-hint {
  color: #60706a;
  font-size: 11px;
  line-height: 1.8;
  margin: 12px 2px;
  text-align: center;
}

.card-modal-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }

.card-modal-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  justify-content: center;
  min-height: 48px;
  padding: 0 12px;
}

.card-modal-actions button:disabled { cursor: wait; opacity: .45; }
.card-share-button { background: linear-gradient(135deg, #165847, #082f27); color: white; }
.card-download-button { background: linear-gradient(135deg, #f0d98e, #c09a3c); color: #17362e; }

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

@media (max-width: 760px) {
  .show-controls { bottom: 16px; gap: 5px; }
  .show-controls button, .show-controls a { height: 34px; width: 34px; }
  .show-controls .save-card-control { height: 36px; padding: 0 11px; }
  .card-modal { padding: 12px; }
  .card-modal-panel { max-height: calc(100svh - 24px); padding: 15px; }
  .card-preview-wrap { margin: auto; max-height: 63svh; }
}
