/* css/clan.css — the Clan page and the shared clan pieces (owner, 4 October 2026, DECISIONS 559).
 * The calm look the owner asked for (docs/PLAN-CLANS.md, "Stijl van de schermen"): nothing heavier than 600, no
 * capitals in pills, soft tinted pills, hairline rows, and the clan colour (--clan) only as an accent.
 * .clan-tag and .clan-emblem are used outside the page too (trainer card, player lists): js/ui/clan-tag.js. */

/* ---- Shared: the tag pill and the emblem ---------------------------------------------------- */
.clan-tag {
  --clan: #a9b3c7;
  display: inline-flex; align-items: center; flex: none;
  height: 17px; padding: 0 6px; margin: 0 4px;
  border-radius: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; line-height: 1;
  color: color-mix(in srgb, var(--clan) 55%, #fff);
  background: color-mix(in srgb, var(--clan) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--clan) 30%, transparent);
  text-decoration: none; vertical-align: middle; white-space: nowrap;
}
a.clan-tag:hover { background: color-mix(in srgb, var(--clan) 22%, transparent); }

.clan-emblem {
  --clan: #a9b3c7;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle, color-mix(in srgb, var(--clan) 22%, transparent), color-mix(in srgb, var(--clan) 7%, transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--clan) 80%, transparent);
}
.clan-emblem img { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; }
.clan-emblem.sm { width: 22px; height: 22px; }
.clan-emblem.sm img { width: 24px; height: 24px; }
.clan-emblem.lg { width: 72px; height: 72px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--clan) 80%, transparent); }
.clan-emblem.lg img { width: 64px; height: 64px; }

/* ---- Pills ---------------------------------------------------------------------------------- */
.clan-pill {
  --c: #a9b3c7;
  display: inline-flex; align-items: center; height: 18px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 55%, #fff);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.clan-pill.join-open { --c: #4cc46a; }
.clan-pill.join-request { --c: #e8b93a; }
.clan-pill.join-invite { --c: #a9b3c7; }
.clan-pill.role-leader { --c: #e8b93a; }
.clan-pill.role-officer { --c: #8b9cf6; }

/* ---- Page ----------------------------------------------------------------------------------- */
[data-view="clan"] h3 { font-weight: 600; }
.clan-body { display: flex; flex-direction: column; gap: 14px; }
.clan-body .panel { padding: 16px 18px; border-radius: 14px; }
.clan-body .panel-title { display: flex; align-items: center; gap: 6px; font-weight: 500; text-transform: none; letter-spacing: 0.01em; }

.clan-head { display: flex; align-items: center; gap: 18px; }
.clan-head-text { flex: 1; min-width: 0; }
.clan-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.clan-motto { margin: 4px 0 0; color: var(--muted); font-style: italic; }
.clan-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.clan-facts > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.clan-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.clan-intro { display: flex; align-items: center; gap: 16px; }
.clan-intro h3 { margin: 0 0 4px; }
.clan-intro p { margin: 0; }

.clan-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.clan-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.clan-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* One row: a trainer or a clan, divided by hairlines. */
.clan-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid rgba(255, 255, 255, 0.05); min-width: 0; }
.panel-title + .clan-row, .clan-list > .clan-row:first-child, .clan-sub + .clan-row { border-top: 0; }
.clan-row.clickable { cursor: pointer; border-radius: 8px; padding-inline: 6px; }
.clan-row.clickable:hover { background: rgba(255, 255, 255, 0.035); }
.clan-row-text { min-width: 0; }
.clan-row-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 500; }
.clan-row-name .clan-tag { margin-left: 2px; }
.clan-row-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.clan-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.clan-sub { margin: 12px 0 2px; font-size: 12px; font-weight: 500; color: var(--muted); }

.clan-list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.clan-list-head .panel-title { margin: 0; }
.clan-search { margin-left: auto; max-width: 260px; }

.clan-invite { display: flex; gap: 8px; margin-bottom: 4px; }
.clan-invite .input { flex: 1; min-width: 0; }

.clan-log { list-style: none; margin: 0; padding: 0; }
.clan-log li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; }
.clan-log li:first-child { border-top: 0; }
.clan-log li .muted { flex: none; }

/* The clan level (DECISIONS 561): one calm line with a 6 px bar in the clan colour. */
.clan-level { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.clan-level-num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The track is visible on its own (an empty bar at the start of a level must still read as a bar); the fill glows a little. */
.clan-level-bar {
  flex: 1; max-width: 280px; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--clan) 35%, transparent);
}
.clan-level-bar i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--clan); box-shadow: 0 0 8px color-mix(in srgb, var(--clan) 60%, transparent); transition: width 0.4s ease; }
.clan-level .muted { font-variant-numeric: tabular-nums; white-space: nowrap; }
.clan-level-how { margin: 6px 0 0; max-width: 560px; }

/* ---- Create / settings form ----------------------------------------------------------------- */
.clan-preview .clan-head { pointer-events: none; }
.clan-form { display: flex; flex-direction: column; gap: 16px; }
.clan-form-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.clan-field { margin: 0; }
.clan-field > label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-weight: 500; }
.clan-field > label .muted { font-weight: 400; }
.clan-tag-input { text-transform: uppercase; letter-spacing: 0.08em; }

.clan-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.clan-swatch {
  width: 30px; height: 30px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--clan); border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.clan-swatch.on { border-color: #fff; }

.clan-emblems {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px;
  max-height: 196px; overflow-y: auto; margin-top: 8px; padding: 2px;
}
.clan-emblem-pick {
  display: grid; place-items: center; height: 44px; padding: 0; cursor: pointer; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
}
.clan-emblem-pick img { width: 40px; height: 40px; image-rendering: pixelated; }
.clan-emblem-pick:hover { background: rgba(255, 255, 255, 0.08); }
.clan-emblem-pick.on { border-color: var(--accent, #e53950); background: rgba(255, 255, 255, 0.09); }

.clan-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clan-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; text-align: left;
  cursor: pointer; border-radius: 10px; color: var(--text);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
}
.clan-mode-label { font-weight: 500; }
.clan-mode.on { border-color: var(--accent, #e53950); background: rgba(255, 255, 255, 0.08); }

.clan-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }

/* ---- Phone ---------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .clan-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .clan-body .panel { padding: 14px; }
  .clan-head { flex-wrap: wrap; gap: 12px; }
  .clan-emblem.lg { width: 56px; height: 56px; }
  .clan-emblem.lg img { width: 52px; height: 52px; }
  .clan-name { font-size: 1.15rem; }
  .clan-level { flex-wrap: wrap; }
  .clan-level-bar { max-width: none; min-width: 120px; }
  .clan-head-actions { flex-direction: row; align-items: center; width: 100%; }
  .clan-intro { flex-direction: column; align-items: stretch; }
  .clan-list-head { flex-wrap: wrap; }
  .clan-search { max-width: none; width: 100%; margin-left: 0; }
  .clan-form-two, .clan-modes { grid-template-columns: minmax(0, 1fr); }
  .clan-form-foot .clan-btns { width: 100%; }
  .clan-form-foot .clan-btns .btn { flex: 1; }
}

/* The clan line on the trainer card (js/ui/profile.js). */
.profile-clan { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.profile-clan:hover span[translate] { text-decoration: underline; }

/* The clan medals (DECISIONS 562): the Trainer Card's .medal cards from css/game.css, one per line, in the calm
   weights of this page; three small tier medals in the foot, the unearned ones greyed. */
.clan-medals { display: flex; flex-direction: column; gap: 8px; }
.clan-medals .medal-name { font-weight: 600; }
.clan-medal-tiers { display: inline-flex; gap: 3px; }
.clan-medal-tiers > span { display: inline-flex; filter: grayscale(1) brightness(0.7); opacity: 0.6; }
.clan-medal-tiers > span.on { filter: none; opacity: 1; }

/* ---- Your own clan: tiles, tabs, bank, shop, rights (docs/img/clans/01-07, DECISIONS 563) ---------------- */
.clan-overworld-btn { font-weight: 600; padding: 10px 16px; white-space: nowrap; }
.clan-overworld ul { margin: 6px 0 10px; padding-left: 18px; }
.clan-overworld li { margin: 3px 0; }

.clan-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0 !important; }
.clan-tile { padding: 14px 18px; border-left: 1px solid rgba(255, 255, 255, 0.06); min-width: 0; }
.clan-tile:first-child { border-left: 0; }
.clan-tile-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.clan-tile-value { margin: 4px 0 2px; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The tab bar (owner, 4 October: "members activity shop en settings moeten in mooiere stijl"): no longer bare
   underlined text on the green page, but a calm panel with pill tabs - the open one lifted, its icon in the accent. */
.clan-tabs {
  display: flex; gap: 4px; padding: 5px; overflow-x: auto; scrollbar-width: none;
  background: var(--panel); border: var(--panel-border); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); backdrop-filter: blur(6px);
}
.clan-tabs::-webkit-scrollbar { display: none; }
.clan-tab {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: max-content; padding: 9px 14px; border-radius: 10px; white-space: nowrap; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.clan-tab svg { opacity: 0.75; }
.clan-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.clan-tab.on {
  color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.clan-tab.on svg { opacity: 1; color: var(--accent-light, #f08c8c); }
.clan-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.clan-tab .badge-count { position: static; margin-left: 2px; }

.clan-bank-sum { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.clan-bank .clan-invite { margin-top: 8px; }

.clan-how { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; }
.clan-sub + .clan-how { border-top: 0; }
.clan-how-ico { display: inline-flex; color: var(--muted); }
.clan-plus { color: #8fe0a2; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }

.clan-shop-head { display: flex; align-items: center; gap: 16px; }
.clan-shop-head p { margin: 0; max-width: 340px; }
.clan-shop-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid rgba(255, 255, 255, 0.05); min-width: 0; }
.panel-title + .clan-shop-row { border-top: 0; }
.clan-shop-row.is-locked { opacity: 0.55; }
.clan-shop-pic { width: 32px; height: 32px; flex: none; object-fit: contain; image-rendering: pixelated; display: inline-grid; place-items: center; }
/* The member slot row (DECISIONS 579) has no sprite: a quiet users icon instead. */
.clan-upg-pic { color: var(--muted); }
.clan-shop-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.clan-shop-sub .type-badge { font-size: 10px; font-weight: 500; text-transform: capitalize; }
.clan-price { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clan-pill.clan-excl { --c: #f97316; }
.clan-buy .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

/* The clan frame from the clan shop: a ring in the clan colour around the avatar (clan page, Trainer Card). */
.avatar.clan-framed, .clan-frame-pic .avatar { box-shadow: 0 0 0 2px var(--clan, #f97316), 0 0 0 4px color-mix(in srgb, var(--clan, #f97316) 30%, transparent); }
.clan-body { --clan: #a9b3c7; }

.clan-rights { width: 100%; font-size: 13px; border-collapse: collapse; }
.clan-rights th { font-weight: 500; text-align: center; }
.clan-rights th:first-child, .clan-rights td:first-child { text-align: left; }
.clan-rights td.yes, .clan-rights td.no { text-align: center; }
.clan-rights td.yes { color: #8fe0a2; }
.clan-rights td.no { color: rgba(255, 255, 255, 0.25); }

@media (max-width: 760px) {
  .clan-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clan-tile:nth-child(3) { border-left: 0; }
  .clan-tile:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, 0.06); }
}
@media (max-width: 600px) {
  .clan-overworld-btn { flex: 1; justify-content: center; }
  .clan-tile { padding: 12px 14px; }
  .clan-tile-value { font-size: 1.1rem; }
  .clan-tab { padding: 8px 10px; font-size: 13px; gap: 5px; }
  .clan-shop-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .clan-shop-row { flex-wrap: wrap; }
  .clan-shop-row .clan-row-text { flex-basis: calc(100% - 50px); }
  .clan-shop-row .clan-price { margin-left: 44px; }
}
