/* css/popup-overlays.css */
:root {
  --popup-width: 320px;
  --accent-color: gold;
  --text-glow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  --bg-dark: #2a0a1f;
  --bg-darker: #12000f;
  --ribbon-gradient: linear-gradient(to right, #FFD700, #FF8C00);
  --btn-glow: rgba(255, 215, 0, 0.7);
}

/* Overlay System - Interactive Styling from page.html */
:root {
  --popup-width: 320px;
  --accent-color: gold;
  --text-glow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  --bg-dark: #2a0a1f;
  --bg-darker: #12000f;
  --ribbon-gradient: linear-gradient(to right, #FFD700, #FF8C00);
  --btn-glow: rgba(255, 215, 0, 0.7);
}

/* Base overlay styling */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  position: relative;
  overflow: hidden;  /* Prevent .overlay-content from scrolling wrapper */
}

.overlay::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 70%),
                    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: none; /* Animation will be enabled when overlay is visible */
  z-index: 0;
}

/* Enable animations only when overlay is visible */
.overlay[style*="display: flex"]::before {
  animation: floatBG 12s linear infinite;
}

@keyframes floatBG {
  0% { background-position: 0% 0%, 100% 100%; }
  50% { background-position: 50% 50%, 50% 50%; }
  100% { background-position: 0% 0%, 100% 100%; }
}

/* Overlay content styling */
.overlay-content {
  position: relative;
  overflow-y: auto;
  flex: 1;
  width: 90vw;
  max-width: 600px;
  max-height: 90vh;
  position: relative;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://wallpapercave.com/wp/wp9279865.jpg') no-repeat center center / cover;
  padding: 30px;
  border-radius: 30px;
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 25px var(--btn-glow);
  z-index: 1;
  opacity: 0;
  transform: scale(0.9);
  animation: none; /* Animation will be enabled when overlay is visible */
  overflow-x: hidden;
  
  /* Hide scrollbar for webkit browsers (Chrome, Safari, Edge) */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Enable fade-in animation only when overlay is visible */
.overlay[style*="display: flex"] .overlay-content {
  animation: fadeInPopup 0.5s ease forwards;
}

@keyframes fadeInPopup {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Floating icons animation */
.overlay-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.overlay-content::after {
  content: "👑 🎲 💎 🎮";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  font-size: 20px;
  color: gold;
  opacity: 0.25;
  animation: none; /* Animation will be enabled when overlay is visible */
}

/* Enable floating icons animation only when overlay is visible */
.overlay[style*="display: flex"] .overlay-content::after {
  animation: floatIcon 14s linear infinite;
}

@keyframes floatIcon {
  0% { top: 100%; opacity: 0; }
  10% { opacity: 0.3; }
  50% { opacity: 0.5; }
  100% { top: -20px; opacity: 0; }
}

/* Close button styling - positioned relative to overlay container */
.close-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
  background: #ff4444;
  color: white;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  text-align: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: none;
  z-index: 1010;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.overlay-inner > .close-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1100;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 20px;
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.overlay-inner > .close-overlay:hover {
  background: #ff0000;
  box-shadow: 0 0 8px #ff0000;
}
.overlay-inner {
  position: relative;       /* establishes context for the close button */
  width: 90vw;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
/* Header banner styling */
.header-banner {
  background: linear-gradient(to right, gold, orange);
  color: #000;
  font-weight: bold;
  font-size: 22px;
  text-align: center;
  padding: 6px 0;
  border-radius: 12px;
  margin: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Info overlay specific styles */
#info-overlay .overlay-content {
  max-width: 600px;
  width: auto;
}

.info-content {
  position: relative;
  z-index: 2;
}

.info-content h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  text-shadow: var(--text-glow);
  background: linear-gradient(to right, gold, orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-content p {
  color: #fff;
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.6;
  text-shadow: var(--text-glow);
}

.info-content .features {
  margin-bottom: 30px;
}

.info-content .features h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.5em;
  text-shadow: var(--text-glow);
  text-align: center;
}

.info-content .features ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.info-content .features li {
  color: #fff;
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.95em;
  backdrop-filter: blur(10px);
  text-shadow: var(--text-glow);
  transition: transform 0.2s ease, background 0.2s ease;
}

.info-content .features li:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,0.15);
}

.game-modes-info h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 1.5em;
  text-shadow: var(--text-glow);
  text-align: center;
}

.mode-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.mode-info-card {
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 2;
}

.mode-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.mode-info-card .mode-icon {
  font-size: 2em;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 6px gold);
  animation: none; /* Animation will be enabled when overlay is visible */
}

/* Enable pulse animation only when overlay is visible */
.overlay[style*="display: flex"] .mode-info-card .mode-icon {
  animation: pulseLogo 3s ease-in-out infinite;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.mode-info-card h4 {
  color: #fff;
  margin: 0 0 5px 0;
  font-size: 1.1em;
  text-shadow: var(--text-glow);
}

.mode-info-card p {
  color: rgba(255,255,255,0.8);
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
  text-shadow: var(--text-glow);
}

/* Board overlay specific styles */
#board-overlay .overlay-content {
  max-width: 500px;
  width: auto;
}

.board-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.board-header h1 {
  color: #fff;
  font-size: 2em;
  text-shadow: var(--text-glow);
  background: linear-gradient(to right, gold, orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.board-header p {
  color: #fff;
  font-size: 1.1em;
  text-shadow: var(--text-glow);
}

.board-container {
  text-align: center;
  margin: 20px 0;
  position: relative;
  z-index: 2;
}

.board-controls {
  text-align: center;
  margin-top: 20px;
  position: relative;
  z-index: 2;
}

.board-controls button {
  display: inline-block;
  margin: 0 10px;
  padding: 10px 20px;
  background: gold;
  color: #000;
  font-weight: bold;
  font-size: 16px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  animation: none; /* Animation will be enabled when overlay is visible */
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

/* Enable button pulse animation only when overlay is visible */
.overlay[style*="display: flex"] .board-controls button {
  animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.board-controls button:hover {
  background: orange;
  transform: scale(1.1);
  box-shadow: 0 0 12px orange;
}

/* Info button styling */
.info-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  margin-top: 20px;
  animation: none; /* Animation will be enabled when overlay is visible */
}

/* Enable info button pulse animation only when overlay is visible */
.overlay[style*="display: flex"] .info-btn {
  animation: pulseBtn 2s infinite;
}

.info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.info-section {
  text-align: center;
  margin-top: 20px;
}

/* Canvas styling for board */
#gameCanvas {
  border: 2px solid gold;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(5px);
}

/* Logout button styling */
.logout-btn {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
  margin-top: 20px;
  animation: none; /* Animation will be enabled when overlay is visible */
}

/* Enable logout button pulse animation only when overlay is visible */
.overlay[style*="display: flex"] .logout-btn {
  animation: pulseBtn 2s infinite;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 68, 68, 0.5);
  background: linear-gradient(135deg, #cc0000 0%, #ff4444 100%);
}

.logout-section {
  text-align: center;
  margin-top: 20px;
}

/* Hide scrollbar for webkit browsers */
.overlay-content::-webkit-scrollbar {
  display: none;
}

.overlay-content::-webkit-scrollbar {
  width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.overlay-content::-webkit-scrollbar-thumb {
  background: rgba(255,215,0,0.5);
  border-radius: 4px;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,215,0,0.7);
}

/* Pass N Play overlay specific styles */
#pass-n-play-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  background: rgba(0,0,0,0.8) !important;
}

#pass-n-play-overlay .overlay-content {
  max-width: 500px;
  width: auto;
}

.pass-n-play-content {
  position: relative;
  z-index: 2;
}

.pass-n-play-content h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  text-shadow: var(--text-glow);
  background: linear-gradient(to right, gold, orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pass-n-play-content p {
  color: #fff;
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.6;
  text-shadow: var(--text-glow);
}

.game-setup {
  margin-bottom: 30px;
}

.game-setup h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.5em;
  text-shadow: var(--text-glow);
  text-align: center;
}

.setup-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.setup-option {
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.setup-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.setup-option label {
  color: #fff;
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  text-shadow: var(--text-glow);
}

.setup-option select {
  width: 100%;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  border: 2px solid gold;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.setup-option select:focus {
  outline: none;
  border-color: orange;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.reward-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background: rgba(255,215,0,0.1);
  border-radius: 12px;
  border: 2px solid gold;
  backdrop-filter: blur(10px);
}

.reward-display img {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 6px gold);
}

.reward-display span {
  color: gold;
  font-size: 1.5em;
  font-weight: bold;
  text-shadow: var(--text-glow);
}

.double-text {
  color: #fff;
  text-align: center;
  margin: 15px 0;
  font-size: 1em;
  text-shadow: var(--text-glow);
  font-style: italic;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.button-group .btn {
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,255,255,0.2);
}

.btn-primary {
  background: linear-gradient(45deg, gold, orange);
  color: #000;
  border: 2px solid gold;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.btn-primary:hover {
  background: linear-gradient(45deg, orange, gold);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

/* Return Bonus Overlay Styles */
.return-bonus-content {
  text-align: center;
  color: #fff;
  padding: 20px;
}

.return-bonus-content h2 {
  color: #ffd700;
  font-size: 28px;
  margin-bottom: 15px;
  text-shadow: var(--text-glow);
  font-weight: bold;
}

.return-bonus-content p {
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.5;
  text-shadow: var(--text-glow);
}

.return-bonus-content .reward-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
  padding: 20px;
  background: rgba(255,215,0,0.15);
  border-radius: 15px;
  border: 3px solid gold;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.return-bonus-content .reward-display img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px gold);
  animation: coinGlow 2s ease-in-out infinite alternate;
}

@keyframes coinGlow {
  0% { filter: drop-shadow(0 0 8px gold); }
  100% { filter: drop-shadow(0 0 15px gold); }
}

.return-bonus-content .reward-display span {
  color: gold;
  font-size: 2em;
  font-weight: bold;
  text-shadow: var(--text-glow);
  animation: numberPulse 1.5s ease-in-out infinite;
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.return-bonus-content .double-text {
  color: #fff;
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  text-shadow: var(--text-glow);
  font-style: italic;
  opacity: 0.9;
}

.return-bonus-content .button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.return-bonus-content .button-group .btn {
  padding: 15px 30px;
  border: none;
  border-radius: 35px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.return-bonus-content .btn-secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
}

.return-bonus-content .btn-secondary:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

.return-bonus-content .btn-primary {
  background: linear-gradient(45deg, gold, orange);
  color: #000;
  border: 2px solid gold;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  animation: primaryButtonGlow 2s ease-in-out infinite alternate;
}

@keyframes primaryButtonGlow {
  0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
  100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

.return-bonus-content .btn-primary:hover {
  background: linear-gradient(45deg, orange, gold);
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.9);
}

.return-bonus-content .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Welcome back animation */
.return-bonus-content h2 {
  animation: welcomeBack 1s ease-out;
}

@keyframes welcomeBack {
  0% { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.8); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
} 