/* Dark holo theme — deep-space navy + color-cycling "holographic foil" accents.
   Aimed at a preteen audience: neon glow, animated gradients, big touch targets. */

:root {
  --bg: #0a0e1a;
  --bg2: #0e1426;
  --card: #131a30;
  --ink: #eef2ff;
  --muted: #8b95b5;
  --line: #242e4e;
  --yellow: #ffcb05;
  --cyan: #22d3ee;
  --magenta: #e14eca;
  --purple: #a855f7;
  --blue: #3b82f6;
  --red: #ff5c6c;
  --ok: #34d399;
  --holo: linear-gradient(90deg, var(--yellow), var(--cyan), var(--purple), var(--magenta), var(--yellow));
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 22px rgba(34, 211, 238, 0.35);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Rubik", "Segoe UI", system-ui, -apple-system, "Arial Hebrew", Arial, sans-serif;
  color: var(--ink);
  direction: rtl;
  line-height: 1.5;
  background-color: var(--bg);
  min-height: 100vh;
}

/* aurora: slow color-shifting glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 203, 5, 0.13), transparent 38%),
    radial-gradient(circle at 12% 30%, rgba(168, 85, 247, 0.16), transparent 42%),
    radial-gradient(circle at 55% 85%, rgba(34, 211, 238, 0.12), transparent 45%);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); filter: hue-rotate(0deg); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); filter: hue-rotate(40deg); }
  100% { transform: translate3d(3%, -2%, 0) scale(1); filter: hue-rotate(-30deg); }
}

.wrap { max-width: 720px; margin: 0 auto; padding: 8px 16px 70px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 32px 16px 52px;
  background: linear-gradient(155deg, #101733 0%, #1b2350 45%, #0d1230 100%);
  background-size: 220% 220%;
  animation: heroShift 10s ease-in-out infinite alternate;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero.compact { padding: 18px 16px 42px; }
@keyframes heroShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
/* holographic sheen sweeping across the hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(34, 211, 238, 0.08) 42%,
    rgba(255, 203, 5, 0.1) 50%,
    rgba(225, 78, 202, 0.08) 58%,
    transparent 70%);
  background-size: 300% 100%;
  animation: sheen 7s linear infinite;
}
@keyframes sheen {
  0% { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}
.hero .badge-emoji {
  width: 80px; height: 80px; margin: 0 auto 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  position: relative; z-index: 2;
  animation: pop 0.5s ease, ringGlow 6s linear infinite;
}
.hero.compact .badge-emoji { width: 58px; height: 58px; font-size: 31px; border-radius: 18px; }
@keyframes ringGlow {
  0%   { box-shadow: 0 0 22px rgba(255, 203, 5, 0.45), inset 0 0 0 2px rgba(255, 203, 5, 0.55); }
  33%  { box-shadow: 0 0 22px rgba(34, 211, 238, 0.45), inset 0 0 0 2px rgba(34, 211, 238, 0.55); }
  66%  { box-shadow: 0 0 22px rgba(225, 78, 202, 0.45), inset 0 0 0 2px rgba(225, 78, 202, 0.55); }
  100% { box-shadow: 0 0 22px rgba(255, 203, 5, 0.45), inset 0 0 0 2px rgba(255, 203, 5, 0.55); }
}
/* color-cycling holo title */
.hero h1 {
  margin: 6px 0 4px;
  font-size: 30px;
  font-weight: 900;
  position: relative;
  z-index: 2;
  background: var(--holo);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoText 6s linear infinite;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.35));
}
.hero.compact h1 { font-size: 22px; }
@keyframes holoText {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.hero p { margin: 0; color: #b9c3e6; font-size: 15px; position: relative; z-index: 2; }

.hero-decor { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero-decor span {
  position: absolute; font-size: 20px; opacity: 0.6;
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 203, 5, 0.6));
}
.hero-decor .d1 { top: 18px; right: 12%; font-size: 24px; animation-delay: 0s; }
.hero-decor .d2 { top: 30px; left: 14%; font-size: 16px; animation-delay: 1.1s; }
.hero-decor .d3 { top: 64px; right: 24%; font-size: 14px; animation-delay: 2s; }
.hero-decor .d4 { top: 52px; left: 26%; font-size: 22px; animation-delay: 0.6s; }
.hero-decor .d5 { top: 96px; left: 8%; font-size: 15px; animation-delay: 1.6s; }
.hero-decor .d6 { top: 100px; right: 8%; font-size: 18px; animation-delay: 2.4s; }

.hero-wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 44px; display: block; z-index: 2; }
.hero-wave path { fill: var(--bg); }

@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-11px) rotate(4deg); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: transform 0.06s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.15); box-shadow: 0 4px 24px rgba(99, 102, 241, 0.6); }
.btn:active { transform: scale(0.97); }
.btn.yellow {
  background: linear-gradient(135deg, #ffe14d, var(--yellow) 60%, #f5a800);
  color: #241c00;
  box-shadow: 0 4px 20px rgba(255, 203, 5, 0.45);
}
.btn.yellow:hover { box-shadow: 0 4px 30px rgba(255, 203, 5, 0.7); }
.btn.secondary { background: #1b2340; color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: linear-gradient(135deg, #ff6b7a, #e03131); box-shadow: none; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn.block { width: 100%; }
.btn.big { font-size: 19px; padding: 18px 26px; }

/* ---------- Cards / panels ---------- */
.card {
  background: linear-gradient(180deg, #151d38, var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  animation: rise 0.4s ease both;
}
.card h2 { margin: 0 0 12px; font-size: 18px; }

.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.badge.sale { background: rgba(52, 211, 153, 0.15); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.4); }
.badge.keep { background: rgba(59, 130, 246, 0.15); color: #7fb3ff; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge.sold { background: rgba(255, 92, 108, 0.15); color: var(--red); border: 1px solid rgba(255, 92, 108, 0.4); }
.badge.hidden { background: rgba(139, 149, 181, 0.15); color: var(--muted); border: 1px solid var(--line); }
.badge.unid { background: rgba(255, 203, 5, 0.12); color: var(--yellow); border: 1px solid rgba(255, 203, 5, 0.4); }

.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 16px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 14px; margin: 12px 0 6px; font-weight: 600; }
input[type="text"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select {
  width: 100%; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; font-family: inherit;
  background: #10162b; color: var(--ink);
}
select option { background: #10162b; }
input:focus, select:focus { outline: 2px solid var(--cyan); border-color: transparent; }
input::placeholder { color: #5d6788; }
input[inputmode="numeric"], input[type="number"] { direction: ltr; text-align: center; }
.row { display: flex; gap: 10px; }
.row > div { flex: 1; }
.error-text { color: var(--red); font-size: 14px; margin-top: 8px; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

.toast {
  position: fixed; bottom: 20px; right: 50%; transform: translateX(50%);
  background: #1b2340; color: #fff; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px; opacity: 0; transition: opacity 0.2s; z-index: 80; pointer-events: none;
  box-shadow: var(--glow-cyan);
}
.toast.show { opacity: 1; }

.spinner {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border: 4px solid var(--line); border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.9s linear infinite;
  box-shadow: var(--glow-cyan);
}

/* ---------- Public gallery grid ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.controls input[type="search"] { flex: 1 1 160px; }
.controls select { width: auto; flex: 0 1 auto; font-size: 14px; padding: 9px 10px; }
.chip {
  border: 1px solid var(--line); background: #131a30; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: box-shadow 0.15s ease;
}
.chip.on {
  background: var(--holo); background-size: 300% 100%;
  animation: holoText 6s linear infinite;
  border-color: transparent; color: #141414;
  box-shadow: 0 0 16px rgba(255, 203, 5, 0.35);
}

.grid {
  display: grid; gap: 12px; margin-top: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  animation: rise 0.35s ease both;
}
.tile:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: var(--glow-cyan), var(--shadow);
}
/* holo shine sweep on hover */
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%);
  transform: translateX(150%);
  pointer-events: none;
}
.tile:hover::after { animation: tileShine 0.8s ease; }
@keyframes tileShine {
  from { transform: translateX(150%); }
  to { transform: translateX(-150%); }
}
.tile img { width: 100%; aspect-ratio: 63/88; object-fit: cover; display: block; background: #0e1426; }
.tile .info { padding: 8px 10px 10px; }
.tile .name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .set { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .price {
  margin-top: 4px; font-weight: 800; font-size: 15px;
  color: var(--yellow); text-shadow: 0 0 12px rgba(255, 203, 5, 0.45);
}
.ribbon {
  position: absolute; top: 10px; inset-inline-start: -28px;
  background: linear-gradient(90deg, #ff5c6c, #e03131);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 34px; transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(255, 92, 108, 0.6);
}

/* ---------- Card page ---------- */
.photo-box { text-align: center; }
.photo-box img {
  max-width: 100%; max-height: 60vh; border-radius: 16px;
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.22), var(--shadow);
  background: #0e1426;
}
.photo-toggle { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.detail-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.detail-table td { padding: 8px 4px; border-top: 1px solid var(--line); }
.detail-table td:first-child { color: var(--muted); width: 40%; }
.price-big {
  font-size: 34px; font-weight: 900;
  background: var(--holo); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: holoText 6s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 203, 5, 0.35));
}

/* ---------- Offer modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(4, 7, 16, 0.72);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.modal-back.show { display: flex; }
.modal {
  background: linear-gradient(180deg, #1a2342, var(--card));
  border: 1px solid var(--line);
  border-radius: 24px; padding: 24px;
  width: 100%; max-width: 420px;
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.18), 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: pop 0.22s ease;
}
.modal h2 { margin: 0 0 4px; font-size: 21px; }
.modal .for-card { color: var(--yellow); font-weight: 600; margin-bottom: 14px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.success { text-align: center; padding: 10px 0; }
.success .check { font-size: 50px; animation: pop 0.4s ease; }
.actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- Add-card flow ---------- */
.stage { animation: rise 0.3s ease both; }
.snap-area { text-align: center; padding: 30px 0 10px; }
.session-count { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.my-photo {
  width: 92px; border-radius: 10px; box-shadow: var(--shadow);
  aspect-ratio: 63/88; object-fit: cover; background: #0e1426;
}
.candidate {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.candidate:first-of-type { border-top: 0; }
.candidate img { width: 78px; border-radius: 8px; aspect-ratio: 63/88; object-fit: cover; background: #0e1426; }
.candidate .info { flex: 1; min-width: 0; }
.candidate .cname { font-weight: 700; }
.candidate .cset { color: var(--muted); font-size: 13px; }
.candidate .cprice { color: var(--yellow); font-weight: 700; font-size: 15px; margin-top: 2px; }
.compare { display: flex; gap: 14px; align-items: center; justify-content: center; margin-bottom: 6px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Admin ---------- */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  flex: 1 1 100px;
  background: linear-gradient(155deg, #1b2a5e, #14204a);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #fff; border-radius: 16px; padding: 14px; text-align: center;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.18);
}
.stat.gold {
  background: linear-gradient(155deg, #3a2f05, #241c00);
  border-color: rgba(255, 203, 5, 0.5);
  color: var(--yellow);
  box-shadow: 0 0 22px rgba(255, 203, 5, 0.25);
}
.stat .num { font-size: 24px; font-weight: 900; direction: ltr; }
.stat.gold .num { text-shadow: 0 0 16px rgba(255, 203, 5, 0.5); }
.stat .lbl { font-size: 12px; opacity: 0.85; }
.setbar { margin: 10px 0; }
.setbar .meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.setbar .track { background: #0e1426; height: 8px; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.setbar .fill {
  background: var(--holo); background-size: 300% 100%;
  animation: holoText 6s linear infinite;
  height: 100%; border-radius: 99px;
}
.admin-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.admin-card:first-of-type { border-top: 0; }
.admin-card img { width: 52px; border-radius: 6px; aspect-ratio: 63/88; object-fit: cover; background: #0e1426; }
.admin-card .info { flex: 1; min-width: 140px; }
.admin-card .price-edit { width: 84px; padding: 8px; font-size: 14px; }

/* respect users who turn animations off */
@media (prefers-reduced-motion: reduce) {
  body::before, .hero, .hero::after, .hero h1, .badge-emoji,
  .chip.on, .setbar .fill, .price-big, .hero-decor span { animation: none !important; }
}
