:root{
  --bg: #ffffff;
  --muted: #666;
  --accent1: linear-gradient(135deg,#6a11cb,#2575fc);
  --card-bg: #ffffff;
  --gap: 18px;
  --max-width: 1200px;
}

/* Page */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: #f3f5f7;
  color:#111;
  -webkit-font-smoothing:antialiased;
}

/* Splash */
#splash{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--bg); /* explicit white background */
  z-index:9999;
  opacity:0;
  transition: opacity 1s ease;
  pointer-events:auto;
}
#splash h1{
  margin:0;
  font-family: Impact, system-ui, sans-serif;
  font-size: clamp(28px, 7vw, 64px);
  letter-spacing:0.6px;
  color:#111;
}

/* Main layout */
#main{
  display:none; /* shown after splash */
  max-width:var(--max-width);
  margin: 28px auto;
  padding: 0 16px 40px;
}

/* Header */
.page-header{ text-align:center; margin-bottom: 18px; }
.page-header .lead{ color:var(--muted); margin-top:8px; }

/* Gallery grid */
.gallery{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  align-items:start;
  justify-items:center;
}

/* Card / slot */
.slot {
  width:100%;
  max-width:260px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(12,20,30,0.06);
  padding: 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.slot:hover{ transform: translateY(-6px); box-shadow: 0 16px 36px rgba(12,20,30,0.09); }

/* 9:16 frame */
.frame{
  width:100%;
  aspect-ratio: 9 / 16;
  background: #e9eef6;
  border-radius: 8px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:8px;
}
.frame img{ width:100%; height:100%; object-fit:cover; display:block; }

/* controls */
.controls{ width:100%; display:flex; flex-direction:column; align-items:center; gap:8px; }

.controls input[type="text"]{
  width:92%;
  padding:7px 8px;
  border-radius:8px;
  border:1px solid #d8dce6;
  font-size:0.9rem;
}

.controls .btn{
  width:92%;
  padding:8px 10px;
  border-radius:8px;
  border:0;
  cursor:pointer;
  font-weight:600;
  font-size:0.95rem;
  color:#fff;
  background: var(--accent1);
  box-shadow: 0 6px 18px rgba(37,117,252,0.12);
}
.controls .btn.secondary{ background: #555; }
.controls .btn.danger{ background: #e14b4b; }

/* small link preview button */
.view-link{
  width:92%;
  text-decoration:none;
  text-align:center;
  padding:7px 8px;
  border-radius:8px;
  border:1px solid #e1e6ef;
  color: #0b63d6;
  background:#fff;
  font-weight:600;
  font-size:0.9rem;
}

/* footer */
.footer{ text-align:center; color:var(--muted); margin-top:16px; }

/* responsive tweaks */
@media (max-width:900px){
  .slot{ max-width:320px; }
}
@media (max-width:520px){
  .gallery{ grid-template-columns: repeat(auto-fit, minmax(90%, 1fr)); gap:14px; }
  #main{ padding: 0 12px 30px; }
}
