
:root{
  --bg:#f5f5f7;
  --card-bg:#ffffff;
  --muted:#6b7280;
  --accent:#111827;
  --gap:24px;
}
html,body {
  height:100%;
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color:var(--accent);
}
.wrap { max-width:1200px; margin:28px auto; padding:0 20px; }
h1 { text-align:center; margin:6px 0 18px; font-size:28px; letter-spacing:-0.02em; }
.controls { display:flex; gap:12px; justify-content:center; margin-bottom:18px; flex-wrap:wrap; }
.search { width:320px; max-width:90%; padding:10px 12px; border-radius:10px; border:1px solid #d1d5db; background:white; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:var(--gap); align-items:start; }

.card-frame { perspective:1100px; }
.card {
  height: 430px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.2,.9,.3,1), box-shadow 0.3s ease;
  cursor: pointer;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.card-frame:hover .card {
  transform: rotateY(4deg) rotateX(2deg);
  box-shadow: 0 18px 30px rgba(0,0,0,0.12);
}
.card-inner { position:absolute; inset:0; transform-style:preserve-3d; transition: transform 0.6s cubic-bezier(.2,.9,.3,1); }
.card.flipped .card-inner { transform: rotateY(180deg); }

.side {
  position:absolute;
  inset:0;
  backface-visibility:hidden;
  border-radius:14px;
  overflow:hidden;
  background: var(--card-bg);
  display:flex;
  flex-direction:column;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.03);
}

/* Anchor & Eye buttons */
.btn-eye,
.btn-anchor {
  position: absolute;
  top: 8px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
}
.btn-eye { right: 8px; }
.btn-anchor { left: 8px; }
.card-frame:hover .btn-eye,
.card-frame:hover .btn-anchor { opacity: 1; }
.btn-eye:hover,
.btn-anchor:hover { background: rgba(0,0,0,0.7); }
.btn-anchor.copied { background: rgba(22,163,74,0.85); }


/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox-controls {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
  z-index: 1001;
}
.lb-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.3); }
.lb-btn-close { background: rgba(220,38,38,0.5); }
.lb-btn-close:hover { background: rgba(220,38,38,0.8); }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  cursor: default;
}

/* Front */
.front .photo {
  width:100%;
  height: 280px;
  object-fit:cover;
  display:block;
}
.front .meta { padding:12px 14px; display:flex; flex-direction:column; gap:6px; flex:1; }
.brand { font-weight:700; font-size:16px; }
.model { color:var(--muted); font-size:14px; margin-top:2px; }
.year { color:#9ca3af; font-size:12px; margin-top:auto; text-align:right; }

/* Back */
.back { transform: rotateY(180deg); padding:14px; gap:8px; }

.specs { display:flex; flex-direction:column; gap:6px; margin-top:4px; font-size:13px; color:var(--muted); }
.specs .row { display:flex; justify-content:space-between; gap:8px; }
.specs .label { color:#6b7280; font-weight:600; width:40%; white-space:nowrap; }
.specs .value { text-align:right; color:#111827; width:60%; }

.specs .case-details {
  margin-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
}
.specs .case-details div { display:flex; justify-content:space-between; }
.specs .case-details div span.label { font-weight:600; color:#6b7280; }
.specs .case-details div span.value { text-align:right; color:#111827; }

.notes-label { margin-top:8px; font-size:13px; font-weight:600; color:#374151; }
.notes { margin-top:6px; min-height:84px; border-radius:8px; padding:10px; font-size:13px; background:#fff; color:#111827; white-space:pre-wrap; }

.flip-hint { font-size:12px; color:#9ca3af; margin-top:8px; text-align:center; }

@media (max-width:420px){ .card { height:440px; } }

.caption { font-size:12px; color:#9ca3af; text-align:center; margin-top:8px; }
.highlight { background: #fffb91; color: #111827; border-radius:2px; }
