:root{
  --bg:#0f1020;
  --card:#1b1d3a;
  --text:#ffffff;
  --muted:#cfd2ff;
  --primary:#6c63ff;
  --secondary:#ff6584;
  --bar:#14162e;
}
body.light{
  --bg:#f4f6ff;
  --card:#ffffff;
  --text:#0f1020;
  --muted:#555;
  --bar:#ffffff;
}

/* BASE */
*{box-sizing:border-box;margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Poppins',sans-serif;
  transition:.6s;
}

/* TOP BAR */
.top-bar{
  position:sticky;
  top:0;
  z-index:1000;
  background:var(--bar);
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:.7rem 1rem;
  box-shadow:0 6px 20px rgba(0,0,0,.25);
}
.brand{display:flex;gap:.6rem;align-items:center;}
.logo{
  width:36px;height:36px;border-radius:50%;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  display:flex;align-items:center;justify-content:center;
  font-family:'Montserrat';font-weight:700;color:#fff;
}
.theme-toggle{
  width:34px;height:34px;border-radius:50%;
  border:none;background:var(--card);color:var(--text);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2);
}

/* APP */
.app{
  max-width:1000px;
  margin:auto;
  padding:2rem 1rem 3rem;
}

/* HEADER */
h1{
  font-family:'Montserrat';
  text-align:center;
  margin-bottom:.3rem;
}
.subtitle{
  text-align:center;
  color:var(--muted);
  margin-bottom:1.5rem;
}

/* CATEGORY TABS */
.tabs{
  display:flex;
  gap:.6rem;
  justify-content:center;
  margin-bottom:1.8rem;
  flex-wrap:wrap;
}
.tab{
  padding:.45rem 1.1rem;
  border-radius:20px;
  border:1px solid var(--primary);
  color:var(--primary);
  font-size:.8rem;
  cursor:pointer;
}
.tab.active{
  background:var(--primary);
  color:#fff;
}

/* STORIES GRID */
.stories{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:1.4rem;
}

/* STORY CARD */
.story-card{
  background:var(--card);
  border-radius:20px;
  overflow:hidden;
  cursor:pointer;
  box-shadow:0 18px 40px rgba(0,0,0,.25);
  transition:.35s;
}
.story-card:hover{transform:translateY(-6px);}

.story-banner{
  padding:1rem;
}

.story-banner img{
  width:100%;
  height:320px;              /* portrait rectangle */
  object-fit:cover;
  border-radius:14px;        /* slightly rounded corners */
  display:block;
}


.story-info{
  padding:1rem 1.2rem 1.3rem;
}
.story-info h3{
  font-family:'Montserrat';
  margin-bottom:.4rem;
}
.desc{
  font-size:.85rem;
  color:var(--muted);
  margin-bottom:.8rem;
}

/* META */
.story-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:.6rem;
}
.author{
  font-size:.75rem;
  color:var(--muted);
}
.badges{
  display:flex;
  gap:.35rem;
  flex-wrap:wrap;
}
.badge{
  font-size:.65rem;
  padding:.25rem .55rem;
  border-radius:12px;
}
.badge.admin{
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:#fff;
}
.badge.source{
  border:1px solid var(--primary);
  color:var(--primary);
  text-decoration:none;
}
.badge.source:hover{
  background:var(--primary);
  color:#fff;
}

/* ACTIONS */
.actions{
  display:flex;
  gap:.6rem;
  margin-top:.8rem;
}
.action{
  font-size:.8rem;
  color:var(--muted);
  cursor:pointer;
}

/* SUBMIT BUTTON */
.submit-story{
  margin:3rem auto 0;
  display:block;
  text-align:center;
  padding:1rem 2.5rem;
  border-radius:40px;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:#fff;
  font-weight:600;
  text-decoration:none;
  width:fit-content;
  box-shadow:0 18px 45px rgba(108,99,255,.45);
}

/* FOOTER */
footer{
  margin-top:3rem;
  text-align:center;
  font-size:.75rem;
  color:var(--muted);
}
