:root {
  --bg: #0f1115;
  --card: #171923;
  --muted: #9aa4b2;
  --text: #e6e6e6;
  --accent: #4f7cff;
  --ok: #22c55e;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }

header { position: sticky; top: 0; z-index: 10; background: rgba(15,17,21,0.9); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid #232838; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }

nav { display: flex; gap: 16px; align-items: center; }
nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; }
nav a.active, nav a:hover { background: #1e2435; }

.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px){ .grid { grid-template-columns: 1.2fr 1fr; } }

.recipe-grid { grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }

.card { background: var(--card); border: 1px solid #232838; border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }

h1 { font-size: 28px; margin: 12px 0 4px; }
h2 { font-size: 20px; margin: 0 0 8px; color: #c7d2fe; }

p.muted, .muted { color: var(--muted); margin: 6px 0 16px; }

label { font-size: 14px; color: var(--muted); display: block; margin: 8px 0 6px; }
input, select, button, textarea { width: 100%; padding: 10px 12px; background: #111420; border: 1px solid #2a3146; color: var(--text); border-radius: 12px; font-size: 15px; }

button { cursor: pointer; background: var(--accent); border: none; font-weight: 600; }
button.secondary { background: #1f2638; }

.row{display: grid; gap: 6px; grid-template-columns: 1fr;}
@media (min-width: 700px){ .row { grid-template-columns: 1fr 1fr; } }

.ing { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #2a3146; }
.ing small { color: var(--muted); }

.divider { height: 1px; background: #232838; margin: 10px 0; }

.warn { color: var(--warn); }
.ok { color: var(--ok); }

.recipe-card { display: grid; grid-template-columns: 1fr; gap: 10px; }

.results{ margin-top:10px; padding:12px; border:1px solid #2a3146; border-radius:12px; background:#111420 }
.results h3{ margin:0 0 8px; font-size:16px; color:#c7d2fe }

.gauge{ height:10px; background:#2a3146; border-radius:999px; overflow:hidden }
.gauge>.bar{ height:100%; background:var(--accent) }

footer { color: var(--muted); font-size: 12px; padding: 24px 0 48px; }

/*Recipe Icons (PNG safe sizing)*/

.recipe-card .recipe-head{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.recipe-card .recipe-icon{
  width: 100px;
  height: 100px;
  flex: 0 0 40px;
  object-fit: contain;
  border-radius: 8px;
}

/* Smaller screens */
@media (max-width: 520px){
  .recipe-card .recipe-icon{
    width: 3px;
    height: 3px;
    flex-basis: 34px;
  }
}

/*Recipe preview image (calculator page)*/
.recipe-preview{
  /*Reserve space so the layout never shifts*/
  height: 120px;          /*adjust if you want more/less*/
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 6px;
}

.recipe-preview img{
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;

  /*Hide without collapsing layout*/
  opacity: 0;
  transition: opacity .15s ease;
}

.recipe-preview.is-visible img{
  opacity: 1;
}

/*Calculator button spacing*/
.button-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

/*Image sizing fixes*/

/*Only the calculator preview image should be large*/
#selectedRecipeImg{
  width: 180px;
  height: 180px;
  object-fit: contain;
  display: block;
}

/*Recipe grid icons should stay small and consistent*/
.recipe-card img{
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

/*Recipes controls*/
.recipe-controls{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin:12px 0 16px;
}

.recipe-controls input[type="search"]{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline:none;
}

.recipe-controls input[type="search"]::placeholder{
  color: var(--muted);
}

.recipe-controls .filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.recipe-controls select{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline:none;
}

/*makes recipe header layout nicer*/
.recipe-head{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}

.recipe-head-text h2{ margin:0; }
.recipe-head-text .muted{ margin:4px 0 0; }

/*Tools page polish*/
.tools-hero h1{
  margin-bottom: 6px;
}

.tools-pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.tools-pill{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:0.9rem;
  border:1px solid var(--border, rgba(255,255,255,.10));
  background: rgba(255,255,255,.04);
}

.tools-card{
  margin-top: 12px;
}

.tool-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.tool-card{
  padding: 14px;
  border: 1px solid var(--border, rgba(255,255,255,.10));
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.tool-top{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}

.tool-img{
  width: 200px;
  height: 200px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 14px;
  padding: 8px;

}

.tool-head h3{
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.tool-badges{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 8px;
}

.tool-badge{
  display:inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--border, rgba(255,255,255,.10));
  background: rgba(255,255,255,.04);
}


/*Legal page polish*/
.legal-hero h1{
  margin-bottom: 6px;
}

.legal-pill-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.legal-pill{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid var(--border, rgba(255,255,255,.10));
  background: rgba(255,255,255,.04);
}

.legal-card{
  margin-top: 12px;
}

.legal-list{
  margin: 10px 0 0;
  padding-left: 18px;
}

.legal-list li{
  margin: 8px 0;
}

/*21+ age gate modal*/

.agegate{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.agegate.is-open{
  display: flex;
}

.agegate-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.agegate-card{
  position: relative;
  width: min(520px, 100%);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border, rgba(255,255,255,.10));
  background: var(--panel, #111827);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.agegate-card h2{
  margin: 0 0 6px;
}

.agegate-actions{
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.agegate-note{
  margin-top: 12px;
  font-size: 0.9rem;
  opacity: .85;
}

/* Keep tool images clean (no border/box/bg) */
.tool-img{
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
