/* Yapson AppStore — vitrine sombre, accent or (comme Yapson Arcade), pensée pour le téléphone. */
:root {
  --bg: #0b1020;
  --panel: #151d33;
  --panel-2: #1c2642;
  --line: #2a3657;
  --text: #edf3ff;
  --muted: #9fb0d1;
  --gold: #ffcf40;
  --gold-ink: #241a00;
  --teal: #52e4d0;
  --red: #ff6b78;
  --green: #4fd68f;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
img { max-width: 100%; }
.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ---------- En-tête ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand b { color: var(--gold); font-weight: 800; }
.top .spacer { flex: 1; }
.top .admin-link { color: var(--muted); font-size: 13px; text-decoration: none; }

/* ---------- Accueil ---------- */
.hero { padding-block: 26px 8px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 6vw, 34px); line-height: 1.15; text-wrap: balance; }
.hero p { margin: 0; color: var(--muted); max-width: 52ch; }
.search {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 13px 0;
  outline: none;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 14px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 12px; padding-block: 14px 40px; }
.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
}
.app-row:hover { border-color: #3c4b75; }
.app-row .meta { flex: 1; min-width: 0; }
.app-row h3 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-row .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.tag.apk { color: var(--green); }
.tag.web { color: var(--teal); }
.get {
  flex-shrink: 0;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
}
.icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
  color: var(--gold);
  box-shadow: 0 6px 18px #0007;
}
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }

/* ---------- Page d'une appli ---------- */
.app-head { display: flex; gap: 18px; align-items: center; padding-block: 24px 6px; }
.app-head .icon { width: 96px; height: 96px; border-radius: 22px; font-size: 38px; }
.app-head h1 { margin: 0; font-size: clamp(22px, 6vw, 30px); line-height: 1.15; }
.app-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.private-note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffcf401a;
  border: 1px solid #ffcf4055;
  color: var(--gold);
  font-size: 13px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
}
.btn.primary { background: var(--gold); color: var(--gold-ink); flex: 1 1 220px; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); flex: 1 1 200px; }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: #3a2433; color: #ffb8c2; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.btn small { font-weight: 600; opacity: .75; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts div { background: var(--panel); padding: 10px 12px; }
.facts span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.facts b { font-size: 15px; font-variant-numeric: tabular-nums; }

.shots { display: flex; gap: 10px; overflow-x: auto; padding-block: 18px 6px; scroll-snap-type: x mandatory; }
.shots img { height: 360px; max-width: none; border-radius: 14px; border: 1px solid var(--line); scroll-snap-align: start; }
section.block { margin-block: 22px; }
section.block h2 { font-size: 17px; margin: 0 0 8px; }
.desc { color: #d6deef; white-space: pre-line; max-width: 68ch; }
.notes { display: grid; gap: 10px; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.note .v { font-weight: 800; }
.note .d { color: var(--muted); font-size: 12px; margin-left: 6px; }
.note p { margin: 6px 0 0; white-space: pre-line; color: #d6deef; font-size: 14px; }
.steps { margin: 0; padding-left: 20px; color: #d6deef; }
.steps li { margin-bottom: 6px; }
.qr { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.qr img { width: 120px; height: 120px; background: #fff; border-radius: 10px; padding: 6px; flex-shrink: 0; }
.qr p { margin: 0; color: var(--muted); font-size: 14px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
footer { color: var(--muted); font-size: 12px; text-align: center; padding-block: 30px 40px; }

/* ---------- Admin ---------- */
.admin h1 { font-size: 24px; margin: 22px 0 4px; }
.admin .lead { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.form { display: grid; gap: 12px; }
.form .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input[type=file] { font-size: 14px; color: var(--muted); }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.flash { padding: 11px 14px; border-radius: 12px; margin: 14px 0; font-size: 14px; }
.flash.ok { background: #4fd68f1f; border: 1px solid #4fd68f66; color: var(--green); }
.flash.err { background: #ff6b781f; border: 1px solid #ff6b7866; color: var(--red); }

.admin-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row .icon { width: 52px; height: 52px; border-radius: 13px; font-size: 20px; }
.admin-row .name { font-weight: 800; text-decoration: none; }
.admin-row .small { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.pill.public { background: #4fd68f26; color: var(--green); }
.pill.lien { background: #ffcf4026; color: var(--gold); }
.pill.masquee { background: #9fb0d126; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.seg button.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; font-size: 13px; }
.copy .btn { flex: none; }
.vers { display: grid; gap: 8px; }
.ver { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ver .t { min-width: 0; }
.ver .t p { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: pre-line; }
.shot-edit { display: flex; gap: 8px; overflow-x: auto; }
.shot-edit figure { margin: 0; flex-shrink: 0; display: grid; gap: 6px; justify-items: center; }
.shot-edit img { height: 140px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.danger-zone { border-color: #ff6b7855; }
.login { max-width: 400px; margin: 40px auto; }

@media (max-width: 520px) {
  .shots img { height: 300px; }
  .app-head .icon { width: 80px; height: 80px; }
  .admin-row { grid-template-columns: 44px 1fr; }
  .admin-row .icon { width: 44px; height: 44px; }
  .admin-row .right { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .app-row, .btn { transition: border-color .15s, transform .1s; }
  .btn:active { transform: scale(.98); }
}
