:root {
  --card: rgba(255, 255, 255, 0.82);
  --ink: #2b2140;
  --muted: #7a6f92;
  --accent: #ff4fa3;
  --accent2: #7b5cff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(120, 70, 180, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(120deg, #ff9ec6, #ffd59e, #fff59d, #a8f0c6, #9ad9ff, #c2a8ff, #ff9ec6);
  background-size: 400% 400%;
  animation: rainbow 22s ease infinite;
}
@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* sparkles overlay */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(255,255,255,.85), transparent),
    radial-gradient(2px 2px at 55% 15%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 10% 65%, rgba(255,255,255,.85), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .95; } }

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 28px 18px 70px; }

header.hero { text-align: center; padding: 22px 10px 8px; }
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -.5px;
  background: linear-gradient(90deg, #ff4fa3, #ff8a3d, #ffd23d, #38d39f, #4f8bff, #a24fff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 12px rgba(255,255,255,.4);
}
.hero p { margin: 10px auto 0; max-width: 600px; color: #4b3d63; font-weight: 500; font-size: 16px; }
.hero .sub { margin-top: 6px; color: #6a5a86; font-size: 14px; }

.intro {
  margin-top: 24px;
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  color: #3d3157;
  line-height: 1.55;
  font-size: 15.5px;
}
.intro p { margin: 0 0 12px; }
.intro p:last-child { margin-bottom: 0; }
.intro b { color: #a2318a; }

.grid { margin-top: 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(120,70,180,.28); }
.card.taken { opacity: .72; }

.photo { aspect-ratio: 1/1; background: linear-gradient(135deg,#ffd9ec,#e3d4ff); overflow: hidden; }
.photo + .photo { margin-top: 3px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.empty { display: flex; align-items: center; justify-content: center; font-size: 44px; }

.body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.title {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.25;
  padding: 16px 16px 12px;
  text-align: center;
  color: #3d2f5c;
}
.price { font-weight: 700; color: var(--accent2); font-size: 15px; }
.note { font-size: 13px; color: #6a5f80; line-height: 1.4; background: rgba(123,92,255,.07); padding: 8px 10px; border-radius: 10px; }
.flames { font-size: 16px; letter-spacing: 1px; line-height: 1; }
.flames-dim { opacity: .18; }
/* admin quick-rating */
.rate { display: inline-flex; gap: 2px; cursor: pointer; font-size: 20px; user-select: none; }
.rate span { opacity: .22; transition: opacity .1s, transform .1s; }
.rate span.on { opacity: 1; }
.rate span:hover { transform: scale(1.15); }
.row { display: flex; gap: 8px; margin-top: auto; }

.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 11px 14px; border-radius: 14px; transition: transform .1s ease, filter .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.97); }
.btn-link { background: rgba(123,92,255,.12); color: var(--accent2); flex: 0 0 auto; }
.btn-link:hover { filter: brightness(1.05); background: rgba(123,92,255,.2); }
.btn-take { flex: 1; color: #fff; background: linear-gradient(90deg, #ff4fa3, #a24fff); box-shadow: 0 6px 16px rgba(200,60,160,.35); }
.btn-take:hover { filter: brightness(1.06); }
.btn-cancel { flex: 1; background: rgba(255,255,255,.6); color: #a23b6e; border: 1.5px solid rgba(255,79,163,.4); }
.badge-taken {
  flex: 1; text-align: center; padding: 11px 14px; border-radius: 14px; font-weight: 700; font-size: 14px;
  background: rgba(120,110,150,.12); color: #6a5f80;
}

.state { text-align: center; padding: 60px 20px; color: #5b4c78; font-weight: 600; }

footer { text-align: center; margin-top: 40px; color: #5b4c78; font-size: 13px; opacity: .8; }
footer a { color: #7b5cff; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: rgba(43,33,64,.94); color: #fff; padding: 13px 20px; border-radius: 14px;
  font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* admin */
.admin-box { max-width: 720px; margin: 0 auto; }
.panel {
  background: var(--card); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 20px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; color: #4b3d63; }
input[type=text], input[type=password], input[type=url] {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid rgba(123,92,255,.25);
  font-family: inherit; font-size: 15px; background: rgba(255,255,255,.7);
}
input:focus { outline: none; border-color: var(--accent2); }
.hint { background: rgba(255,79,163,.1); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #8a2f63; margin-bottom: 16px; }
.admin-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.5); margin-bottom: 10px; }
.admin-item img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #eee; }
.admin-item .meta { flex: 1; min-width: 0; }
.admin-item .meta b { display: block; }
.admin-item .meta small { color: var(--muted); }
.mini { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.mini.edit { background: rgba(123,92,255,.15); color: var(--accent2); }
.mini.del { background: rgba(255,79,163,.15); color: #a23b6e; }
.preview { max-width: 120px; border-radius: 10px; margin-top: 8px; display: none; }
