* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', 'Hiragino Sans', sans-serif;
  background: radial-gradient(ellipse at center, #2a0a4e 0%, #0a0220 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 画面切替 */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ===== タイトル画面 ===== */
#titleScreen {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
#titleScreen.active { display: flex; }

.title-content {
  width: 100%;
  max-width: 600px;
  padding: 40px 20px;
}.title-content img{
  width: 100%;
}

.main-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f7d774 0%, #b8860b 50%, #f7d774 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(247, 215, 116, 0.3);
  margin-bottom: 10px;
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.sub-title {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  color: #f7d774;
  letter-spacing: 3px;
  margin-bottom: 5px;
}

.tagline {
  font-size: clamp(14px, 2vw, 18px);
  color: #ccc;
  margin-bottom: 50px;
}

.start-btn {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  padding: 20px 60px;
  background: linear-gradient(135deg, #ff3366 0%, #c2185b 100%);
  color: #fff;
  border: 3px solid #f7d774;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.6), inset 0 0 20px rgba(247, 215, 116, 0.2);
  transition: all 0.2s;
  letter-spacing: 4px;
}
.start-btn:hover { transform: scale(1.05); box-shadow: 0 0 50px rgba(255, 51, 102, 0.9); }
.start-btn:active { transform: scale(0.98); }

.hint { margin-top: 30px; font-size: 14px; color: #888; }

/* ===== スロット画面 ===== */
#slotScreen { padding: 20px; }

.slot-header {
  text-align: center;
  margin-bottom: 20px;
}
.slot-header h1 {
  font-size: clamp(24px, 4vw, 36px);
  background: linear-gradient(135deg, #f7d774, #b8860b, #f7d774);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slot-header p {
  font-size: clamp(12px, 1.5vw, 14px);
  color: #aaa;
  letter-spacing: 2px;
}

.machine {
  max-width: 700px;
  margin: 0 auto;
  background: linear-gradient(135deg, #2a0a4e, #1a0a3e);
  border: 4px solid;
  border-image: linear-gradient(135deg, #f7d774, #b8860b, #f7d774) 1;
  border-radius: 20px;
  padding: 30px 20px;
  box-shadow: 0 0 40px rgba(247, 215, 116, 0.4),
              inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: borderGlow 4s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(247, 215, 116, 0.4), inset 0 0 30px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 60px rgba(247, 215, 116, 0.7), inset 0 0 30px rgba(0, 0, 0, 0.5); }
}

.reels {
  display: flex;
  gap: 10px;
  justify-content: center;
  background: #000;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #f7d774;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
}

.reel {
  width: clamp(80px, 28vw, 180px);
  height: clamp(80px, 28vw, 180px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
}

.symbol {
  width: 100%;
  height: clamp(80px, 28vw, 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.symbol img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.symbol .emoji {
  font-size: clamp(50px, 18vw, 110px);
}

.controls { text-align: center; }

.spin-btn {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  padding: 15px 50px;
  background: linear-gradient(135deg, #ff3366, #c2185b);
  color: #fff;
  border: 3px solid #f7d774;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 4px;
  margin-bottom: 15px;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
  transition: all 0.2s;
}
.spin-btn:hover:not(:disabled) { transform: scale(1.05); }
.spin-btn:active:not(:disabled) { transform: scale(0.98); }
.spin-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.stop-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.stop-btn {
  flex: 1;
  max-width: 150px;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 700;
  padding: 12px 0;
  background: linear-gradient(135deg, #444, #222);
  color: #f7d774;
  border: 2px solid #f7d774;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.2s;
}
.stop-btn:hover:not(:disabled) { background: linear-gradient(135deg, #666, #333); }
.stop-btn:active:not(:disabled) { transform: scale(0.95); }
.stop-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.result {
  max-width: 700px;
  margin: 20px auto;
  text-align: center;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  color: #f7d774;
  min-height: 50px;
  padding: 10px;
  letter-spacing: 1px;
}

.win-flash {
  animation: flash 0.6s ease-in-out 3;
}
@keyframes flash {
  0%, 100% { box-shadow: 0 0 40px rgba(247, 215, 116, 0.4); }
  50% { box-shadow: 0 0 80px rgba(255, 215, 0, 1), inset 0 0 50px rgba(255, 215, 0, 0.3); }
}

/* ===== チート ===== */
.cheat-section {
  max-width: 700px;
  margin: 20px auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px dashed #ff3366;
  border-radius: 15px;
  text-align: center;
}
.cheat-section h3 {
  color: #ff3366;
  margin-bottom: 15px;
  letter-spacing: 3px;
}
.cheat-section.unlocked {
  animation: cheatReveal 0.6s ease;
}
@keyframes cheatReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cheat-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.cheat-btn {
  padding: 8px 4px;
  font-size: 12px;
  background: #2a0a4e;
  color: #f7d774;
  border: 1px solid #f7d774;
  border-radius: 5px;
  cursor: pointer;
}
.cheat-btn.active { background: #f7d774; color: #2a0a4e; }
.cheat-btn:hover { background: #4a1a6e; }
.cheat-btn.active:hover { background: #ffd700; }

.cheat-clear {
  padding: 8px 20px;
  background: #c2185b;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.slot-footer {
  max-width: 700px;
  margin: 30px auto 0;
  text-align: center;
  font-size: 11px;
  color: #555;
}

/* ===== モーダル ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: modalFadeIn 0.4s ease-out;
}
.modal.show { display: flex; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  max-width: 800px;
  width: 100%;
  background: linear-gradient(135deg, #2a0a4e, #1a0a3e);
  border: 3px solid #f7d774;
  border-radius: 15px;
  padding: 30px 20px;
  position: relative;
  box-shadow: 0 0 60px rgba(247, 215, 116, 0.6);
  text-align: center;
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #f7d774;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: #ffd700; }

#winTitle {
  font-size: clamp(20px, 4vw, 36px);
  color: #f7d774;
  margin-bottom: 10px;
  letter-spacing: 2px;
  padding-right: 40px;
}

#winMessage {
  font-size: clamp(13px, 2vw, 18px);
  color: #ccc;
  margin-bottom: 20px;
}

.iframe-container {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

/* 動画再生時のみ16:9アスペクト維持 */
.iframe-container:has(iframe) {
  padding-bottom: 56.25%;
  height: 0;
  margin-bottom: 15px;
}
.iframe-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-hint {
  font-size: 12px;
  color: #888;
  margin-top: 10px;
}

/* ===== 当たり演出 ===== */
.win-celebration {
  text-align: center;
  padding: 20px 10px;
}

.win-badge {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 800;
  background: linear-gradient(135deg, #ffd700, #ff6b9d, #c14fc7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.win-subtitle {
  color: #ccc;
  margin-bottom: 20px;
  font-size: 14px;
}

.win-divider {
  width: 60%;
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 20px auto;
}

.win-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== シェアボタン ===== */
.share-row,
.share-sns-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.share-secondary {
  margin-top: 12px;
  opacity: 0.7;
}

.share-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #ff6b9d, #c14fc7);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(193, 79, 199, 0.4);
}
.share-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(193, 79, 199, 0.6);
}
.share-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Xシェアボタン強調 */
.share-btn.primary {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(255, 255, 255, 0.2);
  animation: xButtonPulse 2.5s ease-in-out infinite;
}
.share-btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  animation: xButtonShine 3s ease-in-out infinite;
}
.share-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #1a1a1a, #333333);
}
.share-btn.primary:active:not(:disabled) {
  transform: translateY(0) scale(1);
}
@keyframes xButtonPulse {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.5),
      0 0 20px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 4px 25px rgba(0, 0, 0, 0.6),
      0 0 35px rgba(255, 255, 255, 0.5);
  }
}
@keyframes xButtonShine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* サブボタン控えめ */
.share-btn.small {
  padding: 8px 16px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-weight: 600;
}
.share-btn.small:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.share-note {
  font-size: 11px;
  color: #888;
  margin: 8px 0 16px;
  text-align: center;
}

/* ===== 曲を聴くボタン ===== */
.play-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}
.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

/* YouTubeフォールバック */
.youtube-fallback {
  margin-top: 12px;
  text-align: center;
}
.youtube-fallback a {
  display: inline-block;
  padding: 10px 24px;
  background: #ff0000;
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.youtube-fallback a:hover {
  background: #cc0000;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* ===== トースト ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(20, 10, 50, 0.95);
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 200, 50, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== スマホ最適化（統合版） ===== */
@media (max-width: 600px) {
  .modal {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }
  
  .modal-content {
    padding: 24px 14px;
    margin: 10px auto;
  }

  #winTitle {
    font-size: 18px !important;
    margin-bottom: 6px !important;
    padding-right: 36px;
  }
  #winMessage {
    font-size: 12px !important;
    margin-bottom: 10px !important;
  }

  .win-celebration {
    padding: 5px 0 !important;
  }
  .win-badge {
    font-size: 19px !important;
    margin-bottom: 8px !important;
  }
  .win-subtitle {
    font-size: 12px !important;
    margin-bottom: 14px !important;
  }
  .win-divider {
    margin: 14px auto !important;
  }
  
  .win-actions,
  .share-row,
  .share-sns-row {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  .share-btn,
  .share-btn.primary,
  .play-btn {
    width: 100%;
    box-sizing: border-box;
  }
  .share-btn.primary {
    padding: 14px !important;
    font-size: 14px !important;
  }
  .play-btn {
    padding: 14px !important;
    font-size: 14px !important;
  }
  .share-btn.small {
    padding: 10px !important;
    font-size: 12px !important;
  }
  
  .share-note {
    font-size: 10px;
    margin: 6px 0 10px;
  }

  .modal-close {
    top: 6px !important;
    right: 6px !important;
    font-size: 24px !important;
    width: 32px !important;
    height: 32px !important;
  }
}





/* ===== YMOタップ演出 ===== */
.ymo-tap-pulse {
  animation: ymoTapPulse 0.4s ease-out;
}

@keyframes ymoTapPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); }
}

.ymo-float-text {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
  pointer-events: none;
  animation: ymoFloatUp 0.8s ease-out forwards;
  z-index: 1000;
}

@keyframes ymoFloatUp {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50px) scale(1); }
}

.ymo-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid #ffd700;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: ymoRipple 0.6s ease-out forwards;
}

@keyframes ymoRipple {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4); }
}

.ymo-completed {
  animation: ymoCompleted 1s ease-out;
}

@keyframes ymoCompleted {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(2) drop-shadow(0 0 20px #ffd700); }
}

/* リールに position: relative がない場合の保険 */
.reel {
  position: relative;
  overflow: hidden;
}
