:root {
  color-scheme: light;
  --bg: #f8f5ef;
  --surface: #ffffff;
  --surface-muted: #fff8ed;
  --ink: #22201c;
  --muted: #706a61;
  --line: #ded6c9;
  --accent: #b9502c;
  --accent-strong: #923a21;
  --accent-soft: #f3dfd1;
  --green: #2f6657;
  --green-soft: #e2f0eb;
  --blue: #2b5e82;
  --shadow: 0 14px 34px rgba(55, 43, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

.header-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 8px 12px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner,
.controls__inner,
.shop-section__inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 36px;
}

.site-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 2rem + 1vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.35;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 0.94rem;
  letter-spacing: 0;
}

.site-description {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
}

.controls {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.controls__inner {
  padding: 24px 0;
}

.controls__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field__control {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
}

.field__control:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(185, 80, 44, 0.18);
}

.tag-filter {
  margin-top: 20px;
}

.tag-filter__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-button,
.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 700;
  line-height: 1.3;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.button--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent-strong);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button--primary:hover,
.button--primary:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button--danger {
  border-color: #b3261e;
  background: #b3261e;
  color: #ffffff;
}

.button--danger:hover,
.button--danger:focus-visible {
  border-color: #7d1b15;
  background: #7d1b15;
}

.button--ghost:hover,
.button--ghost:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tag-button {
  background: var(--surface);
  color: var(--green);
  border-color: #bdd5cc;
}

.tag-button:hover,
.tag-button:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
}

.tag-button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.shop-section__inner {
  padding: 32px 0 56px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.shop-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shop-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(185, 80, 44, 0.1), rgba(47, 102, 87, 0.1)),
    #eee7dd;
}

.shop-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
}

.shop-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.shop-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shop-card__title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.genre-pill {
  flex: 0 0 auto;
  max-width: 45%;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.fact {
  min-width: 0;
  border-left: 3px solid var(--accent);
  background: #fbfaf7;
  padding: 8px 10px;
}

.fact__label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.fact__value {
  display: block;
  margin: 2px 0 0;
  font-weight: 800;
  line-height: 1.35;
}

.shop-card__memo {
  margin: 16px 0 0;
  color: #3e3932;
}

.shop-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.shop-tag {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.shop-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.shop-card__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 10px;
  font-weight: 800;
  text-decoration: none;
}

.shop-card__link:hover,
.shop-card__link:focus-visible {
  border-color: currentColor;
  background: #f7fbfd;
}

.message {
  margin-top: 16px;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 700;
}

.message--error {
  border: 1px solid #deaaa0;
  background: #fff1ef;
  color: #842719;
}

.message--empty {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.noscript-message {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 32px;
  border: 1px solid #deaaa0;
  border-radius: 8px;
  background: #fff1ef;
  color: #842719;
  padding: 14px 16px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header__inner {
    display: grid;
    padding: 34px 0 28px;
  }

  .header-link {
    width: fit-content;
  }

  .controls__header {
    display: grid;
  }

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

  .button {
    width: 100%;
  }

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

  .shop-card__title-row {
    display: grid;
  }

  .genre-pill {
    max-width: 100%;
    width: fit-content;
  }
}

@media (max-width: 440px) {
  .site-header__inner,
  .controls__inner,
  .shop-section__inner,
  .noscript-message {
    width: min(100% - 24px, 1120px);
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .shop-card__body {
    padding: 16px;
  }
}
