/* Combat pip size + family/trait chip colors. Loaded after elemon.css. */

.face .chip[data-kind],
.face .bar .tip,
.face .pip,
.face .bio {
  touch-action: manipulation;
}

.face .pip {
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: max(11px, 2.6cqi);
  width: 4.4em;
  min-width: 4.4em;
  height: 4.4em;
  min-height: 4.4em;
  padding: 0 0.12em;
  border-radius: 50%;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* Invisible extra tap pad; visual badge stays the round pip. */
.face .pip::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

@media (max-width: 1023px) {
  .face {
    padding-top: 3.2%;
    padding-right: 8%;
  }
  .face .meta {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 0.1em 0 0 0;
    gap: 0.2em;
    align-items: center;
  }
  .face .chem-name {
    font-size: 1.42em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .face .chem-name.long { font-size: 1.12em; }
  .face .pip {
    font-size: 8px;
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
  }
  .face .pip::before {
    inset: -12px;
  }
  .face .type-line {
    max-width: 58%;
    justify-content: flex-end;
  }
  .face .chip[data-kind] {
    white-space: normal;
    text-align: right;
    font-size: 0.92em;
  }
}

.face .type-line {
  row-gap: 0.12em;
}

.face .chip[data-kind] {
  --chip: #3a2f20;
  --chip-glow: #fff1b0;
  --chip-spark: #fff8d8;
  position: relative;
  isolation: isolate;
  z-index: 0;
  max-width: 100%;
  padding: 0.06em 0.22em;
  border-radius: 0.4em;
  color: var(--chip);
  white-space: nowrap;
  line-height: 1.2;
  background-color: color-mix(in srgb, var(--chip) 11%, #fff8e8);
  background-image: url("../img/glitter.png");
  background-repeat: no-repeat;
  background-size: 280% 280%;
  background-position: 38% 42%;
  background-blend-mode: soft-light;
  text-shadow:
    0 0 2px color-mix(in srgb, var(--chip-spark) 90%, #fff),
    0 0 5px var(--chip-glow),
    0 0 9px color-mix(in srgb, var(--chip-glow) 70%, transparent),
    0 0 14px color-mix(in srgb, var(--chip-glow) 40%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--chip-glow) 26%, transparent),
    0 0 6px color-mix(in srgb, var(--chip-glow) 32%, transparent);
}

.face .chip[data-kind]::after {
  content: "";
  position: absolute;
  inset: -0.12em -0.18em;
  border-radius: inherit;
  background: url("../img/glitter.png") 32% 40% / 170% 170% no-repeat;
  opacity: 0.26;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

@container (max-width: 280px) {
  .face .chip[data-kind] {
    white-space: normal;
    text-align: right;
  }
}

/* Families — distinct from combat Salt/Soft/Life/Hard */
.face .chip[data-kind="family"][data-label="alkali"] {
  --chip: #c2187a;
  --chip-glow: #ff5ec8;
  --chip-spark: #ffd0ee;
}
.face .chip[data-kind="family"][data-label="alkaline-earth"] {
  --chip: #1a8a3e;
  --chip-glow: #7dffb0;
  --chip-spark: #d8ffe8;
}
.face .chip[data-kind="family"][data-label="transition"] {
  --chip: #1f5f9a;
  --chip-glow: #7eb8ff;
  --chip-spark: #d6eaff;
}
.face .chip[data-kind="family"][data-label="post-transition"] {
  --chip: #6a5a8a;
  --chip-glow: #c9b8ee;
  --chip-spark: #efe6ff;
}
.face .chip[data-kind="family"][data-label="metalloid"] {
  --chip: #0b6f68;
  --chip-glow: #e0c15a;
  --chip-spark: #fff1b0;
}
.face .chip[data-kind="family"][data-label="nonmetal"] {
  --chip: #0e7394;
  --chip-glow: #7ee7ff;
  --chip-spark: #d8f8ff;
}
.face .chip[data-kind="family"][data-label="halogen"] {
  --chip: #5a6c00;
  --chip-glow: #e8ff4d;
  --chip-spark: #f7ffb8;
}
.face .chip[data-kind="family"][data-label="noble"] {
  --chip: #5a4f96;
  --chip-glow: #d9d0ff;
  --chip-spark: #f3efff;
}
.face .chip[data-kind="family"][data-label="lanthanide"] {
  --chip: #9a2d92;
  --chip-glow: #f08ae8;
  --chip-spark: #ffd6fb;
}
.face .chip[data-kind="family"][data-label="actinide"] {
  --chip: #8a6200;
  --chip-glow: #c8e85a;
  --chip-spark: #fff4b0;
}

/* Traits */
.face .chip[data-kind="trait"][data-label="light-gas"] {
  --chip: #147a7a;
  --chip-glow: #9ff5ef;
  --chip-spark: #e4fffc;
}
.face .chip[data-kind="trait"][data-label="heavy-gas"] {
  --chip: #32267a;
  --chip-glow: #8a7dff;
  --chip-spark: #ddd8ff;
}
.face .chip[data-kind="trait"][data-label="liquid"] {
  --chip: #3d5a6e;
  --chip-glow: #c5e0ee;
  --chip-spark: #eef6fa;
}
.face .chip[data-kind="trait"][data-label="heavy-metal"] {
  --chip: #8a4e10;
  --chip-glow: #e8b060;
  --chip-spark: #ffe3b8;
}
.face .chip[data-kind="trait"][data-label="radioactive"] {
  --chip: #a85c00;
  --chip-glow: #ffcc4a;
  --chip-spark: #8fe86a;
  text-shadow:
    0 0 2px #fff4c2,
    0 0 5px #ffcc4a,
    0 0 9px #8fe86a,
    0 0 13px color-mix(in srgb, #ffcc4a 50%, transparent);
}
.face .chip[data-kind="trait"][data-label="synthetic"] {
  --chip: #5a28a8;
  --chip-glow: #c9a0ff;
  --chip-spark: #eee0ff;
}
.face .chip[data-kind="trait"][data-label="superheavy"] {
  --chip: #3d1868;
  --chip-glow: #b07cff;
  --chip-spark: #e4d0ff;
}
