/* ==========================================
   Omikuji (Fortune) Styles
   ========================================== */

/* ===========================================
   Ready State UI Improvements
   =========================================== */

/* ボタンを上部に配置するスタイル */
.omikuji-draw-btn-top {
  font-size: 1.3rem !important;
  padding: 1rem 2.5rem !important;
  margin-bottom: 0.5rem;
  animation: pulseButton 2s ease-in-out infinite;
}

@keyframes pulseButton {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.5);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(217, 70, 239, 0.8), 0 0 60px rgba(217, 70, 239, 0.4);
  }
}

/* まだ引いていない案内メッセージ */
.omikuji-not-drawn-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin: 1rem 0;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px dashed rgba(217, 70, 239, 0.5);
  border-radius: 12px;
  animation: noticeGlow 2s ease-in-out infinite alternate;
}

@keyframes noticeGlow {
  0% { border-color: rgba(217, 70, 239, 0.4); }
  100% { border-color: rgba(217, 70, 239, 0.8); }
}

.omikuji-not-drawn-notice .notice-arrow {
  font-size: 1.5rem;
  animation: bounceArrow 1s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.omikuji-not-drawn-notice .notice-text {
  font-size: 0.95rem;
  color: #e879f9;
  font-weight: 600;
}

/* 待機中の萌奈（グレースケール＋控えめ表示） */
.omikuji-mona-container.omikuji-mona-waiting {
  position: relative;
  opacity: 0.6;
  margin-top: 1rem;
}

.omikuji-mona-container.omikuji-mona-waiting .omikuji-mona {
  filter: grayscale(50%) brightness(0.8);
  animation: none;
  box-shadow: 0 0 15px rgba(100, 100, 100, 0.3);
}

.omikuji-mona-container.omikuji-mona-waiting .waiting-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #94a3b8;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Profile image clickable for omikuji */
.clickable-profile {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-profile:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(217, 70, 239, 0.5);
}

.profile-image {
  position: relative;
}

.omikuji-hint {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary) 0%, #9333ea 100%);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(217, 70, 239, 0.4);
}

.profile-image:hover .omikuji-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* Omikuji Modal Specific */
.omikuji-modal .modal-content {
  max-width: 420px;
  text-align: center;
  padding: 2rem;
}

.omikuji-content {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  border: 2px solid rgba(217, 70, 239, 0.3);
}

.omikuji-state {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.omikuji-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.omikuji-subtitle {
  color: var(--muted-text);
  margin-bottom: 2rem;
}

/* Omikuji Mona Image - Enhanced */
.omikuji-mona {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #ff69b4, #ffd700, #ff69b4, #87ceeb) border-box;
  box-shadow: 
    0 0 30px rgba(255, 105, 180, 0.5),
    0 0 60px rgba(255, 105, 180, 0.3),
    0 0 90px rgba(255, 105, 180, 0.1);
  margin-bottom: 1.5rem;
  animation: monaFloat 3s ease-in-out infinite, monaGlow 2s ease-in-out infinite alternate;
  position: relative;
  z-index: 10;
}

.omikuji-mona::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff69b4, #ffd700, #87ceeb, #ff69b4);
  z-index: -1;
  animation: borderRotate 3s linear infinite;
}

@keyframes monaGlow {
  0% { box-shadow: 0 0 30px rgba(255, 105, 180, 0.5), 0 0 60px rgba(255, 105, 180, 0.3); }
  100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 0 80px rgba(255, 105, 180, 0.4); }
}

@keyframes borderRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mona Shaking - Magical Effect */
.omikuji-mona.shaking {
  animation: monaMagicShake 0.5s ease-in-out infinite, monaPowerUp 0.3s ease-in-out infinite alternate;
}

@keyframes monaMagicShake {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1); }
  25% { transform: translateY(-10px) rotate(3deg) scale(1.05); }
  50% { transform: translateY(-5px) rotate(-3deg) scale(1.02); }
  75% { transform: translateY(-15px) rotate(2deg) scale(1.08); }
}

@keyframes monaPowerUp {
  0% { 
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.8), 0 0 60px rgba(255, 105, 180, 0.5);
    filter: brightness(1);
  }
  100% { 
    box-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 105, 180, 0.8);
    filter: brightness(1.1);
  }
}

@keyframes monaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Mona Container - Simple and Clean */
.omikuji-mona-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  position: relative;
}

.omikuji-mona-container.drawing {
  z-index: 10;
}

/* Fullscreen Magic Effect */
.fullscreen-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

/* Magic Burst - Center explosion */
.magic-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 105, 180, 0.8) 0%, rgba(217, 70, 239, 0.5) 30%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: burstExpand 2s ease-out infinite;
}

@keyframes burstExpand {
  0% { 
    width: 50px; 
    height: 50px; 
    opacity: 1;
  }
  100% { 
    width: 800px; 
    height: 800px; 
    opacity: 0;
  }
}

/* Magic Rings - Expanding circles */
.magic-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.magic-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border: 3px solid rgba(255, 215, 0, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ringExpand 2s ease-out infinite;
}

.magic-ring:nth-child(2) {
  animation-delay: 0.4s;
  border-color: rgba(255, 105, 180, 0.6);
}

.magic-ring:nth-child(3) {
  animation-delay: 0.8s;
  border-color: rgba(135, 206, 250, 0.6);
}

@keyframes ringExpand {
  0% { 
    width: 50px; 
    height: 50px; 
    opacity: 1;
    border-width: 4px;
  }
  100% { 
    width: 600px; 
    height: 600px; 
    opacity: 0;
    border-width: 1px;
  }
}

/* Particle Shower - Falling stars */
.particle-shower {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.particle-shower span {
  position: absolute;
  font-size: 2rem;
  animation: particleFall 2s ease-in infinite;
  opacity: 0;
}

.particle-shower span:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle-shower span:nth-child(2) { left: 25%; animation-delay: 0.2s; }
.particle-shower span:nth-child(3) { left: 40%; animation-delay: 0.4s; }
.particle-shower span:nth-child(4) { left: 55%; animation-delay: 0.1s; }
.particle-shower span:nth-child(5) { left: 70%; animation-delay: 0.5s; }
.particle-shower span:nth-child(6) { left: 85%; animation-delay: 0.3s; }
.particle-shower span:nth-child(7) { left: 15%; animation-delay: 0.7s; }
.particle-shower span:nth-child(8) { left: 35%; animation-delay: 0.6s; }
.particle-shower span:nth-child(9) { left: 60%; animation-delay: 0.8s; }
.particle-shower span:nth-child(10) { left: 80%; animation-delay: 0.15s; }
.particle-shower span:nth-child(11) { left: 5%; animation-delay: 0.45s; }
.particle-shower span:nth-child(12) { left: 95%; animation-delay: 0.65s; }

@keyframes particleFall {
  0% { 
    top: -10%; 
    opacity: 0;
    transform: rotate(0deg) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% { 
    top: 110%; 
    opacity: 0;
    transform: rotate(360deg) scale(1.5);
  }
}

/* Channeling Mona - Powerful meditation state */
.omikuji-mona.channeling {
  animation: monaChannel 0.8s ease-in-out infinite alternate, monaFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255, 105, 180, 0.8)) drop-shadow(0 0 60px rgba(217, 70, 239, 0.6));
}

@keyframes monaChannel {
  0% { 
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
  100% { 
    transform: scale(1.1);
    filter: brightness(1.2) saturate(1.3);
  }
}

/* Drawing title glow */
.drawing-title {
  animation: titlePulse 0.5s ease-in-out infinite alternate;
}

@keyframes titlePulse {
  0% { 
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
    transform: scale(1);
  }
  100% { 
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(217, 70, 239, 0.5);
    transform: scale(1.02);
  }
}

.omikuji-wait {
  color: var(--primary);
  font-size: 1.2rem;
  margin-top: 1.5rem;
  font-weight: 600;
  text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
  animation: magicText 1s ease-in-out infinite;
  position: relative;
  z-index: 10;
}

.omikuji-wait::before {
  content: '🔮';
  margin-right: 0.5rem;
  animation: iconSpin 2s linear infinite;
  display: inline-block;
}

.omikuji-wait::after {
  content: '🔮';
  margin-left: 0.5rem;
  animation: iconSpin 2s linear infinite reverse;
  display: inline-block;
}

@keyframes magicText {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
  }
  50% { 
    opacity: 0.9; 
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Draw Button - Magical Style */
.omikuji-draw-btn {
  font-size: 1.2rem;
  padding: 1.2rem 2.5rem;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #ff69b4 0%, #d946ef 50%, #8b5cf6 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 15px rgba(217, 70, 239, 0.4),
    0 0 30px rgba(255, 105, 180, 0.3);
  animation: buttonPulse 2s ease-in-out infinite;
}

.omikuji-draw-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: buttonShine 2s ease-in-out infinite;
}

.omikuji-draw-btn::after {
  content: '✨';
  position: absolute;
  right: 15px;
  animation: buttonSparkle 1s ease-in-out infinite;
}

.omikuji-draw-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(217, 70, 239, 0.6),
    0 0 50px rgba(255, 105, 180, 0.5);
}

.omikuji-draw-btn:active {
  transform: scale(0.98);
}

@keyframes buttonPulse {
  0%, 100% { 
    box-shadow: 0 4px 15px rgba(217, 70, 239, 0.4), 0 0 30px rgba(255, 105, 180, 0.3);
  }
  50% { 
    box-shadow: 0 6px 25px rgba(217, 70, 239, 0.6), 0 0 50px rgba(255, 105, 180, 0.5);
  }
}

@keyframes buttonShine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

@keyframes buttonSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.3) rotate(180deg); opacity: 0.8; }
}

.omikuji-remaining {
  color: var(--muted-text);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Result Styles - Dramatic Reveal */
.omikuji-result-title {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  animation: omikujiTitleReveal 1s ease-out;
}

@keyframes omikujiTitleReveal {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.omikuji-fortune-name {
  font-size: 3.5rem;
  font-weight: 900;
  margin: 1rem 0;
  background: linear-gradient(135deg, currentColor 0%, #ffd700 50%, currentColor 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px currentColor);
  animation: fortuneReveal 0.8s ease-out, textShimmer 3s linear infinite;
}

.omikuji-fortune-name.small {
  font-size: 2rem;
}

@keyframes fortuneReveal {
  0% { 
    transform: scale(0) rotate(-180deg); 
    opacity: 0;
    filter: blur(10px);
  }
  50% { 
    transform: scale(1.3) rotate(10deg);
    filter: blur(0);
  }
  70% {
    transform: scale(0.9) rotate(-5deg);
  }
  100% { 
    transform: scale(1) rotate(0deg); 
    opacity: 1;
  }
}

@keyframes textShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.omikuji-image-container {
  margin: 1.5rem 0;
}

.omikuji-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid;
  box-shadow: 0 0 30px rgba(217, 70, 239, 0.5);
  animation: imageFloat 3s ease-in-out infinite;
}

@keyframes imageFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.omikuji-message {
  font-size: 1.05rem;
  color: var(--light-text);
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: rgba(217, 70, 239, 0.08);
  border-radius: 15px;
  text-align: center;
  line-height: 1.6;
}

.omikuji-lucky {
  margin: 1rem auto;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(217, 70, 239, 0.08) 100%);
  border-radius: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.lucky-label {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.lucky-item {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

/* Action Buttons */
.omikuji-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-twitter {
  background: #1da1f2;
  color: white;
  border: none;
}

.btn-twitter:hover {
  background: #1a91da;
  transform: translateY(-2px);
}

.omikuji-share-btn,
.omikuji-retry-btn {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
}

.omikuji-retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Limit Reached */
.omikuji-limit-message {
  margin: 2rem 0;
}

.omikuji-limit-message p {
  font-size: 1.3rem;
  color: var(--light-text);
}

.omikuji-limit-sub {
  font-size: 1rem !important;
  color: var(--muted-text) !important;
  margin-top: 0.5rem;
}

.omikuji-last-result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
}

.last-result-label {
  color: var(--muted-text);
  margin-bottom: 0.5rem;
}

/* Shared Result Display (from query param) */
.omikuji-shared-notice {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--accent);
}

/* ==========================================
   Shared Result Overlay - CTA to draw own
   ========================================== */

.omikuji-shared-overlay {
  margin-bottom: 1.5rem;
}

.shared-cta-card {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 2px solid rgba(217, 70, 239, 0.5);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.3);
    border-color: rgba(217, 70, 239, 0.5);
  }
  50% { 
    box-shadow: 0 0 35px rgba(217, 70, 239, 0.5), 0 0 60px rgba(217, 70, 239, 0.2);
    border-color: rgba(217, 70, 239, 0.8);
  }
}

.shared-cta-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.shared-cta-icon {
  font-size: 1.8rem;
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-5px) rotate(5deg); }
}

.shared-cta-title {
  font-size: 1.4rem;
  margin: 0;
  background: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.shared-cta-text {
  color: var(--light-text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.shared-draw-btn {
  font-size: 1.2rem !important;
  padding: 1rem 2rem !important;
  width: 100%;
  animation: btnGlow 2s ease-in-out infinite alternate;
}

@keyframes btnGlow {
  0% { box-shadow: 0 0 15px rgba(217, 70, 239, 0.5); }
  100% { box-shadow: 0 0 30px rgba(217, 70, 239, 0.8), 0 0 50px rgba(217, 70, 239, 0.4); }
}

.shared-result-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(100, 100, 100, 0.3);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.shared-label-icon {
  font-size: 1.2rem;
  animation: pointDown 1s ease-in-out infinite;
}

@keyframes pointDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.shared-label-text {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Shared mode: dim the actual result */
#omikuji-result.shared-mode .omikuji-result-title,
#omikuji-result.shared-mode .omikuji-fortune-name,
#omikuji-result.shared-mode .omikuji-image-container,
#omikuji-result.shared-mode .omikuji-message,
#omikuji-result.shared-mode .omikuji-lucky {
  opacity: 0.6;
  filter: grayscale(30%);
}

#omikuji-result.shared-mode .omikuji-image {
  transform: scale(0.85);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .omikuji-modal .modal-content {
    max-width: 90%;
    padding: 1.5rem;
  }

  .omikuji-title {
    font-size: 1.3rem;
  }

  .omikuji-fortune-name {
    font-size: 2.5rem;
  }

  .omikuji-image {
    width: 150px;
    height: 150px;
  }

  .omikuji-actions {
    flex-direction: column;
  }

  .omikuji-share-btn,
  .omikuji-retry-btn {
    width: 100%;
  }

  .omikuji-hint {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
  }

  /* Shared overlay mobile */
  .shared-cta-card {
    padding: 1.2rem;
  }

  .shared-cta-title {
    font-size: 1.2rem;
  }

  .shared-cta-text {
    font-size: 0.9rem;
  }

  .shared-draw-btn {
    font-size: 1.1rem !important;
    padding: 0.9rem 1.5rem !important;
  }
}
