.member-wrap.wide { max-width: 560px; }

.card-hint { text-align: center; font-family: var(--hand); font-size: 1.35rem; color: var(--pen); margin: 4px 0 0; }

.flip {
  perspective: 1200px;
  margin: 26px 4px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: rotate(-1deg);
}
.flip:focus-visible { outline: 3px dashed var(--tomato); outline-offset: 8px; }
.flip-inner { display: grid; position: relative; transition: transform 0.7s; transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

.stamp {
  position: relative;
  padding: 16px;
  background-color: var(--wine);
  background-image:
    radial-gradient(circle at 50% 0, var(--paper) 6px, transparent 6.5px),
    radial-gradient(circle at 50% 100%, var(--paper) 6px, transparent 6.5px),
    radial-gradient(circle at 0 50%, var(--paper) 6px, transparent 6.5px),
    radial-gradient(circle at 100% 50%, var(--paper) 6px, transparent 6.5px);
  background-size: 22px 16px, 22px 16px, 16px 22px, 16px 22px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: space no-repeat, space no-repeat, no-repeat space, no-repeat space;
  filter: drop-shadow(4px 6px 5px rgba(43, 18, 22, 0.35));
}

.card-in {
  position: relative;
  background: #e9e3d0;
  border-radius: 10px;
  padding: 14px 14px 12px;
  box-shadow: inset 0 0 0 1px rgba(43, 18, 22, 0.12);
}

.card-top { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 14px; }

.panel {
  position: relative;
  aspect-ratio: 9 / 10;
  background: #c9b898;
  border-radius: 4px;
  overflow: hidden;
  align-self: start;
}
.panel .sticker { position: absolute; width: 46%; filter: drop-shadow(1px 2px 1px rgba(43, 18, 22, 0.3)); }
.panel .s-moon { top: 12%; left: 12%; transform: rotate(-10deg); }
.panel .s-star { bottom: 12%; right: 10%; width: 40%; transform: rotate(14deg); }
.panel .photo { position: absolute; top: 6%; left: 6%; width: 88%; height: 88%; object-fit: cover; }
.panel .frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel:not(.has-photo) .photo, .panel:not(.has-photo) .frame { display: none; }
.panel.has-photo .sticker { display: none; }

.id { display: flex; flex-direction: column; min-width: 0; }
.brand-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.wordmark { font-family: var(--script); font-size: 1.9rem; line-height: 1; color: var(--ink); }
.sub { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; margin-top: 2px; }

.seal {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a8403a, #6e1a18 60%, #3f0d0c);
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 230, 220, 0.85);
  font-size: 0.9rem;
}

.lbl { font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tomato); margin-top: 10px; }
.c-name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.05;
  color: var(--pen);
  overflow-wrap: anywhere;
  border-bottom: 1px solid rgba(36, 53, 126, 0.35);
  padding-bottom: 2px;
}
.c-role { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; margin-top: 4px; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.meta .val { font-size: 0.85rem; font-weight: 700; }
.val.founding {
  display: inline-block;
  color: var(--wine);
  border: 2px solid var(--wine);
  padding: 0 6px;
  transform: rotate(-3deg);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.bar-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(43, 18, 22, 0.4); }
.barcode { flex: 1; height: 34px; color: var(--ink); }
.barcode svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.bar-no { font-size: 0.72rem; letter-spacing: 0.18em; white-space: nowrap; }

.back-in {
  background-color: #efe7d2;
  background-image:
    linear-gradient(90deg, transparent 0 40px, rgba(179, 38, 44, 0.5) 40px 42px, transparent 42px),
    repeating-linear-gradient(transparent 0 27px, rgba(36, 53, 126, 0.22) 27px 28px);
  border-radius: 10px;
  padding: 14px 16px 12px 52px;
  box-shadow: inset 0 0 0 1px rgba(43, 18, 22, 0.12);
  height: 100%;
}
.back-in h3 { font-family: var(--script); font-weight: 400; font-size: 1.7rem; color: var(--ink); line-height: 1.1; }
.back-in .lbl { margin-top: 2px; }
.rules { list-style: none; margin: 8px 0 6px; padding: 0; }
.rules li { font-family: var(--hand); font-weight: 700; font-size: 1.3rem; color: var(--pen); line-height: 28px; }
.back-foot { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; }

.edit-btn { display: block; width: 100%; max-width: 340px; margin: 10px auto 26px; }
.edit-btn[hidden] { display: none; }

.e-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.e-preview {
  flex: none;
  width: 88px;
  height: 88px;
  border: 1.5px dashed var(--ink);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  overflow: hidden;
}
.e-preview img { width: 100%; height: 100%; object-fit: cover; }
.e-tools { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.e-tools input[type="file"] { font-family: var(--type); font-size: 0.8rem; max-width: 100%; }
.mini { align-self: flex-start; background: #fff; border: 1.5px solid var(--ink); padding: 6px 10px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 2px; }
.e-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.e-actions .btn { flex: 1 1 130px; width: auto; }

.settings-title { font-family: var(--serif); font-weight: 900; font-size: 1.3rem; text-transform: uppercase; color: var(--wine); margin: 0 0 14px; }
.s-line { font-family: var(--hand); font-weight: 700; font-size: 1.5rem; color: var(--pen); overflow-wrap: anywhere; margin-bottom: 14px; }
.settings-gap { margin: 20px 0 14px; border: 0; border-top: 1.5px dashed var(--pink); }

@media (max-width: 380px) {
  .wordmark { font-size: 1.6rem; }
  .c-name { font-size: 1.5rem; }
  .card-top { gap: 10px; }
}