@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #060e16;
  --panel: #0d2330;
  --line: #254957;
  --muted: #9ab9c4;
  --accent: #27dcb5;
}
* {
  box-sizing: border-box;
}
body {
  /* Comme une appli : pas de sélection de texte ni de menu d'appui long
     (copier, chercher, traduire…), sauf dans les champs de saisie. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  background: var(--bg);
  color: #f7f8ff;
  font:
    16px "DM Sans",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #42e8cd;
  outline-offset: 4px;
}
button {
  border: 0;
  background: transparent;
}
.brand {
  font-size: 28px;
  color: #28dabb;
  font-weight: 700;
}
.brand span {
  color: white;
}
.app {
  max-width: 1220px;
  margin-inline: auto;
  padding: 40px 56px calc(var(--dock-top) + 24px);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
header small {
  color: #8c97bb;
  font-size: 10px;
  letter-spacing: 2px;
}
h1 {
  font-size: 34px;
  margin: 8px 0;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.6px;
}
h3 {
  margin: 0 0 8px;
}
.icon {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 22px;
}
.banner {
  background: linear-gradient(115deg, #148bff, #12c9d2 60%, #36ed99);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.banner h3 {
  font-size: 19px;
}
.banner p {
  font-size: 13px;
  opacity: 0.85;
  margin: 5px 0;
}
.pill {
  background: #fff;
  color: #343b83;
  border-radius: 30px;
  padding: 11px 18px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.search {
  position: relative;
  margin: 20px 0;
}
.search input,
input,
select {
  width: 100%;
  background: #0b1022;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: white;
  padding: 17px 18px;
  outline-offset: 3px;
}
.search input {
  padding-left: 46px;
}
.search:before {
  content: "⌕";
  position: absolute;
  left: 17px;
  top: 6px;
  font-size: 32px;
  color: #aeb9d9;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 35px;
}
.tile {
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 174px;
  background: linear-gradient(120deg, #1c2440, #0a1028);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 19px;
}
.tile strong {
  font-size: 17px;
}
.tile small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 11px;
}
.tile .art {
  order: -1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1px solid #29d9bd40;
  border-radius: 12px;
  background: linear-gradient(135deg, #168dff22, #39ed9822);
  font-size: 28px;
  line-height: 1;
  color: #6af1d0;
}
.tile:focus-visible {
  outline: 2px solid #6af1d0;
  outline-offset: 4px;
}

.sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tag {
  font-size: 12px;
  border: 1px solid #555d7c;
  border-radius: 30px;
  padding: 9px 13px;
  color: #ced4e8;
}
.group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, #171d34, #070d25);
  margin: 14px 0;
  overflow: hidden;
}
summary {
  cursor: pointer;
  list-style: none;
  padding: 21px;
  font-size: 20px;
  font-weight: 600;
}
summary:after {
  content: "⌄";
  float: right;
  color: #a1abc8;
}
.series {
  padding: 0 21px 8px;
}
.set {
  display: block;
  text-align: left;
  width: 100%;
  padding: 14px 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.code {
  background: #27dcb51a;
  color: #a6f5e2;
  border: 1px solid #29d9bd66;
  border-radius: 9px;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.setname {
  flex: 1;
  font-size: 17px;
}
.count {
  font-size: 13px;
  color: #ccd2e4;
  white-space: nowrap;
}
.count b {
  color: white;
}
.bar {
  height: 4px;
  background: #ffffff14;
  border-radius: 4px;
  margin-top: 11px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #148bff, #36ed99);
  border-radius: 12px;
}
.grid .series {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.grid .set {
  background: #18213a;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.grid .row {
  flex-wrap: wrap;
}
.grid .setname {
  min-width: 100%;
}
.empty {
  padding: clamp(26px, 5vw, 48px) 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.7;
}
.empty strong {
  color: white;
  font-size: 20px;
  display: block;
}
.primary {
  background: #13b8c7;
  border-radius: 12px;
  padding: 13px 19px;
  font-weight: 600;
}
.collectionitem {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(115deg, #1a223b, #080e26);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin: 15px 0;
  width: 100%;
  text-align: left;
}
.collectionitem > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.collectionitem .symbol {
  font-size: 35px;
}
.collectionitem small {
  color: var(--muted);
}
.collectionitem .arrow {
  margin-left: auto;
  font-size: 26px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 20px 0;
}
footer {
  border-top: 1px solid #242b41;
  padding: 28px 0;
  margin-top: 40px;
  font-size: 11px;
  color: #7f8bae;
  letter-spacing: 1px;
}
footer span {
  float: right;
  letter-spacing: 0;
}
dialog {
  width: min(500px, 92vw);
  background: #11182c;
  color: white;
  border: 1px solid #505c81;
  border-radius: 22px;
  padding: 28px;
}
dialog::backdrop {
  background: #020411b8;
  backdrop-filter: blur(6px);
}
.close {
  float: right;
  font-size: 28px;
}
dialog h2 {
  margin-top: 12px;
}
label {
  display: block;
  margin: 17px 0 8px;
  font-size: 13px;
  color: #c0c8e1;
}
dialog .primary {
  margin-top: 20px;
  width: 100%;
}
/* Notifications : pastille discrète et translucide, qui glisse puis s'efface. */
#toast {
  position: fixed;
  bottom: calc(var(--dock-top) + 12px);
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: min(440px, calc(100% - 32px));
  padding: 8px 15px 8px 9px;
  border: 1px solid #ffffff1a;
  border-radius: 999px;
  background: #0d2330d9;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 24px #00000059;
  color: #e9f6f4;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px) scale(0.97);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    visibility 0s linear 0.28s;
}
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    visibility 0s;
}
.toast-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #27dcb526;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
#toast[data-kind="warning"] .toast-icon {
  background: #ffb74d26;
  color: #ffc46b;
}
@media (prefers-reduced-motion: reduce) {
  #toast,
  #toast.show {
    transform: translate(-50%, 0);
    transition: opacity 0.2s;
  }
}
.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  padding: 25px 14px;
  background: #18203a;
  border-radius: 15px;
}
.stat b {
  display: block;
  font-size: 30px;
}
.stat small {
  color: #b5bdd6;
}
.cardrow {
  padding: 15px;
  background: #1b2540;
  border-radius: 12px;
  margin: 12px 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.cardrow div {
  flex: 1;
}
.cardrow small {
  color: #b0bbd9;
}
.remove {
  font-size: 22px;
}
@media (max-width: 1000px) {
  .app {
    padding-inline: 30px;
  }
  .grid .series {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .app {
    padding: 22px 17px calc(var(--dock-top) + 16px);
  }
  header small {
    font-size: 9px;
  }
  h1 {
    font-size: 29px;
  }
  header {
    margin-bottom: 20px;
  }
  .banner {
    padding: 19px;
    align-items: flex-start;
  }
  .banner .pill {
    font-size: 11px;
    padding: 10px;
  }
  .banner h3 {
    font-size: 16px;
  }
  .banner p {
    font-size: 11px;
  }
  .tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 108px;
    padding: 12px 5px;
    border-radius: 14px;
    text-align: center;
  }
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 24px;
  }
  .tile strong {
    font-size: clamp(11px, 3vw, 14px);
    line-height: 1.3;
  }
  .tile small {
    display: none;
  }
  .tile .art {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
    border-radius: 10px;
    font-size: 24px;
  }
  .setname {
    font-size: 16px;
  }
  .count {
    font-size: 11px;
  }
  .series {
    padding: 0 16px 6px;
  }
  summary {
    padding: 19px 16px;
  }
  .tag {
    font-size: 10px;
    padding: 8px;
  }
  .grid .series {
    gap: 8px;
  }
  .grid .set {
    padding: 10px;
  }
  .grid .setname {
    font-size: 14px;
  }
  footer span {
    display: none;
  }
}

/* Hors ligne (dist/js/core/offline.js). */
.offline-badge {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 50%;
  z-index: 40;
  padding: 6px 14px;
  border: 1px solid #ffc46b66;
  border-radius: 999px;
  background: #2a2010e6;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffd99a;
  font-size: 12px;
  font-weight: 700;
  transform: translateX(-50%);
  white-space: nowrap;
}
