:root {
  --gold: #c9a35a;
  --gold-soft: #d9b878;
  --gold-deep: #a07f3c;
  --bg: #0c0a07;
  --bg-2: #14110c;
  --card: #19150e;
  --card-2: #211b12;
  --line: #332a1b;
  --text: #f4ecdc;
  --muted: #b3a890;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --maxw: 920px;
}

[data-theme="light"] {
  --gold: #a07f3c;
  --gold-soft: #b8923f;
  --gold-deep: #8a6b2d;
  --bg: #f6f1e7;
  --bg-2: #efe7d6;
  --card: #ffffff;
  --card-2: #f4eddd;
  --line: #e0d4bb;
  --text: #211b12;
  --muted: #6f6450;
  --shadow: 0 8px 24px rgba(120, 95, 40, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}

body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-image:
    radial-gradient(1200px 400px at 100% -10%, rgba(201, 163, 90, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(201, 163, 90, 0.06), transparent 60%);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: #111;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  z-index: 50;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.hidden { display: none !important; }

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(201, 163, 90, 0.45);
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.brand-text h1 .ch {
  color: var(--gold);
  font-weight: 800;
}
.tagline {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.header-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  background: var(--card);
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.icon-btn.small { width: 38px; height: 38px; font-size: 0.95rem; }
.icon-btn:hover { border-color: var(--gold); }
.icon-btn:active { transform: scale(0.94); }

/* Disclaimer */
.disclaimer {
  max-width: var(--maxw);
  margin: 4px auto 0;
  padding: 12px 16px;
  margin-left: auto; margin-right: auto;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  width: calc(100% - 32px);
}
.disclaimer strong { color: var(--gold-soft); }

/* Controls */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 16px 24px;
}
.controls {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
#searchInput {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
}
#searchInput::placeholder { color: var(--muted); }
#searchInput:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 163, 90, 0.25); }

.select-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.field select {
  appearance: none;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  cursor: pointer;
  width: 100%;
}
.field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 163, 90, 0.25); }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #1a1408;
  border-color: var(--gold);
  font-weight: 700;
}
.chip.ghost { color: var(--muted); }
.result-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

/* List */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  position: relative;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.card:hover { border-color: var(--gold-deep); }
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  color: var(--gold-soft);
  cursor: pointer;
}
.card h3:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.card .place {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.fav-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 2px 4px;
  transition: transform 0.12s ease, color 0.12s ease;
}
.fav-btn.is-fav { color: var(--gold); text-shadow: 0 0 10px rgba(201, 163, 90, 0.5); }
.fav-btn:active { transform: scale(0.85); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.tag {
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(201, 163, 90, 0.12);
  border: 1px solid var(--line);
  color: var(--gold-soft);
}
.tag.cat { background: rgba(201, 163, 90, 0.18); }

.card .brands {
  font-size: 0.82rem;
  color: var(--text);
  margin: 0 0 6px;
}
.card .brands b { color: var(--muted); font-weight: 600; }
.card .hours {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.link-btn {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--gold-soft);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.12s ease;
}
.link-btn:hover { border-color: var(--gold); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 0.95rem;
}

/* Footer */
.app-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  border-top: 1px solid var(--line);
}
.app-footer p { margin: 2px 0; }
.app-footer .copy { color: var(--gold-deep); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--gold-deep);
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 22px 20px 20px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 {
  margin: 0 38px 4px 0;
  color: var(--gold-soft);
  font-size: 1.3rem;
}
.modal .m-place { color: var(--muted); font-size: 0.9rem; margin: 0 0 14px; }
.modal .m-section { margin: 14px 0; }
.modal .m-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 4px;
}
.modal .m-val { margin: 0; font-size: 0.92rem; }
.modal .m-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: #1a1408;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 560px) {
  .select-row { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 1.1rem; }
  .result-count { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
