/* ===== ANOTETE GAMES - SNS Share Module ===== */

/* Overlay */
.ag-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ag-share-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.ag-share-overlay.open .ag-share-panel {
  transform: translateY(0);
}

/* Panel (slides up from bottom) */
.ag-share-panel {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(170deg, #1a1f3d, #0d1020);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-top: 1px solid rgba(70, 170, 184, 0.3);
}

/* Close button */
.ag-share-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.ag-share-close:hover { background: rgba(255,255,255,0.15); }

/* Header */
.ag-share-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.ag-share-header h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 4px;
}
.ag-share-header p {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin: 0;
}

/* Score preview */
.ag-share-score {
  background: rgba(70, 170, 184, 0.1);
  border: 1px solid rgba(70, 170, 184, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #dde8ec;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-line;
  text-align: center;
}

/* SNS Grid */
.ag-share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

/* Each SNS button */
.ag-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-decoration: none;
}
.ag-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.ag-share-btn:active {
  transform: scale(0.95);
}

.ag-share-btn .ag-share-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-share-btn .ag-share-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}
.ag-share-btn .ag-share-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* === SNS Colors === */
.ag-share-btn--x {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.ag-share-btn--x .ag-share-icon { background: #000; }

.ag-share-btn--threads {
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.ag-share-btn--threads .ag-share-icon { background: #000; }

.ag-share-btn--line {
  background: rgba(6,199,85,0.15);
  color: #06C755;
}
.ag-share-btn--line .ag-share-icon { background: #06C755; }

.ag-share-btn--facebook {
  background: rgba(24,119,242,0.15);
  color: #1877F2;
}
.ag-share-btn--facebook .ag-share-icon { background: #1877F2; }

/* CTA (main share trigger button - placed in each game) */
.ag-share-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  margin-bottom: 50px; /* フッターバーとの重なり防止 */
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #46AAB8, #2d8a96);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(70, 170, 184, 0.4), 0 0 40px rgba(70, 170, 184, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: ag-cta-pulse 2s ease-in-out infinite;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ag-share-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 30px rgba(70, 170, 184, 0.5), 0 0 60px rgba(70, 170, 184, 0.2);
}
.ag-share-cta:active {
  transform: scale(0.97);
}
.ag-share-cta svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

@keyframes ag-cta-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(70, 170, 184, 0.4), 0 0 40px rgba(70, 170, 184, 0.15); }
  50% { box-shadow: 0 4px 30px rgba(70, 170, 184, 0.6), 0 0 60px rgba(70, 170, 184, 0.3); }
}

/* Toast notification */
.ag-share-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(70, 170, 184, 0.95);
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100001;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ag-share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
