/* plats.hosh.it — system fonts only, no external resources. */
:root {
  --hue: 200;
  --sat: 70%;
  --light: 52%;
  --accent: hsl(var(--hue), var(--sat), var(--light));
  --accent-2: hsl(calc(var(--hue) + 140), var(--sat), var(--light));
  --accent-ink: hsl(var(--hue), 80%, 26%);
  --bg: hsl(var(--hue), 60%, 97%);
  --bg-2: hsl(calc(var(--hue) + 60), 70%, 94%);
  --card: #ffffff;
  --ink: #1b1b24;
  --muted: #5b5b6b;
  --line: #d9d9e3;
  --focus: #1a5fff;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(var(--hue), 30%, 10%);
    --bg-2: hsl(calc(var(--hue) + 60), 35%, 14%);
    --card: #1d1d27;
    --ink: #f1f1f6;
    --muted: #b3b3c4;
    --line: #3a3a4a;
    --accent-ink: hsl(var(--hue), 90%, 78%);
    --focus: #8fb0ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  transition: background 0.8s ease;
}
a { color: var(--accent-ink); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
kbd {
  font: 0.75em ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: 0.75;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.muted { color: var(--muted); }

/* header / footer */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 16px; max-width: 1000px; margin: 0 auto;
}
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.brand span { color: var(--accent-ink); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.site-header nav a { text-decoration: none; color: var(--ink); padding: 4px 2px; border-bottom: 2px solid transparent; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { border-bottom-color: var(--accent); }
main { max-width: 1000px; margin: 0 auto; padding: 8px 16px 32px; }
main:focus { outline: none; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 16px; }

/* generic blocks */
.panel { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 6px 30px rgb(0 0 0 / 0.08); }
.panel.center { text-align: center; }
.panel.narrow { max-width: 420px; margin: 0 auto; }
.lead { font-size: 1.05rem; color: var(--muted); }
h1 { line-height: 1.15; letter-spacing: -0.02em; margin: 0.2em 0 0.4em; }
h2 { margin-top: 1.6em; }
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 700;
  background: var(--accent-ink); color: #fff; cursor: pointer; text-decoration: none;
}
@media (prefers-color-scheme: dark) { .btn { color: #111; } }
.btn-secondary { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent-ink); }
.btn-danger { background: #b3261e; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: progress; }
.alert { background: #fde8e7; color: #6b0f0a; border-left: 4px solid #b3261e; padding: 10px 14px; border-radius: 8px; }
.flash { background: #e5f6ea; color: #0f4d22; border-left: 4px solid #1e7d3a; padding: 10px 14px; border-radius: 8px; }
.chip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: var(--cat, #888); color: var(--cat-fg, #fff);
}

/* the game */
.meter-wrap { margin: 4px 0 12px; }
.meter { height: 14px; background: rgb(127 127 127 / 0.2); border-radius: 999px; overflow: hidden; }
.meter-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s cubic-bezier(.2,.9,.3,1.3);
}
.meter-label { margin: 6px 0 0; font-size: 0.95rem; }
.meter-label #count { font-weight: 800; font-size: 1.1rem; }
.badge { font-weight: 700; color: var(--accent-ink); }
.next-stop { color: var(--muted); }
.result { min-height: 1.5em; margin-bottom: 10px; }
.result .same { margin: 0 0 6px; font-size: 1.05rem; }
.result .same strong { font-size: 1.3rem; color: var(--accent-ink); }
.result .more { font-size: 0.9rem; }
.mini-dist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.mini-dist li { position: relative; background: rgb(127 127 127 / 0.12); border-radius: 6px; overflow: hidden; font-size: 0.9rem; }
.mini-dist li .bar { position: absolute; inset: 0 auto 0 0; background: var(--cat); opacity: 0.45; }
.mini-dist li span:last-child { position: relative; padding: 2px 8px; display: block; }
.mini-dist li.mine { font-weight: 700; }

.dish-card { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.1); }
.dish-card.enter { animation: enter 0.35s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.prompt { margin: 0; color: var(--muted); font-size: 0.95rem; }
.dish-card h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); margin: 0.1em 0 0.25em; }
.dish-desc { margin: 0 0 6px; }
.dish-region { margin: 0 0 6px; color: var(--muted); font-style: italic; }
.dish-img { margin: 0 0 10px; }
.dish-img img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; height: auto; background: var(--bg-2); }
.dish-img figcaption { font-size: 0.75rem; color: var(--muted); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 14px 0 10px; }
.cat {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border: 0; border-radius: 14px;
  background: var(--cat); color: var(--cat-fg); font: inherit; font-weight: 700; cursor: pointer; text-align: left;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.25); transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.2s;
}
.cat .label { flex: 1; }
.cat:hover { filter: brightness(1.07); }
.cat:active, .cat.pressed { transform: translateY(2px); box-shadow: 0 1px 0 rgb(0 0 0 / 0.25); }
.cat:disabled { cursor: wait; filter: saturate(0.6); }
.cat:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip {
  width: 100%; padding: 10px; border-radius: 12px; border: 2px dashed var(--line); background: transparent;
  color: var(--ink); font: inherit; cursor: pointer;
}
.skip:hover { border-color: var(--muted); }
.hint { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }
@media (hover: none) { .hint, .cat kbd, .skip kbd { display: none; } }
.end { background: var(--card); border-radius: 20px; padding: 24px; text-align: center; }

.fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }
.milestone {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 21; pointer-events: none;
  text-align: center; padding: 18px 28px; border-radius: 24px; background: rgb(255 255 255 / 0.92); color: #111;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); animation: pop 0.5s cubic-bezier(.2,1.6,.4,1);
  max-width: calc(100vw - 32px);
}
.milestone-title { margin: 0; font-weight: 900; font-size: 1.8rem; letter-spacing: -0.02em; }
.milestone-sub { margin: 4px 0 0; }
.milestone-super .milestone-title, .milestone-genial .milestone-title {
  font-size: clamp(2.4rem, 12vw, 4.5rem);
  background: linear-gradient(90deg, hsl(var(--hue),90%,45%), hsl(calc(var(--hue) + 120),90%,45%), hsl(calc(var(--hue) + 240),90%,45%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.palette-or { background: linear-gradient(135deg, #fff6d5, #ffe08a); }
.palette-holographique, .palette-cosmique { background: linear-gradient(135deg, #e0f7ff, #f7e0ff, #fff6d5); }
.palette-cosmique { background: radial-gradient(circle at 30% 30%, #2b1055, #0b0b2a); color: #fff; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
body.pulse { animation: pulse 0.6s ease; }
body.pulse-big { animation: pulse 1.4s ease; }
@keyframes pulse { 0% { filter: none; } 30% { filter: saturate(1.8) brightness(1.08); } 100% { filter: none; } }

/* forms */
.field { margin: 14px 0; }
label { font-weight: 600; display: block; }
.req, .opt { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input[type="text"], input[type="search"], input[type="password"], input:not([type]), textarea, select, input[type="number"], input[type="date"] {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); margin-top: 4px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-ink); outline: none; }
.counter { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }
.similar, .similar-live:not(:empty) { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.similar ul, .similar-live ul { margin: 6px 0; padding-left: 18px; }
.similar li { margin-bottom: 10px; }
.similar-title, .similar h2 { margin: 0; font-weight: 800; font-size: 1.05rem; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* lists, distribution */
.search { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
@media (min-width: 640px) { .search { grid-template-columns: 1fr 220px auto; align-items: end; } }
.dish-list { list-style: none; padding: 0; margin: 0; }
.dish-list li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dish-list a { font-weight: 600; }
.dish-list .meta { color: var(--muted); font-size: 0.9rem; }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 16px; }
.dist, .coverage { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dist li, .coverage li { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 560px) { .dist li, .coverage li { grid-template-columns: 170px 1fr 140px; align-items: center; gap: 10px; } }
.dist-track { height: 18px; background: rgb(127 127 127 / 0.15); border-radius: 999px; overflow: hidden; }
.dist-track .bar { display: block; height: 100%; width: 0; background: var(--cat); border-radius: 999px; transition: width 0.6s ease; }
.bar-accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)) !important; }
.dist-num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.dist li.mine .dist-label { font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.tile-num { font-size: 1.8rem; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.two-cols { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
@media (min-width: 720px) { .two-cols { grid-template-columns: 1fr 1fr; } }
.rank li { margin-bottom: 6px; }
.per-day { list-style: none; padding: 0; margin: 0; display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.per-day li { flex: 1; max-width: 28px; height: 100%; display: flex; align-items: flex-end; }
.per-day .bar { display: block; width: 100%; height: 0; min-height: 2px; border-radius: 3px 3px 0 0; }
.prose { max-width: 720px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.pulse, body.pulse-big { animation: none !important; background: linear-gradient(160deg, var(--accent-2), var(--bg)); }
  .milestone { animation: none; }
}
