@import url('https://fonts.googleapis.com/css2?family=Lalezar&family=Roboto:wght@300;400;500;700&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply antialiased bg-darkBlue text-lightText;
    font-family: 'Roboto', sans-serif;
    /* Fallback styles for production */
    background-color: #0F172A !important;
    color: #F8FAFC !important;
    min-height: 100vh;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Lalezar', cursive;
  }
}

/* Fallback CSS classes for production deployment */
.bg-darkBlue {
  background-color: #0F172A !important;
}

.bg-blackBg {
  background-color: #020617 !important;
}

.text-lightText {
  color: #F8FAFC !important;
}

.text-golden {
  color: #F59E0B !important;
}

.text-lightBlue {
  color: rgba(255, 255, 255, 0.9) !important;
}

.bg-golden {
  background-color: #F59E0B !important;
}

.bg-lightBlue {
  background-color: rgba(255, 255, 255, 0.9) !important;
}

.text-blackBg {
  color: #020617 !important;
}

.border-lightBlue {
  border-color: rgba(255, 255, 255, 0.9) !important;
}

.border-golden {
  border-color: #F59E0B !important;
}

.text-pastelGreen {
  color: #86EFAC !important;
}

.bg-green-300 {
  background-color: #86EFAC !important;
}

.bg-green-400 {
  background-color: #4ADE80 !important;
}

.hover\:bg-green-400:hover {
  background-color: #4ADE80 !important;
}

/* Additional essential utility classes for production */
.min-h-screen {
  min-height: 100vh !important;
}

.flex {
  display: flex !important;
}

.flex-col {
  flex-direction: column !important;
}

.flex-1 {
  flex: 1 1 0% !important;
}

.items-center {
  align-items: center !important;
}

.justify-center {
  justify-content: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.text-center {
  text-align: center !important;
}

.text-3xl {
  font-size: 1.875rem !important;
  line-height: 2.25rem !important;
}

.text-xl {
  font-size: 1.25rem !important;
  line-height: 1.75rem !important;
}

.font-bold {
  font-weight: 700 !important;
}

.font-medium {
  font-weight: 500 !important;
}

.mb-4 {
  margin-bottom: 1rem !important;
}

.mb-6 {
  margin-bottom: 1.5rem !important;
}

.mb-8 {
  margin-bottom: 2rem !important;
}

.p-6 {
  padding: 1.5rem !important;
}

.px-4 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.rounded-lg {
  border-radius: 0.5rem !important;
}

.rounded {
  border-radius: 0.25rem !important;
}

.border {
  border-width: 1px !important;
}

.max-w-4xl {
  max-width: 56rem !important;
}

.max-w-2xl {
  max-width: 42rem !important;
}

.max-w-lg {
  max-width: 32rem !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.container {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.h-16 {
  height: 4rem !important;
}

.w-auto {
  width: auto !important;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.overflow-hidden {
  overflow: hidden !important;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid !important;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.gap-4 {
  gap: 1rem !important;
}

.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-duration: 150ms !important;
}

.duration-200 {
  transition-duration: 200ms !important;
}

.hover\:scale-105:hover {
  transform: scale(1.05) !important;
}

.no-underline {
  text-decoration: none !important;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5 !important;
}

.disabled\:cursor-not-allowed:disabled {
  cursor: not-allowed !important;
}

.cursor-not-allowed {
  cursor: not-allowed !important;
}

.opacity-50 {
  opacity: 0.5 !important;
}

/* Responsive classes for mobile */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .sm\:flex-1 {
    flex: 1 1 0% !important;
  }
  
  .sm\:flex-row {
    flex-direction: row !important;
  }
}

:root {
  --background: 217 91% 12%; /* Dark Blue */
  --foreground: 210 40% 98%; /* Light Text */
  
  --card: 222 47% 6%; /* Black Background */
  --card-foreground: 210 40% 98%; /* Light Text */
  
  --popover: 222 47% 6%; /* Black Background */
  --popover-foreground: 210 40% 98%; /* Light Text */
  
  --primary: 38 92% 50%; /* Golden Yellow */
  --primary-foreground: 222 47% 6%; /* Black Background */
  
  --secondary: 217 33% 17%; /* Light Blue */
  --secondary-foreground: 210 40% 98%; /* Light Text */
  
  --muted: 217 33% 17%; /* Light Blue */
  --muted-foreground: 215 20% 65%; /* Lighter Blue Text */
  
  --accent: 217 33% 17%; /* Light Blue */
  --accent-foreground: 210 40% 98%; /* Light Text */
  
  --destructive: 0 62% 30%;
  --destructive-foreground: 0 0% 98%;
  
  --border: 217 33% 17%; /* Light Blue */
  --input: 217 33% 17%; /* Light Blue */
  --ring: 38 92% 50%; /* Golden Yellow */
  
  --radius: 0.5rem;

  --darkBlue: #05081A;
  --blackBg: #020617;
  --lightText: #F8FAFC;
  --golden: #F59E0B;
  --lightBlue: rgba(255, 255, 255, 0.9);
  --pastelGreen: #86efac;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.coin {
  transition: transform 0.6s ease-in-out;
}

.coin.flip {
  transform: rotateY(720deg);
}

.ad-container {
  min-height: 90px;
  background-color: #1E293B;
  color: #94A3B8;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--lightBlue);
}

.logo-svg {
  margin-bottom: 20px;
}

/* Custom color classes */
.bg-darkBlue {
  background-color: var(--darkBlue);
}

.bg-blackBg {
  background-color: var(--blackBg);
}

.text-lightText {
  color: var(--lightText);
}

.text-golden {
  color: var(--golden);
}

.text-lightBlue {
  color: var(--lightBlue);
}

.border-lightBlue {
  border-color: var(--lightBlue);
}

.bg-golden {
  background-color: var(--golden);
}

.bg-lightBlue {
  background-color: var(--lightBlue);
}

.text-blackBg {
  color: var(--blackBg);
}

.bg-pastelGreen {
  background-color: var(--pastelGreen);
}

.text-pastelGreen {
  color: var(--pastelGreen);
}

.border-pastelGreen {
  border-color: var(--pastelGreen);
}

/* Button styling */
.golden-button {
  padding-left: 2rem !important;
  padding-right: 2rem !important;
  transition: all 0.2s ease-in-out;
  margin-top: auto;
  position: relative;
  bottom: 0;
}

.golden-button:hover {
  background-color: var(--golden);
  color: white !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.green-button {
  transition: all 0.2s ease-in-out;
  margin-top: auto;
  position: relative;
  bottom: 0;
}

.green-button:hover {
  background-color: var(--pastelGreen) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(134, 239, 172, 0.8);
}

/* Custom number input controls */
.number-input-container {
  position: relative;
}

.number-controls {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  width: 30px;
}

.number-control-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  color: rgb(255, 215, 0);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.number-control-btn:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.number-control-btn:hover {
  background: rgba(15, 23, 42, 0.5);
}

.number-control-btn:active {
  background: rgba(255, 215, 0, 0.2);
}

/* Hide number input spinners */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  opacity: 1;
  height: 100%;
}

/* Page title styling */
.page h1 {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .page h1 {
    font-size: 2.5rem;
  }
}

/* Card title styling */
h2 {
  font-weight: normal;
  font-family: 'Lalezar', cursive;
}

/* Coin flip animations */
.coin.flip {
  animation: flip-animation 0.6s ease-in-out forwards;
}

@keyframes flip-animation {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(1800deg);
  }
}

.coin.heads {
  transform: rotateY(0deg);
}

.coin.tails {
  transform: rotateY(180deg);
}

.backface-hidden {
  backface-visibility: hidden;
}

/* Winner reveal animations */
@keyframes winner-glow {
  0% {
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 25px 5px rgba(255, 215, 0, 0.7);
  }
  100% {
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.4);
  }
}

@keyframes winner-fade-in {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.winner-reveal {
  animation:
    winner-fade-in 0.5s ease-out forwards,
    winner-glow 1.2s infinite ease-in-out 0.5s;
  transition: all 0.5s ease-in-out;
}

/* Dice styling */
.dice-svg {
  transition: transform 0.3s ease;
  max-width: 100%;
  height: auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.dice-type-container:hover .dice-svg {
  transform: scale(1.1);
}

.dice-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ensure all dice images have consistent sizing */
img[src*="d4.svg"],
img[src*="d6.svg"],
img[src*="d8.svg"],
img[src*="d10.svg"],
img[src*="d12.svg"],
img[src*="d20.svg"] {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain;
}
