:root {
  --bg-deep: #0f0f12;
  --text: #ffffff;
  --c-green: #00ff9d;
  --c-blue: #00a8ff;
  --c-purple: #bd00ff;
  --c-gold: #ffd700;
  --glass: rgba(255, 255, 255, 0.05);
  --pntd-glass-border: rgba(255, 255, 255, 0.1);
  --card-radius: 12px;
  --ease-float: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(217, 4, 41, 0.05) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(0, 217, 191, 0.05) 0%,
      transparent 40%
    ),
    radial-gradient(circle at 50% 50%, #100510 0%, #020202 100%);
  /* background-attachment: fixed removed — forces non-composited scroll on mobile */
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* .pntd-noise is defined in global.css — no local override needed */

.gallery-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 18, 0.95) 0%,
    rgba(15, 15, 18, 0) 100%
  );
  pointer-events: none;
  transition: opacity 0.8s;
}
.header-left,
.header-right {
  pointer-events: auto;
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pntd-glass-border);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: 0.3s;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.resonance-pill {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid var(--pntd-glass-border);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: 0.3s;
}
.score-bump {
  animation: flashGold 0.5s ease-out;
  border-color: var(--c-gold);
  color: #fff;
}
@keyframes flashGold {
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
  }
}

.progress-text {
  font-family: monospace;
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}
.progress-text i {
  font-size: 0.7rem;
  color: #555;
}

#gallery-stage {
  padding: 100px 20px 100px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.chunk-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 60px 0 40px;
  opacity: 0;
  animation: fadeIn 1s forwards;
}
.div-line {
  height: 1px;
  width: 120px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.6;
}
.div-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 20px;
  box-shadow: 0 0 15px currentColor;
  transform: rotate(45deg);
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.masonry-row {
  display: flex;
  gap: 20px;
  width: 100%;
  align-items: flex-start;
}
.masonry-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 800px) {
  .masonry-row,
  .masonry-col {
    gap: 10px;
  }
}

.art-card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: perspective(1000px) translateY(80px) rotateX(30deg) scale(0.85);
  transition:
    transform 0.8s var(--ease-float),
    box-shadow 0.6s ease,
    border-color 0.6s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
  display: block;
  width: 100%;
  background: linear-gradient(110deg, #151515 8%, #222 18%, #151515 33%);
  background-size: 200% 100%;
}
.art-card.visible {
  animation:
    cardSlam 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
    cardShimmer 1.5s linear infinite;
}
@keyframes cardSlam {
  to {
    opacity: 1;
    transform: perspective(1000px) translateY(0) rotateX(0deg) scale(1);
  }
}
@keyframes cardShimmer {
  to {
    background-position-x: -200%;
  }
}

.art-card:hover {
  transform: translateY(-6px) !important;
  z-index: 5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}
.art-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 60%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: 0.6s;
  z-index: 2;
}
.art-card:hover::after {
  left: 150%;
  transition: 0.8s;
}
.art-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.8s ease;
  opacity: 0;
  filter: brightness(0.9);
}
.art-card img.loaded {
  opacity: 1;
}

.art-card[data-border="green"] {
  border-bottom: 2px solid var(--c-green);
}
.art-card[data-border="blue"] {
  border-bottom: 2px solid var(--c-blue);
}
.art-card[data-border="purple"] {
  border-bottom: 2px solid var(--c-purple);
}
.art-card[data-border="gold"] {
  border: 1px solid var(--c-gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}
.art-card.pearl::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.1),
    rgba(0, 255, 255, 0.1)
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/* Gacha visuals */
body.gacha-active #gallery-stage .art-card {
  filter: brightness(0.2) grayscale(0.5);
  transform: scale(0.98);
  pointer-events: none;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.gacha-active .gallery-header {
  opacity: 0.1;
}
body.gold-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--c-gold);
  mix-blend-mode: overlay;
  animation: flashFade 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes flashFade {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

.gacha-shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0 solid transparent;
  z-index: -1;
  pointer-events: none;
  animation: shockwaveBurst 0.8s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}
@keyframes shockwaveBurst {
  0% {
    width: 80px;
    height: 80px;
    border-width: 40px;
    opacity: 1;
  }
  100% {
    width: 1200px;
    height: 1200px;
    border-width: 0;
    opacity: 0;
  }
}

.prism-gate {
  width: 100%;
  padding: 120px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}
.prism-gate.vanish {
  opacity: 0;
  pointer-events: none;
}
.prism-orb {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 50px rgba(0, 217, 191, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.5s var(--ease-float);
  position: relative;
  backdrop-filter: blur(5px);
}
.prism-orb:hover {
  transform: scale(1.1);
  color: #fff;
  border-color: #fff;
  box-shadow:
    0 0 80px rgba(0, 217, 191, 0.3),
    inset 0 0 30px rgba(0, 217, 191, 0.1);
}
.prism-orb::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.1);
  animation: orbit 8s linear infinite;
  pointer-events: none;
}
.prism-orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  animation: orbitReverse 6s linear infinite;
  pointer-events: none;
}

.prism-orb.rolling {
  animation: pulse 0.2s infinite alternate;
}
.prism-orb.overload {
  animation: orbOverload 0.1s infinite alternate;
  box-shadow:
    0 0 100px rgba(255, 255, 255, 0.8),
    inset 0 0 40px rgba(255, 255, 255, 0.5);
  border-color: #fff;
  color: #fff;
}
.prism-orb.rolling i {
  animation: iconFlip 0.8s linear infinite;
}
.prism-orb.green {
  box-shadow: 0 0 80px var(--c-green);
  border-color: var(--c-green);
  color: var(--c-green);
}
.prism-orb.blue {
  box-shadow: 0 0 100px var(--c-blue);
  border-color: var(--c-blue);
  color: var(--c-blue);
}
.prism-orb.purple {
  box-shadow: 0 0 120px var(--c-purple);
  border-color: var(--c-purple);
  color: var(--c-purple);
}
.prism-orb.gold {
  box-shadow: 0 0 150px var(--c-gold);
  border-color: var(--c-gold);
  color: var(--c-gold);
  animation: spinGold 2s infinite linear;
}
.prism-orb.unlock-hint {
  animation: pulseGold 1s infinite;
  border-color: var(--c-gold);
  color: var(--c-gold);
}

.prism-text {
  margin-top: 30px;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  transition: 0.3s;
}
@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes orbitReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}
@keyframes orbOverload {
  0% {
    transform: scale(1.1) translate(2px, 1px) rotate(-2deg);
  }
  100% {
    transform: scale(1.1) translate(-1px, -2px) rotate(2deg);
  }
}
@keyframes iconFlip {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}
@keyframes spinGold {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulseGold {
  0% {
    box-shadow: 0 0 20px var(--c-gold);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 60px var(--c-gold);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 20px var(--c-gold);
    transform: scale(1);
  }
}

/* Theater */
.theater {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  touch-action: none;
}
.theater.active {
  opacity: 1;
  pointer-events: auto;
}
.t-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.t-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
  opacity: 0;
}
.t-img.show {
  opacity: 1;
}

.t-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(25px);
  padding: 8px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition:
    opacity 0.3s,
    bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tc-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
}
.tc-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}
.tc-sep {
  width: 1px;
  height: 25px;
  background: rgba(255, 255, 255, 0.1);
  align-self: center;
  margin: 0 5px;
}
.t-close {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 50;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}
.t-close:hover {
  background: #d90429;
  transform: rotate(90deg);
}

/* End card */
.end-card {
  width: 100%;
  max-width: 500px;
  margin: 100px auto;
  padding: 60px 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    180deg,
    rgba(20, 20, 25, 0.9),
    rgba(5, 5, 5, 0.95)
  );
  border-radius: 4px;
  text-align: center;
  backdrop-filter: blur(20px);
  animation: softFloat 1s ease;
}
.end-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
}
.end-rank {
  font-size: 1.2rem;
  color: #ffd700;
  letter-spacing: 2px;
  margin-top: 10px;
}
.btn-share-score {
  margin: 30px auto 0;
  font-family: monospace;
  letter-spacing: 1px;
  width: 100%;
  max-width: 300px;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Sidebar panel */
.t-panel {
  width: clamp(400px, 35vw, 600px);
  background: rgba(20, 20, 25, 0.95);
  border-left: 1px solid var(--pntd-glass-border);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
  backdrop-filter: blur(30px);
  transition:
    max-height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    width 0.3s ease;
}
.t-meta,
.t-desc {
  position: relative;
  z-index: 5;
}
.t-meta h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.t-meta p {
  font-family: monospace;
  color: var(--c-blue);
  margin-top: 8px;
  opacity: 0.7;
  font-size: 0.85rem;
}
.t-desc {
  color: #aaa;
  line-height: 1.7;
  font-size: 0.9rem;
  font-weight: 300;
}
.t-badges {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.t-badge {
  background: var(--glass);
  border: 1px solid var(--pntd-glass-border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-family: monospace;
}
.t-badge.green {
  color: var(--c-green);
  border-color: rgba(0, 255, 157, 0.3);
  background: rgba(0, 255, 157, 0.05);
}

/* Calculator */
.t-calc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: -80px -35px 0 -35px;
  padding: 80px 35px 20px 35px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.t-calc-body::-webkit-scrollbar {
  display: none;
}
.step-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.step-header i {
  color: var(--c-purple);
  font-size: 1.1rem;
}

/* Sizes */
.size-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--pntd-glass-border);
}
.size-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 6px 6px 2px 2px;
  cursor: pointer;
  transition: 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  color: #888;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
}
.size-bar:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.size-bar.active {
  background: rgba(189, 0, 255, 0.15);
  border-color: var(--c-purple);
  color: #fff;
  box-shadow: 0 0 20px rgba(189, 0, 255, 0.3);
}

/* Materials */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.opt-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.opt-card:hover {
  transform: translateY(-2px);
}
.opt-card.active {
  border-color: var(--c-purple);
  box-shadow: 0 5px 15px rgba(189, 0, 255, 0.2);
}
.opt-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  position: relative;
  z-index: 2;
}
.opt-price {
  font-size: 0.85rem;
  color: var(--c-blue);
  margin-top: auto;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

/* Material Specific CSS Filters */
.opt-card[data-material="std_matte"] {
  background-color: #1a1a1a;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    );
}
.opt-card[data-material="std_gloss"] {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.02) 60%,
    rgba(255, 255, 255, 0.02) 100%
  );
  background-size: 300% 300%;
  transition: background-position 0.6s ease-out;
}
.opt-card[data-material="std_gloss"]:hover,
.opt-card[data-material="std_gloss"].active {
  background-position: 100% 100%;
}
.opt-card[data-material="metallic"] {
  background: linear-gradient(135deg, #1f2029, #312638, #1d333d);
  background-size: 200% 200%;
  animation: metallicShimmer 5s ease infinite;
}
@keyframes metallicShimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* Fine art texture */
.opt-card[data-material="fine_art"] {
  background-color: #1a1a19;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 4px 4px, 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px, 2px 1px;
}
/* Canvas texture */
.opt-card[data-material="canvas"] {
  background-color: #151515;
  background-image: 
    /* 1. Surface lighting wrap */
    linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 40%, rgba(0,0,0,0.6) 100%),
    /* 2. Horizontal threads (Weft) */
    repeating-linear-gradient(to bottom, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px),
    /* 3. Vertical threads (Warp) */
    repeating-linear-gradient(to right, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px);
  /* Highlight on top/left edge, heavy shadow on bottom/right to simulate 3D wooden stretcher bars */
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.03), inset -5px -5px 15px rgba(0, 0, 0, 0.8);
}

/* Shipping toggle */
.shipping-toggle-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.shipping-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50px;
  border: 1px solid var(--pntd-glass-border);
  padding: 4px;
  position: relative;
  overflow: hidden;
}
.shipping-btn {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  color: #888;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.3s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 50px;
}
.shipping-btn.active {
  color: #fff;
}
.shipping-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  z-index: 1;
  transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}
.shipping-toggle[data-state="express"] .shipping-slider {
  transform: translateX(100%);
  background: rgba(0, 255, 157, 0.15);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.2);
}
.shipping-toggle[data-state="express"] .shipping-btn:nth-child(3) {
  color: var(--c-green);
}

.data-stream {
  height: 2px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.data-stream::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--c-blue), transparent);
  animation: streamFlow 2.5s linear infinite;
  opacity: 0.4;
}
.shipping-toggle-container.express-active .data-stream::after {
  background: linear-gradient(90deg, transparent, var(--c-green), transparent);
  animation: streamFlow 0.8s linear infinite;
  opacity: 1;
}
@keyframes streamFlow {
  to {
    left: 100%;
  }
}

.t-actions-footer {
  border-top: 1px solid var(--pntd-glass-border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: auto;
  background: rgba(20, 20, 25, 0.95);
  z-index: 10;
}
.total-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  transition: opacity 0.3s;
}
.total-label {
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.total-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  transition: color 0.3s;
  line-height: 1;
}
.total-val.bump {
  animation: pulsePurple 0.4s ease;
}
@keyframes pulsePurple {
  50% {
    color: var(--c-purple);
    text-shadow: 0 0 30px var(--c-purple);
    transform: scale(1.05);
  }
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.action-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: 0.2s;
  text-decoration: none;
}
.action-btn.orig-btn {
  border: 1px solid var(--c-green);
  color: var(--c-green);
  background: rgba(0, 255, 157, 0.05);
}
.action-btn.print-btn {
  border: 1px solid var(--c-purple);
  color: var(--c-purple);
  background: rgba(189, 0, 255, 0.05);
}
.action-btn.print-btn:hover {
  background: var(--c-purple);
  color: #fff;
}

.collapse-btn {
  display: none;
}

/* Mobile layout */
@media (max-width: 900px) {
  .theater {
    flex-direction: column;
  }
  .t-stage {
    flex: 1;
    min-height: 20vh;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .theater.panel-expanded .t-controls {
    opacity: 0;
    pointer-events: none;
  }
  #btn-mobile-configure.is-configurable {
    display: flex !important;
  }

  .t-panel {
    width: 100%;
    height: auto;
    max-height: 45vh;
    border-left: none;
    border-top: 1px solid var(--pntd-glass-border);
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
  }
  .t-panel.expanded {
    max-height: 85vh;
  }
  .t-calc-body {
    display: none !important;
    margin: 0;
    padding: 20px 0;
    overflow-y: visible !important;
    height: auto;
  }
  .t-panel.expanded .t-calc-body {
    display: flex !important;
  }
  .t-panel.expanded #t-desc,
  .t-panel.expanded #t-meta {
    display: none;
  }

  .t-panel.expanded .btn-stack {
    flex-direction: row;
  }
  .collapse-btn {
    display: none;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
  }
  .t-panel.expanded .collapse-btn {
    display: flex;
  }
  #btn-send-order {
    display: none;
  }
  .t-panel.expanded #btn-send-order {
    display: flex;
    flex: 2;
  }
  .t-controls {
    bottom: 15px;
    scale: 0.85;
    z-index: 50;
    transition: opacity 0.3s;
  }
}

.opt-card[data-tooltip]::after,
.size-bar[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);

  background: #111111;
  border: 1px solid var(--pntd-glass-border);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.95);

  color: #ccc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: monospace;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
}
.opt-card[data-tooltip]::before,
.size-bar[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--pntd-glass-border) transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 101;
}

.opt-card:hover,
.size-bar:hover {
  z-index: 100 !important;
}

.opt-card.active,
.size-bar.active {
  z-index: 10;
}

@media (hover: hover) {
  .opt-card[data-tooltip]:hover::after,
  .size-bar[data-tooltip]:hover::after {
    opacity: 1;
    border-color: var(--c-purple);
    bottom: calc(100% + 14px);
  }
  .opt-card[data-tooltip]:hover::before,
  .size-bar[data-tooltip]:hover::before {
    opacity: 1;
    border-top-color: var(--c-purple);
    bottom: calc(100% + 2px);
  }
}
@media (max-width: 600px) {
  /* Constrain max width for small screens */
  .opt-card[data-tooltip]::after,
  .size-bar[data-tooltip]::after {
    max-width: 160px;
  }

  .option-grid .opt-card:nth-child(odd)[data-tooltip]::after {
    left: -10px;
    transform: none;
    text-align: left;
  }
  .option-grid .opt-card:nth-child(odd)[data-tooltip]::before {
    left: 25px;
    transform: none;
  }

  .option-grid .opt-card:nth-child(even)[data-tooltip]::after {
    left: auto;
    right: -10px;
    transform: none;
    text-align: right;
  }
  .option-grid .opt-card:nth-child(even)[data-tooltip]::before {
    left: auto;
    right: 25px;
    transform: none;
  }

  .size-visualizer .size-bar:first-child[data-tooltip]::after {
    left: -10px;
    transform: none;
    text-align: left;
  }
  .size-visualizer .size-bar:first-child[data-tooltip]::before {
    left: 15px;
    transform: none;
  }

  .size-visualizer .size-bar:last-child[data-tooltip]::after {
    left: auto;
    right: -10px;
    transform: none;
    text-align: right;
  }
  .size-visualizer .size-bar:last-child[data-tooltip]::before {
    left: auto;
    right: 15px;
    transform: none;
  }
}
