/* ===========================================================
   Pressure Paxx — public stylesheet
   Black + electric blue, glass cards, soft glow
   =========================================================== */

:root {
  /* Color tokens — black + blue */
  --bg:       #060912;
  --bg-2:     #0b1020;
  --bg-3:     #131a2c;
  --bg-4:     #1a2238;
  --ink:      #eef2ff;
  --ink-2:    #b9c3df;
  --ink-mute: #7d89ad;
  --line:     rgba(96, 165, 250, 0.22);
  --line-2:   rgba(96, 165, 250, 0.10);
  --panel:    rgba(11, 16, 32, 0.94);
  --primary:        #3b82f6;
  --primary-2:      #60a5fa;
  --primary-deep:   #2563eb;
  --primary-soft:   rgba(59, 130, 246, 0.16);
  --primary-softer: rgba(59, 130, 246, 0.08);
  --primary-glow:   rgba(59, 130, 246, 0.45);
  --bolt:    #fbbf24;
  --bolt-2:  #f59e0b;
  --danger:  #f87171;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.5), 0 16px 36px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(96, 165, 250, 0.35), 0 12px 32px rgba(59, 130, 246, 0.18);
  --shadow-elev: 0 32px 80px rgba(0, 0, 0, 0.6);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 4px; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(96, 165, 250, 0.10), transparent 60%),
    linear-gradient(180deg, #04070f 0%, #060912 50%, #080d1c 100%);
  background-attachment: fixed;
  overscroll-behavior-y: none;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, p, ul, li { margin: 0; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
img, video { max-width: 100%; display: block; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.muted { color: var(--ink-mute); }

/* ===== App shell ===== */

.app-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 10px 12px calc(20px + env(safe-area-inset-bottom, 0px));
}

.top-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 20;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(8, 13, 28, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #b9c9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-actions { display: flex; }

.search-input {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: rgba(11, 16, 32, 0.8);
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-input::placeholder { color: var(--ink-mute); }
.search-input:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.20);
}

/* ===== Flavor grid ===== */

.flavor-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  contain: layout style;
  align-items: stretch;
}

.empty-state {
  text-align: center;
  color: var(--ink-mute);
  padding: 40px 16px;
  font-weight: 600;
}

/* ===== Flavor card ===== */

.flavor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(26, 34, 56, 0.85) 0%, rgba(13, 18, 36, 0.85) 100%);
  padding: 10px;
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  content-visibility: auto;
  contain-intrinsic-size: 1px 320px;
}

.flavor-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}

.flavor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: var(--shadow-glow);
}
.flavor-card:hover::before { opacity: 1; }
.flavor-card:active { transform: translateY(0); }

.flavor-card.is-dragging {
  opacity: 0.92;
  transform: scale(1.04) rotate(-0.6deg);
  box-shadow: 0 0 0 2px var(--primary-2), 0 24px 60px rgba(0,0,0,0.7), 0 0 50px rgba(59, 130, 246, 0.45);
  z-index: 100;
  cursor: grabbing;
}
.flavor-card.is-drop-target {
  box-shadow: 0 0 0 3px var(--primary-2), 0 0 24px rgba(59, 130, 246, 0.55), var(--shadow-card);
  border-color: var(--primary-2);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-3);
  isolation: isolate;
}

.card-image, .card-video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.card-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800;
  color: var(--ink-mute);
  background:
    radial-gradient(circle at 50% 50%, rgba(96, 165, 250, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-4), var(--bg-3));
}

.card-badge {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 10px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(11, 16, 32, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.35);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.card-badge:empty { display: none; }

.card-body {
  flex: 1;
  padding: 12px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.card-category { min-height: 0.95em; }
.card-name {
  /* Reserve 3 lines of name height so cards align */
  min-height: calc(1.18em * 3);
}
.card-featured-price { min-height: 1.05em; }

.card-category {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.card-category-text:empty { display: none; }

.bolt {
  color: var(--bolt);
  font-size: 0.95rem;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.22));
}

.card-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.18;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-featured-price {
  font-size: 0.85rem;
  color: var(--ink-2);
  font-weight: 600;
  margin-top: 2px;
}

.card-view-btn {
  margin-top: auto;
  width: 100%;
  border: 1px solid rgba(96, 165, 250, 0.40);
  background: rgba(59, 130, 246, 0.14);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.18s var(--ease);
}
.card-view-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18), 0 8px 24px rgba(59, 130, 246, 0.35);
}

/* ===== Tablet: 3 columns ===== */
@media (min-width: 640px) {
  .app-shell { padding: 14px 18px; }
  .flavor-feed { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .top-bar { grid-template-columns: 1fr 320px; align-items: center; gap: 16px; padding: 12px 16px; }
  .brand { text-align: left; }
  .card-name { font-size: 1rem; }
  .card-view-btn { font-size: 0.78rem; padding: 11px 16px; }
}

/* ===== Desktop: 4 columns ===== */
@media (min-width: 1024px) {
  .flavor-feed { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .flavor-card { padding: 12px; }
  .card-name { font-size: 1.05rem; }
}

/* ===== Wide desktop: 5 columns ===== */
@media (min-width: 1400px) {
  .flavor-feed { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ===== Generic overlay / panel ===== */

.overlay {
  position: fixed; inset: 0;
  z-index: 50;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: overlay-in 0.18s var(--ease);
}

@keyframes overlay-in { from { opacity: 0 } to { opacity: 1 } }

.age-overlay {
  background:
    radial-gradient(900px 600px at 50% 0%, rgba(59, 130, 246, 0.22), transparent 65%),
    radial-gradient(700px 500px at 50% 110%, rgba(37, 99, 235, 0.18), transparent 60%),
    linear-gradient(180deg, #04070f 0%, #060912 100%);
  backdrop-filter: none;
}

.panel {
  width: min(100%, 460px);
  background:
    linear-gradient(180deg, rgba(26, 34, 56, 0.95) 0%, rgba(11, 16, 32, 0.95) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid; gap: 12px;
  box-shadow: var(--shadow-elev);
  color: var(--ink);
}

.age-panel {
  width: min(100%, 720px);
  text-align: center;
  padding: clamp(20px, 4vw, 36px);
}

.age-brand {
  font-size: clamp(1.8rem, 8vw, 3.4rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #93b4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(59, 130, 246, 0.35);
}

.age-title {
  font-size: clamp(1.05rem, 3.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.age-copy {
  color: var(--ink-2);
  line-height: 1.55;
}

input[type="password"], input[type="text"], input[type="search"] {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
  background: rgba(11, 16, 32, 0.8);
  color: var(--ink);
}
input[type="password"]::placeholder,
input[type="text"]::placeholder,
input[type="search"]::placeholder { color: var(--ink-mute); }

button {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--primary-2) 0%, var(--primary) 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 14px;
  transition: transform 0.12s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.30), inset 0 1px 0 rgba(255,255,255,0.18);
}
button:hover {
  background: linear-gradient(180deg, #7eb6ff 0%, var(--primary-2) 100%);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.45), inset 0 1px 0 rgba(255,255,255,0.22);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.age-btn { border-radius: var(--radius-pill); padding: 14px 18px; }
.age-btn-no  {
  background: rgba(59, 130, 246, 0.10);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.age-btn-no:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--primary-2);
  box-shadow: none;
}

.message { min-height: 1.2em; color: var(--danger); font-weight: 700; font-size: 0.9rem; }
.age-message { text-align: center; }

/* ===== Detail modal — single scrolling view ===== */

.detail-overlay { padding: 12px; }

.detail-panel {
  position: relative;
  width: min(100%, 580px);
  max-height: 88dvh;
  background:
    linear-gradient(180deg, rgba(26, 34, 56, 0.96) 0%, rgba(11, 16, 32, 0.96) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-elev);
  overflow: hidden;
  color: var(--ink);
}

.detail-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: var(--ink);
  font-size: 1.2rem; font-weight: 700;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  padding: 0;
  z-index: 5;
  box-shadow: none;
}
.detail-close:hover { background: var(--primary); color: #fff; }

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-name {
  text-align: center;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #b9c9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 2px 40px 0;
  line-height: 1.15;
}

.detail-pager {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* Carousel — square, capped, centered */
.carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.32s var(--ease);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #000;
  position: relative;
}

.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.carousel-empty {
  font-weight: 800;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 999px;
  background: rgba(11, 16, 32, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 1.5rem;
  line-height: 1;
  display: grid; place-items: center;
  padding: 0 0 2px;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: background 0.15s var(--ease), transform 0.12s var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.carousel-arrow:hover {
  background: rgba(59, 130, 246, 0.85);
  transform: translateY(-50%) scale(1.06);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-arrow:disabled { opacity: 0; pointer-events: none; }

.carousel-dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 5px;
  z-index: 2;
}
.carousel-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.4);
  padding: 0;
  box-shadow: none;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.carousel-dot.is-active { background: var(--primary-2); transform: scale(1.3); }

/* Thumbnail strip */
.carousel-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.carousel-thumbs:empty { display: none; }
.carousel-thumbs::-webkit-scrollbar { height: 4px; }
.carousel-thumbs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.carousel-thumb {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #000;
  padding: 0;
  box-shadow: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease);
}
.carousel-thumb img, .carousel-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;
}
.carousel-thumb.is-active {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 1px var(--primary-2), 0 0 12px rgba(59, 130, 246, 0.45);
  transform: scale(1.06);
}
/* Play icon overlay for video thumbnails */
.carousel-thumb.is-video::after {
  content: "▶";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Prices block — tighter */
.detail-page-prices {
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(59, 130, 246, 0.18), transparent 60%),
    var(--primary-softer);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-category {
  display: flex; justify-content: center; align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.detail-category .bolt {
  font-size: 1rem;
}
.detail-category-text:empty ~ .bolt,
.detail-category:has(.detail-category-text:empty) { display: none; }

.detail-emojis {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  line-height: 1;
}
.detail-emojis:empty { display: none; }

.detail-price-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.detail-price-list li {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(11, 16, 32, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}
.detail-price-list .price-label { color: var(--ink-2); }
.detail-price-list .price-value {
  color: #ffffff;
  font-size: 0.95rem;
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.55);
}

@media (min-width: 640px) {
  .detail-scroll { padding: 20px 18px 18px; gap: 12px; }
  .detail-name { padding: 2px 56px 0; }
  .detail-page-prices { padding: 18px 16px; }
  .carousel { max-width: 520px; max-height: 70vh; aspect-ratio: 4 / 3; }
  .carousel-thumb { flex: 0 0 64px; width: 64px; height: 64px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
