/* frontend/public/css/scratch.css */
/* 80s / Early 90s Synthwave Neon Arcade Scratch 5 Stylesheet */

.scratch-layout *,
.scratch-layout *::before,
.scratch-layout *::after {
  box-sizing: border-box;
}

.scratch-layout {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 16px 108px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

/* =========================================================
   1. TOP ARCADE HUD & MARQUEE HEADER
   ========================================================= */

.scratch-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scratch-hud-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tickets-left-pill {
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(16, 8, 36, 0.92);
  border: 1.5px solid #00f0ff;
  font-family: monospace, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  color: #e2e8f0;
  letter-spacing: 0.8px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.tickets-left-pill span {
  color: #fde047;
  font-size: 0.9rem;
}

.coin-display {
  background: rgba(24, 10, 44, 0.95);
  color: #fde047;
  padding: 7px 14px;
  border-radius: 10px;
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #fde047;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coin-display.pulse-hit {
  transform: scale(1.14);
  box-shadow: 0 0 22px rgba(253, 224, 71, 0.75);
}

.arcade-marquee-box {
  width: 100%;
  background: linear-gradient(145deg, rgba(28, 12, 54, 0.94), rgba(11, 6, 26, 0.98));
  border: 2px solid #ff007f;
  border-radius: 18px;
  padding: 14px 12px;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.28), inset 0 0 14px rgba(0, 240, 255, 0.12);
}

.marquee-sub {
  font-family: monospace, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  color: #00f0ff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.scratch-header h1 {
  font-family: monospace, sans-serif;
  font-size: 1.95rem;
  font-weight: 900;
  margin: 0 0 4px 0;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.75), 0 3px 0 #000000;
}

.scratch-header h1 span {
  color: #ff007f;
  text-shadow: 0 0 14px rgba(255, 0, 127, 0.9), 0 3px 0 #000000;
}

.scratch-subtitle {
  font-family: monospace, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  margin: 0;
  letter-spacing: 0.5px;
}

/* =========================================================
   2. 1.5X DAILY 5 BOOST BADGE
   ========================================================= */

.daily5-boost-badge {
  width: 100%;
  max-width: 328px;
  margin: 0 auto 16px auto;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: monospace, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
}

.daily5-boost-badge.boost-active {
  background: linear-gradient(90deg, rgba(255, 0, 127, 0.25), rgba(253, 224, 71, 0.25));
  border: 1.5px solid #fde047;
  color: #fde047;
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.35);
  cursor: default;
}

.daily5-boost-badge.boost-inactive {
  background: rgba(0, 240, 255, 0.08);
  border: 1px dashed rgba(0, 240, 255, 0.45);
  color: #00f0ff;
  cursor: pointer;
}

/* =========================================================
   3. 3D FLIPPABLE NEON ARCADE TICKET
   ========================================================= */

.ticket-wrapper {
  perspective: 1100px;
  -webkit-perspective: 1100px;
  width: 100%;
  max-width: 328px;
  height: 192px;
  margin-bottom: 22px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ticket-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.68s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.ticket-flipper.flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.ticket-flipper.flipped .ticket-front {
  pointer-events: none;
}

.ticket-front,
.ticket-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  overflow: hidden;
}

/* Branded 80s Synthwave Cover (Before Flip) */
.ticket-front {
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 0, 127, 0.45) 0%, transparent 60%),
    linear-gradient(135deg, #1e0b3b 0%, #090514 100%);
  border: 3px solid #00f0ff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 240, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  z-index: 2;
  padding: 16px;
}

.ticket-front.hyper-card {
  border-color: #fde047;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 24px rgba(253, 224, 71, 0.45);
}

.ticket-front-corner-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: monospace, sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  letter-spacing: 1px;
}

.ticket-front h2 {
  font-family: monospace, sans-serif;
  font-size: 2.4rem;
  margin: 0 0 12px 0;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.7), 0 3px 0 #000000;
}

.ticket-front h2 span {
  color: #fde047;
  text-shadow: 0 0 14px rgba(253, 224, 71, 0.8), 0 3px 0 #000000;
}

.ticket-front p {
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.8px;
  margin: 0;
  background: rgba(255, 0, 127, 0.25);
  border: 1.5px solid #ff007f;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.45);
  animation: neonPulse 1.8s infinite;
}

@keyframes neonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* The Scratcher Side (After Flip) */
.ticket-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  background: #0d0620;
  border: 3px solid #ff007f;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 0, 127, 0.4);
}

.prize-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(253, 224, 71, 0.22) 0%, transparent 70%),
    repeating-linear-gradient(
      45deg,
      #14082e,
      #14082e 12px,
      #1f0d42 12px,
      #1f0d42 24px
    );
  color: #fde047;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  padding: 12px;
}

.prize-layer p {
  margin: 0 0 4px 0;
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 0.84rem;
  color: #00f0ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.prize-layer h2 {
  margin: 0;
  font-family: monospace, sans-serif;
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.05;
  color: #fde047;
  text-shadow: 0 0 16px rgba(253, 224, 71, 0.75), 0 3px 0 #000000;
}

.prize-unit-tag {
  margin-top: 4px;
  font-family: monospace, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #00ff66;
}

#scratchCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: none;
  cursor: crosshair;
}

/* =========================================================
   4. 3D ARCADE CABINET UNLOCK BUTTON & FLYING COINS
   ========================================================= */

.arcade-unlock-btn {
  width: 100%;
  max-width: 328px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #fde047;
  background: linear-gradient(180deg, #ff007f 0%, #be185d 100%);
  color: #ffffff;
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 #701a75, 0 0 20px rgba(255, 0, 127, 0.55);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}

.arcade-unlock-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #701a75, 0 0 10px rgba(255, 0, 127, 0.4);
}

.arcade-unlock-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.toast-notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #00f0ff, #0284c7);
  color: #000000;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: monospace, sans-serif;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: top 0.45s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.toast-notification.show {
  top: 24px;
}

.flying-coin {
  position: fixed;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef08a 0%, #eab308 55%, #a16207 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.85);
  color: #000000;
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  pointer-events: none;
  transition: all 0.75s cubic-bezier(0.2, 0.85, 0.3, 1);
}