:root{
  --sakura:#F7C9D2; --matcha:#7FB77E; --nori:#2B4930; --rice:#FFF9F5; --ink:#3A2D2D; --line:#00000012;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--rice);color:var(--ink);font-family:Inter,system-ui,Segoe UI,Roboto,sans-serif}
.header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:linear-gradient(180deg,var(--sakura),#ffe8ee)}
.brand{display:flex;gap:10px;align-items:center;color:var(--nori);text-decoration:none;font-weight:800;font-family:Poppins,Inter,sans-serif}
.nav{display:flex;gap:8px;align-items:center}
.nav a,.nav span{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 10px;text-decoration:none;color:var(--nori)}
.nav span{font-weight:700}
.container{max-width:1200px;margin:0 auto;padding:16px}
.card{border:1px solid var(--line);border-radius:16px;background:#fff;padding:14px}

.layout{display:grid;gap:16px;margin-top:16px}
@media(min-width:1000px){ .layout{grid-template-columns:1fr 1.3fr} }

/* Palette */
.palette .filters{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.chip{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;cursor:pointer}
.chip.active{background:#f9f4f4}
.items{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.item{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:12px;padding:10px;background:#fff;cursor:grab}
.item:active{cursor:grabbing}
.item .icon{font-size:22px}
.item .name{font-weight:600}
.item .tag{margin-left:auto;font-size:12px;opacity:.6}

/* Stage */
.box{display:grid;gap:10px;grid-template-columns:1fr 1fr}
.zone{position:relative;min-height:140px;border-radius:14px;border:2px dashed var(--line);background:#fff}
.zone.tall{grid-column:span 2;min-height:200px}
.zone.wide{grid-column:span 2}
.zone .label{position:absolute;left:10px;top:8px;font-size:12px;opacity:.7}
.drop{padding:28px 10px 12px 10px;min-height:110px}
.drop.dragover{background:#fff7fb;outline:2px dashed #f2b1c2}

.chip-big{display:inline-flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:999px;padding:10px 12px;background:#fff;margin:6px 6px 0 0}
.chip-big .icon{font-size:20px}
.chip-big .x{border:1px solid var(--line);border-radius:8px;background:#fff;padding:2px 6px;margin-left:6px;cursor:pointer}
.chip-big .mini{margin-left:6px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:4px 8px;cursor:pointer}

.controls{display:flex;gap:10px;flex-wrap:wrap}
.btn{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 14px;cursor:pointer}
.btn.ghost{background:transparent}

.status{position:absolute;right:16px;bottom:16px;background:#000000c0;color:#fff;padding:8px 12px;border-radius:999px;opacity:0;transform:translateY(8px);transition:.2s}
.status.show{opacity:1;transform:none}

/* Modal */
.modal{border:none;border-radius:16px;padding:14px;max-width:700px;width:clamp(320px,90vw,700px)}
.modal::backdrop{background:rgba(0,0,0,.35)}
.modal h3{margin:0 0 8px;font-family:Poppins,Inter,sans-serif}
.modal .hero{width:100%;border-radius:12px;margin:8px 0}
.modal .modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}

.footer{padding:20px;text-align:center;color:#6b5e5e}
/* =============================
   Thumbnail Images for Food Items
   ============================= */

.item .thumb,
.chip-big .thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px; /* change to 50% for circular */
  object-fit: cover;
  margin-right: 10px;
  vertical-align: -6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* =============================
   Mobile-friendly layout tweaks
   ============================= */
@media (max-width: 999px){
  /* Switch grid to vertical flow so stage is on top and palette is last */
  .layout { display: flex; flex-direction: column; }

  .stage { order: 1; }
  .palette { 
    order: 2; 
    position: sticky; 
    bottom: 0; 
    background: #fff; 
    z-index: 10; 
    max-height: 44vh; 
    overflow: auto;
    box-shadow: 0 -10px 25px rgba(0,0,0,.08);
  }

  /* More compact palette grid on small screens */
  .items { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .item { padding: 12px; }

  /* Make the active zone visually obvious */
  .zone.active { outline: 3px solid var(--sakura); }
  .zone.active .label { font-weight: 700; }
}

/* Thumbnails for items & chips */
.item .thumb,
.chip-big .thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px; /* change to 50% for circles */
  object-fit: cover;
  margin-right: 10px;
  vertical-align: -6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

