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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  overflow-x: hidden;
}

#app {
  text-align: center;
  padding: 20px;
  max-width: 500px;
  width: 100%;
}

header {
  position: relative;
}

header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 3rem;
  background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  margin-bottom: 4px;
}

.tagline {
  font-size: 1.1rem;
  color: #a0a0c0;
  margin-bottom: 8px;
}

.header-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Streak Badge */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  color: #feca57;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: default;
  transition: background 0.2s;
}

.streak-badge:hover {
  background: rgba(255, 255, 255, 0.12);
}

.streak-flame {
  font-size: 1.1rem;
}

.streak-badge.glow {
  animation: streakGlow 0.6s ease;
  border-color: #feca57;
}

@keyframes streakGlow {
  0% { box-shadow: 0 0 0 rgba(254, 202, 87, 0); }
  50% { box-shadow: 0 0 20px rgba(254, 202, 87, 0.5); }
  100% { box-shadow: 0 0 0 rgba(254, 202, 87, 0); }
}

/* Remove Ads Button */
.remove-ads-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.7rem;
  padding: 6px 14px;
  border: 1px solid #feca57;
  border-radius: 20px;
  background: transparent;
  color: #feca57;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.remove-ads-btn:hover {
  background: #feca57;
  color: #1a1a2e;
}

.remove-ads-btn.purchased {
  display: none;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Rating Toggle */
.rating-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.rating-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #666;
  transition: color 0.3s, text-shadow 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-label.active {
  color: #fff;
  text-shadow: 0 0 10px currentColor;
}

#pg13-label.active { color: #48dbfb; }
#r-label.active { color: #ff6b6b; }

.lock-icon {
  font-size: 0.8rem;
  transition: opacity 0.3s;
}

.lock-icon.unlocked {
  display: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #48dbfb;
  transition: 0.4s;
  border-radius: 28px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #ff6b6b;
}

input:checked + .slider:before {
  transform: translateX(28px);
}

/* Wheel */
.wheel-container {
  position: relative;
  display: inline-block;
  margin: 0 auto 24px;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #feca57;
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

#wheel {
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.15), 0 0 60px rgba(72, 219, 251, 0.1);
  transition: filter 0.3s;
}

#wheel.spinning {
  filter: brightness(1.1);
}

/* Spin Button */
.spin-button {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  padding: 14px 60px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff6b6b, #ff9ff3);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
  letter-spacing: 2px;
}

.spin-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 107, 107, 0.6);
}

.spin-button:active {
  transform: scale(0.98);
}

.spin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Ad Banner */
.ad-banner {
  margin-top: 20px;
  transition: opacity 0.3s;
}

.ad-banner.hidden {
  display: none;
}

.ad-placeholder {
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ad-placeholder span {
  color: #888;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ad-placeholder small {
  color: #555;
  font-size: 0.65rem;
}

/* Modals (shared) */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

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

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

.modal-content {
  background: linear-gradient(135deg, #1e2a4a, #2a1e4a);
  border-radius: 20px;
  padding: 32px;
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: slideUp 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.category-badge {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
}

.close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  position: absolute;
  top: 16px;
  right: 20px;
}

.close-btn:hover {
  color: #fff;
}

.joke-text {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #e0e0f0;
}

.joke-punchline {
  font-size: 1.4rem;
  font-weight: 900;
  color: #feca57;
  margin-bottom: 20px;
  animation: slideUp 0.3s ease;
}

.joke-punchline.hidden {
  display: none;
}

.reveal-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 28px;
  border: 2px solid #feca57;
  border-radius: 30px;
  background: transparent;
  color: #feca57;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.reveal-button:hover {
  background: #feca57;
  color: #1a1a2e;
}

.reveal-button.hidden {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border: 2px solid #55efc4;
  border-radius: 30px;
  background: transparent;
  color: #55efc4;
  cursor: pointer;
  transition: all 0.2s;
}

.share-button:hover {
  background: #55efc4;
  color: #1a1a2e;
}

.spin-again-button {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  padding: 12px 36px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #48dbfb, #0abde3);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(72, 219, 251, 0.3);
}

.spin-again-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(72, 219, 251, 0.5);
}

/* Unlock Modal */
.unlock-content {
  text-align: center;
}

.unlock-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: #ff6b6b;
}

.unlock-desc {
  color: #a0a0c0;
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.5;
}

.unlock-close {
  position: absolute;
  top: 16px;
  right: 20px;
}

.watch-ad-button {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #ff6b6b, #e17055);
  color: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  margin-bottom: 16px;
}

.watch-ad-button:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 25px rgba(255, 107, 107, 0.5);
}

.unlock-or {
  color: #555;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.buy-unlock-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border: 2px solid #feca57;
  border-radius: 30px;
  background: transparent;
  color: #feca57;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s;
}

.buy-unlock-button:hover {
  background: #feca57;
  color: #1a1a2e;
}

/* IAP Modal */
.iap-content {
  text-align: center;
}

.iap-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #feca57;
}

.iap-features {
  text-align: left;
  max-width: 260px;
  margin: 0 auto 24px;
}

.iap-feature {
  padding: 8px 0;
  font-size: 1rem;
  color: #c0c0e0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.purchase-button {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  padding: 16px 48px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #feca57, #f0932b);
  color: #1a1a2e;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(254, 202, 87, 0.3);
  margin-bottom: 12px;
}

.purchase-button:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 30px rgba(254, 202, 87, 0.5);
}

.restore-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  text-decoration: underline;
}

.restore-button:hover {
  color: #ccc;
}

/* Premium Category Modal */
.premium-content {
  text-align: center;
}

.premium-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #a29bfe;
}

.premium-cat-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 16px;
}

.premium-desc {
  color: #a0a0c0;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.share-unlock-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border: 2px solid #55efc4;
  border-radius: 30px;
  background: transparent;
  color: #55efc4;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.share-unlock-button:hover {
  background: #55efc4;
  color: #1a1a2e;
}

/* Interstitial Ad */
.interstitial-content {
  text-align: center;
  padding: 40px 32px;
}

.interstitial-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.interstitial-placeholder {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.interstitial-timer {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.close-interstitial-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 24px;
  border: 1px solid #666;
  border-radius: 20px;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.close-interstitial-btn:hover {
  border-color: #fff;
  color: #fff;
}

.close-interstitial-btn.hidden {
  display: none;
}

/* Premium lock overlay on wheel */
.premium-slice-overlay {
  position: absolute;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
  header h1 { font-size: 2.2rem; }
  #wheel { width: 300px; height: 300px; }
  .spin-button { font-size: 1.2rem; padding: 12px 40px; }
  .modal-content { padding: 24px; }
  .joke-text { font-size: 1.1rem; }
  .modal-actions { flex-direction: column; align-items: center; }
  .watch-ad-button, .buy-unlock-button, .share-unlock-button { font-size: 0.95rem; padding: 12px 24px; }
}
