/* Rate my plate — Full styles (blue/white/gray, mobile-first) */
:root{
  --blue:#3b82f6; --blue-700:#1d4ed8;
  --bg:#f5f7fb; --panel:#ffffff; --ink:#0b0f19; --muted:#5b6475; --border:#e6e9f2;
  --radius:16px; --shadow: 0 8px 24px rgba(2,10,37,.08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--ink);
  background:var(--bg);
  line-height:1.5;
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:.75rem; padding:.75rem .9rem;
  background:rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; align-items:center; gap:.6rem; font-weight:800}
.logo{width:34px; height:34px; display:grid; place-items:center; border-radius:10px;
  background:linear-gradient(135deg, var(--blue), #60a5fa); color:#fff; font-weight:800}
.name{letter-spacing:.2px}

.chip{
  padding:.5rem .8rem; border:1px solid var(--border); background:#fff; border-radius:999px;
  font-weight:600; color:var(--ink); cursor:pointer;
}

.screen{
  min-height:calc(100dvh - 64px);
  display:grid; gap:.9rem; grid-template-rows: auto auto auto 1fr;
  max-width:720px; margin:0 auto; padding: .9rem;
}

.card{
  background:var(--panel); border:1px solid var(--border); border-radius:var(--radius);
  padding:1rem; box-shadow: var(--shadow);
}

.hero h1{margin:.2rem 0 .4rem; font-size:clamp(1.4rem, 4vw, 1.9rem)}
.accent{color:var(--blue)}
.lede{color:var(--muted); margin:0}

/* Recent strip */
.recent-strip .strip{ display:flex; gap:.5rem; overflow:auto; padding:.2rem; }
.strip::-webkit-scrollbar{ height:8px }
.strip-item{ display:block; min-width:120px; height:80px; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.strip-item img, .strip-item video{ width:100%; height:100%; object-fit:cover; display:block; }
.strip-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:.4rem; }
.link{ color:var(--blue); text-decoration:none; font-weight:600; }

.form h2{margin:0 0 .5rem}
.stack{display:flex; flex-direction:column; gap:.7rem}
.grid{display:grid; grid-template-columns: 1fr 1fr; gap:.7rem}
.field{display:flex; flex-direction:column; gap:.3rem}
.label{font-weight:600}
input, select, textarea{
  width:100%; padding:.8rem .9rem; border-radius:12px;
  border:1px solid var(--border); background:#fff; color:var(--ink);
}
textarea{resize:vertical; min-height:88px}
.help{color:var(--muted)}

/* Search section */
.search .muted{ margin:.3rem 0 0; }
.row{ display:flex; gap:.6rem; flex-wrap:wrap; }

/* Stars: highlight up to selected (reverse order trick) */
.stars{ display:inline-flex; flex-direction: row-reverse; gap:.2rem; }
.stars input{ display:none; }
.stars label{ cursor:pointer; font-size:1.6rem; color:#c7ced9; }
.stars label:hover,
.stars label:hover ~ label{ color:#fbbf24; }
.stars input:checked ~ label{ color:#f59e0b; }

/* Buttons */
.btn{
  align-self:flex-start; padding:.9rem 1.1rem; border-radius:999px; border:0;
  background:var(--blue); color:#fff; font-weight:800; cursor:pointer;
}
.btn:hover{background:var(--blue-700)}

.msg{margin:.1rem 0 0; color:var(--muted)}

/* Drawer for recent posts */
.drawer{
  position: fixed; inset: auto 0 0 0; background:#fff;
  border-top:1px solid var(--border); border-radius:16px 16px 0 0;
  transform: translateY(102%); transition: transform .25s ease;
  max-height: 70dvh; overflow:auto; box-shadow: 0 -12px 24px rgba(2,10,37,.1);
}
.drawer[aria-hidden="false"]{ transform: translateY(0); }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; padding: .8rem 1rem; position:sticky; top:0; background:#fff; border-bottom:1px solid var(--border);}
.recent{ list-style:none; margin:0; padding: .8rem; display:grid; gap:.6rem; }
.tile{ border:1px solid var(--border); border-radius:12px; padding:.7rem; }
.media-row{ display:grid; grid-template-columns: 96px 1fr; gap:.6rem; align-items:center; }
.media-row .thumb img, .media-row .thumb video{ width:96px; height:72px; object-fit:cover; border-radius:8px; display:block; border:1px solid var(--border); }

.drawer-foot{ padding: .6rem 1rem 1rem; }

/* === Votes styling === */
.votes {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
}
.votes button {
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
}
.votes .score {
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

/* === Comments section === */
.comments {
  margin-top: .6rem;
  display: grid;
  gap: .4rem;
  padding-left: .3rem;
}

.comment {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem .7rem;
  font-size: .9rem;
  line-height: 1.4;
}

.comment strong {
  color: var(--ink);
  font-weight: 700;
}

.comment time {
  color: var(--muted);
  font-size: .8rem;
}

.commentForm {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .6rem;
}

.commentForm input[name="author"],
.commentForm input[name="body"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .6rem .7rem;
  font-size: .9rem;
}

.commentForm button {
  align-self: flex-start;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.1rem;
  cursor: pointer;
}

.commentForm button:hover {
  background: var(--blue-700);
}

.modal{
  position: fixed; inset:0; display:none; place-items:center;
  background: rgba(0,0,0,.35); padding: 1rem; z-index: 50;
}
.modal[aria-hidden="false"]{ display:grid; }
.modal-card{
  width:min(92vw, 520px);
  background:#fff; border:1px solid var(--border); border-radius:16px;
  box-shadow: var(--shadow); padding:1rem 1.1rem;
}
.modal-card h3{ margin:.2rem 0 .4rem; }
.modal-text{ color:var(--muted); margin:.2rem 0 .8rem; }

/* Footer */
.foot{ text-align:center; padding:12px; color:var(--muted); font-size:.9rem; border-top:1px solid var(--border); margin-top:8px; }

/* Responsiveness */
@media (max-width:520px){
  .grid{ grid-template-columns: 1fr; }
}
