/* Chronicle: the player's stats screen (chronicle.js). Pictures first, few words. */
.chron { background: var(--panel); }
.ch-in { display: flex; flex-direction: column; gap: 10px; padding: 10px 8px 16px; }
.ch-head { display: flex; align-items: center; gap: 8px; }
.ch-head h1 { flex: 1; display: flex; justify-content: flex-start; align-items: center; gap: 8px; font-family: var(--display); font-size: 28px; color: var(--gold); text-shadow: 0 2px 0 #0f0907; }
.ch-head h1 img { width: 32px; height: 32px; }
.ch-back { width: 44px; height: 44px; background: var(--wood); border: 3px solid #1a0f0b; box-shadow: inset 0 2px 0 var(--wood-hi); color: var(--cream); font-size: 18px; cursor: pointer; }
.ch-sp { width: 84px; flex: none; }

.ch-hero { display: flex; align-items: center; gap: 12px; justify-content: center; }
.rulerpic.ch-big { width: 112px; height: 112px; border-width: 4px; }
.ch-noface { display: flex; align-items: center; justify-content: center; background: #3b2216; border: 3px solid #1a0f0b; }
.ch-noface.ch-big { width: 112px; height: 112px; } .ch-noface.ch-big img { width: 48px; height: 48px; opacity: .5; }
.ch-noface.ch-mini { width: 56px; height: 56px; } .ch-noface.ch-mini img { width: 32px; height: 32px; }
.ch-best { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--cream-dim); max-width: 190px; }
.ch-best b { font-family: var(--display); font-size: 24px; line-height: 1.05; color: #ddd5cc; }

/* four number tiles */
.ch-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ch-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #2f1d13; border: 3px solid #1a0f0b; box-shadow: inset 0 2px 0 #4c2a18; padding: 8px 2px 6px; color: var(--cream-dim); }
.ch-tile img { width: 32px; height: 32px; }
.ch-tile b { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--cream); }
.ch-tile .label { font-size: 10px; }
.ch-tile small { font-family: var(--label); font-size: 12px; color: #a8957a; }

.ch-sec { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; color: #e6dfd6; }
.ch-h { display: flex; align-items: center; gap: 6px; font-family: var(--label); font-size: 15px; font-weight: 400; letter-spacing: .5px; color: #f3ede4; }
.ch-h img { width: 16px; height: 16px; }

/* reign timeline */
.ch-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.ch-day { --t: #6f6a78; flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; background: #2b2730; border: 3px solid #16131f; box-shadow: inset 0 0 0 2px var(--t); position: relative; scroll-snap-align: end; }
.ch-day .rulerpic.ch-mini { width: 56px; height: 56px; border-width: 2px; background: var(--t); box-shadow: none; }
.ch-dno { position: absolute; left: 3px; top: 2px; font-family: var(--label); font-size: 13px; color: #f3ede4; background: #16131f; padding: 0 4px; z-index: 1; }
.ch-tier { position: absolute; right: 4px; top: 46px; background: #16131f; padding: 2px; }
.ch-tier img { width: 16px; height: 16px; }
.ch-tname { font-family: var(--label); font-size: 12px; text-align: center; line-height: 1.15; color: #ddd5cc; min-height: 21px; overflow-wrap: anywhere; }
.ch-ghost { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border: 2px dashed #4f4a58; font-family: var(--display); font-size: 30px; color: #6f6a78; }
.ch-ghost img { width: 32px; height: 32px; }
.ch-day.missed, .ch-day.future { opacity: .55; box-shadow: none; }
.ch-day.future .ch-ghost img { opacity: .5; }
.ch-day.open { --t: var(--gold); animation: chpulse 1.6s steps(2) infinite; }
@keyframes chpulse { 50% { box-shadow: inset 0 0 0 2px var(--gold-hi); } }
.t-legendary { --t: #f3c94a; } .t-glorious { --t: #d79e24; } .t-survived { --t: #89c6f2; } .t-wounded { --t: #d24a43; } .t-fallen { --t: #6f6a78; }
.ch-day.t-legendary, .ch-day.t-glorious { background: #3a2e18; }

/* name colours by rarity (titles in the strip and cards) */
.r-common .ch-cname, .ch-tname.r-common { color: #ddd5cc; }
.r-uncommon .ch-cname, .ch-tname.r-uncommon, .ch-best.r-uncommon b { color: #9bcb58; }
.r-rare .ch-cname, .ch-tname.r-rare, .ch-best.r-rare b { color: #89c6f2; }
.r-epic .ch-cname, .ch-tname.r-epic, .ch-best.r-epic b { color: #cdbaf6; }
.r-legendary .ch-cname, .ch-tname.r-legendary, .ch-best.r-legendary b { color: #f3c94a; text-shadow: 0 0 10px rgba(243,201,74,.55); }
.r-mythic .ch-cname, .ch-tname.r-mythic, .ch-best.r-mythic b { color: #ff8f6b; text-shadow: 0 0 12px rgba(243,164,58,.75); }

/* endings stacked bar */
.ch-stack { display: flex; height: 26px; border: 3px solid #0f0907; background: #16131f; gap: 2px; }
.ch-stack i { display: block; background: var(--t); box-shadow: inset 0 3px 0 rgba(255,255,255,.3); min-width: 8px; }
.ch-stack i.t-legendary { background: linear-gradient(90deg, #f3c94a, #fff0a0, #f3c94a); }
.ch-stack i.empty { background: repeating-linear-gradient(90deg, #2b2730 0 6px, #24202a 6px 12px); box-shadow: none; }
.ch-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ch-leg { display: flex; flex-direction: column; align-items: center; gap: 1px; font-family: var(--display); font-size: 20px; color: var(--cream); border-top: 4px solid var(--t); padding-top: 3px; }
.ch-leg b { font-size: 18px; font-weight: 400; }
.ch-leg.none { opacity: .4; }

/* traitor hunt */
.ch-huntrow { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.ch-ring { width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--good) calc(var(--p) * 1%), #3a2a22 0); display: flex; align-items: center; justify-content: center; border: 3px solid #0f0907; grid-row: span 2; }
.ch-ring b { width: 58px; height: 58px; border-radius: 50%; background: #2b2730; border: 3px solid #0f0907; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 20px; color: var(--cream); }
.ch-hunts { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-hunt { position: relative; width: 40px; height: 40px; }
.ch-hunt .face { width: 40px; height: 40px; border: 2px solid #0f0907; }
.ch-hunt.no .face { filter: grayscale(.8) brightness(.7); }
.ch-hunt .mark { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; background: #16131f; padding: 2px; }
.ch-hunt.yes .face { box-shadow: 0 0 0 2px var(--good); }
.ch-empty { font-family: var(--display); font-size: 26px; color: #6f6a78; }
.ch-fast { display: flex; align-items: center; gap: 6px; color: var(--cream-dim); }
.ch-fast img { width: 16px; height: 16px; }
.ch-pips { display: inline-flex; gap: 3px; }
.ch-pips i { width: 10px; height: 10px; background: #3a2a22; border: 1px solid #0f0907; }
.ch-pips i.pass { background: #6f6a78; }
.ch-pips i.hit { background: var(--good); box-shadow: 0 0 6px var(--good); }

/* council bars */
.ch-adv { display: grid; grid-template-columns: 36px minmax(0, 1fr) 28px 18px; gap: 8px; align-items: center; }
.ch-adv .face { width: 36px; height: 36px; border: 2px solid #0f0907; }
.ch-track { height: 16px; background: #16131f; border: 2px solid #0f0907; }
.ch-fill { height: 100%; box-shadow: inset 0 3px 0 rgba(255,255,255,.3); min-width: 0; transition: width .6s steps(6); }
.ch-adv b { font-family: var(--display); font-size: 20px; text-align: right; color: var(--cream); }
.ch-fav { width: 18px; height: 18px; }

.ch-realm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.ch-realm .stat > img { width: 28px; height: 28px; flex: none; }

/* collection cards */
.ch-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ch-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; background: #2b2730; border: 3px solid #0f0907; text-align: center; }
.ch-card > img { width: 32px; height: 32px; }
.ch-cname { font-family: var(--display); font-size: 17px; line-height: 1.1; }
.ch-cday { position: absolute; left: 4px; top: 3px; font-family: var(--label); font-size: 12px; color: #a8957a; }
.ch-card.r-uncommon { box-shadow: inset 0 0 0 2px #9bcb58; }
.ch-card.r-rare { box-shadow: inset 0 0 0 2px #89c6f2; }
.ch-card.r-epic { box-shadow: inset 0 0 0 2px #a184e3; background: #2e2640; }
.ch-card.r-legendary { box-shadow: inset 0 0 0 2px #f3c94a, 0 0 10px rgba(243,201,74,.4); background: #3a2e18; }
.ch-card.r-mythic { box-shadow: inset 0 0 0 2px #f3a43a, 0 0 12px rgba(243,164,58,.55); background: #3d1c1c; }
.ch-card.ghost { opacity: .45; border-style: dashed; }
.ch-card.ghost img { filter: grayscale(1) brightness(.6); }
.ch-card.ghost .ch-cname { font-size: 26px; color: #6f6a78; }

/* entry buttons on the title and results screens */
.statbtn { display: inline-flex; align-items: center; gap: 5px; background: var(--wood); border: 2px solid #1a0f0b; box-shadow: inset 0 2px 0 var(--wood-hi); padding: 5px 9px 5px 5px; cursor: pointer; font-family: var(--label); font-size: 14px; color: var(--cream); min-height: 32px; }
.statbtn img { width: 16px; height: 16px; }
.statbtn.new { animation: chpulse2 1.2s steps(2) 4; }
@keyframes chpulse2 { 50% { background: var(--gold-lo); } }

@media (prefers-reduced-motion: reduce) { .ch-day.open, .statbtn.new { animation: none; } .ch-fill { transition: none; } }
