@font-face {
  font-family: 'Freeks';
  src: url('/public/freeks.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: fallback;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Freeks', Arial, sans-serif;
  background: #0a1aa3;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.app-container {
  position: fixed;
  width: 100%; /*max-width: 1920px; */
  height: 100%; /*max-height: 1080px;*/
  margin: 0 auto;
  /* overflow: hidden !important; */
}

.background {
  position: absolute;
  left: 50%;
  bottom: clamp(40%, 50%, 42vw);
  transform: translate(-50%, 50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: -1;
  overflow: visible;
  min-width: 100vw;
  min-height: 100vh;
}

#background-swirl {
  position: absolute;
  min-width: 175vw;
  min-height: 175vh;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  /* animation: spin infinite 20s linear; */
  /* animation-play-state: paused; */
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* CSS variable for background SVG color */
:root {
  --background-svg-color: #1400fe;
}

#background-swirl.animated {
  animation: spin infinite 30s linear;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wallet-spinner {
  margin-bottom: 18px;
  width: auto;
  height: 50vh;
  object-fit: contain;
}

.top-right-connect {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
}

.bottom-right-dizzy {
  position: absolute;
  bottom: 24px;
  right: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
}

.bottom-left-links {
  position: absolute;
  bottom: 24px;
  left: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
}

.link-bar {
  display: none;
  position: absolute;
  bottom: 100%;
  margin-bottom: 8px;
  gap: 12px;
}

.link-bar.show,
.link-bar.flying-out {
  display: grid;
}

.link-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10vh;
  height: 10vh;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: #000;
  box-shadow: 0 2px 10px #0006, 8px 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-20px) scale(0.8);
  opacity: 0;
  animation: flyIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.link-bar.show a:nth-child(1) { animation-delay: 0.2s; }
.link-bar.show a:nth-child(2) { animation-delay: 0.15s; }
.link-bar.show a:nth-child(3) { animation-delay: 0.1s; }
.link-bar.show a:nth-child(4) { animation-delay: 0.05s; }

.link-bar.flying-out a:nth-child(1) { animation: flyOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.05s; }
.link-bar.flying-out a:nth-child(2) { animation: flyOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.1s; }
.link-bar.flying-out a:nth-child(3) { animation: flyOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.15s; }
.link-bar.flying-out a:nth-child(4) { animation: flyOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.2s; }

.link-bar.flying-out a {
  opacity: 1;
  transform: none;
}

@keyframes flyIn {
  0% {
    transform: translateX(-20px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes flyOut {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-20px) scale(0.8);
    opacity: 0;
  }
}

.link-bar a:hover {
  background: #1c1f94 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.link-bar img {
  width: auto;
  height: 90%;
}

.three-d-button,
.nft-popup-button {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid #000;
  background: #fc844e;
  color: #000;
  border-radius: 8px;
  padding: 7.5px 15px;
  font-family: 'Freeks', Arial, sans-serif;
  font-size: 1.5rem;
  box-shadow: 0 2px 10px #0006, 8px 8px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  outline: none;
  width: auto;
  text-align: center;
}

.three-d-button::before,
.nft-popup-button::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: #ff621a;
  transform: translate3d(0, 4px, -1em);
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid #000;
  z-index: -1;
  pointer-events: none;
  border-radius: 8px;
}

.three-d-button:active,
.nft-popup-button:active {
  transform: translate3d(0, 3px, 0);
}

.three-d-button:active::before,
.nft-popup-button:active::before {
  transform: translate3d(0, 0, -1em);
}

.three-d-button.connected,
.three-d-button.paused,
.nft-popup-button.connected,
.nft-popup-button.paused,
.three-d-button.active,
.link-bar.show a {
  background: rgb(30, 60, 255);
  color: #fff;
  border: 3px solid #fff;
}

/* Only apply hover effects on devices that support hover (non-touch devices) */
@media (hover: hover) {
  .three-d-button:hover,
  .nft-popup-button:hover {
    background: #1c1f94 !important;
    color: #fff !important;
  }
}

.mint-stats-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 50vh;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mint-counter {
  position: relative;
  font-size: 5vh;
  color: #fff;
  text-shadow: 1px 1px 6px #000, 0 0 8px #1e3cff;
  margin-bottom: 2px;
}

.mint-stats-container .nft-progress-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgb(30, 60, 255);
  border: 3px solid #000;
  border-radius: 8px;
}

.nft-progress-fill {
  height: 100%;
  background: #fc844e;
  width: 0%;
  transition: width 0.5s ease-in-out;
  position: absolute;
  right: 0;
  top: 0;
  border-radius: 5px;
}

.whitelist-progress-fill {
  height: 100%;
  text-align: center;
  background: linear-gradient(90deg, #ffffffbf, #fc844e);
  width: 0%;
  transition: width 0.5s ease-in-out;
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  border-radius: 5px;
}

.whitelist-color-key .color-swatch {
	display: inline-block;
	width: 18px;
	height: 12px;
	border-radius: 3px;
	background: #fff;
  }

.whitelist-color-key {
  color: #fff;
  font-size: 3vh;
  text-shadow: 0 2px 8px #000;
  text-align: center;
}

#whitelistCounter {
  font-size: 2.5vh;
}

.whitelist-sync-error {
  color: #fff;
  font-size: 2.5vmin;
  text-shadow: 0 2px 8px #000;
  text-align: center;
  margin-top: 4px;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-drag: none;
  user-select: none;
}

.mint-button {
  position: absolute;
  left: 50%;
  bottom: clamp(40%, 50%, 42vw);
  transform: translate(-50%, 50%);
  width: clamp(180px, 35vw, 579px);
  height: clamp(106px, 19vh, 342px);
  aspect-ratio: 579 / 342;
  min-width: 180px;
  max-width: 579px;
  min-height: 106px;
  max-height: 342px;
  object-fit: contain;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: filter 0.1s, transform 0.1s;
  z-index: 3;
  border-radius: 8px;
  outline: none;
}

.mint-price {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(40%, 50%, 42vw) - clamp(75px, 14vh, 342px));
  transform: translateX(-50%);
  color: #fff;
  font-size: 3vh;
  z-index: 3;
  text-align: center;
  font-family: 'Freeks', Arial, sans-serif;
  gap: 15px;
  display: flex;
}

.public-price {
color: red;
text-decoration: line-through;
}

.eligible-price {
	font-weight: bold;
	text-shadow: 1px 1px 6px #000, 0 0 8px #1e3cff;
}

.phase-indicator {
	position: absolute;
	left: 50%;
	bottom: calc(clamp(40%, 50%, 42vw) - clamp(75px, 24vh, 342px));
	transform: translateX(-50%);
	color: #fff;
	z-index: 3;
	display: flex;
	flex-direction: row;
	gap: 16px;
}

.phase-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 6px 10px;
	border-radius: 8px;
	transition: background 0.2s;
}
  
  .phase-status-container {
	display: flex;
	align-items: center;
	gap: 0.2em;
  }
  
  .phase-status {
	font-size: 3vh;
	height: 3vh;
	font-weight: bold;
	text-shadow: 0 0 8px #000, 0 0 12px #1e3cff;
  }
  
  .phase-mint-count {
	font-size: 2vh;
	font-weight: bold;
	color: #fff;
	text-shadow: 1px 1px 6px #000, 0 0 8px #1e3cff;
  }
  
  .phase-label {
	font-size: 2vh;
	font-weight: bold;
	text-shadow: 1px 1px 6px #000, 0 0 8px #1e3cff;
	letter-spacing: 0.03em;
  }
  
  .phase-status.available {
	color: #00ff08; /* Green */
	text-shadow: 0 0 10px #00ff08, 0 0 20px #00ff08, 0 0 30px #00ff08;
  }
  
  .phase-status.used {
	color: #9E9E9E; /* Gray */
	/* text-shadow: 0 0 6px #000; */
  }
  
  .phase-sold-out {
	color: #F44336; /* Red */
	font-size: 2vh;
	font-style: italic;
	min-height: 2vh;
	visibility: hidden;
	text-shadow: 0 0 8px #000;
  }
  
  .phase-sold-out.show {
	visibility: visible;
  }
  
  /* Cross out the phase when sold out */
  .phase-item.sold-out .phase-label {
	text-decoration: line-through;
	color: #9E9E9E; /* Gray */
	text-shadow: 0 0 6px #000;
  }

.mint-button.pressed {
  content: url('/public/mint_0007_Button-Pressed.svg');
  filter: brightness(0.9);
  transform: translate(-50%, calc(50% + 3px));
}

.status-message {
  position: fixed;
  left: 50%;
  bottom: 17.5vh;
  transform: translateX(-50%);
  background: rgba(30, 60, 255, 0.8);
  color: #fff;
  padding: 12px 12px;
  border-radius: 8px;
  font-family: 'Freeks', Arial, sans-serif;
  font-size: 4vmin;
  box-shadow: 0 2px 10px #0005;
  z-index: 10;
  pointer-events: none;
  text-align: center;
  /* min-width: 180px; */
  margin: 0;
  user-select: text;
  -webkit-user-select: text;
  display: none;
}

.status-message:not(:empty) {
  display: block !important;
}

.status-message.success {
  background-color: #008000;
  color: #0f0;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #006400;
}

.status-message.error {
  background-color: #ff4444;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  display: block !important;
  border: 1px solid #ff4444;
}

#statusMessage {
  pointer-events: auto;
}

#statusMessage a {
  text-decoration: underline;
  cursor: pointer;
}

#statusMessage a:hover {
  text-decoration: none;
}


button:disabled,
.nft-popup-button:disabled {
  background: #aaa;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 5px #0004;
}

.nft-popup-button:disabled::before {
  display: none;
}

/* NFT Minted Success Popup */
.screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.screen-overlay.active {
  opacity: 1;
  visibility: visible;
}

.screen-overlay.active .nft-popup {
  transform: scale(1);
}

.nft-popup {
  background: #0a1aa3;
  max-height: 100%;
  border: 3px solid #fff;
  border-radius: 16px;
  padding: 2%;
  position: relative;
  display: inline-table;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(30, 60, 255, 0.6);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.nft-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.nft-popup-title {
  font-size: 5vh;
  color: #fff;
  text-shadow: 2px 2px 8px #000, 0 0 10px #1e3cff;
}

.nft-popup-content {
  /* min-height: 65vh; */
  margin: 2%;
}

.nft-image-wrapper {
  width: 100%;
  max-width: 350px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 3 / 4; /* 1080/1440 = 3/4 */
  margin: 0 auto;
  /* background: #111; */
  border: 0.5vh solid #000;
  max-height: 65vh;
  height: auto;
}
.nft-image-wrapper::before {
  content: "";
  display: block;
  padding-bottom: 133.33%; /* 4:3 aspect ratio */
}
.nft-popup-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: none;
  border-radius: 0;
  background: transparent;
  max-height: 65vh;
}

.nft-popup-buttons {
  display: flex;
  justify-content: center;
  gap: 2%;
  width: 100%;
}

.nft-popup-button {
  /* flex: 1; */
  min-width: 0;
}

.download-options {
  display: flex;
  justify-content: center;
  gap: 2%;
  margin-top: 15px;
  width: 100%;
}

@media (max-width: 600px) {
	.top-right-connect { right: 7.5px; top: 7.5px; }
  
	.bottom-right-dizzy { right: 7.5px; }
  
	.bottom-left-links { left: 7.5px; }

	.status-message {
		bottom: 60vh;
	  }
  
	.link-bar {
		left: 0;
		right: 0;
		width: auto;
		justify-content: center;
	}
  
	/* Make buttons smaller on mobile */
	.three-d-button {
		font-size: 1rem;
		padding: 5px 10px;
		min-width: 60px;
		height: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
  
	/* Icon styles for mobile only */
	.button-icon {
		width: 20px;
		height: 20px;
		fill: currentColor;
		display: block !important; /* Show all icons by default */
	}
  
	/* Connect button specific icon control */
	#connectButton .wallet-icon,
	#connectButton .reload-icon {
		display: none !important; /* Hide both connect icons by default */
	}
	
	/* Show wallet icon when not connected */
	#connectButton:not(.connected) .wallet-icon {
		display: block !important;
	}
	
	/* Show reload icon when connected */
	#connectButton.connected .reload-icon {
		display: block !important;
	}
	
	/* Dizzy button specific icon control */
	#dizzyButton .pause-icon,
	#dizzyButton .play-icon {
		display: none !important; /* Hide both dizzy icons by default */
	}
	
	/* Show pause icon when animations are active */
	#dizzyButton:not(.paused) .pause-icon {
		display: block !important;
	}
	
	/* Show play icon when animations are paused */
	#dizzyButton.paused .play-icon {
		display: block !important;
	}
  
	/* Hide text on mobile, show icons */
	.button-text {
		display: none;
	}
  
	/* .mint-counter {
	  bottom: 32px;
	} */
}

/* Desktop styles - keep original appearance */
@media (min-width: 601px) {
	.button-icon {
		display: none !important;
	}
	
	.button-text {
		display: inline;
	}
}

@media (prefers-reduced-motion: reduce) {
  .finger {
    animation: none;
  }
  
  .nft-popup {
    transition: none;
  }
  
  #background-swirl {
    animation: none;
  }
}

.wallet-wait {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 101;
}
.wallet-wait-message {
  color: #fff;
  font-size: 2rem;
  text-shadow: 0 2px 8px #000;
}

.hidden {
    display: none;
}

.error-retry-button {
  margin-left: 10px;
  padding: 4px 8px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 4vmin;
  display: inline-block;
}

/* Utility classes for display states */
.inline {
  display: inline !important;
}

.flex {
  display: flex !important;
}

/* Countdown Timer Styles */
.countdown-timer {
  position: absolute;
  left: 50%;
  bottom: clamp(40%, 50%, 42vw);
  transform: translate(-50%, 50%);
  width: clamp(210px, 35vw, 481px);
  height: clamp(60px, 18vh, 20vw);
  /* min-width: 180px;
  max-width: 579px;
  min-height: 106px;
  max-height: 342px; */
  display: flex;
  align-items: center;
  justify-content: center;
  /* font-size: 8vmin; */
  font-size: 11vmin;
  /* font-family: 'Freeks', Arial, sans-serif; */
  font-weight: bold;
  color: #fff;
  background: rgba(20,0,254,0.85);
  border-radius: 16px;
  border: 3px solid #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(30,60,255,0.6);
  text-shadow: 1px 1px 8px #000, 0 0 12px #1e3cff;
  z-index: 4;
  padding: 0;
  margin: 0;
  text-align: center;
  white-space: pre;
  transition: box-shadow 0.3s, background 0.3s;
}

.countdown-timer span {
  display: inline-block;
  min-width: 16ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1em;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.countdown-timer.standby {
  background: rgba(20,0,254,0.5);
  color: #ff0;
  font-size: 1.6rem;
  font-style: italic;
  border: 3px dashed #ff0;
  box-shadow: 0 0 10px #ff0;
  white-space: normal;
}

.countdown-timer.pulse {
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(20, 0, 254, 0.3);
    transform: translate(-50%, 50%) scale(1);
  }
  50% {
    box-shadow: 0 8px 48px rgba(20, 0, 254, 0.6);
    transform: translate(-50%, 50%) scale(1.02);
  }
}

.countdown-timer.final-minute {
  animation: countdownFinalMinute 0.5s ease-in-out infinite;
  border-color: #ff4444;
}

@keyframes countdownFinalMinute {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.3);
    border-color: #ff0000;
  }
  50% {
    box-shadow: 0 8px 48px rgba(255, 0, 0, 0.6);
    border-color: #ff4444;
  }
}