@font-face {
  font-family: TazBold;
  src:
    url(fonts/tazb.otf) format("opentype"),
    url(fonts/tazb.woff) format("woff");
}

@font-face {
  font-family: TazBlack;
  src:
    url(fonts/tazblack.otf) format("opentype"),
    url(fonts/tazblack.woff) format("woff");
}

@font-face {
  font-family: TazRegular;
  src:
    url(fonts/tazr.otf) format("opentype"),
    url(fonts/tazr.woff) format("woff");
}
:root {
  --bg: var(--gradijent, linear-gradient(63deg, #ec6426 0%, #f8a91f 100%));

  --bg2: #2d1155;
  --gold: #f5c842;
  --gold2: #ffda6a;
  --cream: #fff8e7;
  --pink: #ff6eb4;
  --mint: #4dffc3;
  --lavender: #c084fc;
  --coral: #ff7c5c;
  --blue: #60c8ff;
  --common: #94a3b8;
  --rare: #60a5fa;
  --epic: #c084fc;
  --legendary: #f5c842;
}

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

body {
  background: var(--bg);
  font-family: TazBlack;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated bg */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 20%,
      rgba(192, 132, 252, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(255, 110, 180, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(77, 255, 195, 0.05) 0%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  font-size: 60px;
}

.logotxt {
  font-family: TazBlack;
  font-size: 66px;
  background: #fde3cf;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.subtitle {
  color: #fde3cf;
  text-align: center;
  font-size: 36px;
  font-style: normal;
  font-weight: 300;
  line-height: normal;
  text-transform: uppercase;
  font-family: TazBold;
  padding-top: 1rem;
}

.lead {
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-style: normal;
  font-weight: 300;
  line-height: normal;
  font-family: TazRegular;
}

/* Eggs counter */
.eggs-counter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.egg-dot {
  width: 32px;
  height: 38px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.egg-dot.available {
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 200, 66, 0.5);
}

.egg-dot.used {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.egg-dot.used::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

.eggs-label {
  text-align: center;
  color: #fad3a8;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: -24px;
  margin-bottom: 1rem;
}

/* Main egg */
.egg-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.egg-wrapper {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 24px;
}

.egg-main {
  width: 160px;
  height: 190px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  transition: transform 0.1s;
  will-change: transform;
}

.egg-main.idle {
  background: linear-gradient(145deg, #fff8e7, #f0d080, #c8a030);
  box-shadow:
    inset -20px -20px 40px rgba(0, 0, 0, 0.3),
    inset 10px 10px 20px rgba(255, 255, 255, 0.4),
    0 20px 60px rgba(245, 200, 66, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.egg-main.tapping {
  animation: eggShake 0.08s ease-in-out;
}

@keyframes eggShake {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-3deg) scale(0.97);
  }
  75% {
    transform: rotate(3deg) scale(0.97);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* Crack overlay */
.crack-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.crack-overlay svg {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

/* Glow pulse when near hatch */
.egg-main.almost {
  animation: almostGlow 0.5s ease-in-out infinite alternate;
}

@keyframes almostGlow {
  from {
    box-shadow:
      0 20px 60px rgba(245, 200, 66, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  to {
    box-shadow:
      0 20px 80px rgba(245, 200, 66, 0.8),
      0 0 40px rgba(255, 200, 50, 0.5),
      0 0 0 2px rgba(255, 255, 255, 0.3);
  }
}

/* Tap prompt */
.tap-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.5s ease;
}

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

.tap-hint {
  font-size: 14px;
  font-weight: 400;
  color: #fad3a8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tap-hint span {
  color: var(--gold);
}

/* Progress bar */
.progress-wrap {
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(245, 200, 66, 0.6);
}

/* Tap count */
.tap-count {
  font-family: TazRegular;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
}

/* Ripple effects */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  animation: rippleAnim 0.4s ease-out forwards;
}

@keyframes rippleAnim {
  from {
    width: 0;
    height: 0;
    opacity: 0.6;
    transform: translate(-50%, -50%);
  }
  to {
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

/* Hatch explosion */
.hatch-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: hatchReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hatchReveal {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.prize-egg-bits {
  position: relative;
  width: 160px;
  height: 130px;
  margin-bottom: -10px;
}

.egg-bit {
  position: absolute;
  width: 70px;
  height: 80px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: eggExplode 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.egg-bit:nth-child(1) {
  background: linear-gradient(145deg, #fff8e7, #f0d080);
  top: 10px;
  left: 20px;
  --tx: -40px;
  --ty: -50px;
  --r: -30deg;
}
.egg-bit:nth-child(2) {
  background: linear-gradient(145deg, #f0d080, #c8a030);
  top: 10px;
  right: 20px;
  --tx: 40px;
  --ty: -50px;
  --r: 30deg;
}
.egg-bit:nth-child(3) {
  background: linear-gradient(145deg, #fff8e7, #e8c060);
  bottom: 20px;
  left: 10px;
  --tx: -30px;
  --ty: 30px;
  --r: -20deg;
}
.egg-bit:nth-child(4) {
  background: linear-gradient(145deg, #f8e080, #c8a030);
  bottom: 20px;
  right: 10px;
  --tx: 30px;
  --ty: 30px;
  --r: 20deg;
}

@keyframes eggExplode {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(0.6);
    opacity: 0;
  }
}

.prize-creature {
  font-size: 80px;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: creatureAppear 0.5s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes creatureAppear {
  from {
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
  }
  to {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

/* Prize card */
.prize-card {
  width: 100%;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.prize-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.5) 10px,
    rgba(255, 255, 255, 0.5) 11px
  );
}

.prize-card.common {
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.prize-card.rare {
  background: linear-gradient(135deg, #1e3a5f, #1d4ed8);
  border: 1px solid rgba(96, 165, 250, 0.4);
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.2);
}

.prize-card.epic {
  background: linear-gradient(135deg, #3b1f6a, #7c3aed);
  border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 30px rgba(192, 132, 252, 0.2);
}

.prize-card.legendary {
  background: linear-gradient(135deg, #3d2800, #92400e);
  border: 1px solid rgba(245, 200, 66, 0.5);
  box-shadow: 0 0 40px rgba(245, 200, 66, 0.3);
}

.rarity-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.common .rarity-badge {
  background: rgba(148, 163, 184, 0.2);
  color: var(--common);
}
.rare .rarity-badge {
  background: rgba(96, 165, 250, 0.2);
  color: var(--blue);
}
.epic .rarity-badge {
  background: rgba(192, 132, 252, 0.2);
  color: var(--lavender);
}
.legendary .rarity-badge {
  background: rgba(245, 200, 66, 0.2);
  color: var(--gold);
}

.prize-title {
  font-family: TazBlack;
  font-size: 28px;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.1;
}

.prize-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* Confetti bits */
.confetti-bit {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1000;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Next / reset buttons */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-family: "Nunito", sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #632713;

  color: #fff;
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(245, 200, 66, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* History */
.history-section {
  margin-top: 40px;
}

.history-title {
  font-family: TazBlack;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.history-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.history-item.legendary {
  border-color: rgba(245, 200, 66, 0.3);
  background: rgba(245, 200, 66, 0.05);
}
.history-item.epic {
  border-color: rgba(192, 132, 252, 0.3);
  background: rgba(192, 132, 252, 0.05);
}
.history-item.rare {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.05);
}

.history-emoji {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}
.history-prize {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}

/* Empty state */
.no-eggs {
  text-align: center;
  padding: 40px 20px;
}

.no-eggs-emoji {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}
.no-eggs-title {
  font-family: TazBlack;
  font-size: 22px;
  color: #fde3cf;
  margin-bottom: 8px;
}
.no-eggs-sub {
  font-size: 13px;
  color: #fde3cf;
}

@media (max-width: 720px) {
  .logo,
  .logotxt {
    font-size: 30px;
  }
  .subtitle,
  .prize-title {
    font-size: 20px;
  }
  .lead {
    font-size: 16px;
  }
  .prize-egg-bits {
    height: 100px;
  }
  .header,
  .eggs-label {
    margin-bottom: 16px;
  }
}
