/* Character page of the game menu (Menu > Character): tabs with the records of the character (see theme.css for the colors) */
/* The tab bar stays in place and the page never grows: only the lists of the selected tab scroll, however long they are */
.game-menu-page.character-page {
  gap: 8px;
  overflow: hidden;
}

/* Section titles a little closer to the content above: the Overview of another character (with its card) fits without scrolling */
.character-page .game-menu-section {
  margin-top: 10px;
}

.character-page .character-tab-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* The fixed parts of a tab (titles, cards, the search box, notes) keep their size */
.character-page .character-tab-page > * {
  flex: 0 0 auto;
}

/* The lists fill the rest of the tab and scroll on their own */
.character-page .character-tab-page > .character-scroll {
  flex: 1 1 0;
  min-height: 60px;
  overflow-y: auto;
  padding-right: 2px;
}

/* Hunting tab: the notable drops take at most about three rows, the creatures get the rest */
.character-page .character-tab-page > .character-scroll.character-drops {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 138px;
}

/* Toolbar: the tabs (shared look: ui-tabs, ui-tab with-icon and ui-tab-page, see controls.css) and the lookup box on the right */
.character-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.character-tabs {
  flex: 0 0 auto;
}

.character-lookup {
  flex: 0 1 190px;
  min-width: 140px;
}

/* A looked up name that is no character */
.character-lookup-error {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--color-error);
}

.character-lookup-error.hidden {
  display: none;
}

/* Card of another character above the tabs: outfit, name with its red skull, level and vocation, online status and the way back */
.character-viewing {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 0% 0%, var(--color-accent-haze), transparent 65%),
    var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.character-viewing.hidden {
  display: none;
}

.character-viewing-outfit {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  background-image: radial-gradient(circle at 50% 35%, #5a5a5a, #1a1a1a 75%);
  box-shadow: 0 0 6px var(--color-accent-glow);
  overflow: hidden;
}

/* The 40px preview drawn a little smaller so the card stays short (the page must fit without scrolling) */
.character-viewing-outfit canvas {
  width: 36px;
  height: 36px;
}

.character-viewing-text {
  display: flex;
  flex: 1 1 120px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.character-viewing-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  color: var(--color-accent-text);
}

.character-viewing-skull {
  display: flex;
  line-height: 0;
}

.character-viewing-details {
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-soft);
}

/* Online in green with a dot, offline (or the last time seen) muted */
.character-viewing-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.character-viewing-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-text-dim);
}

.character-viewing-status.online {
  color: var(--color-success);
}

.character-viewing-status.online::before {
  background-color: var(--color-success);
  box-shadow: 0 0 5px var(--color-success);
}

.modal button.character-viewing-own {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.character-viewing-own .material-icons {
  font-size: 16px;
}

/* Overview tab: the profile, a card with one row per value */
.character-profile {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
}

.character-profile-row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 6px 12px;
  border: 1px solid black;
  border-radius: 8px;
  background-image: var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.character-profile-icon {
  grid-row: 1 / 3;
  font-size: 20px;
  color: var(--color-accent);
  text-shadow: 0 0 6px var(--color-accent-glow);
}

.character-profile-label {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.character-profile-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: bold;
}

.character-profile-value.empty {
  font-weight: normal;
  color: var(--color-text-dim);
}

/* Lists of the Deaths, Hunting and PvP tabs: rows with a badge, a title with details and an optional tag, in as many columns
   as the width holds (two in the game menu, one on narrow screens). Not "character-list": the character list of the login uses it */
.character-records-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-content: start;
  gap: 6px;
}

.character-records-list > .character-records-empty {
  grid-column: 1 / -1;
}

.character-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid black;
  border-radius: 8px;
  background-image: var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.character-row-badge {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #5a5a5a;
  border-radius: 8px;
  background-image: radial-gradient(circle at 50% 35%, #4a4a4a, #141414 75%);
  line-height: 0;
}

/* The level a player died at */
.character-row-badge.level {
  width: auto;
  min-width: 36px;
  padding: 0 6px;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  white-space: nowrap;
  color: var(--color-accent-text);
}

.character-row.death.by-player {
  border-color: var(--color-danger-dark);
}

.character-row.death.by-player .character-row-badge.level {
  border-color: var(--color-danger-dark);
  color: var(--color-danger);
}

.character-row-sprite {
  width: 32px;
  height: 32px;
}

.character-row-badge.skull .skull {
  width: calc(var(--skull-size, 11px) * 2);
  height: calc(var(--skull-size, 11px) * 2);
}

.character-row-badge.justified {
  font-size: 20px;
  color: var(--color-success);
}

.character-row.unjustified {
  border-color: var(--color-danger-dark);
}

.character-row-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.character-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: normal;
}

.character-row-title b {
  color: var(--color-accent-text);
}

.character-row.death.by-player .character-row-title b {
  color: var(--color-danger);
}

/* Notable drops are named in the color of their rarity, like the loot message */
.character-row-title.rarity {
  font-weight: bold;
}

.character-row-title.rarity[rarity="1"] { color: var(--color-rarity-uncommon); }
.character-row-title.rarity[rarity="2"] { color: var(--color-rarity-rare); }
.character-row-title.rarity[rarity="3"] { color: var(--color-rarity-epic); }
.character-row-title.rarity[rarity="4"] { color: var(--color-rarity-legendary); }

.character-row-details {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-muted);
}

.character-row-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid var(--color-surface-light-bottom);
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
  color: var(--color-text-soft);
}

.character-row-tag.danger {
  border-color: var(--color-danger-dark);
  background-color: var(--color-danger-darker);
  color: var(--color-danger);
}

.character-records-empty {
  padding: 14px 12px;
  font-size: 10px;
  font-weight: normal;
  font-style: italic;
  text-align: center;
  color: var(--color-text-muted);
}

/* Hunting tab: a search box and a grid of the killed creatures */
.character-hunting-search {
  margin-bottom: 6px;
}

.character-monsters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  align-content: start;
  gap: 6px;
}

.character-monsters .character-records-empty {
  grid-column: 1 / -1;
}

.character-monster {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid black;
  border-radius: 8px;
  background-image: var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.character-monster-outfit {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #5a5a5a;
  border-radius: 8px;
  background-image: radial-gradient(circle at 50% 35%, #4a4a4a, #141414 75%);
  overflow: hidden;
}

.character-monster-outfit canvas {
  width: 40px;
  height: 40px;
}

.character-monster-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.character-monster-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: bold;
}

.character-monster-count {
  font-size: 12px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-text);
}

/* Kill counters: two cards, one column on narrow screens */
.pvp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.pvp-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 0% 0%, var(--color-accent-haze), transparent 65%),
    var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.pvp-stat.unjustified {
  border-color: var(--color-danger-dark);
  background-image:
    radial-gradient(circle at 0% 0%, var(--color-danger-haze), transparent 65%),
    var(--gradient-card);
}

/* Worlds without skulls have no unjustified kills */
.pvp-stat.unjustified.disabled {
  opacity: 0.45;
  filter: grayscale(1);
}

.pvp-stat-medallion {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.pvp-stat-medallion svg {
  width: 36px;
  height: 36px;
}

.pvp-stat.unjustified .pvp-stat-medallion {
  border-color: var(--color-danger-dark);
  background-image: radial-gradient(circle at 30% 25%, #4a2a28, #140c0c 80%);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8), 0 0 8px var(--color-danger-haze);
}

/* The skull at twice its size: every pixel of the sprite is two screen pixels */
.pvp-stat-medallion .skull,
.pvp-red-skull-icon .skull {
  width: calc(var(--skull-size, 11px) * 2);
  height: calc(var(--skull-size, 11px) * 2);
}

.pvp-stat-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pvp-stat-value {
  font-size: 26px;
  font-weight: bold;
  line-height: 1;
  color: var(--color-accent-text);
  text-shadow: 0 0 8px var(--color-accent-glow), 0 2px 2px black;
  font-variant-numeric: tabular-nums;
}

.pvp-stat.unjustified .pvp-stat-value {
  color: var(--color-danger);
  text-shadow: 0 0 8px var(--color-danger-glow), 0 2px 2px black;
}

.pvp-stat-label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.pvp-stat-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-muted);
}

/* Red skull status: a grey skull while the record is clean, a pulsing red frame while marked */
.pvp-red-skull-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid black;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.3);
}

.pvp-red-skull-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #5a5a5a;
  border-radius: 50%;
  background-image: radial-gradient(circle at 50% 35%, #4a4a4a, #141414 75%);
  line-height: 0;
}

.pvp-red-skull-status:not(.marked) .pvp-red-skull-icon .skull {
  opacity: 0.35;
  filter: grayscale(1);
}

.pvp-red-skull-status.marked {
  border-color: var(--color-danger);
  background-image: linear-gradient(to right, var(--color-danger-dark), rgba(0, 0, 0, 0.3));
  animation: pvp-red-skull-pulse 1.6s ease-in-out infinite alternate;
}

.pvp-red-skull-status.marked .pvp-red-skull-icon {
  border-color: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger-glow);
}

@keyframes pvp-red-skull-pulse {
  from { box-shadow: 0 0 2px var(--color-danger-haze); }
  to { box-shadow: 0 0 10px var(--color-danger-glow); }
}

.pvp-red-skull-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pvp-red-skull-title {
  font-size: 12px;
  font-weight: bold;
}

.pvp-red-skull-status.marked .pvp-red-skull-title {
  color: var(--color-danger);
}

.pvp-red-skull-subtitle {
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-muted);
}

/* Unjustified kills of the last day, week and month against their limits */
.pvp-frags {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.pvp-frag {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 5px 8px;
  padding: 7px 10px 8px;
  border: 1px solid black;
  border-radius: 8px;
  background-image: var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pvp-frag-label {
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-soft);
}

.pvp-frag-count {
  font-size: 11px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.pvp-frag-bar {
  grid-column: 1 / -1;
  height: 5px;
  border: 1px solid black;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.pvp-frag-fill {
  width: 0;
  height: 100%;
  background-image: linear-gradient(to right, var(--color-accent-dark), var(--color-accent));
  box-shadow: 0 0 4px var(--color-accent-glow);
  transition: width 0.6s ease-out;
}

/* One kill away from the limit */
.pvp-frag.warning .pvp-frag-count {
  color: var(--color-warning);
}

.pvp-frag.warning .pvp-frag-fill {
  background-image: linear-gradient(to right, var(--color-accent), var(--color-warning));
}

/* The limit is reached */
.pvp-frag.danger {
  border-color: var(--color-danger-dark);
}

.pvp-frag.danger .pvp-frag-count {
  color: var(--color-danger);
}

.pvp-frag.danger .pvp-frag-fill {
  background-image: linear-gradient(to right, var(--color-danger-dark), var(--color-danger));
  box-shadow: 0 0 6px var(--color-danger-glow);
}

/* A limit of 0 never gives a red skull */
.pvp-frag.off .pvp-frag-count {
  color: var(--color-text-dim);
}

.pvp-note {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 10px;
  font-weight: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.pvp-note.centered {
  margin-top: 14px;
  text-align: center;
}
