/* Mobile-first, happy PSA vibe */
:root{
  --ink:#3b2f2a;
  --tempura:#f3c562;
  --tempura-deep:#e7b24e;
  --paper:#fff7e6;
  --ui-bg: rgba(255, 247, 230, 0.92);
  --shadow: 0 6px 18px rgba(0,0,0,0.22);
  --shadow-soft: 0 4px 12px rgba(0,0,0,0.18);
  --radius: 14px;
}

html, body {
  height:100%;
  margin:0;
  font-family: "Fredoka", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--paper);
  overflow:hidden;
}

#app{
  position:relative;
  width:100%;
  height:100%;
}

#map{
  position:absolute;
  inset:0;
  z-index:0;
}

/* Title block */
#titleBlock{
  position:absolute;
  top:12px;
  left:12px;
  z-index:500;
  max-width:min(78vw, 420px);
  background: transparent;
  border-radius: 0;
  padding:0;
  box-shadow: none;
  backdrop-filter: none;
}

#titleBlock .title{
  font-family: "Mochiy Pop One", "Fredoka", sans-serif;
  font-size: 20px;
  letter-spacing: 0.2px;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.7);
}

#titleBlock .tagline{
  margin-top:6px;
  font-size: 15px;
  line-height: 1.15;
  color: rgba(59,47,42,0.88);
  text-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

/* Hamburger */
#hamburger{
  position:absolute;
  top:12px;
  right:12px;
  z-index:600;
  width:48px;
  height:48px;
  border-radius: 999px;
  border: 2px solid rgba(59,47,42,0.18);
  background: rgba(255,247,230,0.92);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}

#hamburger.shadow{
  box-shadow: var(--shadow-soft);
}

#hamburger .bun{
  width:20px;
  height:3px;
  background: var(--ink);
  border-radius:999px;
  opacity:0.9;
}

#menu{
  position:absolute;
  top:64px;
  right:12px;
  z-index:650;
  width: 190px;
  background: var(--ui-bg);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(59,47,42,0.12);
  overflow:hidden;
}

.menuItem{
  width:100%;
  text-align:left;
  padding:12px 12px;
  background: transparent;
  border:none;
  font-size: 14px;
  color: var(--ink);
  cursor:pointer;
}

.menuItem:active{
  background: rgba(243,197,98,0.25);
}

.hidden{ display:none; }

/* Sources modal */
#modalBackdrop{
  position:absolute;
  inset:0;
  z-index:900;
  background: rgba(0,0,0,0.25);
}

#sourcesModal{
  position:absolute;
  z-index:950;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 560px);
}

.modalInner{
  background: rgba(255,247,230,0.97);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(59,47,42,0.12);
  padding: 14px 14px 12px;
}

.modalTitle{
  font-family: "Mochiy Pop One", "Fredoka", sans-serif;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 10px;
}

.modalBody{
  font-size: 14px;
  line-height: 1.35;
  color: rgba(59,47,42,0.92);
}

.modalBody a{
  color: rgba(59,47,42,0.95);
  text-decoration-thickness: 2px;
}

/* Sushi train overlay */
#sushiTrainOverlay{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:120px; /* default; JS will keep canvas fitted */
  z-index:700;  /* above map, below menu+modal */
  pointer-events:none;
}

#sushiTrainCanvas{
  width:100%;
  height:100%;
  display:block;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper{
  border-radius: 16px;
  background: rgba(255,247,230,0.96);
  box-shadow: var(--shadow);
  border: 1px solid rgba(59,47,42,0.12);
}

.leaflet-popup-tip{
  background: rgba(255,247,230,0.96);
}

.popupTitle{
  font-family: "Mochiy Pop One", "Fredoka", sans-serif;
  font-size: 13px;
  margin: 0 0 6px 0;
  color: var(--ink);
}

.popupRow{
  display:flex;
  gap:10px;
  align-items:center;
}

.popupNumbers{
  font-size: 13px;
  color: rgba(59,47,42,0.92);
}

.popupNumbers b{ color: var(--ink); }


/* Plate waffle marker */
.plateMarker{
  width:auto;
  height:auto;
  transform: translate(-50%, -50%);
  pointer-events:none;
}

.plateGrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,247,230,0.55);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(4px);
}

.plateGrid img{
  width: 18px;
  height: 18px;
  display:block;
}

@media (min-width: 480px){
  #titleBlock .title{ font-size: 20px; }
  #titleBlock .tagline{ font-size: 14px; }
  .plateGrid img{ width: 20px; height: 20px; }
  #sushiTrainOverlay{ height: 130px; }
}


/* Ensure divIcons are fully transparent (prevents white strip/background) */
.plateMarker.leaflet-div-icon{ background: transparent !important; border: none !important; }
.plateMarker{ background: transparent; border: none; }

/* Center the waffle on its anchor point */
.plateMarker{ transform: translate(-50%, -50%); }

/* Plate grid sizing via CSS variable (updated on zoom) */
:root{ --plateIcon: 18px; }
.plateGrid{ display:grid; grid-template-columns: repeat(4, var(--plateIcon)); grid-auto-rows: var(--plateIcon); gap: 3px; }
.plateGrid img{ width: var(--plateIcon); height: var(--plateIcon); display:block; }


/* Tempura texture overlay pane */
.leaflet-pane .tempuraTexture{
  position:absolute;
  top:0; left:0;
  width:100%; height:100%;
  pointer-events:none;
}



/* --- Plate marker: kill any residual background artifacts (left strip issue) --- */
.leaflet-marker-icon.plateMarker,
.plateMarker.leaflet-div-icon,
.plateMarker{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

.plateMarker::before,
.plateMarker::after,
.plateGrid::before,
.plateGrid::after{
  content: none !important;
  display: none !important;
}

.plateGrid{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.plateGrid img{ background: transparent !important; }


/* Popup without arrow/tip */
.noTipPopup .leaflet-popup-tip,
.leaflet-popup.noTipPopup .leaflet-popup-tip,
.leaflet-popup-tip-container{ display:none !important; }

.noTipPopup .leaflet-popup-content-wrapper{
  border-radius: 16px;
}

/* Popup metrics + charts */
.popupRow{
  display:flex;
  align-items:center;
  gap:12px;
}
.metricCol{
  flex:1 1 auto;
  min-width: 120px;
}
.metricLabel{
  font-size: 12px;
  opacity: 0.78;
  margin-bottom: 2px;
}
.metricVal{
  font-family: "Mochiy Pop One","Fredoka",sans-serif;
  font-size: 18px;
}
.popupCharts{
  margin-top: 10px;
}
