/* How an update looks, everywhere it is shown: the game's What's New (screens/changelog.ts), the update
   editor's preview and the elyvar.net landing page (Landing/build.mts copies this file). Markup: updateHtml
   in updateFormat.ts. Each section kind has its own accent colour. */

.changelog-entry {
  --u-gold: #e3b955;
  --u-text: #e2d8c3;
  --u-muted: #9a8f7b;
  margin: 0;
  border: 1px solid rgb(212 171 85 / 0.35);
  background: linear-gradient(rgb(20 18 22 / 0.88), rgb(10 9 12 / 0.92));
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
  overflow: hidden;
  text-align: left;
}

.changelog-entry + .changelog-entry {
  margin-top: 14px;
}

/* ---- Banner: the update's name and date ---------------------------------- */

.update-banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 14px 40px 12px 18px;
  list-style: none;
  cursor: pointer;
  background:
    linear-gradient(100deg, #2a1f10, #16120c 55%, #1d1710);
  border-bottom: 1px solid rgb(212 171 85 / 0.45);
}

.update-banner::-webkit-details-marker {
  display: none;
}

/* The fold arrow on the right. */
.update-banner::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--u-gold);
  border-bottom: 2px solid var(--u-gold);
  opacity: 0.8;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.changelog-entry:not([open]) .update-banner {
  border-bottom-color: transparent;
}

.changelog-entry:not([open]) .update-banner::after {
  transform: translateY(-40%) rotate(-45deg);
}

.update-name {
  font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
  background: linear-gradient(90deg, #f6e3b0, #e3b955 30%, #fff4cf 50%, #e3b955 70%, #f6e3b0);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The newest update's name has a slow gold shimmer running through it. */
.changelog-entry--latest .update-name {
  animation: update-shimmer 6s linear infinite;
}

@keyframes update-shimmer {
  to {
    background-position: -200% 0;
  }
}

.update-date {
  padding: 2px 10px;
  border: 1px solid rgb(212 171 85 / 0.4);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--u-muted);
}

.update-banner:hover .update-date {
  color: var(--u-gold);
}

/* ---- Sections: Additions, Changes, Fixes, Screenshots -------------------- */

.update-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.update-body > p {
  margin: 0;
  color: var(--u-muted);
  font-family: 'Crimson Text', Georgia, serif;
}

.update-section {
  --accent: #c8b07a;
  --accent-rgb: 200 176 122;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.13), rgb(var(--accent-rgb) / 0.03) 60%, transparent);
}

.update-section--additions {
  --accent: #6fcf7f;
  --accent-rgb: 111 207 127;
}

.update-section--changes {
  --accent: #e3b955;
  --accent-rgb: 227 185 85;
}

.update-section--fixes {
  --accent: #6fb2ec;
  --accent-rgb: 111 178 236;
}

.update-section--screenshots {
  --accent: #c595ea;
  --accent-rgb: 197 149 234;
}

.update-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  padding: 3px 12px 3px 9px;
  border: 1px solid rgb(var(--accent-rgb) / 0.55);
  background: rgb(var(--accent-rgb) / 0.14);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.update-heading::before {
  content: '◆';
  font-size: 0.6rem;
}

.update-section--additions .update-heading::before {
  content: '+';
  font-size: 0.95rem;
}

.update-section--fixes .update-heading::before {
  content: '✓';
  font-size: 0.8rem;
}

.update-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.98rem;
  color: var(--u-text);
}

.update-section li {
  position: relative;
  padding-left: 17px;
}

.update-section li + li {
  margin-top: 3px;
}

/* A small diamond in the section's colour instead of a plain bullet. */
.update-section li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* "[28 -> 21]" in an item: the old value struck through, the new one bright. */
.update-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 2px;
  padding: 0 7px;
  border: 1px solid rgb(var(--accent-rgb) / 0.45);
  background: rgb(0 0 0 / 0.4);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
  color: var(--accent);
}

.update-from {
  color: var(--u-muted);
  font-weight: 400;
  text-decoration: line-through;
}

.update-to {
  color: #fff4cf;
}

/* A spell's tag in an item: its name on a tinted box; hovering shows .update-tip (placed by updateTips.ts). */
.update-spell {
  display: inline-block;
  margin: 0 1px;
  padding: 0 6px;
  border: 1px solid rgb(var(--accent-rgb) / 0.5);
  background: rgb(var(--accent-rgb) / 0.16);
  font-weight: 600;
  line-height: 1.35;
  color: #f3e6c4;
  cursor: help;
}

.update-spell:hover,
.update-spell:focus-visible {
  background: rgb(var(--accent-rgb) / 0.3);
  outline: none;
}

.update-tip {
  display: none;
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid rgb(212 171 85 / 0.6);
  background: linear-gradient(rgb(28 25 30 / 0.98), rgb(14 13 17 / 0.98));
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.6);
  font-family: 'Crimson Text', Georgia, serif;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  color: var(--u-text);
  pointer-events: none;
}

.update-tip.is-shown,
.update-tip > span {
  display: block;
}

.update-tip .update-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #f6e3b0;
}

/* The game's spell tags (spellTags in Shared); damage types in their own colour, like the spellbook. */
.update-tip .update-tip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.update-tip-tag {
  padding: 0 6px;
  border: 1px solid rgb(212 171 85 / 0.35);
  background: rgb(0 0 0 / 0.35);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--tag-color, var(--u-text));
}

.update-tip-changes {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgb(212 171 85 / 0.25);
}

.update-tip .update-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-tip-row + .update-tip-row {
  margin-top: 3px;
}

/* A spell's rank in its tooltip, on a tinted box in the rank's colour (the spellbook's, windows.css .book-rank--N). */
.update-rank {
  --rank-rgb: 154 143 123;
  display: inline-block;
  margin: 0 2px;
  padding: 0 7px;
  border: 1px solid rgb(var(--rank-rgb) / 0.55);
  background: rgb(var(--rank-rgb) / 0.14);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
  vertical-align: 1px;
  color: rgb(var(--rank-rgb));
}

.update-rank--2 {
  --rank-rgb: 156 198 106;
}

.update-rank--3 {
  --rank-rgb: 111 168 220;
}

.update-rank--4 {
  --rank-rgb: 180 138 224;
}

.update-rank--5 {
  --rank-rgb: 232 176 74;
}

/* ---- Screenshots: framed thumbnails that open full size ------------------ */

.update-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.update-shots figure {
  margin: 0;
}

.update-shots a {
  display: block;
  overflow: hidden;
  border: 1px solid rgb(var(--accent-rgb) / 0.5);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.update-shots a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.update-shots img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.update-shots figcaption {
  margin-top: 4px;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.85rem;
  text-align: center;
  color: var(--u-muted);
}

@media (prefers-reduced-motion: reduce) {
  .changelog-entry--latest .update-name {
    animation: none;
  }
  .update-shots a {
    transition: none;
  }
}
