:root {
  color-scheme: light;
  --paper: #fbfbf8;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --slot: #f1f3f4;
  --slot-edge: #c7c9c7;
  --green: #2f7d32;
  --grass: #5b9a3d;
  --dirt: #7a5230;
  --stone: #7d8588;
  --water: #2d72b8;
  --gold: #d29b2f;
  --shadow: 0 10px 28px rgba(60, 64, 67, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(251, 251, 248, 0.98)),
    repeating-linear-gradient(90deg, rgba(47, 125, 50, 0.05) 0 12px, transparent 12px 24px),
    var(--paper);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 42px;
}

.search-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 24px 0 34px;
}

.minecraft-logo {
  display: block;
  width: min(780px, 100%);
  margin: 0;
  line-height: 0.86;
}

.minecraft-title-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.2));
}

.search-form {
  position: relative;
  width: min(690px, 100%);
}

.search-icon {
  position: absolute;
  left: 23px;
  top: 50%;
  width: 21px;
  height: 21px;
  fill: none;
  pointer-events: none;
  stroke: #6f7880;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
  transform: translateY(-50%);
}

.search-form input {
  width: 100%;
  height: 54px;
  padding: 0 24px 0 60px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: #fff;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.12);
  color: var(--ink);
  font-size: 1.02rem;
}

.search-form input:hover,
.search-form input:focus {
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(60, 64, 67, 0.23);
}

.recipe-meta {
  display: none;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
}

.filter-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible {
  border-color: #b8bcbf;
  box-shadow: 0 1px 4px rgba(60, 64, 67, 0.18);
}

.filter-button.is-active {
  border-color: rgba(47, 125, 50, 0.42);
  background: #eaf4e5;
  color: #1f5c26;
}

.results-shell {
  padding-top: 4px;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.results-heading h2,
.results-heading p {
  margin: 0;
}

.results-heading h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.results-heading p {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.results-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 14px;
}

.recipe-card {
  display: flex;
  min-width: 0;
  min-height: 360px;
  flex-direction: column;
  gap: 14px;
  padding: 15px;
  border: 1px solid #e1e3e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.recipe-card:hover {
  box-shadow: var(--shadow);
}

.card-top {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  min-width: 0;
}

.result-icon {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  --cube-size: 44px;
  place-items: center;
  border: 3px solid #535353;
  border-radius: 4px;
  background:
    linear-gradient(135deg, hsl(var(--item-hue), 50%, 58%), hsl(var(--item-hue), 42%, 34%));
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.3),
    inset -3px -3px 0 rgba(0, 0, 0, 0.2);
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.result-icon.has-texture {
  border-color: #cfd4cf;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(216, 221, 216, 0.55)),
    #f7f9f7;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.8),
    inset -2px -2px 0 rgba(0, 0, 0, 0.08);
}

.title-block {
  min-width: 0;
}

.title-line {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.recipe-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 1.06rem;
  line-height: 1.25;
}

.count-badge {
  display: none;
}

.recipe-id {
  display: none;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.station-crafting {
  background: #eaf4e5;
  color: #1f5c26;
}

.badge.station-cooking {
  background: #fff2d7;
  color: #6f4b00;
}

.badge.station-stonecutting {
  background: #edf0f1;
  color: #435056;
}

.badge.station-smithing {
  background: #e8f0fe;
  color: #174ea6;
}

.recipe-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.crafting-layout {
  display: grid;
  grid-template-columns: auto 34px 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.crafting-grid {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 4px;
}

.special-layout {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.special-layout .field-list {
  width: 100%;
}

.slot {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 44px;
  place-items: center;
  border: 2px solid var(--slot-edge);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(198, 205, 196, 0.45)),
    var(--slot);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.65),
    inset -2px -2px 0 rgba(0, 0, 0, 0.08);
}

.slot.is-empty {
  background: #eef0ee;
}

.mini-item {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  --cube-size: 30px;
  place-items: center;
  border: 2px solid rgba(43, 47, 43, 0.75);
  border-radius: 3px;
  background:
    linear-gradient(135deg, hsl(var(--item-hue), 54%, 62%), hsl(var(--item-hue), 45%, 37%));
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.mini-item.has-texture {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.item-texture {
  display: block;
  place-self: center;
  width: 92%;
  height: 92%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.block-cube {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cube-size);
  height: var(--cube-size);
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.22));
}

.banner-model {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cube-size);
  height: var(--cube-size);
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.24));
}

.shulker-model {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cube-size);
  height: var(--cube-size);
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.24));
}

.banner-pole,
.banner-crossbar,
.banner-cloth,
.banner-cloth-side,
.shulker-face,
.shulker-lid {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.banner-pole {
  left: 25%;
  top: 10%;
  width: 9%;
  height: 84%;
  background:
    linear-gradient(90deg, #3a2514 0 22%, #9b6a33 23% 66%, #5f3a1f 67% 100%);
}

.banner-crossbar {
  left: 23%;
  top: 12%;
  width: 59%;
  height: 8%;
  background:
    linear-gradient(180deg, #b98444 0 40%, #5f3a1f 41% 100%);
}

.banner-cloth {
  left: 34%;
  top: 20%;
  width: 40%;
  height: 64%;
  background-image: var(--block-texture-top);
  background-position: center;
  background-size: 100% 100%;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 62% 82%, 50% 100%, 38% 82%, 0 82%);
  filter: brightness(1.02);
}

.banner-cloth-side {
  left: 74%;
  top: 23%;
  width: 9%;
  height: 55%;
  background-image: var(--block-texture-top);
  background-position: center;
  background-size: 100% 100%;
  clip-path: polygon(0 0, 100% 12%, 100% 88%, 0 100%);
  filter: brightness(0.64);
}

.shulker-top {
  left: 18%;
  top: 8%;
  width: 64%;
  height: 35%;
  clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%);
  background-image: var(--block-texture-top);
  background-position: center 14%;
  background-size: 170% 170%;
  filter: brightness(1.14);
}

.shulker-left {
  left: 18%;
  top: 26%;
  width: 32%;
  height: 55%;
  clip-path: polygon(0 0, 100% 31%, 100% 100%, 0 69%);
  background-image: var(--block-texture-top);
  background-position: 18% 58%;
  background-size: 170% 170%;
  filter: brightness(0.68);
}

.shulker-right {
  left: 50%;
  top: 26%;
  width: 32%;
  height: 55%;
  clip-path: polygon(0 31%, 100% 0, 100% 69%, 0 100%);
  background-image: var(--block-texture-top);
  background-position: 82% 58%;
  background-size: 170% 170%;
  filter: brightness(0.9);
}

.shulker-lid {
  left: 25%;
  top: 24%;
  width: 50%;
  height: 9%;
  clip-path: polygon(0 25%, 50% 0, 100% 25%, 100% 70%, 50% 100%, 0 70%);
  background: rgba(20, 16, 42, 0.28);
}

.cube-face {
  position: absolute;
  display: block;
  overflow: hidden;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.cube-top {
  left: 18%;
  top: 6%;
  width: 64%;
  height: 36%;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background-image: var(--block-texture-top);
  filter: brightness(1.18);
}

.cube-left {
  left: 18%;
  top: 24%;
  width: 32%;
  height: 56%;
  clip-path: polygon(0 0, 100% 32%, 100% 100%, 0 68%);
  background-image: var(--block-texture-left);
  filter: brightness(0.74);
}

.cube-right {
  left: 50%;
  top: 24%;
  width: 32%;
  height: 56%;
  clip-path: polygon(0 32%, 100% 0, 100% 68%, 0 100%);
  background-image: var(--block-texture-right);
  filter: brightness(0.94);
}

.is-block-texture .block-cube {
  display: block;
}

.is-block-texture .item-texture {
  display: none;
}

.is-carpet-texture .block-cube {
  display: block;
  width: calc(var(--cube-size) * 0.94);
  height: calc(var(--cube-size) * 0.72);
  transform: translate(-50%, -47%);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
}

.is-carpet-texture .item-texture {
  display: none;
}

.is-carpet-texture .cube-top {
  left: 8%;
  top: 8%;
  width: 84%;
  height: 62%;
  clip-path: polygon(50% 0, 100% 45%, 50% 90%, 0 45%);
  background-image: var(--block-texture-top);
  filter: brightness(1.04);
}

.is-carpet-texture .cube-left {
  left: 8%;
  top: 36%;
  width: 42%;
  height: 18%;
  clip-path: polygon(0 0, 100% 100%, 100% 82%, 0 18%);
  background-image: var(--block-texture-left);
  filter: brightness(0.56);
}

.is-carpet-texture .cube-right {
  left: 50%;
  top: 36%;
  width: 42%;
  height: 18%;
  clip-path: polygon(0 100%, 100% 0, 100% 18%, 0 82%);
  background-image: var(--block-texture-right);
  filter: brightness(0.72);
}

.is-banner-texture .banner-model {
  display: block;
}

.is-banner-texture .item-texture {
  display: none;
}

.is-shulker-texture .shulker-model {
  display: block;
  width: calc(var(--cube-size) * 1.12);
  height: calc(var(--cube-size) * 1.12);
}

.is-shulker-texture .item-texture {
  display: none;
}

.result-icon .item-texture {
  width: 46px;
  height: 46px;
}

.mini-item.is-rendered-item .item-texture {
  width: 100%;
  height: 100%;
}

.result-icon.is-rendered-item .item-texture {
  width: 48px;
  height: 48px;
}

.mini-item.is-shulker-render.is-rendered-item .item-texture {
  width: 108%;
  height: 108%;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.22));
}

.result-icon.is-shulker-render.is-rendered-item .item-texture {
  width: 54px;
  height: 54px;
}

.mini-item.has-texture .fallback-initials,
.result-icon.has-texture .fallback-initials {
  display: none;
}

.fallback-initials {
  position: relative;
  z-index: 1;
}

.output-count {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: end;
  gap: 1px;
  --count-pixel: 1.8px;
  line-height: 0;
  letter-spacing: 0;
  filter: drop-shadow(1px 1px 0 #9aa1a7);
}

.recipe-output-count {
  margin-top: 3px;
  --count-pixel: 2px;
}

.item-output-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  margin: 0;
  --count-pixel: 1.55px;
}

.pixel-digit {
  display: grid;
  grid-template-columns: repeat(5, var(--count-pixel));
  grid-template-rows: repeat(7, var(--count-pixel));
  gap: 0;
}

.pixel-bit {
  width: var(--count-pixel);
  height: var(--count-pixel);
}

.pixel-bit.is-on {
  position: relative;
  background: #d8dde1;
}

.flow-slot {
  position: relative;
  width: 34px;
  height: 34px;
  background: transparent;
}

.flow-slot::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  content: "";
  background: #5f6368;
  box-shadow:
    -15px 0 0 #5f6368,
    -10px 0 0 #5f6368,
    -5px 0 0 #5f6368,
    5px -10px 0 #5f6368,
    5px -5px 0 #5f6368,
    5px 0 0 #5f6368,
    5px 5px 0 #5f6368,
    5px 10px 0 #5f6368,
    10px -5px 0 #5f6368,
    10px 0 0 #5f6368,
    10px 5px 0 #5f6368,
    15px 0 0 #5f6368;
  filter: drop-shadow(1px 1px 0 #cfd4cf);
  transform: translate(-50%, -50%);
}

.output-slot {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 2px solid var(--slot-edge);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(198, 205, 196, 0.45)),
    var(--slot);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.65),
    inset -2px -2px 0 rgba(0, 0, 0, 0.08);
}

.output-slot .mini-item {
  width: 34px;
  height: 34px;
  --cube-size: 34px;
}

.item-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.2;
}

.item-id {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ingredient-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #d9dcda;
  border-radius: 999px;
  background: #fff;
}

.ingredient-chip .mini-item {
  width: 22px;
  height: 22px;
  --cube-size: 22px;
  flex: 0 0 auto;
  font-size: 0.62rem;
}

.ingredient-chip .mini-item.is-rendered-item .item-texture {
  width: 22px;
  height: 22px;
}

.ingredient-chip span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.station-layout,
.slot-list {
  display: grid;
  gap: 9px;
}

.station-row {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 8px;
  align-items: center;
}

.station-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.field-list {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}

.field-key {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.field-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-state {
  margin: 36px 0 0;
  color: var(--muted);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 34px;
  }

  .search-hero {
    gap: 22px;
    padding-bottom: 24px;
  }

  .minecraft-logo {
    width: min(430px, 100%);
  }

  .search-form input {
    height: 50px;
    padding: 0 18px 0 56px;
  }

  .results-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .results-heading p {
    text-align: left;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .recipe-card {
    min-height: 0;
  }

  .crafting-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .flow-slot {
    width: 38px;
    height: 38px;
  }

  .flow-slot::before {
    box-shadow:
      0 -15px 0 #5f6368,
      0 -10px 0 #5f6368,
      0 -5px 0 #5f6368,
      -10px 5px 0 #5f6368,
      -5px 5px 0 #5f6368,
      0 5px 0 #5f6368,
      5px 5px 0 #5f6368,
      10px 5px 0 #5f6368,
      -5px 10px 0 #5f6368,
      0 10px 0 #5f6368,
      5px 10px 0 #5f6368,
      0 15px 0 #5f6368;
  }
}

@media (max-width: 390px) {
  .crafting-grid {
    grid-template-columns: repeat(3, 42px);
    grid-template-rows: repeat(3, 42px);
  }

  .output-slot {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .output-slot .mini-item {
    width: 30px;
    height: 30px;
    --cube-size: 30px;
  }

  .station-row,
  .field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
