/*
  =============================================================================
  Project: 3D Transform Gallery - Unique Showcase Styles
  Author: Molla Samser | rskworld.in | 2026
  - Website: https://rskworld.in
  - Email: help@rskworld.in | support@rskworld.in
  - Phone: +91 93305 39277
  - Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
  =============================================================================
*/

/* ========== Isometric Card Grid - rskworld.in | 2026 ========== */
.iso-scene {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.iso-grid {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-template-rows: repeat(2, 60px);
  gap: 8px;
  transform: rotateX(12deg) rotateZ(-45deg);
  transform-style: preserve-3d;
}

.iso-card {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-light);
  transition: transform 0.4s var(--ease-out-back);
  transform: translateZ(0);
  cursor: pointer;
}

.iso-card:hover {
  transform: translateZ(25px) scale(1.15);
  z-index: 5;
  box-shadow: 0 15px 35px var(--shadow-accent);
}

/* ========== 3D Curtain Reveal - Molla Samser | rskworld.in | 2026 ========== */
.curtain-scene {
  perspective: 900px;
  width: 220px;
  height: 140px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
}

.curtain-left,
.curtain-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #0a58ca 100%);
  border-radius: 4px;
  transition: transform 0.8s var(--ease-in-out);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
}

.curtain-left {
  left: 0;
  transform-origin: left center;
}

.curtain-right {
  right: 0;
  transform-origin: right center;
}

.curtain-scene:hover .curtain-left {
  transform: rotateY(75deg);
}

.curtain-scene:hover .curtain-right {
  transform: rotateY(-75deg);
}

.curtain-back {
  position: absolute;
  inset: 8px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: -1;
}

/* ========== 3D Pop-Out Button - rskworld.in | 2026 ========== */
.popout-scene {
  perspective: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

.popout-btn {
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent) 0%, #0a58ca 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-back), box-shadow 0.3s;
  transform: translateZ(0);
  box-shadow: 0 4px 0 #0a58ca, 0 8px 20px var(--shadow-accent);
}

.popout-btn:hover {
  transform: translateZ(20px) translateY(-4px);
  box-shadow: 0 8px 0 #0a58ca, 0 20px 40px var(--shadow-accent);
}

.popout-btn:active {
  transform: translateZ(5px) translateY(0);
  box-shadow: 0 2px 0 #0a58ca, 0 6px 15px var(--shadow-accent);
}

/* ========== 3D Peek Card - Molla Samser | rskworld.in | 2026 ========== */
.peek-scene {
  perspective: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}

.peek-card {
  width: 120px;
  height: 160px;
  position: relative;
  cursor: pointer;
}

.peek-card .face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  border: 2px solid var(--accent);
  backface-visibility: hidden;
  transition: transform 0.5s var(--ease-out-back);
}

.peek-card .face.front {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  color: var(--accent-light);
  transform-origin: left top;
}

.peek-card .face.back {
  background: linear-gradient(145deg, var(--accent) 0%, #0a58ca 100%);
  color: #fff;
  transform: rotateY(180deg);
  transform-origin: left top;
}

.peek-card:hover .face.front {
  transform: rotateY(-25deg) rotateZ(-3deg);
}

/* ========== Perspective Tunnel - rskworld.in | 2026 ========== */
.tunnel-scene {
  perspective: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.tunnel {
  position: relative;
  width: 120px;
  height: 120px;
  transform-style: preserve-3d;
  animation: tunnelPulse 3s var(--ease-in-out) infinite;
}

.tunnel-frame {
  position: absolute;
  border: 3px solid var(--accent);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-light);
}

.tunnel-frame:nth-child(1) { width: 100%; height: 100%; top: 0; left: 0; transform: translateZ(0); }
.tunnel-frame:nth-child(2) { width: 80%; height: 80%; top: 10%; left: 10%; transform: translateZ(-40px); }
.tunnel-frame:nth-child(3) { width: 60%; height: 60%; top: 20%; left: 20%; transform: translateZ(-80px); }
.tunnel-frame:nth-child(4) { width: 40%; height: 40%; top: 30%; left: 30%; transform: translateZ(-120px); }
.tunnel-frame:nth-child(5) { width: 20%; height: 20%; top: 40%; left: 40%; transform: translateZ(-160px); }

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

/* ========== Slot Reel - Molla Samser | rskworld.in | 2026 ========== */
.slot-scene {
  perspective: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.slot-machine {
  width: 70px;
  height: 90px;
  border: 4px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
}

.slot-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  animation: slotSpin 2s linear infinite;
}

.slot-item {
  width: 62px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
  color: var(--accent-light);
}

@keyframes slotSpin {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* ========== Tumbling Dice - rskworld.in | 2026 ========== */
.dice-scene {
  perspective: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.dice {
  width: 60px;
  height: 60px;
  position: relative;
  transform-style: preserve-3d;
  animation: diceTumble 4s linear infinite;
}

.dice-face {
  position: absolute;
  width: 60px;
  height: 60px;
  background: linear-gradient(145deg, #fff 0%, #e2e8f0 100%);
  border: 2px solid var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

[data-theme="light"] .dice-face {
  background: linear-gradient(145deg, #fff 0%, #f1f5f9 100%);
}

.dice-face.f1 { transform: translateZ(30px); }
.dice-face.f2 { transform: rotateY(180deg) translateZ(30px); }
.dice-face.f3 { transform: rotateY(90deg) translateZ(30px); }
.dice-face.f4 { transform: rotateY(-90deg) translateZ(30px); }
.dice-face.f5 { transform: rotateX(90deg) translateZ(30px); }
.dice-face.f6 { transform: rotateX(-90deg) translateZ(30px); }

@keyframes diceTumble {
  0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
  25% { transform: rotateX(90deg) rotateY(180deg); }
  50% { transform: rotateX(180deg) rotateY(270deg); }
  75% { transform: rotateX(270deg) rotateY(360deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* ========== Layered Depth Title - Molla Samser | rskworld.in | 2026 ========== */
.depth-title-scene {
  perspective: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.depth-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--accent-light);
  position: relative;
  transform-style: preserve-3d;
  display: inline-block;
}

.depth-title .layer {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  transition: transform 0.3s;
  pointer-events: none;
}

.depth-title .layer:nth-child(3) {
  position: relative;
}

.depth-title .layer:nth-child(1) { transform: translateZ(-20px); opacity: 0.4; }
.depth-title .layer:nth-child(2) { transform: translateZ(-10px); opacity: 0.6; }
.depth-title .layer:nth-child(3) { transform: translateZ(0); opacity: 1; }
.depth-title .layer:nth-child(4) { transform: translateZ(10px); opacity: 0.7; }
.depth-title .layer:nth-child(5) { transform: translateZ(20px); opacity: 0.4; }

.depth-title-scene:hover .depth-title .layer:nth-child(1) { transform: translateZ(-35px); }
.depth-title-scene:hover .depth-title .layer:nth-child(2) { transform: translateZ(-15px); }
.depth-title-scene:hover .depth-title .layer:nth-child(4) { transform: translateZ(15px); }
.depth-title-scene:hover .depth-title .layer:nth-child(5) { transform: translateZ(35px); }

/* ========== Card Deck Spread - rskworld.in | 2026 ========== */
.deck-scene {
  perspective: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}

.deck {
  position: relative;
  width: 80px;
  height: 110px;
  cursor: pointer;
}

.deck-card {
  position: absolute;
  width: 80px;
  height: 110px;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-light);
  transition: transform 0.5s var(--ease-out-back);
  transform-origin: bottom center;
}

.deck-card:nth-child(1) { z-index: 1; }
.deck-card:nth-child(2) { z-index: 2; transform: rotate(-8deg); }
.deck-card:nth-child(3) { z-index: 3; transform: rotate(-4deg); }
.deck-card:nth-child(4) { z-index: 4; transform: rotate(0); }
.deck-card:nth-child(5) { z-index: 5; transform: rotate(4deg); }
.deck-card:nth-child(6) { z-index: 6; transform: rotate(8deg); }

.deck:hover .deck-card:nth-child(1) { transform: rotate(-25deg) translateY(-15px); }
.deck:hover .deck-card:nth-child(2) { transform: rotate(-15deg) translateY(-10px); }
.deck:hover .deck-card:nth-child(3) { transform: rotate(-5deg) translateY(-5px); }
.deck:hover .deck-card:nth-child(4) { transform: rotate(0) translateY(0); }
.deck:hover .deck-card:nth-child(5) { transform: rotate(5deg) translateY(-5px); }
.deck:hover .deck-card:nth-child(6) { transform: rotate(15deg) translateY(-10px); }

/* ========== Floating Orb - Molla Samser | rskworld.in | 2026 ========== */
.orb-scene {
  perspective: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-light), var(--accent) 40%, #0a58ca);
  box-shadow:
    0 0 30px var(--shadow-accent),
    inset -10px -10px 25px rgba(0,0,0,0.2),
    inset 8px 8px 20px rgba(255,255,255,0.15);
  animation: orbFloat 3s var(--ease-in-out) infinite;
  transition: transform 0.4s;
}

.orb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 50px var(--shadow-accent), inset -10px -10px 25px rgba(0,0,0,0.2);
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ========== 3D Badge / Medal - Molla Samser | rskworld.in | 2026 ========== */
.badge-scene {
  perspective: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.badge-3d {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-light) 0%, var(--accent) 40%, #0a58ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  border: 4px solid var(--bg-elevated);
  box-shadow: 0 8px 24px var(--shadow-accent), inset 0 2px 0 rgba(255,255,255,0.3);
  transition: transform 0.4s var(--ease-out-back);
  cursor: pointer;
}

.badge-3d:hover {
  transform: rotateY(20deg) rotateX(10deg) scale(1.15);
}

/* ========== 3D Photo Stack (Polaroid) - rskworld.in | 2026 ========== */
.photo-stack-scene {
  perspective: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.photo-stack {
  position: relative;
  width: 100px;
  height: 120px;
}

.photo-stack .polaroid {
  position: absolute;
  width: 90px;
  height: 110px;
  left: 0;
  top: 0;
  background: #fff;
  padding: 8px 8px 24px;
  box-shadow: 0 4px 12px var(--shadow);
  border-radius: 2px;
  transition: transform 0.5s var(--ease-out-back);
  cursor: pointer;
}

.photo-stack .polaroid .img-area {
  width: 100%;
  height: 70px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-light);
}

.photo-stack .polaroid:nth-child(1) { transform: rotate(-8deg); z-index: 1; }
.photo-stack .polaroid:nth-child(2) { transform: rotate(4deg); z-index: 2; left: 10px; top: 5px; }
.photo-stack .polaroid:nth-child(3) { transform: rotate(12deg); z-index: 3; left: 20px; top: 10px; }

.photo-stack:hover .polaroid:nth-child(1) { transform: rotate(-18deg) translateY(-10px); }
.photo-stack:hover .polaroid:nth-child(2) { transform: rotate(0deg) translateY(-5px); }
.photo-stack:hover .polaroid:nth-child(3) { transform: rotate(18deg) translateY(-10px); }

/* ========== 3D Flip Counter (multi-digit) - Molla Samser | rskworld.in | 2026 ========== */
.flip-counter-scene {
  perspective: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: 100px;
}

.flip-counter-digit {
  width: 44px;
  height: 56px;
  perspective: 120px;
  cursor: pointer;
}

.flip-counter-digit .digit-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease-in-out);
  transform-style: preserve-3d;
}

.flip-counter-digit:hover .digit-wrap {
  transform: rotateX(-90deg);
}

.flip-counter-digit .half {
  position: absolute;
  width: 100%;
  height: 50%;
  left: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  color: var(--accent-light);
}

.flip-counter-digit .half.top {
  top: 0;
  align-items: flex-end;
  border-radius: 6px 6px 0 0;
  transform-origin: bottom;
}

.flip-counter-digit .half.bottom {
  bottom: 0;
  align-items: flex-start;
  border-radius: 0 0 6px 6px;
  transform-origin: top;
  transform: rotateX(90deg);
  backface-visibility: hidden;
}
