/* zcrisis.com /perso: game-style character window (charwin.js). Looks like Project Zomboid's own panels: dark
   translucent window, thin grey frame, grey title bar, flat tabs, small light text, the game's skill squares. */
.cw { --cw-line: rgba(255,255,255,.28); --cw-dim: #a9a9a9; --cw-good: #8fd16a; --cw-bad: #e0675a; --cw-gold: #e4c15a;
  background: rgba(14,14,14,.86); border: 1px solid var(--cw-line); color: #e6e6e6; border-radius: 2px;
  font: 13.5px/1.35 "Noto Sans", "Segoe UI", Arial, sans-serif; text-shadow: 0 1px 0 #000;
  box-shadow: 0 12px 34px rgba(0,0,0,.5); margin: 0 0 22px; max-width: 920px; }
.cw-title { display: flex; justify-content: space-between; align-items: center; height: 26px; padding: 0 10px;
  background: linear-gradient(#4a4a4a, #262626); border-bottom: 1px solid var(--cw-line); font-weight: 600; font-size: 13px; }
.cw-tsub { color: var(--cw-dim); font-weight: 400; }
.cw-x { appearance: none; border: 0; background: none; color: #ddd; font-size: 18px; line-height: 1; margin-left: 10px; cursor: pointer; padding: 0 2px; }
.cw-x:hover { color: #fff; }
.cw-tabs { display: flex; gap: 1px; padding: 6px 8px 0; border-bottom: 1px solid var(--cw-line); background: rgba(255,255,255,.02); }
.cw-tab { appearance: none; border: 1px solid var(--cw-line); border-bottom: 0; background: linear-gradient(#2b2b2b, #161616);
  color: var(--cw-dim); padding: 4px 14px; font: inherit; font-size: 13px; cursor: pointer; border-radius: 2px 2px 0 0; }
.cw-tab:hover { color: #fff; }
.cw-tab.on { background: linear-gradient(#5a5a5a, #353535); color: #fff; position: relative; top: 1px; }
.cw-tab:has(.cw-badge) { white-space: nowrap; flex: none; }
.cw-badge { display: inline-block; min-width: 17px; margin-left: 6px; padding: 0 4px; border-radius: 9px; background: #d4483b; color: #fff; font-size: 12px; font-weight: 700; line-height: 17px; text-align: center; text-shadow: none; }
.cw-body-wrap { padding: 14px 16px 16px; min-height: 380px; }
.cw-h { color: #fff; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; margin: 4px 0 8px;
  padding-bottom: 4px; border-bottom: 1px solid var(--cw-line); }
.cw-muted { color: var(--cw-dim); }

/* Info */
.cw-info { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.cw-portrait { flex: none; width: 104px; height: 104px; display: grid; place-items: center; border: 1px solid var(--cw-line);
  background: radial-gradient(circle at 50% 40%, #3a3a3a, #121212); }
.cw-prof { width: 64px; height: 64px; image-rendering: auto; filter: drop-shadow(0 2px 2px #000); }
.cw-name { font-size: 22px; font-weight: 700; color: #fff; }
.cw-profn { color: var(--cw-gold); margin-bottom: 8px; }
.cw-kv { border-collapse: collapse; } .cw-kv td { padding: 2px 18px 2px 0; } .cw-kv td:first-child { color: var(--cw-dim); }
/* Traits, grouped: occupation / positive / negative / gained in play / other (charwin.js traitsHtml) */
.cw { --cw-play: #73ccff; }   /* the game's "In play:" blue (ZCrisis Traits, RGB 0.45,0.8,1) */
.cw-tgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px 16px; align-items: start; }
.cw-tg { border: 1px solid var(--cw-line); background: rgba(0,0,0,.22); border-top: 2px solid var(--cw-tg, var(--cw-line)); min-width: 0; }
.cw-tg-job { --cw-tg: var(--cw-gold); grid-column: 1 / -1; }
.cw-tg-good { --cw-tg: var(--cw-good); } .cw-tg-bad { --cw-tg: var(--cw-bad); } .cw-tg-play { --cw-tg: var(--cw-play); } .cw-tg-other { --cw-tg: #8a8a8a; }
.cw-tgh { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 8px 4px; font-weight: 600; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .6px; color: var(--cw-tg); background: rgba(255,255,255,.035); }
.cw-tgh b { color: var(--cw-dim); font-weight: 600; }
.cw-tgn { padding: 4px 8px 0; color: var(--cw-dim); font-size: 12.5px; line-height: 1.35; }
.cw-tlist { display: grid; gap: 2px; padding: 6px; }
.cw-tg-job .cw-tlist { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); padding-top: 0; }
.cw-trait { display: flex; flex-wrap: wrap; align-items: center; gap: 0 7px; padding: 3px 6px; background: rgba(255,255,255,.04); min-width: 0; }
.cw-trait[data-trait] { cursor: pointer; } .cw-trait[data-trait]:hover { background: rgba(255,255,255,.08); }
.cw-tdesc { display: none; flex-basis: 100%; padding: 4px 0 3px 25px; color: #cfcfcf; font-size: 12.5px; line-height: 1.4; white-space: pre-line; }
.cw-tdesc p { margin: 0 0 3px; } .cw-tdyn { color: var(--cw-play); } .cw-tdyn b { font-weight: 600; }
.cw-trait.open { background: rgba(255,255,255,.07); } .cw-trait.open .cw-tdesc { display: block; }
.cw-trait:focus-visible { outline: 1px solid var(--cw-gold); }
.cw-trait img { width: 18px; height: 18px; image-rendering: pixelated; flex: none; }
.cw-tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-trait.good .cw-tn { color: var(--cw-good); } .cw-trait.bad .cw-tn { color: var(--cw-bad); }
.cw-trait.play .cw-tn { color: var(--cw-play); } .cw-trait.job .cw-tn { color: #f0dfa8; }
.cw-tc { flex: none; font-size: 12px; color: var(--cw-dim); font-variant-numeric: tabular-nums; }
.cw-tdot { width: 18px; height: 18px; flex: none; border: 1px solid var(--cw-line); }
.cw-job { display: flex; gap: 10px; align-items: center; padding: 6px 8px; }
.cw-jobn { font-weight: 700; color: var(--cw-gold); font-size: 15px; }
.cw-boosts { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 3px; font-size: 12.5px; }
.cw-boost { padding: 0 6px; border: 1px solid rgba(228,193,90,.35); background: rgba(228,193,90,.07); white-space: nowrap; }
.cw-boost b { color: var(--cw-gold); font-weight: 600; }

/* Skills */
/* One column, sized by the window itself (a container query: the same window also opens over the map, narrower):
   name | squares | level | XP into the level / cost of the next | total. */
.cw-skills { container-type: inline-size; --cw-skc: minmax(0, 1fr) auto 20px 124px 66px; }
.cw-cat { margin-bottom: 14px; }
.cw-skill { display: grid; grid-template-columns: var(--cw-skc); align-items: center; gap: 8px; padding: 1px 2px; }
.cw-skill:hover { background: rgba(255,255,255,.05); }
.cw-sn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-skh { display: grid; grid-template-columns: minmax(0, 1fr) 20px 124px 66px; column-gap: 8px; padding-right: 2px; align-items: baseline; }
.cw-skc { text-align: right; color: var(--cw-dim); font-weight: 400; font-size: 11.5px; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.cw-skill.zero .cw-sn { color: var(--cw-dim); }
.cw-sq { display: flex; gap: 1px; } .cw-sq img { width: 18px; height: 18px; image-rendering: pixelated; }
.cw-sl { text-align: right; color: var(--cw-gold); } .cw-skill.zero .cw-sl { color: #666; }
.cw-xp, .cw-xt { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #cfcfcf; }
.cw-xp b { color: #fff; font-weight: 600; } .cw-xs { color: var(--cw-dim); } .cw-xmax { color: var(--cw-gold); font-weight: 600; font-size: 11.5px; }
.cw-skill.zero .cw-xp, .cw-skill.zero .cw-xt, .cw-skill.est .cw-xt { color: var(--cw-dim); }
.cw-skill.zero .cw-xp b { color: inherit; font-weight: 400; }
.cw-xnote { margin: 0 0 12px; padding: 6px 9px; border-left: 2px solid var(--cw-gold); background: rgba(228,193,90,.07); color: #d8d3bf; font-size: 12.5px; line-height: 1.4; }
/* the square in progress: filled up to the XP share toward the next level, like the game (ISSkillProgressBar), with
   the level square's own art, dimmed, so it reads as "this square, partly earned" */
.cw-sqp { position: relative; display: block; width: 18px; height: 18px; }
.cw-sqp i { position: absolute; left: 0; top: 0; bottom: 0; background: url(/ui/UnlockedSkill.png) 0 0 / 18px 18px no-repeat; opacity: .55; }
/* narrower windows: smaller squares, then (phone width) the figures go on a second line, labelled, so nothing scrolls */
@container (max-width: 560px) {
  .cw-skill { grid-template-columns: minmax(0, 1fr) auto 16px 108px 54px; gap: 6px; }
  .cw-skh { grid-template-columns: minmax(0, 1fr) 16px 108px 54px; column-gap: 6px; }
  .cw-sq img, .cw-sqp { width: 13px; height: 13px; } .cw-sqp i { background-size: 13px 13px; }
}
@container (max-width: 440px) {
  .cw-skill { grid-template-columns: minmax(0, 1fr) auto 16px; row-gap: 0; padding: 3px 2px; }
  .cw-skh { grid-template-columns: minmax(0, 1fr); } .cw-skc { display: none; }
  .cw-xp { grid-column: 1 / 2; text-align: left; color: var(--cw-dim); } .cw-xp::before { content: "XP "; color: var(--cw-dim); }
  .cw-xt { grid-column: 2 / 4; } .cw-xt::before { content: "Total "; color: var(--cw-dim); }
  .cw-skill.zero .cw-xp, .cw-skill.zero .cw-xt { display: none; }
}

/* Health */
.cw-health { display: flex; gap: 28px; align-items: flex-start; }
.cw-body { flex: none; padding: 10px 18px; border: 1px solid var(--cw-line); background: rgba(0,0,0,.35); }
.cw-body img { display: block; width: 132px; height: 264px; image-rendering: auto; }
/* B42 health panel: one full-size layer per body part under the game's outline (charwin.js healthTab) */
.cw-bps { position: relative; width: 148px; height: 363px; }
.cw-bps .cw-bp, .cw-bps .cw-bps-out { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw-bp { display: block; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; transition: filter .15s; }
.cw-bp.hl { filter: brightness(1.6) drop-shadow(0 0 4px rgba(255,255,255,.6)); }
.cw-wounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.cw-wpart { text-align: left; padding: 6px 8px; border: 1px solid var(--cw-line); background: rgba(0,0,0,.25); cursor: default; }
.cw-wpart:hover { border-color: var(--cw-gold); }
.cw-wname { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 3px; }
.cw-wname span { color: var(--cw-dim); font-weight: 400; }
.cw-wl { font-size: 13px; line-height: 1.45; text-align: left; } .cw-wl.bad { color: #e34848; } .cw-wl.warn { color: #ff9400; } .cw-wl.good { color: #6fd36f; }
.cw-hp { flex: 1; max-width: 420px; }
.cw-big { font-size: 40px; font-weight: 700; line-height: 1; } .cw-state { margin: 4px 0 10px; color: var(--cw-dim); }
.cw-big.ok { color: var(--cw-good); } .cw-big.warn { color: var(--cw-gold); } .cw-big.bad { color: var(--cw-bad); }
.cw-bar { height: 10px; border: 1px solid var(--cw-line); background: #111; margin-bottom: 14px; }
.cw-bar i { display: block; height: 100%; background: var(--cw-good); } .cw-bar.warn i { background: var(--cw-gold); } .cw-bar.bad i { background: var(--cw-bad); }

/* Inventory / clothing */
.cw-inv { display: flex; gap: 0; border: 1px solid var(--cw-line); min-height: 360px; }
.cw-cbtns { flex: none; width: 46px; display: flex; flex-direction: column; gap: 2px; padding: 4px; border-right: 1px solid var(--cw-line);
  background: rgba(255,255,255,.03); }
.cw-cbtn { appearance: none; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; background: transparent;
  cursor: pointer; border-radius: 2px; padding: 0; }
.cw-cbtn img { width: 30px; height: 30px; image-rendering: auto; }
.cw-cbtn:hover { background: rgba(255,255,255,.08); } .cw-cbtn.on { background: rgba(255,255,255,.16); border-color: var(--cw-line); }
.cw-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cw-solo { border: 1px solid var(--cw-line); min-height: 300px; }
.cw-ph { display: flex; justify-content: space-between; padding: 5px 8px; background: linear-gradient(#3a3a3a, #232323);
  border-bottom: 1px solid var(--cw-line); font-weight: 600; } .cw-ph .bad { color: var(--cw-bad); }
.cw-cols, .cw-row { display: grid; grid-template-columns: 30px 1fr 170px 52px; align-items: center; gap: 8px; padding: 0 8px; }
.cw-cols { height: 22px; font-size: 12px; color: var(--cw-dim); border-bottom: 1px solid var(--cw-line); background: rgba(255,255,255,.04); }
.cw-cols span:last-child, .cw-w { text-align: right; }
.cw-list { overflow-y: auto; max-height: 440px; scrollbar-color: #555 #151515; scrollbar-width: thin; }
.cw-row { min-height: 30px; } .cw-row:nth-child(even) { background: rgba(255,255,255,.035); } .cw-row:hover { background: rgba(120,160,220,.16); }
.cw-ic { width: 26px; height: 26px; object-fit: contain; display: block; }
.cw-in { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cw-q { color: var(--cw-dim); }
.cw-tag { font-size: 11px; color: var(--cw-gold); border: 1px solid rgba(228,193,90,.45); padding: 0 4px; margin-left: 4px; }
.cw-ic2 { color: var(--cw-dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-w { color: var(--cw-dim); font-variant-numeric: tabular-nums; }
.cw-empty { padding: 14px; color: var(--cw-dim); }

@media (max-width: 640px) {
  .cw-body-wrap { padding: 10px; } .cw-info, .cw-health { flex-direction: column; }
  .cw-cols, .cw-row { grid-template-columns: 28px 1fr 46px; } .cw-cols span:nth-child(3), .cw-ic2 { display: none; }
  .cw-tgs { grid-template-columns: minmax(0, 1fr); } .cw-tabs { overflow-x: auto; } .cw-tab { padding: 4px 9px; }
}

/* Item tooltip (hover a row; tap on phones): like the game's own, a dark box, bold name, label/value rows and the
   green-to-red bars. Appended to <body> so it can leave the window. */
.cw-tip { position: fixed; z-index: 3000; display: none; pointer-events: none; min-width: 230px; max-width: 340px;
  background: rgba(10,10,10,.94); border: 1px solid rgba(255,255,255,.35); color: #e6e6e6; padding: 8px 10px 9px;
  font: 13px/1.35 "Noto Sans", "Segoe UI", Arial, sans-serif; text-shadow: 0 1px 0 #000; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.cw-tip .tt-name { font-weight: 700; color: #fff; font-size: 14px; }
.cw-tip .tt-q { color: #a9a9a9; font-weight: 400; }
.cw-tip .tt-cat { color: #a9a9a9; font-size: 12px; margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.18); }
.cw-tip .tt-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: center; }
.cw-tip .tt-l { color: #cfcfcf; white-space: nowrap; }
.cw-tip .tt-v { display: flex; align-items: center; gap: 8px; justify-content: flex-end; text-align: right; }
.cw-tip .tt-v.good { color: #8fd16a; } .cw-tip .tt-v.bad { color: #e0675a; }
.cw-tip .tt-bar { flex: 1; min-width: 70px; height: 8px; background: #1d1d1d; border: 1px solid rgba(255,255,255,.25); }
.cw-tip .tt-bar i { display: block; height: 100%; }
.cw-tip .tt-v b { font-weight: 400; min-width: 34px; color: #e6e6e6; }
.cw-row { cursor: default; }
/* the row whose piece is lit on the 3D model: same gold as the piece */
.cw-row.hl, .cw-row.sel, .cw-row.hl:hover { background: rgba(31,229,255,.16); }
.cw-row.sel { box-shadow: inset 3px 0 0 #1fe5ff; }
.cw-tip.pinned { pointer-events: auto; border-color: rgba(228,193,90,.7); }
