/* v082: summon and Summer shop history in the "ของที่ได้รับ" tab. Built on the match history card look. */
.history-totals { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.history-total { display: grid; gap: 1px; min-width: 120px; padding: 8px 12px; border: 1px solid #343750; border-radius: 11px; background: rgb(14 17 33 / 72%); }
.history-total small { color: #9299b0; font-size: 12px; }
.history-total strong { color: #f0edff; font-size: 17px; font-variant-numeric: tabular-nums; }

.history-roll-mode { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: rgb(138 124 186 / 18%); color: #cfc4ff; font-size: 12px; font-weight: 700; }
.history-roll-mode.is-marco { background: rgb(255 150 90 / 16%); color: #ffbe8f; }
.history-roll-card { border-left-color: #8a7cba; }
.history-roll-card.has-marco { border-left-color: #ff9a5c; }
.history-roll-sub { margin: 4px 0 8px; color: #a7abc6; font-size: 12px; }
.history-roll-sub strong { color: #f0edff; font-variant-numeric: tabular-nums; }

.history-drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.history-drop { --rarity: #6f7392; position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 4px 5px; border: 1px solid color-mix(in srgb, var(--rarity) 45%, transparent); border-radius: 9px; background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 14%, transparent), rgb(14 17 33 / 80%)); text-align: center; }
.history-drop[data-rarity="Rare"] { --rarity: #6cb6ff; }
.history-drop[data-rarity="Epic"] { --rarity: #b98cff; }
.history-drop[data-rarity="Legendary"] { --rarity: #ffc75a; }
.history-drop[data-rarity="Mythic"] { --rarity: #ff6b8a; }
.history-drop[data-rarity="Secret"], .history-drop.is-unit { --rarity: #6df0c2; }
.history-drop-art { position: relative; width: 44px; aspect-ratio: 1; display: grid; place-items: center; color: #6f7392; }
.history-drop-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.history-drop-name { width: 100%; overflow: hidden; color: #e6e3f7; font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.history-drop-qty { color: var(--rarity); font-size: 11px; font-weight: 700; }
.history-drop.is-deleted { opacity: .5; }
.history-drop.is-deleted .history-drop-name { text-decoration: line-through; }
.history-drop-flag { position: absolute; top: 3px; right: 3px; padding: 0 5px; border-radius: 6px; background: rgb(255 130 147 / 22%); color: #ff9dab; font-size: 10px; font-weight: 700; }
.history-drop.is-unit .history-drop-flag { background: rgb(109 240 194 / 20%); color: #8ff5d3; }

.history-shop-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.history-shop-row .history-drop-art { width: 44px; }
.history-shop-name { margin: 0; color: #f0edff; font-size: 14px; }
.history-shop-name span { color: #ffc75a; }
.history-shop-cost { color: #a7abc6; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.history-more { justify-self: center; min-height: 40px; margin-top: 4px; padding: 0 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-raised); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.history-more:hover { border-color: var(--line-bright); }
.history-more:focus-visible, .items-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 560px) {
  .history-drops { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
  .history-total { min-width: 0; flex: 1 1 40%; }
}

/* v087: Summer shop history. Item tiles copy the merchant's cards: rarity frame, game icon, quantity badge. */
.shop-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.shop-stat { display: grid; gap: 3px; min-width: 150px; padding: 10px 14px; border: 1px solid #343750; border-radius: 12px; background: rgb(14 17 33 / 72%); }
.shop-stat small { color: #9299b0; font-size: 12px; }
.shop-stat strong, .shop-stat-value { color: #f0edff; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.shop-stat-value, .shop-price { display: inline-flex; align-items: center; gap: 6px; }
.shop-coin { width: 20px; height: 20px; object-fit: contain; flex: none; }

.shop-ledger { display: grid; gap: 8px; }
.shop-day { margin: 6px 2px 0; color: #9299b0; font-size: 13px; font-weight: 700; }
.shop-day:first-child { margin-top: 0; }
.shop-receipt { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 14px 9px 9px; border: 1px solid #2f3350; border-radius: 14px; background: linear-gradient(100deg, rgb(28 31 52 / 92%), rgb(17 20 35 / 92%)); }

.shop-tile { --edge: #8a7cba; --glow: rgb(138 124 186 / 35%); position: relative; display: grid; place-items: center; width: 64px; aspect-ratio: 1; border-radius: 12px; background: radial-gradient(circle at 50% 38%, var(--glow), transparent 70%), linear-gradient(160deg, #24203d, #121428); box-shadow: inset 0 0 0 2px var(--edge), 0 0 14px -4px var(--edge); }
.shop-tile[data-rarity="Legendary"] { --edge: #ffc24a; --glow: rgb(255 194 74 / 32%); }
.shop-tile[data-rarity="Mythic"] { --edge: #ff5fd2; --glow: rgb(120 255 160 / 30%); box-shadow: inset 0 0 0 2px #7dffa8, 0 0 16px -4px #ff5fd2; }
.shop-tile img { width: 50px; height: 50px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 45%)); }
.shop-tile img[src*="dungeon_key"] { image-rendering: pixelated; }
.shop-qty { position: absolute; right: -5px; bottom: -6px; min-width: 26px; padding: 1px 6px; border-radius: 999px; background: #0f1222; box-shadow: 0 0 0 1.5px var(--edge); color: #fff; font-size: 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

.shop-copy { display: grid; gap: 2px; min-width: 0; }
.shop-name { overflow: hidden; color: #f0edff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.shop-time { color: #8f95ad; font-size: 12px; font-variant-numeric: tabular-nums; }
.shop-price { color: #ffe3a3; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.shop-price.is-gems { color: #9fe6ff; }

@media (max-width: 560px) {
  .shop-stat { min-width: 0; flex: 1 1 40%; }
  .shop-receipt { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding-right: 10px; }
  .shop-tile { width: 56px; }
  .shop-tile img { width: 44px; height: 44px; }
  .shop-name { font-size: 14px; }
}

/* v087: summon history, like the game's summon reveal. Rarity colors follow the capsule text in the game. */
.roll-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.roll-tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.roll-tally-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--tone) 12%, rgb(14 17 33 / 80%)); color: #d9dbea; font-size: 13px; }
.roll-tally-chip strong { color: #fff; font-variant-numeric: tabular-nums; }
.roll-tally-chip small { color: #9299b0; font-size: 11px; }
.roll-tally-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 8px var(--tone); }
.roll-list { display: grid; gap: 10px; }
.roll-card { --best: #343750; padding: 10px 12px 12px; border: 1px solid #2f3350; border-left: 3px solid var(--best); border-radius: 14px; background: linear-gradient(100deg, rgb(28 31 52 / 92%), rgb(17 20 35 / 92%)); }
.roll-card[data-best="Epic"] { --best: #a64dff; }
.roll-card[data-best="Legendary"] { --best: #ffba19; background: radial-gradient(ellipse at 0% 0%, rgb(255 186 25 / 12%), transparent 45%), linear-gradient(100deg, rgb(28 31 52 / 92%), rgb(17 20 35 / 92%)); }
.roll-card[data-best="Mythic"] { --best: #f740dc; background: radial-gradient(ellipse at 0% 0%, rgb(247 64 220 / 16%), transparent 50%), linear-gradient(100deg, rgb(28 31 52 / 92%), rgb(17 20 35 / 92%)); }
.roll-card[data-best="Unit"] { --best: #ff3b3b; background: radial-gradient(ellipse at 0% 0%, rgb(255 59 59 / 16%), transparent 50%), linear-gradient(100deg, rgb(28 31 52 / 92%), rgb(17 20 35 / 92%)); }
.roll-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.roll-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.roll-mode { padding: 2px 9px; border-radius: 999px; background: rgb(138 124 186 / 20%); color: #d4caff; font-size: 12px; font-weight: 800; }
.roll-mode.is-marco { background: rgb(255 150 90 / 18%); color: #ffbe8f; }
.roll-number { color: #9299b0; font-size: 12px; font-variant-numeric: tabular-nums; }
.roll-side { display: flex; align-items: center; gap: 10px; }
.roll-side .shop-price { font-size: 13px; }
.roll-side .shop-coin { width: 16px; height: 16px; }

.roll-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.roll-drop { position: relative; display: grid; gap: 3px; min-width: 0; }
.roll-face { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; border-radius: 10px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tone) 45%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--tone) 30%, #141629), #10121f); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 80%, transparent); }
.roll-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.roll-drop:not(.is-unit) .roll-face img { position: static; }
.roll-drop .roll-face.has-skin-art img, .roll-drop:not(.is-unit) .roll-face.has-skin-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.roll-drop:not(.is-unit) .roll-face img { width: 78%; height: 78%; object-fit: contain; }
.roll-skin-name { padding: 0 3px; color: #fff; font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; text-shadow: 0 1px 3px rgb(0 0 0 / 70%); }
.roll-label { overflow: hidden; color: var(--tone); font-size: 10px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.roll-drop[data-rarity="Mythic"] .roll-face, .roll-drop[data-rarity="Unit"] .roll-face { box-shadow: inset 0 0 0 2px var(--tone), 0 0 12px -2px var(--tone); }
.roll-drop.is-deleted .roll-face { filter: grayscale(.75) brightness(.6); }
.roll-drop.is-deleted .roll-label { color: #ff9dab; }
.roll-flag { position: absolute; top: 3px; left: 50%; padding: 0 5px; transform: translateX(-50%); border-radius: 5px; background: rgb(10 12 22 / 85%); color: #ff9dab; font-size: 9px; font-weight: 800; white-space: nowrap; }

@media (max-width: 720px) { .roll-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 420px) { .roll-head { flex-wrap: wrap; } .roll-skin-name { font-size: 10px; } }

.roll-tally-chip, .roll-drop { --tone: #6f7392; }
.roll-tally-chip[data-rarity="Rare"], .roll-drop[data-rarity="Rare"] { --tone: #15adff; }
.roll-tally-chip[data-rarity="Epic"], .roll-drop[data-rarity="Epic"] { --tone: #a64dff; }
.roll-tally-chip[data-rarity="Legendary"], .roll-drop[data-rarity="Legendary"] { --tone: #ffba19; }
.roll-tally-chip[data-rarity="Mythic"], .roll-drop[data-rarity="Mythic"] { --tone: #f740dc; }
.roll-tally-chip[data-rarity="Unit"], .roll-drop[data-rarity="Unit"] { --tone: #ff3b3b; }
/* v363: Secret = red to black like the game's Secret frame */
.roll-tally-chip[data-rarity="Secret"], .roll-drop[data-rarity="Secret"] { --tone: #ff2d55; }
.roll-tally-chip[data-rarity="Secret"] .roll-tally-dot { background: linear-gradient(135deg, #ff2d55, #120308); box-shadow: 0 0 0 1px #ff2d55; }
.roll-drop[data-rarity="Secret"] .roll-face { box-shadow: inset 0 0 0 2px #ff2d55, inset 0 -18px 18px -10px rgb(0 0 0 / 85%), 0 0 14px -2px #ff2d55; }


/* v089: rarity chips are filters. */
button.roll-tally-chip { font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
button.roll-tally-chip:hover { border-color: var(--tone); }
button.roll-tally-chip:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.roll-tally-chip.is-active { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 28%, rgb(14 17 33 / 80%)); box-shadow: 0 0 12px -3px var(--tone); }
.roll-tally-chip.is-muted { opacity: .55; }
.roll-filter-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 12px; color: #d9dbea; font-size: 14px; font-weight: 700; }
.roll-filter-clear { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-raised); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.roll-filter-clear:hover { border-color: var(--line-bright); }
.roll-drop.is-faded { opacity: .35; filter: saturate(.4); }

/* v227: match history timeline. Quiet dark rows; colour is kept for the result, the weather and the map tile. */
.match-history-list.has-matches { display: block; }
.mh-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mh-day { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 8px; padding: 0 4px; color: #8f93a8; font-size: 12px; font-variant-numeric: tabular-nums; }
.mh-day:first-child { margin-top: 0; }
.mh-day strong { color: #d7d5e4; font-size: 13px; font-weight: 600; }
.mh-row { --mh-tone: #8f93a8; position: relative; display: grid; grid-template-columns: 40px 20px minmax(0, 1fr); align-items: start; gap: 12px; padding: 4px 0; }
.mh-row.is-win { --mh-tone: #5fd39b; }
.mh-row.is-loss { --mh-tone: #f0737f; }
.mh-row.is-chest { --mh-tone: #e8bd62; }
.mh-row::before { content: ""; position: absolute; top: 0; bottom: 0; left: 61px; width: 1px; background: rgb(255 255 255 / 8%); }
.mh-time { padding-top: 13px; color: #7f8399; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.mh-node { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 12px; border: 1px solid color-mix(in srgb, var(--mh-tone) 70%, transparent); border-radius: 50%; background: #10121f; color: var(--mh-tone); }
.mh-node .mh-icon { width: 12px; height: 12px; stroke-width: 2.5; }
.match-history-card.mh-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0; padding: 8px 16px 8px 8px; overflow: hidden; border: 1px solid rgb(255 255 255 / 7%); border-radius: 12px; background: rgb(255 255 255 / 2.5%); transition: background-color 120ms ease, border-color 120ms ease; }
.match-history-card.mh-card:hover { border-color: rgb(255 255 255 / 12%); background: rgb(255 255 255 / 4.5%); }
.mh-tile { position: relative; display: grid; place-items: center; height: 68px; overflow: hidden; padding: 8px; border-radius: 8px; background-color: hsl(var(--mh-hue) 42% 30%); background-image: radial-gradient(rgb(255 255 255 / 13%) 1px, transparent 1px), linear-gradient(135deg, hsl(var(--mh-hue) 48% 38%), hsl(calc(var(--mh-hue) + 36) 52% 22%)); background-size: 8px 8px, 100% 100%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%); }
.mh-tile .match-history-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.mh-tile:has(.match-history-art)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(8 10 20 / 66%), rgb(8 10 20 / 10%)); }
.mh-tile-name { position: relative; z-index: 1; display: grid; justify-items: center; gap: 4px; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; text-shadow: 0 1px 2px rgb(0 0 0 / 60%); overflow-wrap: anywhere; }
.mh-body { display: grid; gap: 8px; min-width: 0; }
.mh-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: #eeecf6; font-size: 14px; line-height: 1.3; }
.mh-result { color: var(--mh-tone); font-weight: 600; }
.mh-result.is-win { color: #5fd39b; }
.mh-result.is-loss { color: #f0737f; }
.mh-stage { font-weight: 600; }
.mh-mode { padding: 0 8px; border: 1px solid rgb(232 189 98 / 28%); border-radius: 6px; color: #e8bd62; font-size: 11px; font-weight: 500; line-height: 18px; }
.mh-card .match-history-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.mh-card .history-chip { min-height: 28px; padding: 2px 8px 2px 4px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 8px; background: rgb(0 0 0 / 18%); color: #c9c7d6; font-size: 12px; font-variant-numeric: tabular-nums; }
.mh-card .history-chip-value { color: #f1eff8; font-weight: 600; }
.mh-stats { display: flex; align-items: center; justify-content: flex-end; gap: 12px; align-self: start; padding-top: 4px; color: #8f93a8; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-stat, .mh-weather { display: inline-flex; align-items: center; gap: 4px; }
.mh-stat .mh-icon { width: 13px; height: 13px; color: #6f7389; }
.mh-weather { color: var(--mh-weather); font-weight: 500; }
.mh-difficulty { color: #b9b7c8; }
@media (max-width: 820px) {
  .match-history-card.mh-card { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; padding: 8px 12px 8px 8px; }
  .mh-stats { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; padding-top: 0; }
}
@media (max-width: 560px) {
  .mh-row { grid-template-columns: 36px 20px minmax(0, 1fr); gap: 8px; }
  .mh-row::before { left: 53px; }
  .match-history-card.mh-card { grid-template-columns: minmax(0, 1fr); }
  .mh-tile { height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .match-history-card.mh-card { transition: none; } }

/* v228: automatic rejoin line on the timeline */
.mh-row.is-rejoin { --mh-tone: #e8bd62; align-items: center; padding: 8px 0; }
.mh-row.is-rejoin .mh-time { padding-top: 0; }
.mh-row.is-rejoin .mh-node { margin-top: 0; }
.mh-rejoin-text { color: #8f93a8; font-size: 13px; }
.mh-rejoin-text strong { color: #eeecf6; font-weight: 600; }

/* v238: on a phone each match uses the full width: time above the card, map and result on one line, rewards and stats below. */
@media (max-width: 560px) {
  .match-history-list.has-matches { max-height: none; padding-right: 0; overflow: visible; }
  .mh-day { margin: 16px 0 4px; padding: 0; }
  .mh-row { grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 4px 8px; padding: 8px 0 4px; }
  .mh-row::before { display: none; }
  .mh-node { grid-column: 1; grid-row: 1; margin-top: 0; }
  .mh-time { grid-column: 2; grid-row: 1; padding-top: 0; text-align: left; }
  .match-history-card.mh-card { grid-column: 1 / -1; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 8px; }
  .mh-tile { grid-column: 1; grid-row: 1; height: 56px; padding: 4px; }
  .mh-tile-name { gap: 2px; font-size: 11px; }
  .mh-body { display: contents; }
  .mh-heading { grid-column: 2; grid-row: 1; min-width: 0; }
  .mh-card .match-history-chips { grid-column: 1 / -1; }
  .mh-stats { grid-column: 1 / -1; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding-top: 8px; border-top: 1px solid rgb(255 255 255 / 6%); }
  .mh-rejoin-text { grid-column: 1 / -1; }
  /* the card has a dark overlay; these two sit directly on the card here, so they must stay above it */
  .mh-heading, .mh-card .match-history-chips { position: relative; z-index: 1; }
}

/* v348: pause line on the timeline (same shape as the rejoin line, blue) */
.mh-row.is-pause { --mh-tone: #7cb6ff; }

/* v353: chest batch tile = the game's open chest on a warm treasure glow; dungeon drops use the game's own pixel art */
.mh-tile.is-chest { align-content: center; gap: 2px; background-image: radial-gradient(circle at 50% 42%, rgb(255 200 90 / 38%), transparent 62%), linear-gradient(160deg, #4a2f16, #1d130a); background-size: 100% 100%; }
.mh-tile-chest { position: relative; z-index: 1; width: 40px; height: 40px; image-rendering: pixelated; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 55%)); }
.mh-tile.is-chest .mh-tile-name { color: #ffe3a3; font-size: 10px; }
.history-drop-icon[src*="name=dungeon_chest"] { image-rendering: pixelated; }

/* v355: rare chest batch = purple glow behind the game's rare chest */
.mh-tile.is-chest.is-rare { background-image: radial-gradient(circle at 50% 42%, rgb(200 145 255 / 45%), transparent 62%), linear-gradient(160deg, #3b1f6e, #160b2a); }
.mh-tile.is-chest.is-rare .mh-tile-name { color: #e7d2ff; }

/* v381: compact again (old size), all cards the same height: map | title + one line of rewards ("+N") | match facts on the right (2 columns, own icons). Thinner result line. */
.match-history-card.mh-card { grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 16px; height: 86px; padding: 8px 16px 8px 8px; border-left: 2px solid var(--mh-tone); }
.mh-card > .mh-tile { height: 68px; }
.mh-card > .mh-body { gap: 6px; overflow: hidden; }
.mh-card .match-history-chips { flex-wrap: wrap; max-height: 34px; overflow: hidden; }
.mh-card .history-chip[hidden] { display: none; }
.mh-card .mh-more { justify-content: center; min-width: 36px; padding: 2px 8px; color: #d7d5e4; font-weight: 600; cursor: help; }
.mh-card > .mh-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 16px; align-self: center; padding: 0 0 0 16px; border-left: 1px solid rgb(255 255 255 / 7%); }
.mh-card .mh-stat .mh-icon { color: #8c84c9; }
.mh-badge { padding: 1px 8px; border-radius: 6px; background: color-mix(in srgb, var(--mh-tone) 16%, transparent); font-size: 11px; font-weight: 600; line-height: 18px; }
@media (max-width: 820px) {
  .match-history-card.mh-card { grid-template-columns: 96px minmax(0, 1fr); height: auto; }
  .mh-card > .mh-stats { grid-column: 1 / -1; display: flex; padding: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .mh-card .match-history-chips { max-height: none; }
}

/* v464: one card per chest batch: totals on top, one row per chest below (the card grows, the rewards are not cut) */
.match-history-card.mh-card.has-parts { height: auto; align-items: start; }
.mh-card.has-parts > .mh-body { overflow: visible; }
.mh-card.has-parts .match-history-chips { max-height: none; }
.mh-chest-parts { grid-column: 1 / -1; display: grid; gap: 4px; margin: 0; padding: 8px 0 0; border-top: 1px solid rgb(255 255 255 / 7%); list-style: none; }
.mh-chest-parts li { display: flex; align-items: center; gap: 8px; min-width: 0; color: #c9c7d6; font-size: 12px; }
.mh-chest-parts img { width: 22px; height: 22px; flex: none; object-fit: contain; }
.mh-chest-parts b { flex: none; min-width: 52px; color: #f1eff8; font-weight: 700; }
.mh-chest-parts li.is-rare b { color: #e2b8ff; }
.mh-chest-parts span { min-width: 0; overflow-wrap: anywhere; }

/* v410: a dungeon room AA Log left (monsters near the base) */
.mh-row.is-left { --mh-tone: #f4a95e; }
.mh-result.is-left { color: #f4a95e; }
