:root {
  --panel: #111;
  --panel-2: #161616;
  --slot: #0e0e0e;
  --slot-line: #2c2c2c;
  --accent: #b22a2e;
  --tile: 64px;
  --tile-s: 48px;
}

h1 { font-family: "Lisiere", "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 400; line-height: .9; margin: 0; }

.c-hero {
  position: relative;
  height: 62vh;
  height: 62svh;
  min-height: 400px;
  max-height: 640px;
  overflow: hidden;
  background: #000;
}
.c-hero .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 46% 40%; }
.c-hero .veil {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .1) 30%),
    linear-gradient(to top, var(--bg) 0, rgba(11, 11, 11, .78) 30%, rgba(11, 11, 11, .2) 70%);
}
.c-title { position: absolute; left: 0; right: 0; bottom: clamp(28px, 6vh, 56px); z-index: 2; }
.c-title h1 { font-size: clamp(64px, 11vw, 140px); }
.c-title p { max-width: 58ch; margin: 18px 0 0; color: var(--text-2); font-size: 19px; }
.c-title .stats { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--text-3); font-size: 15px; margin-top: 14px; }
.c-title .stats span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 22px 3px -13px; background: var(--accent); }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 11, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.toolbar-in { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.search { position: relative; flex: 0 0 300px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  background: #050505;
  border: 1px solid var(--line-2);
  border-radius: 0;
  color: var(--text);
  font: 500 16px "Barlow", system-ui, sans-serif;
}
.search input:focus { outline: none; border-color: #777; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  background: none;
  border: 1px solid var(--line);
  color: var(--text-2);
  font: 600 14px "Barlow", system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { color: #fff; border-color: var(--line-2); }
.chip.is-on { color: #fff; border-color: var(--accent); background: rgba(178, 42, 46, .16); }

.c-main { padding-top: 40px; }

.howto { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 24px; }
.howto > div { background: var(--bg); padding: 20px 22px; }
.howto h2 { font-size: 24px; margin-bottom: 8px; }
.howto p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.howto b { color: var(--text); font-weight: 600; }
.howto i { font-style: normal; color: var(--text); }

.empty { color: var(--text-2); padding: 40px 0; }
.is-filtering .howto { display: none; }
.is-filtering .cat { padding-top: 32px; }

.cat { padding-top: 56px; scroll-margin-top: 70px; }
.cat-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.cat-head h2 { font-size: clamp(40px, 5vw, 60px); line-height: .92; }
.cat-head p { grid-column: 1; margin: 0; color: var(--text-2); font-size: 17px; }
.cat-head .count { grid-row: 1 / span 2; grid-column: 2; font: 400 clamp(30px, 4vw, 44px)/1 "Lisiere", sans-serif; color: var(--text-3); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 368px), 1fr)); gap: 14px; align-items: start; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  min-width: 0;
}
.card:target { border-color: var(--accent); }
.card header { margin-bottom: 14px; }
.card h3 { font-size: 26px; line-height: 1; }
.how { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.35; }
.kind { font: 600 11px/1 "Barlow", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--line-2); padding: 4px 6px 3px; }
.time { margin-left: auto; color: var(--text); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.time::before { content: ""; width: 11px; height: 11px; border: 2px solid var(--text-3); border-radius: 50%; box-sizing: border-box; background: linear-gradient(var(--text-3), var(--text-3)) 50% 25% / 2px 40% no-repeat; }

.recipe .row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 8px; }
.grp { display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 8px; }
.op { align-self: center; color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 2px; margin-top: -18px; }
.op.wide { font-size: 15px; margin-top: 0; }
.to {
  align-self: center;
  margin: -18px 4px 0;
  width: 26px;
  height: 14px;
  background: linear-gradient(var(--accent), var(--accent)) 0 50% / 18px 2px no-repeat;
  position: relative;
  flex: 0 0 auto;
}
.to::after { content: ""; position: absolute; right: 1px; top: 50%; width: 9px; height: 9px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: translateY(-50%) rotate(45deg); }

.stack, .capped { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }
.cap { font: 600 11px/1.15 "Barlow", sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); text-align: center; max-width: 84px; }

.slot {
  position: relative;
  width: var(--tile);
  height: var(--tile);
  padding: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, #1c1c1c, var(--slot) 72%);
  border: 1px solid var(--slot-line);
  box-shadow: inset 0 0 0 1px #000;
  cursor: pointer;
  color: inherit;
}
.slot:hover { border-color: #6a6a6a; }
.slot img { width: 86%; height: 86%; object-fit: contain; image-rendering: auto; pointer-events: none; }
.slot.is-out { border-color: #4a4a4a; background: radial-gradient(circle at 50% 42%, #232323, #101010 72%); }
.stack.is-kept .slot { border-style: dashed; }
.stack.cycles .slot.alt { display: none; }
.js .stack.cycles .slot:not(.on) { display: none; }
.js .stack.cycles .slot.on { display: grid; }
.n {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font: 600 14px/1 "Barlow", sans-serif;
  color: #fff;
  text-shadow: 1px 1px 0 #000, 0 0 3px #000;
  pointer-events: none;
}
.noicon { font: 400 20px "Lisiere", sans-serif; color: var(--text-3); text-transform: uppercase; }

.chip-tile {
  min-width: var(--tile);
  height: var(--tile);
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  color: var(--text-2);
  font: 600 13px/1.2 "Barlow", sans-serif;
  text-align: center;
  max-width: 130px;
}
.chip-tile.is-result { border-style: solid; border-color: #4a4a4a; color: var(--text); background: #151515; }

.spread { display: flex; flex-wrap: wrap; gap: 12px 10px; }
.spread .slot { --tile: 56px; }

.later { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; margin-left: 6px; opacity: .85; }
.later::after { content: "if left on"; font: 600 11px/1 "Barlow", sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.later .slot { --tile: 46px; }
.later.small { margin-left: 2px; gap: 0; opacity: 1; }
.later .slot.is-burnt { background: radial-gradient(circle at 50% 42%, #3a2a24, #140e0c 72%); border-color: #3a2b26; }
.later.small::after { display: none; }
.later.small .slot { --tile: 34px; }

.alts { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.alts span { color: var(--text-3); font-weight: 600; }

.pairs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px 14px; }
.pairs li[hidden] { display: none; }
.pairs li { display: flex; align-items: center; gap: 6px; }
.pairs .slot { --tile: var(--tile-s); }
.pairs .to { margin: 0 2px; width: 20px; background-size: 12px 2px; }
.pairs .to::after { width: 7px; height: 7px; }
.pairs .cap { display: none; }

.notes { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.notes li { position: relative; padding-left: 14px; margin: 3px 0; }
.notes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 2px; background: var(--accent); }

.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.drawer.is-open .drawer-back { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: #0d0d0d;
  border-left: 1px solid var(--line-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(24px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
  outline: none;
}
.drawer.is-open .drawer-panel { transform: none; opacity: 1; }
.drawer-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 1px solid var(--line-2); color: var(--text); cursor: pointer; }
.drawer-x svg { width: 16px; height: 16px; }
.drawer-head { display: flex; align-items: center; gap: 20px; padding: 28px 70px 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-icon { flex: 0 0 auto; width: 112px; height: 112px; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #222, #0b0b0b 72%); border: 1px solid var(--slot-line); }
.drawer-icon img { width: 88%; height: 88%; object-fit: contain; }
.drawer-head h2 { font-size: 34px; line-height: 1; }
.drawer-head p { margin: 8px 0 0; color: var(--text-3); font-size: 14px; }
.drawer-body { padding: 8px 24px 40px; }
.d-h { font-size: 22px; margin: 26px 0 12px; }
.d-list { display: grid; gap: 12px; }
.d-list .card { background: var(--panel-2); }
.d-list .none { color: var(--text-3); font-size: 15px; margin: 0; }

.foot-cats { columns: 2; column-gap: 24px; }
.foot-cats h3 { column-span: all; }

@media (max-width: 900px) {
  .howto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-in { flex-direction: column; align-items: stretch; gap: 10px; }
  .search { flex: none; }
}

@media (max-width: 640px) {
  :root { --tile: 54px; --tile-s: 44px; }
  .c-hero { height: 56svh; min-height: 380px; }
  .c-title p { font-size: 17px; }
  .howto { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px 14px 14px; }
  .card h3 { font-size: 23px; }
  .pairs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .drawer-head { padding: 22px 64px 18px 16px; gap: 14px; }
  .drawer-icon { width: 84px; height: 84px; }
  .drawer-head h2 { font-size: 27px; }
  .drawer-body { padding: 4px 14px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer-back, .drawer-panel { transition: none; }
}
