@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Playfair+Display:wght@700&family=Noto+Sans+JP:wght@400;700&display=swap');

.promo-screen {
  position: fixed;
  inset: 0;
  background: #f3e0d6;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.promo-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.promo-slide {
  position: relative;
  flex: 1;
  background: #f3e0d6;
}

.mag-cover {
  position: absolute;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1;
}

.mag-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  transition: opacity 0.45s ease;
}

.promo-nav {
  position: absolute;
  bottom: 10px;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  border-radius: 50%;
  transition: all 0.2s;
}

.promo-nav:hover {
  background: var(--pink);
  transform: translateY(-50%) scale(1.1);
}

.prev { left: 20px; }
.next { right: 20px; }

.promo-dots {
  position: absolute;
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
  flex-wrap: wrap;
}

.promo-dot {
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
}

.promo-dot.active {
  background: var(--pink);
  transform: scale(1.4);
}

.enter-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pink);
  color: white;
  border: none;
  padding: 6px 16px;
  font-size: 1.0rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255,105,180,0.4);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
}

.enter-btn:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 12px 30px rgba(255,105,180,0.6);
}

.promo-actions {
  position: absolute;
  bottom: calc(55px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .promo-dots {
    bottom: calc(65px + env(safe-area-inset-bottom));
  }
}

.promo-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--pink);
  width: 100%;
  transform-origin: left;
  z-index: 15;
  border-radius: 0 0 12px 12px;
}

.mag-header {
  position: absolute;
  /* top, left, width, height are set dynamically by JS to sit immediately above .mag-cover */
  height: 7%;
  background: #c9a18a;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(0.55rem, 1.8vw, 0.75rem);
  color: white;
  font-weight: 700;
  pointer-events: none;
  position: relative;
}

.mag-header-bottom {
  content: '';                 /* not needed, but harmless */
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 12px;
  background: radial-gradient(circle 7px at top, #c9a18a 98%, transparent 99%) repeat-x;
  background-size: 14px 12px;
  z-index: 6;
  pointer-events: none;
}

.mag-brand {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(0.8rem, 2.5rem, 2.05rem);
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 3px;
  color: #7a4535;
}

.mag-title {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.6rem, 5.5vw, 3rem);
  font-weight: bold;
  text-shadow: 0 3px 10px rgba(0,0,0,0.8);
  z-index: 12;
  white-space: nowrap;
  pointer-events: none;
}

.mag-vol {
  position: absolute;
  bottom: 5.5%;
  right: 9%;
  text-align: right;
  z-index: 10;
  line-height: 1;
  pointer-events: none;
  opacity: 70%
}

.mag-vol img {
  height: clamp(1.1rem, 3.8vw, 1.8rem);
  width: auto;
  display: block;
}

.mag-left {
  position: absolute;
  left: 4%;
  bottom: 21%;
  display: flex;
  flex-direction: column;
}

.mag-left .mag-tag {
  position: static;
  margin-bottom: 5%;
  width: fit-content;
}

.mag-left .mag-headline {
  position: static;
  width: 100%;
  margin-bottom: 3%;
  margin-left: 12px;
}

.mag-left .mag-desc {
  position: static;
  width: 100%;
  margin-bottom: 5%;
  margin-left: 12px;
}

.mag-tag {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(0.42rem, 1.6rem, 1rem);
  font-weight: 700;
  padding: 1px 12px;
  border-radius: 999px;
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
  
}

.mag-tag-pink {
  background: #f8a5c2;
  color: #7a4535;
}

.mag-tag-blue {
  background: #7ec8e3;
  color: #7a4535;
}

.mag-headline {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  line-height: 1.05;
  z-index: 10;
  pointer-events: none;
  text-shadow: 2px 1px 4px black
}

.mag-h1 {
  font-size: clamp(0.85rem, 2.8vw, 1.25rem);
}

.mag-h2 {
  font-size: clamp(0.85rem, 2.8vw, 1.25rem);
}

.mag-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(0.55rem, 1.7vw, 0.72rem);
  line-height: 1.15;
  z-index: 10;
  pointer-events: none;
  padding: 1px 3px;
  border-radius: 3px;
  text-shadow: 2px 1px 4px black
}



.mag-credit {
  position: absolute;
  bottom: 3.5%;
  left: 4%;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(0.45rem, 1.3vw, 0.6rem);
  z-index: 16;
  pointer-events: none;
  padding: 1px 3px;
  border-radius: 3px;
  text-shadow: 2px 1px 4px black
}

.mag-price {
  position: absolute;
  bottom: 2.5%;
  right: 3.5%;
  background: white;
  color: #7a4535;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(0.55rem, 1.7vw, 0.75rem);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  z-index: 16;
  white-space: nowrap;
  pointer-events: none;
}

.mag-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 245, 238, 0.12) 0%,
    rgba(255, 240, 230, 0.08) 18%,
    rgba(0, 0, 0, 0.28) 48%,
    rgba(0, 0, 0, 0.45) 78%
  );
  z-index: 3;
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}

.mag-cover .mag-image-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(248, 233, 223, 0.18) 0%,
    transparent 25%,
    transparent 55%,
    rgba(248, 233, 223, 0.45) 100%
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 0 0 12px 12px;
}

/* ===== Promo Editor (Up Up Down Down) ===== */
.promo-editor {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 31, 0.92);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  /*padding: 20px;*/
  overflow: auto;
}
.promo-editor-inner {
  width: 100%;
  /*max-width: 980px;*/
  background: #1a1433;
  border: 2px solid var(--pink, #ff69b4);
  border-radius: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  max-height: 100vh; /*default 92*/
  overflow: hidden;
}
.promo-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #3a2f55;
  background: #120d26;
  border-radius: 10px 10px 0 0;
}
.promo-editor-header h3 {
  margin: 0;
  color: var(--pink, #ff69b4);
  font-size: 1.1rem;
}
.promo-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.promo-editor-actions input[type="password"] {
  background: #0f0a1f;
  border: 1px solid #554a77;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  width: 180px;
}
.promo-editor-actions button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-save { background: var(--pink, #ff69b4); color: #0f0a1f; }
.btn-close { background: #3a2f55; color: #fff; }

.promo-config {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 12px 16px;
  background: #120d26;
  font-size: 0.9rem;
  border-bottom: 1px solid #3a2f55;
}
.promo-config label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.promo-config input[type="number"] {
  width: 70px;
  background: #0f0a1f;
  color: #fff;
  border: 1px solid #554a77;
  padding: 2px 6px;
  border-radius: 4px;
}

.promo-cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  align-content: start;
  grid-auto-rows: auto;
}
.promo-card {
  background: #0f0a1f;
  border: 1px solid #554a77;
  border-radius: 8px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.promo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: #1a1433;
  font-size: 0.8rem;
  color: #a0a0c0;
}
.promo-card-del {
  background: #3a2f55;
  color: #ff9a9a;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}
.promo-card-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.promo-img-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.promo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
  border: 1px solid #3a2f55;
  flex-shrink: 0;
}
.promo-img-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.promo-img-controls input {
  width: 100%;
  background: #0f0a1f;
  color: #fff;
  border: 1px solid #554a77;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.promo-upload-btn {
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 0.8rem;
  background: #3a2f55;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.promo-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.promo-fields label {
  font-size: 0.75rem;
  color: #a0a0c0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.promo-fields input,
.promo-fields textarea {
  background: #0f0a1f;
  color: #fff;
  border: 1px solid #554a77;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.promo-fields textarea {
  min-height: 38px;
  resize: vertical;
}

.promo-editor-footer {
  padding: 10px 16px;
  border-top: 1px solid #3a2f55;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #120d26;
  border-radius: 0 0 10px 10px;
}
.promo-editor-footer .btn-add {
  background: #3a2f55;
  color: #a0ffa0;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.promo-status {
  font-size: 0.85rem;
  color: #a0ffa0;
  min-height: 1em;
}

/* Drag and drop for promo cards */
.promo-card {
  cursor: default;
}
.promo-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--pink, #ff69b4);
  z-index: 10;
}
.promo-card.drag-over {
  border-color: #a0ffa0;
  box-shadow: 0 0 0 2px rgba(160, 255, 160, 0.3);
}
.drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  color: #888;
  margin-left: 4px;
  flex-shrink: 0;
}
.drag-handle:active {
  cursor: grabbing;
}

@media (max-width: 700px) {
  .promo-editor {
    padding: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    align-items: stretch;
  }

  .promo-editor-inner {
    max-width: none;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .promo-editor-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 0;
  }

  .promo-editor-header h3 {
    font-size: 1rem;
  }

  .promo-editor-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .promo-editor-actions input[type="password"] {
    width: 100%;
    min-height: 44px;
    font-size: 16px; /* stops iOS zoom */
  }

  .promo-editor-actions button {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    padding: 10px 14px;
  }

  .promo-config {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .promo-config label {
    justify-content: space-between;
  }

  .promo-config input[type="number"] {
    width: 96px;
    min-height: 40px;
    font-size: 16px;
  }

  .promo-cards {
    grid-template-columns: 1fr;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .promo-card {
    height: max-content;
  }

  .promo-card-del {
    width: 36px;
    height: 36px;
  }

  .promo-thumb {
    width: 64px;
    height: 64px;
  }

  .promo-img-controls input,
  .promo-fields input,
  .promo-fields textarea {
    font-size: 16px;
    padding: 8px 10px;
  }

  .promo-upload-btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .promo-fields {
    grid-template-columns: 1fr;
  }

  .promo-editor-footer {
    flex-wrap: wrap;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-radius: 0;
    gap: 8px;
  }

  .promo-editor-footer .btn-add {
    min-height: 44px;
    width: 100%;
  }

  .promo-status {
    width: 100%;
  }
}