:root { --bg: #0a0414; --panel: #170a28; --raised: #2a1446; --line: #553682; --text: #f3eaff; --soft: #c6b7e0; --main: #7c2fc7; --light: #d9a6ff; --bad: #ff9c8a; --gold: #f0c463; --edge: #7a5a2a; --title: "Palatino Linotype", Palatino, Georgia, serif; --gap: clamp(6px, 1.1vmin, 12px); }
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; color: var(--text); font: 16px/1.4 "Segoe UI", system-ui, sans-serif; background: radial-gradient(ellipse 75% 70% at 50% 42%, transparent, rgba(5, 1, 10, .85)), repeating-linear-gradient(0deg, transparent 0 46px, #08030f 46px 48px), repeating-linear-gradient(90deg, #1a0d2d 0 94px, #08030f 94px 96px); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--title); line-height: 1.15; color: var(--gold); }
h1 img { display: block; width: 100%; height: auto; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
ul { list-style: none; margin: 0; padding: 0; }
button, select { font: inherit; color: inherit; min-height: 44px; padding: 6px 16px; border: 2px solid var(--line); border-radius: 2px; background: var(--raised); }
button { font-weight: 700; cursor: pointer; background: linear-gradient(#3a1e5e, #221038); }
button.main { background: linear-gradient(#8a3ad6, #5f1fa3); border-color: #b77af2; }
button:hover:not(:disabled) { border-color: var(--gold); }
button:active:not(:disabled) { transform: translateY(2px); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* One screen: header, then squad | arena | overview, then dock */
.game { height: 100vh; height: 100dvh; display: grid; gap: var(--gap); padding: var(--gap); grid-template: "top top top" auto "side hall over" minmax(0, 1fr) "side dock over" auto / clamp(180px, 16vw, 300px) minmax(0, 1fr) clamp(190px, 17vw, 300px); }
.top { grid-area: top; display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; min-height: 44px; }
.brand img { display: block; height: clamp(40px, 7.4vh, 62px); width: auto; margin: -4px 0 -6px; }
#purse { display: flex; gap: 10px; margin-inline: auto; }
.chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; font-size: 14px; color: var(--soft); background: linear-gradient(#22103a, #120722); border: 2px solid var(--edge); }
.chip b { color: var(--text); font-size: 16px; }
.chip svg { width: 22px; height: 22px; }
#leave { min-height: 40px; padding: 4px 8px; border-color: var(--edge); }
#leave svg { display: block; width: 26px; height: 26px; }
#soundBtn { min-height: 40px; padding: 4px 8px; border-color: var(--edge); }
#soundBtn svg { display: block; width: 26px; height: 26px; }
.top { position: relative; }
#soundBox { position: absolute; right: 52px; top: 100%; z-index: 6; display: grid; gap: 10px; width: 220px; padding: 12px; }
#soundBox label { display: grid; gap: 4px; font-size: 14px; }
#soundBox label.row { display: flex; }
#soundBox input[type=range] { width: 100%; min-height: 24px; padding: 0; accent-color: var(--gold); }
#soundBox input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--gold); }
#guide { flex: 1 1 100%; order: -1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 6px 10px; margin-bottom: 4px; font-size: 14px; background: linear-gradient(90deg, rgba(240, 196, 99, .18), transparent); border-left: 4px solid var(--gold); }
#guide b { color: var(--gold); }
#guide span { color: var(--text); flex: 1 1 260px; }
#guide button { min-height: 32px; padding: 2px 10px; font-size: 13px; margin-left: auto; }
#dock button.nudge { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: 0 -3px var(--gold), 0 3px var(--gold), -3px 0 var(--gold), 3px 0 var(--gold), 0 0 22px rgba(240, 196, 99, .8); transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #dock button.nudge { animation: none; box-shadow: 0 -3px var(--gold), 0 3px var(--gold), -3px 0 var(--gold), 3px 0 var(--gold); } }
#walletBtn { border-color: var(--edge); min-height: 40px; }
#walletBtn:disabled { opacity: 1; cursor: default; }

/* Frames with notched pixel corners */
.box, #panel, dialog { background: linear-gradient(#1f0f35, #120722); border: 0; margin: 3px; box-shadow: 0 -3px var(--edge), 0 3px var(--edge), -3px 0 var(--edge), 3px 0 var(--edge); }
.box { padding: 10px; min-height: 0; overflow: hidden; }
.hall { grid-area: hall; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.arena { container-type: size; display: grid; place-items: center; min-height: 0; }
.frame { position: relative; width: calc(min(100cqw, 177.78cqh) - 12px); aspect-ratio: 16 / 9; box-shadow: 0 -3px var(--gold), 0 3px var(--edge), -3px 0 var(--edge), 3px 0 var(--edge), 0 0 40px rgba(138, 58, 214, .4); }
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.hud { display: flex; flex-wrap: wrap; gap: 0 20px; padding: 6px 6px 0; align-items: center; justify-content: space-between; font-variant-numeric: tabular-nums; }
.stage { display: flex; gap: 6px; align-items: center; }
.stage b { min-width: 76px; text-align: center; font: 700 18px var(--title); color: var(--gold); }
.stage button { min-height: 32px; min-width: 36px; padding: 0 8px; font-size: 14px; border-color: var(--edge); }
.stage .small { max-width: 340px; color: var(--muted, #b9a9c9); font-size: 12px; line-height: 1.3; }
.kinds button { min-width: 84px; }
.kinds [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }
.stage [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }
#count { color: var(--gold); }
#earned { color: var(--soft); font-size: 14px; }
.track { position: absolute; left: 25%; right: 25%; top: 2%; text-align: center; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.track b { font: 700 clamp(14px, 2.4vmin, 20px)/1.2 var(--title); color: var(--gold); }
.track div { position: relative; height: 20px; background: #16060c; border: 2px solid var(--edge); }
.track i { display: block; height: 100%; width: 0; background: linear-gradient(#c93a2e, #8f1d24); }
.track span { position: absolute; inset: 0; font: 600 13px/16px "Segoe UI", system-ui, sans-serif; }
#status { position: absolute; left: 0; right: 0; top: 30%; padding: 0 16px; text-align: center; font-weight: 700; text-shadow: 0 1px 3px #14061f; }

/* Cards */
.leftcol { grid-area: side; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 0; }
.side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; }
.events { display: grid; gap: 4px; align-content: start; font-size: 13px; }
#side[hidden] + .events { display: none; }
.events .evBoss { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.events .evBoss b { color: var(--light); }
.events .evBoss span, .events .small { color: var(--soft); }
.evTop { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.evTop li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; gap: 6px; }
.evTop em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evTop .none { display: block; color: var(--soft); }
#dock [data-narrow] { display: none; }
.side h3 { display: flex; justify-content: space-between; gap: 8px; }
.side h3 span { color: var(--text); white-space: nowrap; }
#cards { display: grid; gap: 5px; min-height: 0; overflow-y: auto; align-content: start; grid-auto-rows: minmax(59px, auto); }
#cards li:not(.none) { display: flex; gap: 8px; align-items: center; padding: 4px 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--r) 22%, #170a28), #170a28 70%); border: 1px solid color-mix(in srgb, var(--r) 55%, #170a28); border-left: 4px solid var(--r); }
#cards li > div { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; font-size: 13px; line-height: 1.25; }
#cards b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face { flex: none; display: block; background-repeat: no-repeat; background-color: #2d1650; image-rendering: pixelated; }
.rar { color: var(--r); font-weight: 600; }
#cards .bar { grid-column: 1 / -1; position: relative; height: 15px; margin-top: 2px; background: #0a0412; overflow: hidden; }
#cards .bar i { display: block; height: 100%; background: linear-gradient(#2b8a52, #1f6f41); }
#cards em { position: absolute; inset: 0; text-align: center; font: 600 12px/15px "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
#cards .down .face { filter: grayscale(1) brightness(.6); }
#cards .down .bar i { background: #5d49a8; }
#cards.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(38px, 70px); gap: 4px; }
#cards.mini li { gap: 5px; padding: 2px 4px; }
#cards.mini .rar, #cards.mini .rar + .num { display: none; }
#cards.mini .bar { height: 12px; }
#cards.mini li:not(.down) em { display: none; }
#cards.mini em { font-size: 11px; line-height: 12px; }
#cards.mini li > div { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
#cards.mini b { grid-column: 1 / -1; }
#cards.mini .num { font-size: 12px; }
#cards.mini .bar { grid-column: 2; margin: 0; }
.none { color: var(--soft); padding: 8px 0; }

/* Overview */
.over { grid-area: over; display: grid; grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px; min-height: 0; }
#tally { display: flex; flex-wrap: wrap; gap: 2px 12px; font-weight: 600; font-size: 14px; padding: 8px 0; border-block: 1px solid #3a2361; }
.sq { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
#sideQuests { list-style: none; margin: 4px 0 0; padding: 0; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
#sideQuests li { display: grid; gap: 3px; padding: 6px 7px; background: rgba(8, 3, 18, .55); border: 1px solid #2b1848; font-size: 13px; line-height: 1.25; }
#sideQuests li.done { opacity: .5; }
#sideQuests li > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; }
#sideQuests li b { overflow-wrap: anywhere; }
#sideQuests li i { display: block; height: 5px; background: #0d0618; position: relative; }
#sideQuests li i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: linear-gradient(var(--gold), #b9822c); }
#sideQuests small { color: var(--soft); font-size: 11px; }
#sideQuests button { min-height: 26px; padding: 0 10px; font-size: 12px; }
#sideQuests .none { color: var(--soft); }

/* Dock: separate boxes, no frame around them */
#dock { grid-area: dock; display: grid; grid-template-columns: repeat(11, minmax(0, 104px)); justify-content: center; gap: clamp(8px, 1vw, 16px); padding: 3px; }
#dock button { min-width: 0; min-height: 0; height: clamp(54px, 12.2vh, 104px); padding: 4px 2px; display: grid; justify-items: center; align-content: center; gap: clamp(1px, .5vh, 5px); border: 0; border-radius: 0; font-size: clamp(12px, 1.05vw, 15px); line-height: 1.2; background: linear-gradient(#3b2060, #1b0c31); box-shadow: 0 -3px var(--edge), 0 3px #4b3518, -3px 0 var(--edge), 3px 0 var(--edge), inset 0 2px #5a3590; transition: transform .12s; }
#dock svg { width: clamp(26px, 6vh, 52px); height: clamp(26px, 6vh, 52px); }
#dock button:hover { transform: translateY(-3px); box-shadow: 0 -3px var(--gold), 0 3px var(--gold), -3px 0 var(--gold), 3px 0 var(--gold), inset 0 2px #7a4cb8; }
#dock button[aria-expanded="true"] { color: var(--gold); background: linear-gradient(#5f2c9c, #2b1150); box-shadow: 0 -3px var(--gold), 0 3px var(--gold), -3px 0 var(--gold), 3px 0 var(--gold), 0 0 18px rgba(240, 196, 99, .45); }

/* Panels open over the arena, between the header and the dock */
#panel { grid-area: hall; z-index: 5; align-self: start; max-height: calc(100% - 6px); min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
dialog { margin: auto; color: var(--text); padding: 20px; width: min(760px, calc(100vw - 32px)); max-height: 86vh; overflow: auto; }
dialog::backdrop { background: rgba(6, 2, 12, .75); }
#toasts { position: fixed; right: 16px; bottom: calc(clamp(54px, 12.2vh, 104px) + 28px); display: grid; gap: 8px; z-index: 9; max-width: calc(100vw - 32px); }
.toast { background: var(--raised); border: 2px solid var(--gold); padding: 10px 16px; }
.toast.bad { border-color: var(--bad); }
#gate { position: fixed; inset: 0; z-index: 5; background: rgba(8, 3, 16, .86); display: grid; place-items: center; padding: 16px; overflow: auto; }
#gate > div { width: min(400px, 100%); display: grid; gap: 14px; }
#gate button { min-height: 48px; }

/* Panel contents */
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 14px; color: var(--soft); }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; margin-top: 18px; }
.figures { display: grid; gap: 10px; margin-top: 8px; }
.figures dt { color: var(--soft); font-size: 14px; }
.figures dd { font-size: 22px; font-weight: 700; line-height: 1.2; }
.danger { color: var(--bad); }

#panel .body { overflow-y: auto; overflow-x: hidden; grid-template-columns: minmax(0, 1fr); display: grid; gap: 14px; align-content: start; padding: 3px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.hero { display: grid; gap: 8px; align-content: start; padding: 12px; background: linear-gradient(#22103a, #150826); border: 2px solid var(--line); }
.hero.in { border-color: var(--r); background: linear-gradient(#33185a, #1c0c33); }
.hero h3 { font-size: 17px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; font-size: 14px; }
.stats div { display: flex; justify-content: space-between; }
.stats dt { color: var(--soft); }
.stats dd { font-weight: 700; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.buys { display: grid; gap: 8px; margin-top: 10px; }
.buys button { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
table { width: 100%; max-width: 560px; border-collapse: collapse; }
caption { text-align: left; color: var(--soft); padding-bottom: 6px; }
th, td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid #2b1848; }
dialog p, dialog .grid { margin-top: 10px; }
#gateError { color: var(--bad); }

/* Gear */
.slot { width: 48px; height: 48px; flex: none; padding: 4px; background: #2d1650; border-radius: 2px; }
.item { border-color: var(--r); }
.item button { padding: 6px 10px; }
.item .row button { flex: 1; }
.item h3 { color: var(--r); font-size: 16px; }
.short { color: var(--bad); }
.craft { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.unseen { opacity: .6; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; }
.tome { flex: 1 1 180px; max-width: 280px; display: grid; gap: 8px; padding: 10px; border: 2px solid var(--r); background: linear-gradient(#22103a, #150826); }
.tome.empty { place-items: center; min-height: 112px; border-style: dashed; border-color: var(--line); }

/* Hero and Fuse pages */
.sheet { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 18px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.portrait { display: grid; justify-items: center; align-content: end; gap: 8px; padding: 10px; background: radial-gradient(ellipse 60% 30% at 50% 70%, color-mix(in srgb, var(--r) 60%, transparent), transparent), linear-gradient(#2c1650, #12061f); border: 3px solid var(--r); }
.portrait canvas { width: 100%; max-width: 264px; height: auto; }
.facts { display: grid; gap: 10px; }
.facts .big { font-size: 26px; }
.facts .cp { font-size: 22px; color: var(--gold); }
.plus { color: #7fe0a0; font-weight: 600; }
.stars { color: var(--gold); font-family: "Segoe UI Symbol", system-ui, sans-serif; letter-spacing: 1px; }
.pick { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; font-weight: 400; }
.pick[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(#6a2c1a, #32120f); }
.hero .row > button { flex: 1; padding: 6px 8px; }
@media (max-width: 700px) { .sheet { grid-template-columns: minmax(0, 1fr); } }

/* Market, quests and lists */
input { font: inherit; color: inherit; min-height: 44px; width: 120px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--raised); }
select { max-width: 100%; min-width: 0; }
.row > * { min-width: 0; }
.quest { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid #2b1848; }
.quest button { min-width: 108px; }
.bar2 { height: 8px; margin: 6px 0; background: #0d0618; border-radius: 2px; overflow: hidden; }
.bar2 i { display: block; height: 100%; background: linear-gradient(var(--gold), #b9822c); }

/* Narrow or upright screens: arena on top, squad below it */
@media (max-width: 900px) and (min-height: 481px), (max-aspect-ratio: 11 / 10) {
  .game { grid-template: "top" auto "hall" auto "side" minmax(0, 1fr) "dock" auto / minmax(0, 1fr); }
  #dock { grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); }
  #dock [data-narrow] { display: grid; }
  .over { display: none !important; } /* quests and chat are in the dock here */
  .arena { aspect-ratio: 16 / 9; max-height: 44vh; width: 100%; }
  #panel { grid-row: 2 / 4; grid-column: 1; align-self: stretch; }
  #cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  #cards.mini { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (max-width: 640px) {
  .game { grid-template: "top" auto "hall" auto "side" minmax(0, 1fr) "dock" auto / minmax(0, 1fr); }
  .over, #earned, .events { display: none !important; }
  #dock [data-narrow] { display: grid; }
  #guide span { display: none; }
  #soundBox { right: 0; }
  #panel { grid-column: 1; }
  .top { flex-wrap: wrap; }
  #purse { order: 3; width: 100%; gap: 6px; }
  .chip { flex: 1; justify-content: center; padding: 3px 4px; font-size: 12px; gap: 4px; }
  .chip b { font-size: 14px; }
  .chip svg { width: 18px; height: 18px; }
  #dock { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 9px; }
  #dock button { height: clamp(48px, 7.6vh, 64px); font-size: 11.5px; letter-spacing: -.2px; }
  #cards.mini { grid-auto-rows: 34px; }
  .side { gap: 4px; }
  .box { padding: 6px; }
  #dock svg { width: 30px; height: 30px; }
  .cols { grid-template-columns: 1fr; }
  .tome { flex-basis: 100%; max-width: none; }
  .tome.empty { min-height: 44px; padding: 4px; }
}
/* Short, wide screens such as a phone on its side */
@media (max-height: 480px) and (min-aspect-ratio: 11 / 10) {
  .game { grid-template: "top top" auto "side hall" minmax(0, 1fr) "dock dock" auto / 180px minmax(0, 1fr); }
  .over, .hud, .events { display: none !important; }
  #dock [data-narrow] { display: grid; }
  #dock { grid-template-columns: repeat(11, minmax(0, 1fr)); }
  .top { min-height: 0; }
  .top button { min-height: 32px !important; padding: 2px 10px; }
  .chip { padding: 1px 8px; }
  #panel { grid-row: 2; grid-column: 1 / 3; }
  #dock button { height: 50px; }
  #dock svg { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.levels { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
#skip { position: absolute; right: 10px; bottom: 10px; min-height: 40px; }
.raidboss { grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.bossart { width: 236px; height: 212px; display: grid; place-items: end center; overflow: hidden; background: radial-gradient(ellipse 60% 26% at 50% 88%, rgba(160, 70, 220, .6), transparent), linear-gradient(#2c1650, #12061f); border: 3px solid var(--edge); }
.bossart span { display: block; background-position: 0 0; image-rendering: pixelated; }
@media (max-width: 700px) { .raidboss { grid-template-columns: minmax(0, 1fr); justify-items: center; } .raidboss .facts { width: 100%; } }
#cards li[data-hero] { cursor: pointer; transition: transform .1s; }
#cards li[data-hero]:hover { transform: translateX(3px); filter: brightness(1.2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.chip-t { font-size: 12px; font-weight: 600; padding: 1px 6px; color: var(--r); border: 1px solid color-mix(in srgb, var(--r) 60%, transparent); background: rgba(10, 4, 20, .5); }
.chip-t.fit-poor, .chip-t.fit-none { opacity: .55; border-style: dashed; }
.chip-t.fit-poor::before, .chip-t.fit-none::before { content: "\2716  "; font-size: 9px; color: var(--soft); }
.chip-t.fit-bad { color: var(--bad); border-color: var(--bad); }
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.traits li { padding: 8px 10px; border: 2px solid var(--r); background: linear-gradient(#22103a, #150826); display: grid; gap: 4px; }
.traits b { color: var(--r); }
.fit { font-size: 13px; font-weight: 600; }
.fit-good { color: #7fe0a0; } .fit-poor { color: #ffb36b; } .fit-none { color: var(--soft); } .fit-bad { color: var(--bad); } .fit-plain { color: var(--light); }
.links { display: grid; gap: 4px; font-size: 14px; } .links li::before { content: "◆ "; color: var(--gold); }

/* ---------- Summoning: the gate, and face-down pixel cards turned over with pixel bursts ---------- */
.gate { display: block; width: 100%; height: 100%; image-rendering: pixelated; background: #080312; }
/* the Summon panel is a scene that fills the whole arena; its buttons sit over the bottom of it */
#panel.scene { padding: 0; align-self: stretch; height: calc(100% - 6px); grid-template-rows: minmax(0, 1fr); position: relative; overflow: hidden; }
#panel.scene > .row { position: absolute; z-index: 3; left: 14px; right: 14px; top: 10px; pointer-events: none; }
#panel.scene > .row h2 { text-shadow: 0 2px 0 #000, 0 0 12px #000; }
#panel.scene > .row button { pointer-events: auto; }
#panel.scene .body { padding: 0; overflow: hidden; display: block; position: relative; height: 100%; }
.gatebox { position: absolute; inset: 0; }
.sceneBar { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 3; display: grid; gap: 8px; justify-items: center; padding: 0 12px; }
.sceneBar .odds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12px; padding: 4px 10px; background: rgba(8, 3, 18, .7); }
.buys.big { width: min(100%, 520px); min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.45fr); gap: clamp(5px, 1vw, 10px); margin: 0; }
.sceneBar { grid-template-columns: minmax(0, 1fr); }
.buys.big button {
  position: relative; display: grid; place-content: center; justify-items: center; min-width: 0; min-height: 78px; padding: 8px 5px; gap: 5px;
  border: 1px solid #82738f; border-radius: 2px; background: linear-gradient(#393146, #242033);
  color: #f1eaf8; box-shadow: inset 0 1px #ffffff1f, inset 0 -3px #100d1d, 0 2px 0 #0f0c19;
  font: bold 24px/1 var(--title); text-shadow: none;
}
.buys.big button:disabled { opacity: 1; border-color: #66596e; background: linear-gradient(#312b3c, #221d2c); color: #c5baca; }
.buys.big button small { color: #d1c6d8; font: 500 11px/1.25 "Segoe UI", system-ui, sans-serif; overflow-wrap: anywhere; }
.buys.big button:not(:disabled):hover { border-color: #ddd0e8; transform: translateY(-1px); }
.buys.big .summonFeatured {
  padding-top: 24px; border-color: #8ddbc6; background: radial-gradient(ellipse at top, #374948, transparent 75%), #211e32;
  color: #f4fff9; box-shadow: inset 0 -3px #161421, 0 0 0 1px #304943, 0 0 12px #83d9c320;
}
.buys.big .summonFeatured:disabled { border-color: #67988e; background: linear-gradient(#30333d, #211e30); color: #ded9e7; }
.summonRibbon {
  position: absolute; inset: 0 0 auto; padding: 2px 1px; color: #c9f6e8; background: #304340;
  font: 750 10px/1.25 "Segoe UI", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
}
.summonQuantity { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 6px; }
.buys.big .bonusTag {
  position: relative; isolation: isolate; overflow: hidden; padding: 3px 7px; background: #a9f5d6; color: #173c32;
  clip-path: polygon(3px 0,100% 0,100% calc(100% - 3px),calc(100% - 3px) 100%,0 100%,0 3px);
  box-shadow: inset 0 2px #e6fff3, inset 0 -2px #67baa3; font: 800 13px/1.2 "Segoe UI", system-ui, sans-serif; white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .bonusTag::after { content: ''; pointer-events: none; position: absolute; inset: 0; background: linear-gradient(115deg,transparent 42%,#fff9 49%,transparent 56%) -60px 0 / 60px 100% no-repeat; animation: summonBonusShine 4.5s ease-out infinite; }
  @keyframes summonBonusShine { 0%, 75% { background-position-x: -60px; } 100% { background-position-x: calc(100% + 60px); } }
}
button.chip { font: inherit; cursor: pointer; }
button.chip:hover, button.chip:focus-visible { border-color: var(--gold); }

dialog.wide { width: min(1100px, calc(100vw - 24px)); max-height: 100vh; overflow-x: hidden; background: none; box-shadow: none; padding: 0; }
dialog.wide::backdrop { background: radial-gradient(ellipse at center, rgba(14, 5, 28, .78), rgba(3, 1, 7, .94)); animation: packFade .7s ease-out; }
@keyframes packFade { from { opacity: 0; } to { opacity: 1; } }
dialog.wide .packTitle { text-shadow: 0 2px 0 #000, 0 0 14px #000; }
.portal { position: relative; }
.portal .gate { height: min(64vh, 560px); background: none; -webkit-mask-image: radial-gradient(ellipse at center, #000 52%, transparent 96%); mask-image: radial-gradient(ellipse at center, #000 52%, transparent 96%); }
.portal .packTitle { position: absolute; left: 0; right: 0; bottom: 14px; text-shadow: 0 2px 0 #000; animation: packBlink 1.4s ease-in-out infinite; }
.portal .skip { position: absolute; right: 8px; top: 8px; min-height: 32px; padding: 2px 12px; opacity: .8; }
@keyframes packBlink { 50% { opacity: .45; } }
.packTitle { text-align: center; font-family: var(--title); color: var(--gold); letter-spacing: 1px; }
.fxlayer { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; pointer-events: none; z-index: 5; }
.pack { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 16px 0 8px; }
.pcard { position: relative; width: 152px; height: 224px; padding: 0; background: none; border: 0; box-shadow: none; cursor: pointer; min-height: 0; transition: transform .18s cubic-bezier(.2, .8, .3, 1), filter .18s; }
.pcard:not(.open):hover, .pcard:not(.open):focus-visible { transform: translateY(-8px); filter: brightness(1.15); }
.pcard .inner { position: absolute; inset: 0; }
.pcard .back, .pcard .front { position: absolute; inset: 0; }
.pcard .front { display: none; text-align: left; }
.pcard.open .front { display: block; }
.pcard.open .back { display: none; }
/* pixel frames: notched corners made of box shadows, like the dock */
.pcard .pf { margin: 3px; box-shadow: 0 -3px var(--r), 0 3px var(--r), -3px 0 var(--r), 3px 0 var(--r), 0 0 18px 4px rgba(var(--rgb), .35); }
.pcard .back { overflow: hidden; margin: 0; box-shadow: 0 0 14px 2px rgba(var(--rgb), .4); }
.pcard .back .art { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pcard.r3 .back, .pcard.r4 .back, .pcard.r5 .back { animation: packPulse 1.6s ease-in-out infinite; }
@keyframes packPulse { 50% { box-shadow: 0 0 26px 8px rgba(var(--rgb), .8); } }
@keyframes packBob { 50% { transform: translateY(-3px); } }
.pcard.shake { animation: packShake .5s ease-in-out; }
@keyframes packShake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, 2px); } 80% { transform: translate(3px, -1px); } }
/* the front */
.pf { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 5px; width: calc(100% - 6px); height: calc(100% - 6px); padding: 7px; background: linear-gradient(#26123f, #140826); overflow: hidden; }
.pf .pfTop { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; font-size: 12px; background: var(--r); color: #12071f; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.pf .pfArt { display: grid; place-items: center; padding: 6px 0; background: radial-gradient(circle at 50% 70%, rgba(var(--rgb, 255, 255, 255), .25), transparent 70%), #1d0e33; box-shadow: inset 0 0 0 2px #3a1e5e; }
.pf .pfArt .face { background-color: transparent; transform: scale(1.5); transform-origin: 50% 70%; margin-top: 8px; }
.pf .pfArt { overflow: hidden; }
.pf .pfName { text-align: center; font: 700 15px var(--title); color: var(--text); line-height: 1.1; }
.pf .pfStats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; font-size: 12px; align-content: start; }
.pf .pfStats span { display: flex; justify-content: space-between; }
.pf .pfStats i { font-style: normal; color: var(--soft); }
.pf .pfTraits { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 18px; }
.pf .pfTraits em { font: 600 10px "Segoe UI", system-ui, sans-serif; font-style: normal; padding: 1px 5px; background: #3a1e5e; color: var(--light); }
.pf .pfTraits em.none { background: none; color: var(--soft); opacity: .6; }
.packRow { margin-top: 12px; }
/* the white flash the cards come out of, and a soft shine on a rare card once it is turned */
.packFlash { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, #fff, rgba(255, 255, 255, .85) 45%, rgba(255, 255, 255, .6)); animation: packFlash .75s ease-out forwards; }
@keyframes packFlash { to { opacity: 0; } }
.pcard.shine .pf { animation: packShine 1.2s ease-out; }
@keyframes packShine { 0% { box-shadow: 0 -3px var(--r), 0 3px var(--r), -3px 0 var(--r), 3px 0 var(--r), 0 0 60px 24px rgba(var(--rgb), .9); } 100% { box-shadow: 0 -3px var(--r), 0 3px var(--r), -3px 0 var(--r), 3px 0 var(--r), 0 0 18px 4px rgba(var(--rgb), .35); } }
.pack ~ .packRow { animation: fadeIn .4s .5s ease-out backwards; }
dialog.wide > h2.packTitle { animation: fadeIn .5s .15s ease-out backwards; }
@media (prefers-reduced-motion: reduce) { .pcard.r3 .back, .pcard.r4 .back, .pcard.r5 .back, .pcard .back svg, .pcard.shake, .portal .packTitle, .packFlash, .pcard.shine .pf, .pack ~ .packRow, dialog.wide > h2.packTitle { animation: none !important; } }
@media (max-width: 700px) { .pcard { width: 132px; height: 200px; } }

/* Chat, under the activity list */
.chat { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 4px; }
.chatTabs { display: flex; gap: 4px; }
.chatTabs button { min-height: 28px; padding: 0 12px; font-size: 13px; }
.chatTabs [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }
#chatLog { overflow-y: auto; font-size: 13px; line-height: 1.3; padding: 4px 6px; background: rgba(8, 3, 18, .55); border: 1px solid #2b1848; word-break: break-word; }
#chatLog li { padding: 1px 0; }
#chatLog li b { color: var(--light); }
#chatLog li em { font-style: normal; color: var(--gold); }
#chatLog li.mine b { color: var(--gold); }
#chatLog li.none { color: var(--soft); opacity: .7; }
#chatForm { display: flex; flex-wrap: wrap; gap: 4px; }
#chatForm input { flex: 1 1 90px; min-width: 0; min-height: 32px; padding: 2px 8px; font: inherit; font-size: 13px; color: var(--text); background: #0d0518; border: 2px solid var(--line); }
#chatForm button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.gemTabs { display: flex; gap: 6px; margin: 8px 0; }
.gemTabs [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }

/* Gear and tome cards: short, with buttons that fit */
.grid.gearGrid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.item { gap: 6px; padding: 10px; min-width: 0; }
.item .head { align-items: flex-start; gap: 8px; }
.item .grow { min-width: 0; flex: 1; }
.item h3 { overflow-wrap: anywhere; }
.gs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 10px; font-size: 13px; line-height: 1.3; }
.gs li { display: flex; justify-content: space-between; gap: 4px; min-width: 0; }
.gs i { font-style: normal; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs b { white-space: nowrap; }
.item .tag { color: var(--soft); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btns button, .item button.wide, .drawer button { min-height: 34px; padding: 3px 8px; font-size: 13px; line-height: 1.15; }
.btns button { flex: 1 1 70px; display: grid; justify-items: center; align-content: center; gap: 0; }
.btns small, .drawer small { font: 400 11px "Segoe UI", system-ui, sans-serif; color: var(--soft); }
.item button.wide { width: 100%; }
.drawer { display: grid; gap: 5px; }
.drawer button { display: grid; justify-items: start; text-align: left; gap: 0; width: 100%; }
.trow { display: grid; gap: 4px; padding: 4px 0; border-top: 1px solid #2b1848; }
.how { font-size: 13px; }
.how summary { cursor: pointer; color: var(--soft); }
.how p { margin-top: 6px; }
#chatHost .chat { height: min(62vh, 560px); }
@media (max-width: 640px) {
  #purse { flex-wrap: wrap; }
  .chip { flex: 1 1 28%; }
  .stage { flex-wrap: wrap; }
  #auto { white-space: nowrap; }
}

/* Expeditions */
.dgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.dg { display: grid; gap: 2px; text-align: left; justify-items: start; padding: 8px 10px; min-height: 0; font-weight: 400; }
.dg b { color: var(--gold); font-family: var(--title); font-size: 16px; }
.dg span { font-size: 13px; }
.dg small { color: var(--soft); font-size: 12px; }
.dg.on { border-color: var(--gold); background: linear-gradient(#5f2c9c, #2b1150); }
.tripRow, .tripPool { display: flex; flex-wrap: wrap; gap: 8px; }
.tripHero { display: grid; justify-items: center; gap: 1px; padding: 4px 6px; background: #170a28; border: 2px solid var(--r); min-width: 58px; }
.tripHero small { font-size: 11px; color: var(--r); font-weight: 700; }
.tripPool > button { display: grid; justify-items: center; gap: 0; padding: 3px; min-height: 0; background: none; border: 2px solid transparent; font-weight: 400; }
.tripPool > button.on { border-color: var(--gold); background: rgba(240, 196, 99, .14); }
.needs { margin: 4px 0; padding-left: 18px; list-style: disc; font-size: 14px; }

/* Boss Raid */
.diff { display: inline-block; margin-left: 6px; padding: 1px 8px; font: 700 12px "Segoe UI", system-ui, sans-serif; color: #12071f; background: var(--r, var(--gold)); vertical-align: middle; }

.pickH { display: flex; align-items: center; gap: 8px; text-align: left; padding: 4px 8px; min-height: 0; font-weight: 400; border: 2px solid transparent; background: #170a28; }
.pickH.on { border-color: var(--gold); background: rgba(240, 196, 99, .14); }
.pickH b { color: var(--r); }
.raidPool { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.evB { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.evB b { font-size: 12px; color: var(--soft); }
.evB.killed b { color: #6fd07a; } .evB.failed b { color: var(--bad); }
.dot { width: 8px; height: 8px; } .d-easy { background: #6fd07a; } .d-normal { background: #f0c463; } .d-hard { background: #ff6a5a; }

.clock { font-variant-numeric: tabular-nums; color: var(--gold); }
.cool { font-size: 17px; }

/* PvP and the rankings */
.mini { display: inline-block; border: 2px solid var(--r); background: #170a28; line-height: 0; }
.mini .face { background-color: transparent; }
.opp { border-left: 4px solid #5f2c9c; }
.win { color: #6fd07a; }
.plain { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
.tabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }

.pcard:disabled { opacity: 1; cursor: default; } /* a card that has been turned is not faded like a button you cannot press */

/* ===== The look: gold frames with studs, red banner headings, portraits, and smooth motion ===== */
:root { --gold: #f6c04f; --edge: #8a6a32; --cream: #ffe7a3; --banner: linear-gradient(#b52a1d, #7c160f); --frameRing: 0 0 0 2px #2a1708, 0 0 0 4px var(--edge), 0 0 0 5px #f6c04f88, 0 0 0 7px #1a0d06; }
body { background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(120, 50, 190, .28), transparent 70%), radial-gradient(circle at 8% 4%, rgba(255, 150, 60, .12), transparent 30%), radial-gradient(circle at 92% 4%, rgba(255, 150, 60, .12), transparent 30%), repeating-linear-gradient(0deg, #0b0516 0 38px, #07030e 38px 40px), repeating-linear-gradient(90deg, transparent 0 76px, #07030e 76px 78px), #0b0516; }
.side, .events, .over { position: relative; background: linear-gradient(180deg, #24123c, #140a24 60%, #0f0719); box-shadow: var(--frameRing), 0 10px 30px rgba(0, 0, 0, .6), inset 0 0 0 1px #f6c04f33, inset 0 0 40px rgba(0, 0, 0, .5); margin: 7px; padding: 0 10px 10px; overflow: visible; }
.side::before, .side::after, .events::before, .events::after, .over::before, .over::after { content: ""; position: absolute; top: -9px; width: 14px; height: 14px; z-index: 2; pointer-events: none; background: radial-gradient(circle, #fff6c8 0 2px, #f6c04f 3px 4px, #8a5a1a 5px 6px, transparent 7px); }
.side::before, .events::before, .over::before { left: -9px; }
.side::after, .events::after, .over::after { right: -9px; }
.side h3, .events h3, .over h3 { margin: 0 -10px 8px; padding: 7px 12px 6px; text-align: center; justify-content: center; gap: 10px; font-size: 17px; letter-spacing: .5px; color: var(--cream); text-shadow: 0 2px 0 #3a0a05; background: var(--banner); box-shadow: inset 0 2px #e05a44, inset 0 -2px #4d0c08, 0 2px 0 var(--edge); }
.side h3 span { color: #fff; background: #4d0c08; padding: 0 6px; }
.chip { background: linear-gradient(#1d0f31, #0d0618); border: 0; box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--edge), inset 0 1px #f6c04f33; padding: 6px 14px 6px 8px; transition: filter .15s, transform .15s; }
button.chip:hover { filter: brightness(1.2); transform: translateY(-1px); }
.chip b { color: var(--cream); }
.chip svg { filter: drop-shadow(0 2px 0 #000); }
#purse { gap: 14px; }
.me { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; background: linear-gradient(#1d0f31, #0d0618); box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--edge); }
.me .face { flex: none; width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--gold); background-color: #3a1e5e; }
.me b { display: block; font: 700 15px/1.1 var(--title); color: var(--cream); }
.me small { color: var(--soft); font-size: 11px; white-space: nowrap; }
.frame { box-shadow: 0 0 0 3px #19131e, 0 0 0 7px #514957, 0 0 0 8px #897f90, 0 0 0 11px #251d2b, 0 0 32px rgba(150, 70, 230, .26), 0 12px 28px rgba(0, 0, 0, .5); }
.side, .events, .over { --frameRing: 0 0 0 2px #221925, 0 0 0 4px #514957, 0 0 0 5px #817586, 0 0 0 7px #1a141e; }
.frame::before, .frame::after { content: ""; position: absolute; top: -16px; width: 26px; height: 26px; z-index: 3; pointer-events: none; background: radial-gradient(circle, #ffd9f7 0 3px, #c04cff 4px 6px, #f6c04f 7px 9px, #6a4210 10px 11px, transparent 12px); }
.frame::before { left: -16px; }
.frame::after { right: -16px; }
.hud { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; margin: 14px 4px 0; padding: 6px 12px; background: linear-gradient(#1d0f31, #0f0719); box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--edge); }
#guide { grid-column: 1 / -1; margin: 0; }
#autoNote { display: none; }
#count { justify-self: end; font: 700 18px var(--title); }
#earned { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 22px; font-size: 13px; border-top: 1px solid #3d2560; padding-top: 4px; }
#earned:empty { display: none; }
#earned b { color: var(--cream); }
#earned .full b { color: var(--bad); }
.stage b { font-size: 18px; }
#auto[aria-pressed="true"] { background: linear-gradient(#ffd877, #d99a2b); box-shadow: inset 0 -2px #8a5a1a; }
#dock { gap: 12px; }
#dock button { position: relative; background: linear-gradient(180deg, #3a2160 0, #241240 55%, #160a28 100%); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px var(--edge), inset 0 2px #f6c04f55, inset 0 -3px #0b0516, 0 8px 16px rgba(0, 0, 0, .5); transition: transform .15s ease-out, box-shadow .15s ease-out, filter .15s; }
#dock button span { font-family: var(--title); color: var(--cream); text-shadow: 0 2px 0 #000; }
#dock button svg { filter: drop-shadow(0 3px 0 #0b0516); transition: transform .2s ease-out; }
#dock button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 0 0 2px #201822, 0 0 0 4px #857b8d, inset 0 2px #c1aec344, 0 6px 12px rgba(0, 0, 0, .4); }
#dock button[aria-expanded="true"] { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px var(--gold), inset 0 2px #f6c04f88, 0 0 18px rgba(246, 192, 79, .45); }
#dock .mark { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 5px; z-index: 2; font: 700 12px/22px "Segoe UI", system-ui, sans-serif; color: #fff; text-align: center; text-shadow: none; background: linear-gradient(#ff5a42, #b51d12); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 10px rgba(255, 90, 66, .6); animation: markIn .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes markIn { from { transform: scale(0); } }
/* Boss Raid box */
.evState { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 0 7px; margin-bottom: 8px; padding: 5px; font-weight: 700; font-size: 14px; color: var(--soft); background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.evState small { grid-column: 1 / -1; text-align: center; font-weight: 400; font-size: 12px; color: var(--soft); }
.evState small b { color: var(--text); }
.evState i { width: 9px; height: 9px; background: var(--soft); }
.evState.on { color: #45d483; box-shadow: inset 0 0 0 1px #2a7a50; }
.evState.on i { background: #45d483; box-shadow: 0 0 8px #45d483; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.evTop { gap: 4px; margin-bottom: 8px; }
.evTop li.evB { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; padding: 5px 6px; font-size: 13px; background: #170a28; box-shadow: inset 3px 0 var(--d); }
.evB .ic { width: 26px; height: 26px; display: grid; place-items: center; font: 700 13px var(--title); color: var(--d); background: #0b0516; box-shadow: inset 0 0 0 1px var(--d); }
.evB small { display: block; font-size: 11px; color: var(--soft); }
.evB > b { color: var(--d); font-size: 12px; text-align: right; line-height: 1.2; }
.evB.killed, .evB.failed { opacity: .55; }
.events .go { width: 100%; min-height: 38px; border: 0; color: #fff3d4; font-family: var(--title); font-size: 16px; text-shadow: 0 2px 0 #4d0c08; background: linear-gradient(#c93525 50%, #a52318 50%); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), inset 0 2px #e8604a; animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), inset 0 2px #e8604a, 0 0 18px rgba(255, 100, 60, .65); } }
/* Squad and quests */
#tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 0; border: 0; }
#tally .pc { text-align: center; padding: 3px 0; font-size: 12px; font-weight: 400; color: var(--c); background: #0b0516; box-shadow: inset 0 -3px var(--c); }
#tally .pc b { display: block; color: #fff; font-size: 15px; }
#tally .pc.zero { opacity: .45; }
.over .figures { grid-template-columns: 1fr 1fr; }
.over .figures dd { font: 700 22px var(--title); color: var(--cream); text-shadow: 0 2px 0 #000; }
#sideQuests { display: grid; gap: 6px; align-content: start; }
#sideQuests li { background: linear-gradient(#22123a, #160a28); border: 0; box-shadow: inset 0 0 0 1px #3d2560; transition: box-shadow .2s; }
#sideQuests li.ready { box-shadow: inset 0 0 0 1px #45d48388, inset 3px 0 #45d483; }
#sideQuests li i { height: 6px; box-shadow: 0 0 0 1px #000; }
#sideQuests li.ready i::after { background: linear-gradient(#6ff0a6, #2a9d5a); }
#sideQuests li.ready button { background: linear-gradient(#3fc27a, #1f7f4a); border-color: #8ff0b8; animation: glowG 2s ease-in-out infinite; }
@keyframes glowG { 50% { box-shadow: 0 0 12px rgba(69, 212, 131, .7); } }
/* Chat */
#chatLog { background: #0b0516; border: 0; box-shadow: inset 0 0 0 1px #3d2560, inset 0 4px 14px rgba(0, 0, 0, .6); }
#chatTabs [aria-pressed="true"] { background: var(--banner); color: var(--cream); border-color: var(--gold); }
#chatLog li.news { color: var(--gold); font-style: italic; animation: fadeIn .4s ease-out; }
#chatLog li.news.mythic { color: #ff6b6b; }
#chatLog li.news.legendary { color: #ffb35c; }
#chatLog li.news.raid { color: #7fe3ab; }
/* Hero cards; on wide screens a grid of portraits */
#cards li { position: relative; transition: transform .15s ease-out, filter .15s; }
#cards li:hover { transform: translateY(-2px); filter: brightness(1.15); }
#cards.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; gap: 5px; padding: 3px 2px 2px; align-content: start; }
#cards.grid li:not(.none) { flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px 3px; border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--r) 28%, #1d0f33), #140a24 75%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r) 70%, #000), inset 0 0 0 3px #0b0516, 0 3px 0 #07030c; }
#cards.grid li:hover { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 0 3px #0b0516, 0 0 14px color-mix(in srgb, var(--r) 55%, transparent); }
#cards.grid li > div { display: block; width: 100%; }
#cards.grid b, #cards.grid .rar, #cards.grid .rar + .num { display: none; }
#cards.grid li > div > .num:first-of-type { position: absolute; top: 2px; right: 3px; font: 700 10px/13px "Segoe UI", system-ui, sans-serif; color: #fff; background: #0b0516cc; padding: 0 3px; }
#cards.grid li[data-r]::after { content: attr(data-r); position: absolute; left: 3px; top: 2px; padding: 0 3px; font: 700 9px/13px "Segoe UI", system-ui, sans-serif; color: #12061d; background: var(--r); }
#cards.grid .bar { height: 5px; margin: 0; box-shadow: 0 0 0 1px #000; }
#cards.grid .bar i { background: repeating-linear-gradient(90deg, #45d483 0 6px, #2a9d5a 6px 7px); }
#cards.grid em { display: none; }
#cards.grid .down em { display: block; top: -30px; bottom: auto; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#cards.grid .down .bar { overflow: visible; }
#cards.grid .down .bar i { background: #8875b9; }
@media (prefers-reduced-motion: no-preference) {
  #cards .bar i, .track i { transition: width .15s linear; }
}
/* Panels, dialogs and notes come in softly */
#panel:not([hidden]) { animation: panelIn .22s cubic-bezier(.2, .8, .3, 1); }
dialog[open] { animation: panelIn .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.toast { animation: toastIn .3s cubic-bezier(.2, .8, .3, 1); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes fadeIn { from { opacity: 0; } }
button { transition: filter .15s, border-color .15s, background-color .15s; }
button:hover:not(:disabled) { filter: brightness(1.1); }
@media (max-width: 640px) { .me small { display: none; } .side, .events, .over { margin: 5px; } }
@media (max-height: 480px) and (min-aspect-ratio: 11 / 10) { .me { display: none; } }
@media (prefers-reduced-motion: reduce) { #panel:not([hidden]), dialog[open], .toast, #dock .mark, .evState.on i, .events .go, #sideQuests li.ready button, #chatLog li.news { animation: none; } }

/* The money bar: every chip is a button (withdraw, buy Gems, or the forge for materials) */
#purse .chip { position: relative; cursor: pointer; font: inherit; font-size: 14px; color: var(--soft); min-height: 0; border: 0; border-radius: 0; background: linear-gradient(#34205a, #1c0f33 55%, #120822); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--edge), inset 0 2px #f6c04f55, inset 0 -3px #0b0516, 0 4px 0 #07030c; transition: transform .12s ease-out, box-shadow .12s, filter .12s; }
#purse .chip::after { content: attr(data-hint); margin-left: 4px; padding: 0 6px; font: 700 12px/18px "Segoe UI", system-ui, sans-serif; color: #1a0608; background: linear-gradient(#ffd877, #d99a2b); box-shadow: inset 0 -2px #8a5a1a; }
#purse .chip:hover { transform: translateY(-2px); filter: brightness(1.15); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), inset 0 2px #f6c04f88, inset 0 -3px #0b0516, 0 6px 0 #07030c, 0 0 14px rgba(246, 192, 79, .35); }
#purse .chip:active { transform: translateY(2px); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), inset 0 2px #0b0516, 0 1px 0 #07030c; }
@media (max-width: 640px) { #purse .chip::after { display: none; } }

/* The fuse confirmation */
.fuseList { margin: 8px 0; display: grid; gap: 2px; }
.fuseCost { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 10px 0 12px; padding: 10px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.fuseCost dd { font-size: 19px; }
.qual { font-weight: 700; }

/* Heroes panel: cards that open on a click, a compact portrait view, and filters */
.heroFilters { gap: 8px; align-items: center; }
.heroFilters select { min-height: 38px; padding: 4px 10px; }
.viewSwitch { display: inline-flex; }
.viewSwitch button { min-height: 38px; padding: 4px 12px; }
.viewSwitch [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }
.fuseBtn { position: relative; }
.dotMark { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; background: #ff5a42; box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold); }
.heroGrid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.hc { grid-template-rows: auto auto auto 1fr; border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--r) 16%, #22103a), #150826 55%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r) 55%, #12061d), 0 4px 0 #07030c; transition: transform .15s ease-out, box-shadow .15s, filter .15s; }
.hc:hover, .hc:focus-visible { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--r), 0 0 16px color-mix(in srgb, var(--r) 45%, transparent), 0 6px 0 #07030c; }
.hc.in { background: linear-gradient(180deg, color-mix(in srgb, var(--r) 22%, #33185a), #1c0c33 60%); box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 #07030c; }
.hcMid { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.hcMid .hmarks { flex: 1; margin: 0; }
.hcTop { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.hcPort { position: relative; padding: 3px; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--r) 35%, transparent), #12061d 75%); box-shadow: inset 0 0 0 2px var(--r), 0 0 10px color-mix(in srgb, var(--r) 40%, transparent); }
.hcPort .face { display: block; }
.hcLv { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 0 5px; font: 700 11px/15px "Segoe UI", system-ui, sans-serif; color: #fff; white-space: nowrap; background: #0b0516; box-shadow: 0 0 0 1px var(--r); }
.hcName { min-width: 0; }
.hcName h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcName .rar { color: var(--r); font-weight: 700; font-size: 14px; }
.hcCp { font: 700 16px var(--title); color: var(--cream, #ffe7a3); }
.hcCp small { font: 400 11px "Segoe UI", system-ui, sans-serif; color: var(--soft); }
.hcToggle { min-height: 30px; padding: 2px 9px; font-size: 12px; }
.hcToggle.on { border-color: #6a3a3a; color: #ffb0a0; }
.hmarks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.hm { font-size: 11px; padding: 1px 6px; color: var(--soft); background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.hm.sq { color: #1a0608; background: var(--gold); box-shadow: none; font-weight: 700; }
.hm.away { color: #8fdcff; box-shadow: inset 0 0 0 1px #2c6a8a; }
.hm.up { color: #45d483; box-shadow: inset 0 0 0 1px #2a7a50; font-weight: 700; }
.hc .stats { align-self: end; padding-top: 6px; border-top: 1px solid #2c1d44; font-size: 13px; }
.htGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.ht { position: relative; display: grid; place-items: center; min-height: 0; padding: 6px 2px 4px; border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--r) 28%, #1d0f33), #140a24 75%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r) 70%, #000), 0 3px 0 #07030c; transition: transform .15s ease-out, box-shadow .15s; }
.ht:hover, .ht:focus-visible { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--r), 0 0 12px color-mix(in srgb, var(--r) 50%, transparent); }
.ht.in { box-shadow: inset 0 0 0 2px var(--gold), 0 3px 0 #07030c; }
.htR { position: absolute; left: 3px; top: 2px; padding: 0 3px; font: 700 9px/13px "Segoe UI", system-ui, sans-serif; color: #12061d; background: var(--r); }
.htLv { position: absolute; right: 3px; top: 2px; padding: 0 3px; font: 700 10px/13px "Segoe UI", system-ui, sans-serif; color: #fff; background: #0b0516cc; }
.htS { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font-size: 9px; color: var(--gold); text-shadow: 0 1px 0 #000; }
.htIn { position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px; background: var(--gold); }
.htUp { position: absolute; left: 3px; bottom: 1px; font-size: 11px; color: #45d483; text-shadow: 0 1px 0 #000; }
.hc[data-act] { cursor: pointer; }
/* The heroes list in groups: in the squad, away, not used */
.heroGroup { display: grid; gap: 8px; }
.hgHead { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 16px; color: var(--cream, #ffe7a3); background: linear-gradient(90deg, rgba(246, 192, 79, .22), transparent 70%); box-shadow: inset 3px 0 var(--gold); }
.hgHead .num { padding: 0 7px; font: 700 13px/20px "Segoe UI", system-ui, sans-serif; color: #1a0608; background: var(--gold); }
.heroGroup.away .hgHead { background: linear-gradient(90deg, rgba(143, 220, 255, .18), transparent 70%); box-shadow: inset 3px 0 #8fdcff; color: #8fdcff; }
.heroGroup.away .hgHead .num { background: #8fdcff; }
.heroGroup.idle .hgHead { background: linear-gradient(90deg, rgba(198, 183, 224, .14), transparent 70%); box-shadow: inset 3px 0 var(--soft); color: var(--soft); }
.heroGroup.idle .hgHead .num { background: var(--soft); }
.heroGroup.idle .hc:not(:hover):not(:focus-visible), .heroGroup.idle .ht:not(:hover):not(:focus-visible) { filter: saturate(.75) brightness(.92); }
.hm.idle { color: var(--soft); box-shadow: inset 0 0 0 1px #5a4a78; }

/* Inventory: quality as a small bar */
.qual { position: relative; height: 16px; margin-top: 4px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; overflow: hidden; }
.qual span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--q) 35%, transparent), color-mix(in srgb, var(--q) 70%, transparent)); }
.qual b { position: relative; display: block; padding: 0 6px; font: 700 11px/16px "Segoe UI", system-ui, sans-serif; color: #fff; text-shadow: 0 1px 1px #000; }
/* Market: room for the price */
input[data-set="sellPrice"] { width: 170px; }
/* Expeditions: can the spare heroes go? */
.dg em { font-style: normal; font-size: 12px; font-weight: 700; margin-top: 3px; }
.dg.can em { color: #45d483; }
.dg.cannot em { color: var(--soft); }
.dg.cannot:not(.on) { opacity: .72; }
/* PvP: opponents side by side */
.opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.opps .opp { margin: 0; }

/* Boss Raid: the three bosses side by side, each on its own lit stage */
.raidcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.raidcard { display: grid; grid-template-rows: auto 1fr; background: linear-gradient(#22123a, #140a24); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px color-mix(in srgb, var(--r) 55%, var(--edge)), 0 10px 24px rgba(0, 0, 0, .5); margin: 4px; transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s; }
.raidcard:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px var(--r), 0 0 22px color-mix(in srgb, var(--r) 40%, transparent), 0 14px 28px rgba(0, 0, 0, .55); }
.rcStage { position: relative; height: 200px; display: grid; place-items: end center; overflow: hidden; background: radial-gradient(ellipse 55% 16% at 50% 90%, color-mix(in srgb, var(--r) 55%, transparent), transparent), radial-gradient(ellipse 70% 60% at 50% 70%, rgba(150, 70, 230, .35), transparent), linear-gradient(#2c1650, #0e0519); border-bottom: 2px solid color-mix(in srgb, var(--r) 60%, #000); }
.rcStage .bossart { width: 100%; height: 100%; border: 0; background: none; padding-bottom: 12px; }
.rcStage .bossart span { animation: rcBob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .6)); }
@keyframes rcBob { 50% { transform: translateY(-4px); } }
.rcDiff { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 2px 10px; font: 700 12px/18px "Segoe UI", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .5px; color: #12071f; background: var(--r); box-shadow: 0 0 0 2px #1a0d06; }
.rcLv { position: absolute; right: 8px; top: 8px; z-index: 1; padding: 2px 8px; font: 700 12px/18px "Segoe UI", system-ui, sans-serif; color: #fff; background: #0b0516cc; box-shadow: inset 0 0 0 1px #3d2560; }
.rcDone { position: absolute; inset: auto 0 40% 0; z-index: 1; text-align: center; font: 700 26px var(--title); letter-spacing: 2px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 #000, 0 0 12px #000; transform: rotate(-8deg); }
.raidcard.won .rcDone { color: #7fe3ab; } .raidcard.lost .rcDone { color: var(--bad); }
.raidcard.won .bossart span, .raidcard.lost .bossart span { filter: grayscale(1) brightness(.55); animation: none; }
.rcBody { display: grid; gap: 7px; align-content: start; padding: 10px 14px 12px; text-align: center; }
.rcBody h3 { font-size: 22px; color: var(--cream, #ffe7a3); }
.rcSkill { font-size: 13px; color: var(--soft); }
.rcSkill b { display: block; color: var(--r); font-size: 14px; }
.rcFacts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.rcFacts div { padding: 4px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.rcFacts dt { font-size: 11px; color: var(--soft); }
.rcFacts dd { margin: 0; font-weight: 700; }
.rcPay { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.rcPay span { padding: 2px 10px; font-weight: 700; font-size: 13px; color: var(--cream, #ffe7a3); background: rgba(246, 192, 79, .12); box-shadow: inset 0 0 0 1px rgba(246, 192, 79, .5); }
.rcGo { width: 100%; }
.rcNote { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .rcStage .bossart span { animation: none; } }
.raidLoot { display: grid; gap: 3px; margin: 6px 0 4px; }

/* The shop and skins */
.shopGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.skinCard { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 12px 10px; background: linear-gradient(#22123a, #140a24); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--edge); transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s; }
.skinCard:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 18px rgba(246, 192, 79, .3); }
.skinCard.royal { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 16px rgba(192, 76, 255, .35); }
.skinCard.royal::before { content: "Royal"; position: absolute; top: 6px; right: 6px; padding: 0 6px; font: 700 10px/16px "Segoe UI", system-ui, sans-serif; color: #12071f; background: linear-gradient(#ffd877, #d99a2b); }
.skinArt { width: 150px; height: 150px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 65%, rgba(150, 70, 230, .45), #0e0519 72%); box-shadow: inset 0 0 0 2px #3d2560; }
.skinCard.royal .skinArt { background: radial-gradient(circle at 50% 65%, rgba(246, 192, 79, .4), #0e0519 72%); animation: royalGlow 2.6s ease-in-out infinite; }
@keyframes royalGlow { 50% { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 22px rgba(246, 192, 79, .5); } }
.bodyArt { display: block; background-position: 0 0; background-repeat: no-repeat; image-rendering: pixelated; transform: scale(2); transform-origin: 50% 100%; }
.skinArt { place-items: end center !important; padding-bottom: 6px; }
.skinCard h3 { font-size: 16px; }
.skinCard button { width: 100%; min-height: 36px; }
.skinOwned { font-weight: 700; color: #45d483; }
.skinCard.owned { opacity: .85; }
.skinPick { display: flex; flex-wrap: wrap; gap: 8px; }
.skinOpt { display: grid; justify-items: center; gap: 2px; padding: 6px 10px; min-height: 0; font-size: 12px; }
.skinOpt.on { border-color: var(--gold); background: linear-gradient(#5f2c9c, #2b1150); }
@media (prefers-reduced-motion: reduce) { .skinCard.royal .skinArt { animation: none; } }

/* The shop, dressed up: light rays, twinkles, a shine, ribbons and gold prices */
.shopHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: linear-gradient(90deg, rgba(246, 192, 79, .16), transparent 70%); box-shadow: inset 3px 0 var(--gold); }
.shopHead h3 { font-size: 22px; color: var(--cream, #ffe7a3); }
.shopGems { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: #0b0516; box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--edge); }
.shopGems svg { width: 22px; height: 22px; }
.shopGems b { font-size: 18px; color: var(--cream, #ffe7a3); }
.shopGrid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.skinCard { overflow: hidden; padding: 10px 10px 12px; background: linear-gradient(170deg, #2e1850, #1a0d2e 55%, #120822); }
.skinCard h3 { font-size: 17px; letter-spacing: .5px; text-transform: uppercase; color: var(--cream, #ffe7a3); text-shadow: 0 2px 0 #000; }
.skinArt { position: relative; width: 100%; height: 160px; isolation: isolate; background: radial-gradient(circle at 50% 62%, rgba(150, 70, 230, .55), #120821 70%); }
.skinCard.royal .skinArt { background: radial-gradient(circle at 50% 62%, rgba(255, 196, 80, .55), rgba(120, 40, 200, .35) 45%, #120821 75%); }
.skinArt .rays { position: absolute; inset: -60%; z-index: -1; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 230, 160, .16) 0 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 58%); mask-image: radial-gradient(circle, #000 18%, transparent 58%); animation: rays 22s linear infinite; }
.skinCard.standard .skinArt .rays { opacity: .55; }
@keyframes rays { to { transform: rotate(360deg); } }
.skinArt .twinkle { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle at 18% 28%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 82% 22%, #ffe7a3 0 2px, transparent 3px), radial-gradient(circle at 74% 70%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 24% 76%, #f6c04f 0 2px, transparent 3px), radial-gradient(circle at 50% 14%, #fff 0 1px, transparent 2px); animation: twinkle 2.2s ease-in-out infinite; }
.skinCard.standard .skinArt .twinkle { opacity: .5; animation-duration: 3s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.03); } }
.skinArt .sweep { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 48%, rgba(255, 240, 190, .25) 52%, transparent 62%); mix-blend-mode: screen; transform: translateX(-120%); animation: sweep 3.4s ease-in-out infinite; }
.skinCard.standard .skinArt .sweep { display: none; }
.skinCard:hover .skinArt .sweep { display: block; animation-duration: 1.6s; }
@keyframes sweep { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.skinArt .bodyArt { position: relative; z-index: 1; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); animation: skinBob 2.6s ease-in-out infinite; }
.skinCard.royal .skinArt .bodyArt { filter: drop-shadow(0 0 6px rgba(255, 210, 110, .75)) drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
@keyframes skinBob { 50% { transform: scale(2) translateY(-2px); } }
.skinCard.royal::before { content: none; }
.skinCard .ribbon { position: absolute; top: 14px; right: -34px; z-index: 4; width: 130px; padding: 2px 0; text-align: center; transform: rotate(40deg); font: 800 11px/16px "Segoe UI", system-ui, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: #3a1a00; background: linear-gradient(#ffe48a, #e0a22e); box-shadow: 0 2px 0 #6a4210, 0 0 10px rgba(255, 200, 90, .6); }
.skinTags { display: flex; gap: 6px; justify-content: center; }
.skinTags span { padding: 1px 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--soft); background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.skinTags .t-royal { color: #ffd877; box-shadow: inset 0 0 0 1px #8a6a32; }
.soft { color: var(--soft); }
.buyGold { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; color: #3a1a00; background: linear-gradient(#ffe48a, #f0b53a 55%, #d48d1e); box-shadow: 0 0 0 2px #6a4210, inset 0 2px #fff3c4, inset 0 -3px #a86a14, 0 4px 0 #3a2208, 0 0 14px rgba(255, 190, 70, .35); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.buyGold svg { width: 20px; height: 20px; }
.buyGold b { font-size: 18px; }
.buyGold small { font-weight: 700; font-size: 11px; opacity: .8; }
.buyGold:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); }
.buyGold:disabled { opacity: 1; filter: grayscale(.8) brightness(.7); }
.skinCard.owned .skinArt { filter: saturate(.85); }
.skinOwned { width: 100%; text-align: center; margin-top: 4px; padding: 6px 0; font-weight: 700; color: #45d483; background: rgba(69, 212, 131, .1); box-shadow: inset 0 0 0 1px rgba(69, 212, 131, .5); }
@media (prefers-reduced-motion: reduce) { .skinArt .rays, .skinArt .twinkle, .skinArt .sweep, .skinArt .bodyArt { animation: none; } }

/* The shop showcase and the auras */
.showcase { display: block; width: 100%; height: auto; aspect-ratio: 960 / 260; image-rendering: pixelated; box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px var(--edge), 0 0 0 5px #f6c04f88, 0 12px 30px rgba(0, 0, 0, .55); }
.skinArt .auraFloor { position: absolute; left: 50%; bottom: 4px; z-index: 0; width: 120px; height: 30px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, var(--aura) 0, color-mix(in srgb, var(--aura) 45%, transparent) 40%, transparent 70%); box-shadow: 0 0 0 2px color-mix(in srgb, var(--aura) 55%, transparent) inset; mix-blend-mode: screen; animation: auraPulse 2s ease-in-out infinite; }
.skinCard.standard .skinArt .auraFloor { opacity: .7; }
@keyframes auraPulse { 50% { transform: translateX(-50%) scale(1.12); opacity: .75; } }
.skinCard { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--edge), inset 0 0 30px rgba(0, 0, 0, .4); }
.skinCard.royal { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 18px rgba(255, 190, 80, .3); }
.skinCard:hover .skinArt .auraFloor { animation-duration: .9s; }
@media (prefers-reduced-motion: reduce) { .skinArt .auraFloor { animation: none; } }

/* Skins that shine: the hero glows in its colour, stars pop around it */
.skinArt .bodyArt { filter: drop-shadow(0 0 3px var(--aura)) drop-shadow(0 0 8px var(--aura)) drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); animation: skinBob 2.6s ease-in-out infinite, skinGlow 1.8s ease-in-out infinite; }
.skinCard.royal .skinArt .bodyArt { filter: drop-shadow(0 0 4px #fff6d0) drop-shadow(0 0 10px var(--aura)) drop-shadow(0 0 22px var(--aura)); }
@keyframes skinGlow { 50% { filter: drop-shadow(0 0 5px #fff6d0) drop-shadow(0 0 14px var(--aura)) drop-shadow(0 0 28px var(--aura)); } }
.skinArt::after { content: ""; position: absolute; left: 50%; bottom: 0; z-index: 0; width: 70px; height: 150px; transform: translateX(-50%); background: linear-gradient(transparent, color-mix(in srgb, var(--aura) 45%, transparent)); mix-blend-mode: screen; pointer-events: none; }
.skinArt .auraFloor { background: radial-gradient(ellipse, #fff 0, var(--aura) 18%, color-mix(in srgb, var(--aura) 55%, transparent) 45%, transparent 70%); box-shadow: 0 0 18px 4px color-mix(in srgb, var(--aura) 60%, transparent); }
.skinArt .stars { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.skinArt .stars b { position: absolute; width: 14px; height: 14px; background: radial-gradient(circle, #fff 0 1.5px, transparent 2.5px), linear-gradient(#fff, #fff) center / 2px 100% no-repeat, linear-gradient(#fff, #fff) center / 100% 2px no-repeat; filter: drop-shadow(0 0 4px var(--aura)) drop-shadow(0 0 2px #fff); opacity: 0; animation: starPop 2.4s ease-in-out infinite; }
.skinArt .stars b:nth-child(1) { left: 22%; top: 24%; animation-delay: 0s; }
.skinArt .stars b:nth-child(2) { left: 72%; top: 18%; animation-delay: .5s; }
.skinArt .stars b:nth-child(3) { left: 80%; top: 58%; animation-delay: 1s; transform: scale(.7); }
.skinArt .stars b:nth-child(4) { left: 16%; top: 64%; animation-delay: 1.5s; }
.skinArt .stars b:nth-child(5) { left: 48%; top: 8%; animation-delay: 1.9s; transform: scale(.6); }
.skinCard.standard .skinArt .stars b:nth-child(n+4) { display: none; }
@keyframes starPop { 0%, 60%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 75% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
.skinCard.royal .skinArt .sweep { background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .8) 47%, rgba(255, 240, 190, .45) 53%, transparent 64%); animation-duration: 2.6s; }
.showcase { filter: saturate(1.15) brightness(1.05); }
@media (prefers-reduced-motion: reduce) { .skinArt .bodyArt, .skinArt .stars b { animation: none; } }

.skinBonus { display: grid; gap: 2px; width: 100%; margin: 2px 0 4px; padding: 6px 8px; list-style: none; text-align: left; font-size: 12px; font-weight: 700; color: #7fe3ab; background: #0b0516; box-shadow: inset 0 0 0 1px #2a5a40; }
.skinCard.royal .skinBonus { color: #ffd877; box-shadow: inset 0 0 0 1px #8a6a32; }
.skinBonus li::before { content: "\25B2  "; font-size: 9px; }
.skinOpt small { max-width: 130px; font-weight: 400; font-size: 10px; color: #7fe3ab; line-height: 1.2; }

/* Skin bonuses as a small stat panel: a bar per bonus, coloured by stat */
.skinBonus { display: block; padding: 7px 8px 8px; color: var(--text); font-weight: 400; }
.skinBonus ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.skinBonus li { display: grid; grid-template-columns: minmax(0, 1fr) 54px auto; align-items: center; gap: 6px; font-size: 12px; }
.skinBonus li::before { content: none; }
.skinBonus li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); }
.skinBonus li i { height: 6px; background: #1d1230; box-shadow: inset 0 0 0 1px #000; position: relative; }
.skinBonus li i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c, #7fe3ab); box-shadow: 0 0 6px var(--c, #7fe3ab); }
.skinBonus li b { min-width: 34px; text-align: right; font-size: 12px; color: var(--c, #7fe3ab); }
.sb-atk { --c: #ff7a5c; } .sb-hp { --c: #45d483; } .sb-def { --c: #6fb4ff; } .sb-atkSpeed { --c: #8fe6ff; } .sb-critChance { --c: #ffd257; } .sb-critDmg { --c: #ffb24a; } .sb-recover { --c: #c9a0ff; } .sb-heal { --c: #ff9ad0; }
.sbHead { margin: 0 0 5px; font: 700 10px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--soft); }
.skinCard.royal .sbHead { color: #ffd877; }
.sbSpecial { margin: 6px 0 0; padding: 4px 6px; font-size: 11px; font-weight: 700; color: #ffe7a3; background: linear-gradient(90deg, rgba(246, 192, 79, .25), transparent); box-shadow: inset 2px 0 var(--gold); text-align: left; }
.skinCard.royal .skinBonus { background: linear-gradient(#1a0d22, #0b0516); box-shadow: inset 0 0 0 1px #8a6a32, inset 0 0 14px rgba(246, 192, 79, .12); }
.shopGrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.skinCard { display: flex; flex-direction: column; align-items: center; }
.skinCard > * { flex: none; }
.skinCard .skinArt, .skinCard .skinBonus { align-self: stretch; }
.skinCard .buyGold, .skinCard .skinOwned { margin-top: auto; align-self: stretch; }
.skinCard .skinBonus { margin-bottom: 8px; }
.skinTags { align-items: center; }
.skinTags span { line-height: 16px; }

/* Starter packs */
.packs { display: grid; gap: 12px; padding: 14px; background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(246, 192, 79, .18), transparent 70%), linear-gradient(#2a1240, #140a24); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 4px var(--gold), 0 0 30px rgba(246, 192, 79, .25); }
.packsHead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.packsHead h3 { font-size: 26px; text-transform: uppercase; letter-spacing: 1px; color: #ffe7a3; text-shadow: 0 2px 0 #4d0c08, 0 0 14px rgba(246, 192, 79, .5); }
.packsHead p { color: var(--soft); }
.packsHead b { color: #ff8a6a; }
.packGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.packGrid .pack { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: linear-gradient(170deg, #34195a, #1a0d2e 60%, #120822); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--edge); transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s; }
.packGrid .pack:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 22px rgba(246, 192, 79, .35); }
.packGrid .pack.champion { box-shadow: 0 0 0 2px #1a0d06, 0 0 0 3px var(--gold), 0 0 26px rgba(255, 190, 80, .35); }
.packGrid .pack h3 { font-size: 20px; text-transform: uppercase; letter-spacing: .5px; color: #ffe7a3; text-shadow: 0 2px 0 #000; }
.packGrid .pack .ribbon { position: absolute; top: 16px; right: -38px; z-index: 3; width: 150px; padding: 3px 0; text-align: center; transform: rotate(40deg); font: 800 11px/16px "Segoe UI", system-ui, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; background: linear-gradient(#e0402c, #9e1d12); box-shadow: 0 2px 0 #4d0c08; }
.packGrid .pack.warband .ribbon { background: linear-gradient(#5aa8ff, #2c55b4); }
.packGrid .pack.champion .ribbon { color: #3a1a00; background: linear-gradient(#ffe48a, #e0a22e); box-shadow: 0 2px 0 #6a4210, 0 0 12px rgba(255, 200, 90, .6); }
.packArt { position: relative; isolation: isolate; height: 130px; display: flex; justify-content: center; align-items: flex-end; gap: 0; overflow: hidden; padding-bottom: 6px; background: radial-gradient(circle at 50% 70%, rgba(150, 70, 230, .5), #120821 72%); box-shadow: inset 0 0 0 1px #3d2560; }
.packGrid .pack.champion .packArt { background: radial-gradient(circle at 50% 70%, rgba(255, 196, 80, .55), rgba(120, 40, 200, .3) 50%, #120821 78%); }
.packArt .rays { position: absolute; inset: -80%; z-index: -1; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 230, 160, .16) 0 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 55%); mask-image: radial-gradient(circle, #000 15%, transparent 55%); animation: rays 24s linear infinite; }
.packArt .bodyArt { transform: scale(1.4); transform-origin: 50% 100%; margin: 0 -20px; filter: drop-shadow(0 0 6px rgba(255, 220, 140, .45)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.packGrid .pack.champion .packArt .bodyArt { filter: drop-shadow(0 0 8px rgba(255, 200, 90, .8)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.packGrid .pack .buyGold, .packGrid .pack .skinOwned { margin-top: auto; }
.packList { display: grid; gap: 3px; margin: 0; padding: 8px 10px; list-style: none; font-size: 13px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.packList li::before { content: "\2726  "; color: var(--gold); }
.packWorth { margin-top: auto; font-size: 13px; color: var(--soft); }
.packWorth s { opacity: .8; }
.packWorth b { margin-left: 4px; padding: 0 6px; color: #fff; background: #c0281d; }
.packGrid .pack.bought { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .packArt .rays { animation: none; } }
.packGrid .pack > * { min-width: 0; max-width: 100%; }
.packGrid .pack > p { overflow-wrap: anywhere; }

/* The castle wall behind the game (castle.js). On a very wide screen the game keeps the width its arena can use
   and the wall shows at the sides; elsewhere it shows in the gaps between panels. */
body { background: #08040f; }
.game { position: relative; z-index: 1; max-width: max(1280px, calc((100dvh - 250px) * 1.778 + 660px)); margin-inline: auto; }
.side, .events, .over { background: linear-gradient(180deg, rgba(36, 18, 60, .9), rgba(20, 10, 36, .93) 60%, rgba(15, 7, 25, .95)); }
.hud { background: linear-gradient(rgba(29, 15, 49, .9), rgba(15, 7, 25, .93)); }

/* The right column as three boxes: Squad, Quests (gold, so it is noticed) and Chat */
.over { background: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; overflow: visible; grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.over::before, .over::after { content: none !important; }
.over > div, .over > .sq, .over > .chat { position: relative; min-height: 0; margin: 7px; padding: 0 10px 10px; background: linear-gradient(180deg, rgba(36, 18, 60, .9), rgba(20, 10, 36, .93) 60%, rgba(15, 7, 25, .95)); box-shadow: 0 0 0 2px #221925, 0 0 0 4px #514957, 0 0 0 5px #817586, 0 0 0 7px #1a141e, 0 10px 30px rgba(0, 0, 0, .6), inset 0 0 0 1px #f6c04f22; }
.over > div::before, .over > div::after { content: ""; position: absolute; top: -9px; width: 14px; height: 14px; z-index: 2; pointer-events: none; background: radial-gradient(circle, #fff6c8 0 2px, #f6c04f 3px 4px, #8a5a1a 5px 6px, transparent 7px); }
.over > div::before { left: -9px; } .over > div::after { right: -9px; }
.over > .sq { display: grid; grid-template-rows: auto minmax(0, 1fr); box-shadow: 0 0 0 2px #2a1708, 0 0 0 4px var(--edge), 0 0 0 5px var(--gold), 0 0 0 7px #1a0d06, 0 0 22px rgba(246, 192, 79, .22), 0 10px 30px rgba(0, 0, 0, .6); }
.over > .sq.hasReady { animation: questCall 2.4s ease-in-out infinite; }
@keyframes questCall { 50% { box-shadow: 0 0 0 2px #2a1708, 0 0 0 4px var(--edge), 0 0 0 5px var(--gold), 0 0 0 7px #1a0d06, 0 0 34px rgba(69, 212, 131, .45), 0 10px 30px rgba(0, 0, 0, .6); } }
.over > .sq h3 { background: linear-gradient(#c9922a, #8a5a14); color: #fff3d4; box-shadow: inset 0 2px #ffd877, inset 0 -2px #5a3a0c, 0 2px 0 var(--edge); }
.qReady { margin-left: 6px; padding: 0 7px; font: 700 12px/18px "Segoe UI", system-ui, sans-serif; color: #fff; text-shadow: none; background: #2a9d5a; box-shadow: 0 0 0 1px #8ff0b8, 0 0 10px rgba(69, 212, 131, .7); }
.over > .chat { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 6px; }
.over > .chat .chatHead { margin-bottom: 2px; }
.chat .chatHead { display: none; }
.over > .chat .chatHead { display: flex; }
@media (prefers-reduced-motion: reduce) { .over > .sq.hasReady { animation: none; } }

/* Summon: how to pay, and the free heroes of x10 */
.payWith { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.payWith button { min-height: 32px; padding: 2px 12px; font-size: 13px; }
.payWith [aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a0608; }
.payNote { text-align: center; max-width: 60ch; margin: 0 auto 6px; }
/* The name plate opens the invite window */
.me { cursor: pointer; transition: filter .15s; }
.me:hover { filter: brightness(1.2); }
.inviteRow { gap: 8px; margin: 8px 0; }
.inviteRow input { flex: 1; min-width: 220px; width: auto; }

/* Gold action buttons, like Auto-advance, in the panels and dialogs. Toggles ([aria-pressed]), cards and pickers keep their own look. */
:is(#panel, dialog) button:not([aria-pressed]):not(.pcard):not(.ht):not(.skinOpt):not(.dg):not(.pick):not(.pickH):not(.buyGold):not(.go):not(.bigPlay):not([data-act="close"]):not(.hc *):not(.buys.big button):not(.chestCard) {
  color: #1a0608; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); border: 0;
  background: linear-gradient(#ffe08a, #f0b53a 55%, #d48d1e);
  box-shadow: 0 0 0 2px #6a4210, inset 0 2px #fff3c4, inset 0 -3px #a86a14, 0 3px 0 #2a1708;
  transition: transform .14s cubic-bezier(.2, .8, .3, 1), filter .14s, box-shadow .14s;
}
:is(#panel, dialog) button:not([aria-pressed]):not(.pcard):not(.ht):not(.skinOpt):not(.dg):not(.pick):not(.pickH):not(.buyGold):not(.go):not(.bigPlay):not([data-act="close"]):not(.hc *):not(.buys.big button):not(.chestCard):hover:not(:disabled) {
  transform: translateY(-2px); filter: brightness(1.08);
  box-shadow: 0 0 0 2px #6a4210, inset 0 2px #fff3c4, inset 0 -3px #a86a14, 0 5px 0 #2a1708, 0 0 14px rgba(246, 192, 79, .45);
}
:is(#panel, dialog) button:not([aria-pressed]):not(.pcard):not(.ht):not(.skinOpt):not(.dg):not(.pick):not(.pickH):not(.buyGold):not(.go):not(.bigPlay):not([data-act="close"]):not(.hc *):not(.buys.big button):not(.chestCard):active:not(:disabled) {
  transform: translateY(2px); box-shadow: 0 0 0 2px #6a4210, inset 0 2px #a86a14, 0 1px 0 #2a1708;
}
:is(#panel, dialog) button:not([aria-pressed]):not(.pcard):not(.ht):not(.skinOpt):not(.dg):not(.pick):not(.pickH):not(.buyGold):not(.go):not(.bigPlay):not([data-act="close"]):not(.hc *):not(.buys.big button):not(.chestCard):disabled { opacity: 1; filter: grayscale(.85) brightness(.6); }
:is(#panel, dialog) button small { color: inherit; opacity: .8; }
/* the panel's Close stays dark, so it reads apart from the actions */
#panel [data-act="close"] { transition: transform .14s, border-color .14s; }

/* Cards that move smoothly: they ease in when a panel opens, and lift on hover */
#panel .item, #panel .tome, #panel .hero, #panel .craft, #panel .skinCard, #panel .pack, #panel .raidcard {
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, border-color .2s, filter .2s;
}
#panel .item:hover, #panel .tome:not(.empty):hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--r), 0 0 18px color-mix(in srgb, var(--r) 40%, transparent), 0 8px 16px rgba(0, 0, 0, .45); }
#panel:not([hidden]) :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > * { animation: cardIn .32s cubic-bezier(.2, .8, .3, 1) backwards; }
#panel:not([hidden]) :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > :nth-child(2) { animation-delay: .03s; }
#panel:not([hidden]) :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > :nth-child(3) { animation-delay: .06s; }
#panel:not([hidden]) :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > :nth-child(4) { animation-delay: .09s; }
#panel:not([hidden]) :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > :nth-child(n+5) { animation-delay: .12s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
#panel .body { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { #panel :is(.grid, .gearGrid, .shopGrid, .packGrid, .raidcards, .htGrid, .opps) > * { animation: none !important; } #panel .body { scroll-behavior: auto; } }

/* Rarity you can see: every card of a rarity is lit in its colour; Epic glows, Legendary and Mythic shine */
[data-rar] { position: relative; overflow: hidden; isolation: isolate; }
.item[data-rar], .hc[data-rar] {
  border: 0;
  background: radial-gradient(ellipse 120% 70% at 50% -10%, color-mix(in srgb, var(--r) 30%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--r) 12%, #221038), #150826 70%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r) 80%, #000), inset 0 0 0 3px rgba(0, 0, 0, .55), inset 0 2px 14px color-mix(in srgb, var(--r) 22%, transparent), 0 4px 0 #07030c;
}
.item[data-rar] h3, .hc[data-rar] h3 { color: color-mix(in srgb, var(--r) 70%, #fff); text-shadow: 0 0 10px color-mix(in srgb, var(--r) 55%, transparent), 0 2px 0 #000; }
.hc[data-rar] .rar { display: inline-block; padding: 0 7px; color: #12061d; background: var(--r); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; box-shadow: 0 0 8px color-mix(in srgb, var(--r) 60%, transparent); }
/* the rarity strip along the top of the card */
.item[data-rar]::before, .hc[data-rar]::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; z-index: 0; background: linear-gradient(90deg, transparent, var(--r), transparent); }
[data-rar="epic"] { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 0 3px rgba(0, 0, 0, .55), inset 0 2px 18px color-mix(in srgb, var(--r) 30%, transparent), 0 0 14px color-mix(in srgb, var(--r) 35%, transparent), 0 4px 0 #07030c !important; }
[data-rar="legendary"], [data-rar="mythic"] { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 0 3px rgba(0, 0, 0, .55), inset 0 2px 22px color-mix(in srgb, var(--r) 38%, transparent), 0 0 20px color-mix(in srgb, var(--r) 50%, transparent), 0 4px 0 #07030c !important; }
[data-rar="mythic"] { animation: mythicPulse 2.4s ease-in-out infinite; }
@keyframes mythicPulse { 50% { box-shadow: inset 0 0 0 2px #ff8a7a, inset 0 0 0 3px rgba(0, 0, 0, .55), inset 0 2px 26px rgba(255, 77, 77, .5), 0 0 32px rgba(255, 77, 77, .7), 0 4px 0 #07030c; } }
/* a light that sweeps across Legendary and Mythic cards */
[data-rar="legendary"]::after, [data-rar="mythic"]::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 47%, color-mix(in srgb, var(--r) 35%, transparent) 52%, transparent 64%); mix-blend-mode: screen; transform: translateX(-130%); animation: rarSweep 3.8s ease-in-out infinite; }
[data-rar="mythic"]::after { animation-duration: 2.8s; }
@keyframes rarSweep { 0%, 50% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
/* the compact portraits too */
.ht[data-rar="legendary"], .ht[data-rar="mythic"] { box-shadow: inset 0 0 0 2px var(--r), 0 0 12px color-mix(in srgb, var(--r) 55%, transparent), 0 3px 0 #07030c; }
.ht[data-rar] > * { position: relative; z-index: 4; }
.ht[data-rar] .face { position: relative; z-index: 1; }
/* the squad beside the arena */
#cards.grid li[data-r="E"] { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 0 3px #0b0516, 0 0 10px color-mix(in srgb, var(--r) 40%, transparent); }
#cards.grid li[data-r="L"], #cards.grid li[data-r="M"] { box-shadow: inset 0 0 0 2px var(--r), inset 0 0 0 3px #0b0516, 0 0 14px color-mix(in srgb, var(--r) 60%, transparent); }
#cards.grid li[data-r="M"] { animation: mythicPulse 2.4s ease-in-out infinite; }
/* keep the card's content above the strip and the sweep's base */
.item[data-rar] > *, .hc[data-rar] > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { [data-rar="mythic"], #cards.grid li[data-r="M"] { animation: none; } [data-rar="legendary"]::after, [data-rar="mythic"]::after { animation: none; display: none; } }

/* Cards in a row are the same height, and their buttons line up along the bottom */
.grid { align-items: stretch; }
.grid > .item { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.grid > .item:not(.gear) > :last-child { margin-top: auto; }
.grid > .item.gear > .btns { margin-top: auto; }
.grid > .item > .row:first-child { align-items: flex-start; }

/* Tomes: rarity on the card frame and a pill, the tier as a badge (I to X), the level as five pips */
.rarPill { display: inline-block; padding: 0 7px; margin-right: 4px; font: 700 11px/17px "Segoe UI", system-ui, sans-serif; letter-spacing: .5px; text-transform: uppercase; color: #12061d; background: var(--r); box-shadow: 0 0 8px color-mix(in srgb, var(--r) 55%, transparent); }
.tIcon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; background: radial-gradient(circle, color-mix(in srgb, var(--ink, var(--r)) 40%, transparent), #0b0516 72%); box-shadow: inset 0 0 0 2px var(--r), 0 0 10px color-mix(in srgb, var(--r) 40%, transparent); }
.tIcon .slot { width: 32px; height: 32px; }
.grade { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; vertical-align: middle; }
.tier { display: inline-block; padding: 0 6px; font: 800 12px/18px var(--title); letter-spacing: .5px; color: #fff; text-shadow: 0 1px 0 #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 0 6px var(--tc); background: linear-gradient(var(--tc), color-mix(in srgb, var(--tc) 55%, #000)); }
.tier.t1 { --tc: #6d6a7a; } .tier.t2 { --tc: #8a6a44; } .tier.t3 { --tc: #9aa3b5; } .tier.t4 { --tc: #3c9a5a; } .tier.t5 { --tc: #3c7ad8; }
.tier.t6 { --tc: #8a4ad8; } .tier.t7 { --tc: #c9592a; } .tier.t8 { --tc: #d8a12a; } .tier.t9 { --tc: #e0402c; } .tier.t10 { --tc: #ff3a8a; }
.tier.t8, .tier.t9, .tier.t10 { animation: tierGlow 2s ease-in-out infinite; }
@keyframes tierGlow { 50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 14px var(--tc); } }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 8px; height: 8px; transform: rotate(45deg); background: #241634; box-shadow: inset 0 0 0 1px #4a3a64; }
.pips i.on { background: linear-gradient(135deg, #fff3c4, var(--gold)); box-shadow: 0 0 5px rgba(246, 192, 79, .7); }
.spare { margin-left: 2px; font-weight: 700; color: var(--cream, #ffe7a3); }
.tomeCard[data-rar] .trow { padding: 6px 0 0; border-top: 1px solid color-mix(in srgb, var(--r) 30%, transparent); }
.tome[data-rar] { border: 0; background: radial-gradient(ellipse 120% 70% at 50% -10%, color-mix(in srgb, var(--r) 28%, transparent), transparent 60%), linear-gradient(#22103a, #150826); box-shadow: inset 0 0 0 2px var(--r), 0 0 12px color-mix(in srgb, var(--r) 30%, transparent); }
@media (prefers-reduced-motion: reduce) { .tier.t8, .tier.t9, .tier.t10 { animation: none; } }
/* the description takes the spare room, so the grade rows and buttons of a row of cards line up */
.grid > .item > .row:first-child + p { flex: 1 1 auto; }
.tier { font-size: 13px; padding: 1px 8px; }
.usedBy { display: block; margin-top: 4px; color: var(--cream, #ffe7a3); font-weight: 600; }

.addSlots { min-height: 0 !important; margin-left: 6px; padding: 0 8px !important; font: 800 12px/20px "Segoe UI", system-ui, sans-serif; color: #1a0608; border: 0 !important; background: linear-gradient(#ffe08a, #d99a2b); box-shadow: 0 0 0 1px #6a4210, inset 0 -2px #a86a14; text-shadow: none; }
.addSlots:hover { filter: brightness(1.1); transform: translateY(-1px); }
/* a big squad fits as smaller portraits */
#cards.grid.many { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
#cards.grid.many .face { transform: scale(.85); }
/* bulk recycle and salvage */
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(11, 5, 22, .6); box-shadow: inset 0 0 0 1px #3d2560; }
.bulk b { color: var(--cream, #ffe7a3); }
.bulk select { min-height: 36px; padding: 2px 8px; }
/* the tome is just the book: no tile behind it */
.tIcon { width: auto; height: auto; background: none; box-shadow: none; }
.tIcon .slot { width: 40px; height: 40px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--r) 55%, transparent)) drop-shadow(0 2px 0 #000); }
/* Deployed heroes on one line, with room for the +5 button */
.side h3 { white-space: nowrap; font-size: 15px; gap: 6px; }
.grade .lvl { padding: 0 7px; font: 800 12px/18px "Segoe UI", system-ui, sans-serif; color: #1a0608; background: linear-gradient(#ffe08a, #d99a2b); box-shadow: inset 0 -2px #a86a14; }
.gear .tier { margin-left: 4px; vertical-align: middle; }

/* Boss Raid box: portraits, and the list fills the box */
.events { grid-template-rows: auto auto 1fr auto auto; align-content: stretch; }
.events .evTop { display: grid; grid-auto-rows: 1fr; gap: 6px; min-height: 0; }
.evTop li.evB { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 4px 6px 4px 4px; align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--d) 16%, #170a28), #170a28 70%); box-shadow: inset 3px 0 var(--d); }
.bp { position: relative; width: 64px; height: 64px; display: grid; place-items: end center; overflow: hidden; background: radial-gradient(ellipse 60% 30% at 50% 88%, color-mix(in srgb, var(--d) 45%, transparent), transparent), radial-gradient(circle at 50% 55%, rgba(150, 70, 230, .35), #0b0516 75%); box-shadow: inset 0 0 0 1px var(--d); }
.bp > span { display: block; flex: none; background-repeat: no-repeat; background-position: 0 0; image-rendering: pixelated; margin-bottom: 2px; }
.evB em { display: block; font-style: normal; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evB .dl { display: inline-block; margin: 2px 0; padding: 0 6px; font-size: 10px; line-height: 15px; letter-spacing: .5px; text-transform: uppercase; color: #12061d; background: var(--d); }
.evB small { display: block; font-size: 11px; color: var(--soft); line-height: 1.3; }
.evB .done { display: inline-block; margin-top: 2px; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--d); }
.evB.killed .bp > span, .evB.failed .bp > span { filter: grayscale(1) brightness(.6); }
.events .see { width: 100%; min-height: 34px; font-family: var(--title); font-size: 15px; color: #1a0608; border: 0; background: linear-gradient(#ffe08a, #d99a2b); box-shadow: 0 0 0 2px #6a4210, inset 0 -3px #a86a14; }
.evNote { margin: 0; text-align: center; }

/* Tomes toolbar: the bag, the filter and Recycle unused on one row */
.tomeBar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(11, 5, 22, .6); box-shadow: inset 0 0 0 1px #3d2560; }
.tomeBar .bag { flex: 1 1 200px; display: grid; gap: 4px; font-size: 13px; color: var(--soft); }
.tomeBar .bag b { color: var(--cream, #ffe7a3); font-size: 15px; }
.tomeBar .bag i { display: block; height: 6px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; position: relative; }
.tomeBar .bag i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: linear-gradient(90deg, #6fd07a, #f6c04f); }
.tomeBar .bag.full { color: var(--bad); }
.tomeBar .bag.full i::after { background: linear-gradient(90deg, #ff7a5c, #e0402c); }
.tomeBar select { min-height: 36px; padding: 2px 8px; }
.bulk.inline { padding: 0; background: none; box-shadow: none; }
.soft { color: var(--soft); }
.events { grid-template-rows: none; align-content: start; }
.events .evTop { grid-auto-rows: auto; gap: 4px; }
.evTop li.evB { grid-template-columns: 50px minmax(0, 1fr); padding: 3px 6px 3px 3px; }
.bp { width: 50px; height: 50px; }
.evB .dl { margin: 1px 6px 1px 0; }
.evB small { display: inline; }
.evB small { white-space: nowrap; }
.bp { width: 44px; height: 44px; }
.evTop li.evB { grid-template-columns: 44px minmax(0, 1fr); }
.events .evState { margin-bottom: 4px; padding: 3px; }

/* A panel in front: the rest of the screen dims (the dock stays usable to switch panels) */
.game::after { content: ""; position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, rgba(8, 3, 16, .45), rgba(3, 1, 7, .72)); opacity: 0; transition: opacity .22s ease-out; }
body.panelOpen .game::after { opacity: 1; }
#panel { z-index: 6; }
body.panelOpen #dock { position: relative; z-index: 6; }
body.panelOpen #dock button:not([aria-expanded="true"]) { filter: brightness(.6) saturate(.7); }
body.panelOpen #dock button:hover { filter: none; }
@media (prefers-reduced-motion: reduce) { .game::after { transition: none; } }

/* Fuse: the three heroes, the chance, and what they become, played out in one box */
dialog.fuseDlg { width: min(640px, calc(100vw - 24px)); text-align: center; }
dialog.fuseDlg h2 { transition: color .3s; }
.fStage { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 6px; padding: 18px 10px; background: radial-gradient(ellipse at 80% 50%, color-mix(in srgb, var(--to) 20%, transparent), transparent 55%), #0b0516; box-shadow: inset 0 0 0 1px #3d2560; position: relative; overflow: hidden; }
.fIn { display: flex; gap: 8px; }
.fHero { display: grid; justify-items: center; gap: 2px; width: 92px; transition: transform .9s cubic-bezier(.6, 0, .4, 1), opacity .9s ease-in, filter .9s; }
.fHero b { font-size: 13px; line-height: 1.2; }
.fHero > span { font-size: 11px; opacity: .8; }
.fRing { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--r) 30%, #140a24) 0%, #100820 70%); box-shadow: 0 0 0 2px var(--r), 0 0 14px color-mix(in srgb, var(--r) 55%, transparent); overflow: hidden; }
.fCore { width: 64px; height: 64px; flex: none; display: grid; place-content: center; border-radius: 50%; background: radial-gradient(circle, #3a1d5c, #170b2a); box-shadow: 0 0 0 2px #b77af2, 0 0 18px #8a3ad6aa; color: #fff; transition: transform .4s, box-shadow .4s; position: relative; z-index: 1; }
.fCore span { font-size: 18px; font-weight: 700; line-height: 1; }
.fCore small { font-size: 10px; opacity: .75; }
.fOut .mystery .fRing { background: radial-gradient(circle, color-mix(in srgb, var(--r) 35%, #140a24), #0c0618 75%); animation: fGlow 1.8s ease-in-out infinite; }
.fQ { font-size: 36px; font-weight: 800; color: var(--r); text-shadow: 0 0 12px var(--r); }
@keyframes fGlow { 50% { box-shadow: 0 0 0 2px var(--r), 0 0 26px var(--r); } }
/* while the server decides: the three are pulled into the core, which charges */
.fusing .fIn .fHero { transform: translate(var(--dx, 0), var(--dy, 0)) scale(.3); opacity: 0; filter: brightness(2.5); }
.fusing .fCore { animation: fCharge .5s ease-in-out infinite alternate; }
@keyframes fCharge { to { transform: scale(1.25); box-shadow: 0 0 0 3px #fff, 0 0 40px var(--to); } }
.fusing .fOut .fRing { animation-duration: .5s; }
/* what happened */
.won .fStage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 55% 50%, var(--to), transparent 45%); opacity: 0; animation: fFlash 1s ease-out; pointer-events: none; }
@keyframes fFlash { 15% { opacity: .85; } to { opacity: 0; } }
.won .fCore { box-shadow: 0 0 0 2px var(--gold), 0 0 22px var(--gold); color: var(--gold); }
.fHero.born { width: 120px; animation: fBorn .7s cubic-bezier(.2, 1.6, .4, 1); }
.fHero.born .fRing { width: 100px; height: 100px; box-shadow: 0 0 0 3px var(--r), 0 0 30px var(--r); animation: fGlow 1.6s ease-in-out infinite; }
.fHero.born b { color: var(--r); font-size: 15px; }
@keyframes fBorn { from { transform: scale(.2); opacity: 0; } }
.lost .fStage { animation: fShake .45s; }
.lost .fCore { box-shadow: 0 0 0 2px #c0392b, 0 0 18px #c0392b; color: #ff8a7a; }
.fHero.back { animation: fBorn .5s ease-out; }
.fHero.back .fRing { filter: saturate(.6); }
@keyframes fShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.fNote { margin-top: 8px; }
.done .fIn { display: none; }
.done .fStage { gap: 22px; padding: 22px 10px; background: radial-gradient(ellipse at 55% 50%, color-mix(in srgb, var(--to) 22%, transparent), transparent 55%), #0b0516; }
.fuseDlg .fBtns { margin-top: 12px; }
[data-act="fuseNow"].ready { animation: fReady 1.4s ease-in-out infinite; }
@keyframes fReady { 50% { box-shadow: 0 0 16px #ffd35a; } }
@media (max-width: 560px) { .fStage { flex-wrap: wrap; } .fHero { width: 76px; } .fRing { width: 62px; height: 62px; } }
@media (prefers-reduced-motion: reduce) { .fHero, .fCore, .fOut .mystery .fRing, .fusing .fCore, .won .fStage::after, .fHero.born, .fHero.born .fRing, .lost .fStage, .fHero.back, [data-act="fuseNow"].ready { animation: none !important; transition: none !important; } }

/* Chests: the button in the top bar sparkles; the box shows the three chests */
.chestBtn { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; color: #ffe7a3; font-weight: 700; background: linear-gradient(#3a1a08, #1d0d04); box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--gold), 0 0 14px #ffb54a66; overflow: visible; }
.chestBtn:hover { filter: brightness(1.15); }
.chestIco { position: relative; width: 34px; height: 30px; display: grid; place-items: center; }
.chestIco::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, #ffcf6aaa, transparent 65%); animation: chestPulse 1.8s ease-in-out infinite; }
.chestIco .chestSvg { position: relative; width: 30px; height: 26px; image-rendering: pixelated; filter: drop-shadow(0 0 4px #ffcf6a); animation: chestBob 2.4s ease-in-out infinite; }
.chestIco::after { content: ""; position: absolute; width: 3px; height: 3px; left: 4px; top: 2px; background: #fff; box-shadow: 22px 4px #fff, 12px -4px #ffe7a3, 28px 18px #ffe7a3, 2px 18px #fff; animation: chestTwinkle 1.2s steps(2) infinite; }
.chestBtn #keyCount { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; font-size: 12px; color: #fff; background: #c0392b; box-shadow: 0 0 0 2px #1a0d06, 0 0 10px #ff4a4a; border-radius: 10px; }
.chestBtn.hasKey { box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--gold), 0 0 22px #ffcf6a; animation: chestCall 1.6s ease-in-out infinite; }
@keyframes chestPulse { 50% { transform: scale(1.25); opacity: .55; } }
@keyframes chestBob { 50% { transform: translateY(-2px); } }
@keyframes chestTwinkle { 50% { opacity: .15; } }
@keyframes chestCall { 50% { box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px #fff3c4, 0 0 32px #ffcf6a; } }
dialog.chestDlg { width: min(860px, calc(100vw - 24px)); text-align: center; }
.chestRow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.chestCard { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 22px 10px 12px; color: var(--text); font-weight: 400;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--c) 30%, transparent), transparent 62%), linear-gradient(#170b26, #0b0516);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, #000), 0 10px 24px #0008; transition: transform .2s, box-shadow .2s; }
.chestCard:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 2px var(--c), 0 0 26px color-mix(in srgb, var(--c) 50%, transparent), 0 14px 28px #000a; }
.chestCard b { font: 700 19px/1.2 var(--title, serif); color: var(--c); text-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }
.chestRays { position: absolute; z-index: -1; left: 50%; top: 40%; width: 340px; height: 340px; translate: -50% -50%; background: repeating-conic-gradient(color-mix(in srgb, var(--c) 30%, transparent) 0 8deg, transparent 8deg 24deg); mask: radial-gradient(circle, #000 0 15%, transparent 55%); animation: chestSpin 14s linear infinite; opacity: .7; }
.chestBig { position: relative; width: 128px; height: 112px; display: grid; place-items: center; }
.chestBig .chestSvg { width: 128px; height: 102px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 #0008) drop-shadow(0 0 14px color-mix(in srgb, var(--c) 70%, transparent)); animation: chestBob 2.6s ease-in-out infinite; }
.chestSpark i { position: absolute; width: 4px; height: 4px; background: #fff; box-shadow: 0 0 6px var(--c), 0 0 2px #fff; animation: chestRise 2.4s linear infinite; opacity: 0; }
.chestSpark i:nth-child(1) { left: 30%; top: 55%; } .chestSpark i:nth-child(2) { left: 62%; top: 50%; animation-delay: .5s; } .chestSpark i:nth-child(3) { left: 45%; top: 60%; animation-delay: 1s; }
.chestSpark i:nth-child(4) { left: 70%; top: 62%; animation-delay: 1.5s; } .chestSpark i:nth-child(5) { left: 24%; top: 45%; animation-delay: 1.9s; }
@keyframes chestRise { 10% { opacity: 1; } 100% { transform: translateY(-80px); opacity: 0; } }
@keyframes chestSpin { to { rotate: 360deg; } }
.chestKeys { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.keySvg { width: 28px; height: 14px; image-rendering: pixelated; filter: drop-shadow(0 0 4px currentColor); }
dialog .chestCard .chestOpen[aria-disabled="true"] { color: #cbb9e0 !important; background: #0008 !important; box-shadow: inset 0 0 0 1px #ffffff2a !important; text-shadow: none !important; filter: none !important; transform: none !important; font-size: 13px; }
.chestOdds { width: 100%; margin-top: 4px; text-align: left; font-size: 12px; }
.chestOdds summary { cursor: pointer; text-align: center; color: var(--c); opacity: .85; list-style: none; }
.chestOdds summary::before { content: "▸ "; } .chestOdds[open] summary::before { content: "▾ "; }
.chestOdds ul { display: grid; gap: 2px; margin-top: 6px; padding: 6px 8px; background: #0006; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.chestOdds li { display: flex; justify-content: space-between; gap: 8px; }
.chestOdds li b { color: var(--c); }
.chestOdds li.k-sure span, .chestOdds li.k-summon span { color: #ffe7a3; }
/* opening */
dialog.chestDlg.opening { width: min(560px, calc(100vw - 24px)); overflow: hidden; }
.chestStage { position: relative; isolation: isolate; display: grid; justify-items: center; min-height: 380px; padding-top: 30px; }
.chestRays.big { width: 620px; height: 620px; top: 130px; opacity: .9; animation-duration: 3s; }
.chestHero { position: relative; width: 200px; height: 160px; display: grid; place-items: center; }
.chestHero .chestSvg { width: 200px; height: 160px; image-rendering: pixelated; filter: drop-shadow(0 8px 0 #0008) drop-shadow(0 0 20px var(--c)); }
.opening:not(.burst) .chestHero .chestSvg { animation: chestCharge 1.3s ease-in forwards; }
@keyframes chestCharge { 0% { transform: none; } 20% { transform: rotate(-3deg); } 30% { transform: rotate(3deg); } 45% { transform: rotate(-5deg) scale(1.03); } 55% { transform: rotate(5deg) scale(1.05); } 65% { transform: rotate(-7deg) scale(1.08); filter: drop-shadow(0 0 30px var(--c)) brightness(1.3); } 75%, 85%, 95% { transform: rotate(7deg) scale(1.1); filter: drop-shadow(0 0 40px var(--c)) brightness(1.6); } 80%, 90%, 100% { transform: rotate(-7deg) scale(1.1); filter: drop-shadow(0 0 50px #fff) brightness(2); } }
.burst .chestHero .chestSvg { animation: chestPop .5s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes chestPop { from { transform: scale(1.3); filter: brightness(3) drop-shadow(0 0 60px #fff); } }
.burst .chestHero::before { content: ""; position: absolute; left: 50%; bottom: 60%; width: 90px; height: 260px; translate: -50% 0; background: linear-gradient(to top, var(--c), color-mix(in srgb, var(--c) 30%, transparent) 60%, transparent); filter: blur(6px); opacity: .8; animation: chestBeam 1.2s ease-out; z-index: -1; }
@keyframes chestBeam { from { height: 0; opacity: 1; } }
.chestBurst { position: absolute; left: 50%; top: 110px; width: 0; height: 0; z-index: 2; pointer-events: none; }
.chestBurst i { position: absolute; width: 5px; height: 5px; background: #fff; box-shadow: 0 0 8px var(--c); opacity: 0; }
.burst .chestBurst i { animation: chestFly .9s ease-out forwards; }
.burst .chestBurst i:nth-child(3n) { background: var(--c); }
@keyframes chestFly { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1.8)); } }
.burst::after { content: ""; position: absolute; inset: 0; background: #fff; pointer-events: none; animation: chestFlash .6s ease-out forwards; }
@keyframes chestFlash { from { opacity: .85; } to { opacity: 0; } }
.chestWhat b { font: 700 20px/1.2 var(--title, serif); color: var(--c); text-shadow: 0 0 12px var(--c); }
.chestPrize { min-height: 60px; }
.prizeHead { margin: 6px 0 4px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #ffe7a3; animation: fadeIn .4s .2s ease-out backwards; }
.prizeList { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.prizeList li { display: grid; justify-items: center; gap: 2px; min-width: 130px; padding: 10px 14px; background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--r) 35%, transparent), transparent 70%), #0b0516; box-shadow: inset 0 0 0 2px var(--r), 0 0 22px color-mix(in srgb, var(--r) 45%, transparent); animation: prizeRise .6s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.prizeList li:nth-child(2) { animation-delay: .12s; } .prizeList li:nth-child(3) { animation-delay: .24s; } .prizeList li:nth-child(4) { animation-delay: .36s; } .prizeList li:nth-child(n+5) { animation-delay: .48s; }
.prizeList.many li { min-width: 86px; padding: 6px 8px; }
.prizeList li b { font-size: 17px; }
.prizeList li small { opacity: .8; font-size: 12px; }
.prizeIco svg { width: 40px; height: 40px; filter: drop-shadow(0 0 8px var(--r)); }
@keyframes prizeRise { from { opacity: 0; transform: translateY(40px) scale(.6); } }
.chestAfter { margin-top: 16px; width: 100%; justify-content: center; gap: 10px; animation: fadeIn .4s .5s ease-out backwards; }
@media (prefers-reduced-motion: reduce) { .opening .chestHero .chestSvg, .burst .chestHero::before, .burst .chestBurst i, .burst::after, .prizeList li, .prizeHead, .chestAfter { animation: none !important; } }
.chestCard.ready .chestBig .chestSvg { animation: chestJiggle 1.6s ease-in-out infinite; }
@keyframes chestJiggle { 0%, 70%, 100% { transform: none; } 75% { transform: rotate(-4deg); } 85% { transform: rotate(4deg); } 95% { transform: rotate(-2deg); } }
.chestCard.shake { animation: chestShake .4s; }
@keyframes chestShake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.chestMsg { min-height: 1.4em; margin-top: 12px; color: #ffe7a3; }
.keyDrop { color: var(--c); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.keyDrop .keySvg { color: var(--c); }
@media (max-width: 620px) { .chestRow { grid-template-columns: 1fr; } .chestBig, .chestBig .chestSvg { width: 96px; height: 84px; } .chestTxt { display: none; } }
@media (prefers-reduced-motion: reduce) { .chestIco::before, .chestIco .chestSvg, .chestIco::after, .chestBtn.hasKey, .chestRays, .chestBig .chestSvg, .chestSpark i, .chestCard.shake { animation: none !important; } }

/* ---------- Clan panel tabs, Clan War and Research ---------- */
.clanTabs { display: flex; gap: 6px; margin-bottom: 12px; }
:is(#panel) .clanTabs button { flex: 1; padding: 9px; font-weight: 700; color: #cbb9e0 !important; background: linear-gradient(#24123a, #160a26) !important; box-shadow: inset 0 0 0 1px #4a2f6e !important; text-shadow: none !important; filter: none !important; transform: none !important; }
:is(#panel) .clanTabs button.on { color: #2a1606 !important; background: linear-gradient(#ffe08a, #e0a94a) !important; box-shadow: 0 0 0 2px #6a4210, 0 0 14px #ffcf6a66 !important; }
.wFrame { position: relative; padding: 10px; margin-bottom: 12px; background: linear-gradient(#1c0d30, #120822); box-shadow: inset 0 0 0 2px #3d2560, inset 0 0 0 4px #160a26, inset 0 0 0 5px #5a3a8a, 0 10px 26px #0008; }
.wTop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 8px 14px; margin: -2px auto 10px; width: fit-content; max-width: 100%; background: #0d0619; box-shadow: inset 0 0 0 2px #4a2f6e; }
.wTitle { font: 700 22px/1.1 var(--title, serif); color: #fff3dc; text-shadow: 0 2px 0 #000; }
.wPhase { padding: 3px 10px; font-weight: 700; font-size: 13px; color: #fff; background: #6a2fb8; box-shadow: inset 0 0 0 1px #c08aff; }
.wPhase.prep { background: #2a5a9e; box-shadow: inset 0 0 0 1px #7fc0ff; } .wPhase.results, .wPhase.done { background: #8a6a1a; box-shadow: inset 0 0 0 1px #ffd36a; }
.wSep { width: 1px; height: 22px; background: #4a2f6e; }
.wHead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 10px 14px; }
.wSide { display: flex; align-items: center; gap: 12px; }
.wSide.theirs { justify-content: flex-end; text-align: right; }
.wSide h3 { font: 700 clamp(16px, 2vw, 22px)/1.1 var(--title, serif); color: #fff3dc; letter-spacing: .04em; text-transform: uppercase; }
.wSide p { font-size: 13px; color: #cbb9e0; }
.wBanner { position: relative; display: grid; place-items: center; width: 46px; height: 58px; font-size: 13px; color: #fff; text-shadow: 0 1px 0 #000;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%); box-shadow: inset 0 0 0 3px #0005; }
.wBanner.ours { background: linear-gradient(#3a7bd8, #1d4a9e); } .wBanner.theirs { background: linear-gradient(#d8343a, #8a1620); }
.wBanner::before { content: ""; position: absolute; top: -4px; left: -4px; right: -4px; height: 5px; background: #c9a24a; }
.wScore { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: #0b0516; box-shadow: inset 0 0 0 2px #5a3a8a, 0 0 0 3px #0b0516; position: relative; }
.wScore b { font: 700 clamp(30px, 4vw, 44px)/1 var(--title, serif); color: #fff3dc; }
.wScore i { font-style: normal; color: #8f7aa8; font-size: 26px; }
.wResult { position: absolute; left: 50%; bottom: -12px; translate: -50% 0; padding: 1px 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.wResult.win { background: #2f8a3e; color: #eaffea; } .wResult.loss { background: #8a1620; color: #ffe0e0; } .wResult.draw { background: #5a4a7a; color: #fff; }
.wRows { display: grid; gap: 6px; max-height: 460px; overflow-y: auto; padding: 2px 4px; }
.wPair { display: grid; grid-template-columns: 1fr 26px 1fr; align-items: center; gap: 6px; }
.wX { text-align: center; color: #8f7aa8; font-size: 18px; }
.wRow { display: grid; grid-template-columns: 38px auto 1fr auto; align-items: center; gap: 10px; min-height: 58px; padding: 6px 10px; text-align: left; font-weight: 400; color: var(--text);
  background: #1a0d2c; box-shadow: inset 0 0 0 1px #3d2560; }
:is(#panel) button.wRow { background: #1a0d2c !important; box-shadow: inset 0 0 0 1px #3d2560 !important; color: var(--text) !important; text-shadow: none !important; filter: none !important; transform: none !important; cursor: pointer; }
:is(#panel) button.wRow:hover { box-shadow: inset 0 0 0 2px #b77af2 !important; }
.wRow.empty { background: transparent; box-shadow: none; }
.wRow.me, :is(#panel) button.wRow.sel { box-shadow: inset 0 0 0 2px #b77af2, 0 0 16px #8a3ad688 !important; background: #2a1444 !important; }
.wRow.gone { opacity: .6; }
.wRank { font: 700 18px/1 var(--title, serif); color: #fff3dc; }
.wAva { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; background: #0b0516; box-shadow: inset 0 0 0 2px var(--b), 0 0 0 1px #000; }
.wAva.ours { --b: #3a7bd8; } .wAva.theirs { --b: #d8343a; }
.wAva i { font-style: normal; color: #8f7aa8; }
.wWho { display: grid; min-width: 0; } .wWho b { font: 700 16px/1.15 var(--title, serif); color: #fff3dc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wWho small { color: #cbb9e0; }
.wState { display: flex; align-items: center; gap: 6px; justify-self: end; }
.wChip { padding: 4px 10px; font-size: 12px; font-weight: 700; color: #cbb9e0; background: #24163a; box-shadow: inset 0 0 0 1px #5a4a7a; white-space: nowrap; }
.wChip.won { color: #8dff9a; background: #12301a; box-shadow: inset 0 0 0 1px #3fa04e; }
.wChip.you, .wChip.sel { color: #fff; background: #5a2a9a; box-shadow: inset 0 0 0 1px #c08aff; }
.wChip.hit { color: #ffd0a0; background: #3a2010; box-shadow: inset 0 0 0 1px #b8742a; }
.wChip.down { color: #ffb0b0; background: #3a1016; box-shadow: inset 0 0 0 1px #c0392b; }
.wChip.ok { color: #8dff9a; } .wChip.no { color: #ffb0b0; }
.wDots { display: flex; gap: 3px; } .wDots i { width: 8px; height: 8px; background: #3d2560; box-shadow: inset 0 0 0 1px #5a4a7a; } .wDots i.on { background: #ffd36a; box-shadow: 0 0 6px #ffcf6a; }
.wBar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; padding: 10px 14px; background: #0d0619; box-shadow: inset 0 0 0 2px #4a2f6e; }
.wBarTxt { font-size: 16px; } .wBarTxt b { font-family: var(--title, serif); color: #fff3dc; }
:is(#panel) .wBig { padding: 10px 22px !important; font-size: 17px !important; }
.wHint { text-align: center; font-size: 12px; color: #8f7aa8; margin-top: 6px; }
.wEmpty { text-align: center; padding: 22px 10px; color: #cbb9e0; }
.wAtks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wAtk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.wAtk.win { box-shadow: inset 0 0 0 1px #3fa04e; } .wAtk.loss { box-shadow: inset 0 0 0 1px #8a1620; }
.wAtk > b { font-family: var(--title, serif); color: #ffe7a3; }
.wAtk .win, .wLog .win { color: #8dff9a; font-weight: 700; }
.wLog { display: grid; gap: 3px; } .wLog li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; background: #160a26; border-left: 3px solid #3a7bd8; } .wLog li.theirs { border-left-color: #d8343a; }
:is(#panel) .wLog .tiny, :is(#panel) .wAtk button { margin-left: auto; padding: 3px 10px !important; font-size: 12px !important; }
.wHist { display: grid; gap: 4px; }
:is(#panel) .wHist > li > button { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--text) !important; background: #160a26 !important; box-shadow: inset 0 0 0 1px #3d2560 !important; text-shadow: none !important; filter: none !important; transform: none !important; }
.wHist .win { color: #8dff9a; }
.wTable tr.me { background: #2a1444; }
.wReview { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 8px 0 12px; }
.wSquad { padding: 10px; background: #160a26; box-shadow: inset 0 0 0 2px var(--b); } .wSquad.ours { --b: #3a7bd8; } .wSquad.theirs { --b: #d8343a; }
.wSquad h4 { font: 700 18px/1.2 var(--title, serif); color: #fff3dc; }
.wFaces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .wFaces .mini { display: grid; justify-items: center; } .wFaces small { font-size: 10px; }
.wVs { font: 700 28px/1 var(--title, serif); color: #ffd36a; text-shadow: 0 0 14px #ffb54a; }
.wFoot { margin-top: 6px; color: #8f7aa8; }
dialog.warDone h2.win { color: #8dff9a; }
.resGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.resCard { display: grid; gap: 8px; padding: 12px; background: linear-gradient(#1c0d30, #120822); box-shadow: inset 0 0 0 1px #4a2f6e, 0 8px 18px #0006; }
.resTop { display: flex; gap: 10px; align-items: center; } .resIco { width: 40px; height: 40px; display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle, #6a3aa8, #1c0d30 70%); box-shadow: inset 0 0 0 1px #8a5ad8; }
.resCard h4 { font: 700 17px/1.2 var(--title, serif); color: #ffe7a3; }
.resLv { display: flex; gap: 4px; } .resLv i { flex: 1; height: 7px; background: #2a1a40; box-shadow: inset 0 0 0 1px #4a2f6e; } .resLv i.on { background: linear-gradient(90deg, #ffd36a, #e0a94a); box-shadow: 0 0 6px #ffcf6a88; }
@media (max-width: 760px) {
  .wHead { grid-template-columns: 1fr; text-align: center; } .wSide, .wSide.theirs { justify-content: center; }
  .wPair { grid-template-columns: 1fr; } .wX { display: none; }
  .wRow { grid-template-columns: 30px auto 1fr; } .wState { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-end; }
  .wAtks, .resGrid { grid-template-columns: 1fr; } .wReview { grid-template-columns: 1fr; } .wVs { text-align: center; }
}
dialog.warDone .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; padding: 10px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
dialog.warDone h2 { font-size: 30px; }

/* ---------- Clan Home, editor, members, clan cards ---------- */
.clanBanner { display: block; image-rendering: pixelated; filter: drop-shadow(0 6px 0 #0007) drop-shadow(0 0 12px #0008); }
.clanBanner.big { width: 120px; height: 168px; }
.clanBanner.card { width: 52px; height: 73px; flex: none; }
.clanBanner.tiny { width: 34px; height: 48px; filter: none; }
.clanBanner.war { width: 48px; height: 67px; }
.cHero { position: relative; isolation: isolate; display: flex; gap: 22px; align-items: center; padding: 18px 20px; margin-bottom: 10px; min-height: max-content;
  background: radial-gradient(ellipse at 12% 40%, #6a3ad655, transparent 55%), linear-gradient(#22103a, #140a24); box-shadow: inset 0 0 0 2px #4a2f6e, inset 0 0 0 4px #160a26, inset 0 0 0 5px #6a4aa0, 0 12px 28px #0009; }
.cHero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12; background: url(/raid/map.webp?v=5) center / cover; image-rendering: pixelated; }
.cFlag { flex: none; animation: cSway 4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes cSway { 50% { transform: rotate(1.5deg) skewX(-1deg); } }
.cInfo { flex: 1; min-width: 0; display: grid; gap: 8px; }
.cTagline { display: flex; align-items: center; gap: 10px; }
.cTag { font: 700 14px/1 var(--title, serif); color: #ffd36a; letter-spacing: .12em; }
.cName { font: 700 clamp(26px, 3.4vw, 38px)/1.05 var(--title, serif); color: #fff3dc; text-shadow: 0 3px 0 #000, 0 0 22px #b77af255; }
.cLevel { display: flex; align-items: center; gap: 10px; }
.cLv { flex: none; padding: 6px 10px; font: 700 16px/1 var(--title, serif); color: #2a1606; background: linear-gradient(#ffe08a, #e0a94a); box-shadow: 0 0 0 2px #6a4210, 0 0 14px #ffcf6a77; }
.cExp { position: relative; flex: 1; height: 20px; background: #0b0516; box-shadow: inset 0 0 0 1px #5a3a8a; overflow: hidden; }
.cExp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6a2fb8, #b77af2); box-shadow: 0 0 12px #b77af2; }
.cExp span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; color: #fff; text-shadow: 0 1px 0 #000; }
.cNotice { padding: 8px 12px; background: #0b051699; box-shadow: inset 3px 0 0 #ffd36a; color: #e8e1eb; font-style: italic; }
.cMode { padding: 3px 9px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cMode.m-open { color: #0d2a12; background: #6fe08a; } .cMode.m-restricted { color: #2a1a04; background: #ffcf6a; } .cMode.m-invite { color: #fff; background: #a04ae0; }
.cStats { min-height: max-content; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cStats > div { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.cStats b { font: 700 20px/1.1 var(--title, serif); color: #fff3dc; } .cStats span { font-size: 12px; color: #a99bb8; text-align: center; }
.cDonors { display: grid; gap: 4px; margin-top: 10px; }
.cDonors li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 5px 10px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.cDonors li:first-child { box-shadow: inset 0 0 0 1px #ffcf6a, 0 0 12px #ffcf6a33; } .cDonors li:first-child b { color: #ffd36a; }
.cAlert { box-shadow: inset 0 0 0 1px #ffcf6a !important; }
.cBadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; color: #fff; background: #c0392b; border-radius: 9px; }
.cRoster { display: grid; gap: 4px; }
.cRoster li { display: grid; grid-template-columns: 42px 1fr 80px 70px 80px auto; align-items: center; gap: 10px; padding: 6px 10px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.cRoster li.lead { box-shadow: inset 0 0 0 1px #ffcf6a; background: linear-gradient(90deg, #3a2a0844, #160a26 40%); }
.cFace { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; background: #0b0516; box-shadow: inset 0 0 0 1px #5a3a8a; }
.cNoFace { font-style: normal; color: #8f7aa8; }
.cWho { display: grid; } .cWho b { color: #fff3dc; } .cWho small, .cNum small { font-size: 11px; color: #a99bb8; }
.cRoster li.lead .cWho small { color: #ffd36a; }
.cNum { display: grid; justify-items: end; } .cNum b { color: #fff3dc; }
.cPeople { display: grid; gap: 4px; margin-top: 8px; } .cPeople li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.cCards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cCard { display: flex; align-items: center; gap: 12px; padding: 10px; background: linear-gradient(#1c0d30, #120822); box-shadow: inset 0 0 0 1px #4a2f6e; }
.cCardInfo { flex: 1; min-width: 0; } .cCardInfo b { color: #fff3dc; font-family: var(--title, serif); font-size: 16px; }
.cFound { display: flex; gap: 20px; align-items: center; } .cFoundFlag { display: grid; justify-items: center; gap: 8px; }
.cEdit { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: start; }
.cPreview { display: grid; justify-items: center; gap: 8px; padding: 14px; background: radial-gradient(ellipse, #6a3ad644, transparent 70%), #0b0516; box-shadow: inset 0 0 0 1px #4a2f6e; position: sticky; top: 0; }
.cParts h4, .craft > h4 { margin: 10px 0 6px; font-size: 13px; color: #ffe7a3; letter-spacing: .06em; text-transform: uppercase; }
.cSws { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#panel) .cSw { width: 30px; height: 30px; min-height: 0; padding: 0 !important; background: var(--c) !important; box-shadow: inset 0 0 0 2px #0006, 0 0 0 1px #000 !important; filter: none !important; transform: none !important; }
:is(#panel) .cSw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000, 0 0 12px var(--c) !important; }
.cOpts { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#panel) .cOpt { display: grid; justify-items: center; gap: 2px; width: 74px; padding: 6px 4px !important; color: #e8e1eb !important; background: #160a26 !important; box-shadow: inset 0 0 0 1px #3d2560 !important; text-shadow: none !important; filter: none !important; transform: none !important; }
:is(#panel) .cOpt small { font-size: 10px; } :is(#panel) .cOpt.on { box-shadow: inset 0 0 0 2px #ffd36a, 0 0 12px #ffcf6a55 !important; } :is(#panel) .cOpt:disabled { opacity: .45; }
.cModes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
:is(#panel) .cModeOpt { display: grid; gap: 4px; text-align: left; padding: 10px !important; color: #e8e1eb !important; background: #160a26 !important; box-shadow: inset 0 0 0 1px #3d2560 !important; text-shadow: none !important; filter: none !important; transform: none !important; }
:is(#panel) .cModeOpt.on { box-shadow: inset 0 0 0 2px #b77af2, 0 0 14px #8a3ad666 !important; background: #2a1444 !important; }
.cModeOpt small { font-size: 12px; color: #a99bb8; font-weight: 400; }
.craft textarea { width: 100%; padding: 8px 10px; color: var(--text); background: #0b0516; border: 0; box-shadow: inset 0 0 0 1px #5a3a8a; font: inherit; resize: vertical; }
.wFlag { flex: none; }
@media (max-width: 760px) {
  .cHero { flex-direction: column; text-align: center; } .cTagline, .cLevel { justify-content: center; }
  .cStats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cCards, .cModes { grid-template-columns: 1fr; }
  .cRoster li { grid-template-columns: 40px 1fr auto; } .cRoster .cNum { display: none; }
  .cEdit { grid-template-columns: 1fr; } .cPreview { position: static; } .cFound { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .cFlag { animation: none; } }

.cHome { display: flex; flex-direction: column; gap: 10px; }
.cHome > * { flex: none; margin-bottom: 0; }

/* ---------- Clan Research tree ---------- */
.rTop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: max-content; }
.rHall { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; }
.rCastle { font-size: 30px; filter: drop-shadow(0 0 8px #b77af2); }
.rHall > div { flex: 1; display: grid; gap: 4px; } .rHall b { font: 700 18px/1.1 var(--title, serif); color: #fff3dc; letter-spacing: .04em; text-transform: uppercase; }
.rPoints { padding: 8px 14px; background: #0d0619; box-shadow: inset 0 0 0 2px #ffcf6a88, 0 0 14px #ffcf6a33; color: #ffe7a3; } .rPoints span { color: #4fd18b; } .rPoints b { color: #fff3dc; }
.rWrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; min-height: max-content; }
.rBoard { position: relative; padding: 16px 10px; background: linear-gradient(#1c0d30, #120822); box-shadow: inset 0 0 0 2px #3d2560, inset 0 0 0 4px #160a26, inset 0 0 0 5px #5a3a8a; }
.rBoard::before, .rBoard::after { content: ""; position: absolute; top: 14px; z-index: 0; width: 26px; height: 120px; background: linear-gradient(#4a2450, #2a1238); clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); opacity: .7; }
.rBoard::before { left: 4px; } .rBoard::after { right: 4px; }
.rGrid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; grid-auto-rows: auto; align-items: center; justify-items: center; max-width: 520px; margin: 0 auto; }
.rCell { width: 100%; display: grid; justify-items: center; }
.rH { width: 100%; height: 3px; background: #3d2560; align-self: center; margin-top: -24px; }
.rV { width: 3px; height: 18px; background: #3d2560; }
.rH.lit, .rV.lit { background: #d08aff; box-shadow: 0 0 8px #b77af2; }
:is(#panel) .rNode { border: 0 !important; display: grid; justify-items: center; gap: 3px; width: 100%; max-width: 120px; padding: 2px !important; color: #e8e1eb !important; background: none !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; transform: none !important; font-weight: 400; }
.rShield { position: relative; display: grid; place-items: center; width: 64px; height: 70px; background: linear-gradient(#3a2458, #1d1030); clip-path: polygon(50% 0, 100% 18%, 100% 70%, 50% 100%, 0 70%, 0 18%); box-shadow: inset 0 0 0 3px #6a4aa0; transition: transform .15s; }
.rShield::before { content: ""; position: absolute; inset: 3px; clip-path: inherit; background: radial-gradient(circle at 50% 40%, #4a2e70, #1a0d2c 75%); }
.rIco { position: relative; width: 38px; height: 38px; image-rendering: pixelated; } .rIco svg, .rBig svg { width: 100%; height: 100%; display: block; }
.rNode b { font-size: 12px; line-height: 1.15; text-align: center; color: #fff3dc; }
.rPips { display: flex; gap: 2px; } .rPips i { width: 8px; height: 6px; background: #2a1a40; box-shadow: inset 0 0 0 1px #6a4aa0; } .rPips i.on { background: #d08aff; box-shadow: 0 0 5px #b77af2; }
.rNode.learned .rShield { background: linear-gradient(#8a5ad8, #4a2a8a); }
.rNode.maxed .rShield { background: linear-gradient(#ffe08a, #b8862a); } .rNode.maxed .rPips i.on { background: #ffd36a; box-shadow: 0 0 5px #ffcf6a; }
.rNode.locked .rIco { filter: grayscale(1) brightness(.55); } .rNode.locked b { color: #8f82a3; }
.rLock { position: absolute; right: 2px; bottom: 6px; font-size: 14px; filter: drop-shadow(0 1px 0 #000); }
:is(#panel) .rNode:hover .rShield { transform: translateY(-2px); }
.rNode.sel .rShield { box-shadow: inset 0 0 0 3px #fff3dc; filter: drop-shadow(0 0 10px #d08aff) drop-shadow(0 0 4px #fff); }
.rNode.sel::before { content: "◆"; color: #d08aff; font-size: 12px; text-shadow: 0 0 6px #d08aff; margin-bottom: -4px; }
.rSide { position: sticky; top: 0; display: grid; gap: 10px; padding: 14px; background: linear-gradient(#1c0d30, #120822); box-shadow: inset 0 0 0 2px #3d2560, inset 0 0 0 4px #160a26, inset 0 0 0 5px #5a3a8a; }
.rHead { display: flex; gap: 12px; align-items: center; } .rBig { width: 56px; height: 56px; flex: none; image-rendering: pixelated; filter: drop-shadow(0 0 8px #b77af2); }
.rHead h4 { font: 700 20px/1.15 var(--title, serif); color: #fff3dc; } .rLvl { color: #c08aff; font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.rStat { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #0d0619; box-shadow: inset 0 0 0 1px #6a4aa0; } .rStat b { color: #fff3dc; } .rStat em { font-style: normal; color: #d08aff; }
.rWhat { color: #cbb9e0; font-size: 14px; }
.rReq { display: flex; gap: 10px; align-items: baseline; padding-top: 8px; border-top: 1px solid #3d2560; } .rReq ul { display: grid; gap: 2px; font-size: 13px; } .rReq li.ok { color: #8dff9a; } .rReq li.no { color: #ff9a9a; }
.rLab { color: #c08aff; font-weight: 700; font-size: 13px; min-width: 70px; }
.rPrice { display: flex; gap: 10px; align-items: baseline; } .rPrice b { color: #ffe7a3; font-size: 17px; }
.rAfter { text-align: center; color: #a99bb8; }
:is(#panel) .rBuy { width: 100%; padding: 12px !important; font-size: 17px !important; }
.rDone { color: #ffd36a; text-align: center; font-weight: 700; }
.rLegend { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid #3d2560; font-size: 12px; color: #a99bb8; }
.rLegend i { display: inline-block; width: 22px; height: 3px; margin-right: 6px; vertical-align: middle; background: #3d2560; } .rLegend i.lit { background: #d08aff; box-shadow: 0 0 6px #b77af2; }
@media (max-width: 860px) { .rWrap { grid-template-columns: 1fr; } .rSide { position: static; } }
@media (max-width: 520px) { .rGrid { grid-template-columns: 1fr 12px 1fr 12px 1fr; } .rShield { width: 52px; height: 58px; } .rIco { width: 30px; height: 30px; } .rNode b { font-size: 10px; } }

/* ---------- Clan: gifts, positions, chat, trade; inbox; whispers ---------- */
.rNode { position: relative; }
.rNode.sel::before { position: absolute; top: -10px; left: 50%; translate: -50% 0; margin: 0; } /* the marker no longer pushes the board */
.clanTabs { flex-wrap: wrap; }
:is(#panel) .clanTabs button { min-width: 90px; }
.giveRow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.giveOpt { display: grid; gap: 6px; align-content: start; padding: 12px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.giveOpt.k-tokens { box-shadow: inset 0 0 0 1px #d8402c88; } .giveOpt.k-gems { box-shadow: inset 0 0 0 1px #b06cf888; } .giveOpt.k-hero { box-shadow: inset 0 0 0 1px #4aa8ff88; }
.giveIco { width: 34px; height: 34px; image-rendering: pixelated; } .giveIco svg { width: 100%; height: 100%; display: block; }
.giveOpt b { font: 700 17px/1.1 var(--title, serif); color: #fff3dc; } .giveOpt small { color: #a99bb8; font-size: 12px; }
.giveOpt .row { flex-wrap: wrap; gap: 6px; align-items: center; } .giveOpt input, .giveOpt select { min-width: 0; flex: 1; }
.giveLeft { font-size: 13px; color: #e8c7ff; flex: 1; }
.cRoster li { grid-template-columns: 34px 42px minmax(0, 1fr) 84px 70px 74px auto; }
.cRank { font: 700 15px/1 var(--title, serif); color: #ffe7a3; }
.cRoster li:first-child .cRank { color: #ffd36a; text-shadow: 0 0 8px #ffcf6a; }
.cRole { justify-self: start; padding: 1px 7px; font-size: 11px; color: #cbb9e0; background: #24163a; box-shadow: inset 0 0 0 1px #5a4a7a; }
.cRole.lead { color: #2a1606; background: linear-gradient(#ffe08a, #e0a94a); box-shadow: none; } .cRole.has { color: #fff; background: #5a2a9a; box-shadow: inset 0 0 0 1px #c08aff; }
.cActs { justify-content: flex-end; flex-wrap: wrap; gap: 4px; } .cAssign select { max-width: 120px; }
.cRoles { display: grid; gap: 4px; margin: 8px 0; }
.cRoleCard { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: #160a26; box-shadow: inset 0 0 0 1px #5a2a9a; }
.cRoleCard b { color: #e8c7ff; }
.cRoleEdit { display: grid; gap: 8px; padding: 10px; background: #0d0619; box-shadow: inset 0 0 0 1px #b77af2; }
.cPerms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
:is(#panel) .cPerm { text-align: left; padding: 7px 10px !important; font-weight: 400; color: #cbb9e0 !important; background: #160a26 !important; box-shadow: inset 0 0 0 1px #3d2560 !important; text-shadow: none !important; filter: none !important; transform: none !important; }
:is(#panel) .cPerm.on { color: #fff !important; background: #2a1444 !important; box-shadow: inset 0 0 0 2px #b77af2 !important; }
.craft input[data-set="annTitle"] { width: 100%; margin-bottom: 6px; }
.gChat { display: grid; gap: 8px; }
.gLog { height: 320px; overflow-y: auto; display: grid; align-content: start; gap: 3px; padding: 8px; background: #0b0516; box-shadow: inset 0 0 0 1px #3d2560; }
.gLog li { font-size: 14px; } .gLog li span { color: #8f82a3; font-size: 12px; } .gLog li b { color: #ffe7a3; } .gLog li.mine b { color: #8dff9a; }
.gChat .row input { flex: 1; }
.tradeRow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tradeCard { display: grid; justify-items: center; gap: 6px; text-align: center; background: radial-gradient(ellipse at 50% 0%, #6a3ad633, transparent 70%) !important; }
.tradeCard.shut { opacity: .75; } .tradeIco { font-size: 34px; filter: drop-shadow(0 0 8px #b77af2); }
.cLock { padding: 3px 9px; font-size: 12px; color: #ffcf6a; background: #2a1a08; box-shadow: inset 0 0 0 1px #8a6a1a; }
.mScopes { margin: 8px 0 4px; }
.mScope { display: inline-block; margin-bottom: 4px; padding: 2px 7px; font-size: 11px; font-weight: 700; color: #fff; background: #5a2a9a; } .mScope.s-alliance { background: #2a6a5a; }
/* the inbox */
.inboxBtn { position: relative; display: grid; place-items: center; width: 44px; padding: 3px 6px; color: #ffe7a3; background: linear-gradient(#2a1440, #140a24); box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px #8a6aba; font-size: 22px; }
.inboxBtn.hasMail { box-shadow: 0 0 0 2px #2a1708, 0 0 0 3px var(--gold), 0 0 16px #ffcf6a88; animation: chestCall 1.6s ease-in-out infinite; }
.inboxBtn #inboxCount { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; font-size: 12px; color: #fff; background: #c0392b; box-shadow: 0 0 0 2px #1a0d06; border-radius: 10px; }
dialog.inboxDlg { width: min(640px, calc(100vw - 24px)); }
.mailList { display: grid; gap: 4px; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.mail { background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.mail.unread { box-shadow: inset 0 0 0 1px #b77af2; } .mail.k-clan { border-left: 3px solid #b77af2; } .mail.k-invite { border-left: 3px solid #4fd18b; }
dialog .mailHead { width: 100%; display: grid; grid-template-columns: 12px 1fr; gap: 2px 8px; text-align: left; padding: 8px 10px !important; color: var(--text) !important; background: none !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; transform: none !important; font-weight: 400; }
.mailHead b { color: #fff3dc; } .mailHead small { grid-column: 2; color: #a99bb8; font-size: 12px; }
.mailDot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; } .mail.unread .mailDot { background: #ff5a5a; box-shadow: 0 0 6px #ff5a5a; }
.mailBody { padding: 0 12px 10px 30px; } .mailBody p { white-space: pre-wrap; color: #e8e1eb; }
/* whispers in the chat box */
#chatLog li.whisper { color: #ff9ad8; } #chatLog li.whisper i { color: #c07aa8; } #chatLog li.whisper b { color: #ffc0e8; }
#chatLog b[data-whisper] { cursor: pointer; }
.whisperBtn { flex: none; width: 34px; padding: 0 !important; font-size: 16px; }
@media (max-width: 760px) { .giveRow, .tradeRow, .cPerms { grid-template-columns: 1fr; } .cRoster li { grid-template-columns: 28px 40px 1fr auto; } .cRoster .cNum { display: none; } }

/* ---------- Summon cards: made to be pressed ---------- */
.buys.big { width: min(100%, 600px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); align-items: end; gap: clamp(6px, 1.2vw, 12px); }
.buys.big .sumCard { --a: #4aa8ff; --b: #1d3d8e; position: relative; isolation: isolate; overflow: visible; display: grid; justify-items: center; align-content: end; gap: 3px; min-height: 132px; padding: 22px 6px 8px; border: 0; border-radius: 0;
  color: #fff; text-shadow: 0 2px 0 #000; font: inherit; cursor: pointer;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--a) 45%, transparent), transparent 65%), linear-gradient(#24123a, #0e0618);
  box-shadow: inset 0 0 0 2px var(--a), inset 0 0 0 4px #0b0516, inset 0 0 0 5px color-mix(in srgb, var(--a) 50%, #000), 0 8px 18px #000a, 0 0 18px color-mix(in srgb, var(--a) 30%, transparent);
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.4), box-shadow .2s, filter .2s; }
.buys.big .sumCard.t5 { --a: #b06cf8; --b: #4a1a8a; }
.buys.big .sumCard.t10 { --a: #ffcf4a; --b: #8a5a10; min-height: 150px; }
.buys.big .sumCard::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(115deg, transparent 38%, #ffffff35 48%, transparent 58%) -180% 0 / 250% 100% no-repeat; }
.buys.big .sumCard:not(:disabled):hover { transform: translateY(-5px) scale(1.03); filter: brightness(1.12); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #0b0516, inset 0 0 0 5px var(--a), 0 14px 26px #000c, 0 0 34px var(--a); }
.buys.big .sumCard:not(:disabled):active { transform: translateY(1px) scale(.98); }
.buys.big .sumCard:disabled { opacity: 1; filter: saturate(.75) brightness(.85); cursor: not-allowed; }
.sumRibbon { position: absolute; top: -11px; left: 50%; translate: -50% 0; padding: 3px 12px; white-space: nowrap; font: 800 11px/1.2 "Segoe UI", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #2a1606; text-shadow: none;
  background: linear-gradient(#ffe8a0, #f0b53a); box-shadow: 0 0 0 2px #6a4210, 0 0 14px #ffcf6a; }
.sumRibbon.alt { color: #fff; background: linear-gradient(#c08aff, #7a3ac8); box-shadow: 0 0 0 2px #2a1050, 0 0 12px #b06cf8; }
.sumFree { position: absolute; top: 10px; right: -10px; z-index: 2; display: grid; place-content: center; width: 52px; height: 52px; color: #0d2a12; text-shadow: none; font: 800 10px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .06em; text-align: center;
  background: radial-gradient(circle, #d8ffe6 0 40%, #4fd18b 70%); clip-path: polygon(50% 0, 61% 12%, 77% 7%, 80% 23%, 95% 28%, 89% 43%, 100% 55%, 88% 66%, 92% 82%, 76% 84%, 68% 98%, 54% 90%, 40% 100%, 30% 87%, 14% 90%, 13% 74%, 0 66%, 9% 52%, 2% 38%, 16% 30%, 18% 14%, 34% 14%); filter: drop-shadow(0 0 8px #4fd18b); }
.sumFree b { font-size: 17px; line-height: 1; }
.sumArt { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 40px; margin-bottom: 2px; }
.sumArt i { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, color-mix(in srgb, var(--a) 70%, #fff) 25%, var(--a) 55%, var(--b) 100%); box-shadow: 0 0 12px var(--a), inset 0 -3px 4px #0006; }
.t10 .sumArt i:nth-child(3) { width: 30px; height: 30px; }
.sumQty { font: 700 clamp(26px, 3.2vw, 34px)/1 var(--title, serif); color: #fff; text-shadow: 0 3px 0 #000, 0 0 14px var(--a); }
.sumGet { font: 600 12px/1.2 "Segoe UI", system-ui, sans-serif; color: #e8e1eb; text-shadow: none; }
.sumGet em { font-style: normal; color: #8dff9a; font-weight: 800; }
.sumPrice { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 3px; padding: 4px 10px; background: #0008; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a) 60%, transparent); }
.sumPrice svg { width: 18px; height: 18px; flex: none; }
.sumPrice b { font: 700 15px/1 "Segoe UI", system-ui, sans-serif; color: #ffe7a3; }
.sumPrice small { font: 500 11px/1.2 "Segoe UI", system-ui, sans-serif; color: #d1c6d8; }
.sumNeed { font: 600 11px/1.2 "Segoe UI", system-ui, sans-serif; color: #ffb0a0; text-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .buys.big .sumCard::after { animation: sumShine 4s ease-in-out infinite; }
  .buys.big .sumCard.t5::after { animation-delay: 1.3s; } .buys.big .sumCard.t10::after { animation-delay: 2.6s; animation-duration: 3s; }
  @keyframes sumShine { 0%, 70% { background-position: -180% 0; } 100% { background-position: 180% 0; } }
  .sumArt i { animation: sumFloat 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
  @keyframes sumFloat { 50% { transform: translateY(-5px); } }
  .buys.big .sumCard.t10:not(:disabled) { animation: sumPulse 1.8s ease-in-out infinite; }
  @keyframes sumPulse { 50% { box-shadow: inset 0 0 0 2px #fff3c4, inset 0 0 0 4px #0b0516, inset 0 0 0 5px var(--a), 0 8px 18px #000a, 0 0 36px var(--a); } }
  .sumFree { animation: sumBadge 2.2s ease-in-out infinite; }
  @keyframes sumBadge { 50% { transform: rotate(10deg) scale(1.08); } }
}
@media (max-width: 520px) { .buys.big .sumCard { min-height: 118px; padding-top: 18px; } .sumArt { height: 30px; } .sumArt i { width: 16px; height: 16px; } .sumFree { width: 44px; height: 44px; right: -6px; } }

/* the $RBORN chip: Deposit and Withdraw */
#purse .tokChip::after { content: none; }
.tokBtns { display: flex; gap: 4px; margin-left: 4px; }
.tokBtn { min-height: 0; padding: 0 7px !important; border: 0 !important; font: 700 12px/20px "Segoe UI", system-ui, sans-serif !important; color: #1a0608 !important; background: linear-gradient(#ffd877, #d99a2b) !important; box-shadow: inset 0 -2px #8a5a1a !important; cursor: pointer; }
.tokBtn.dep { color: #062a12 !important; background: linear-gradient(#a9f5c0, #3fbf6a) !important; box-shadow: inset 0 -2px #1f7a45, 0 0 8px #4fd18b77 !important; }
.tokBtn:hover { filter: brightness(1.12); }
dialog.depositDlg { width: min(520px, calc(100vw - 24px)); }
.depHead { display: flex; align-items: center; gap: 14px; }
.depCoin svg { width: 64px; height: 64px; filter: drop-shadow(0 0 12px #ffb54a); }
.depSoon { display: inline-block; margin-top: 4px; padding: 2px 9px; font: 800 11px/1.4 "Segoe UI", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #2a1606; background: linear-gradient(#ffe7a3, #e0a94a); }
.depSteps { display: grid; gap: 6px; margin: 12px 0; }
.depSteps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #160a26; box-shadow: inset 0 0 0 1px #3d2560; }
.depSteps li b { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: #2a1606; background: #ffd36a; border-radius: 50%; }
.depSteps li.done { box-shadow: inset 0 0 0 1px #3fa04e; } .depSteps li.done b { background: #4fd18b; }
dialog.depositDlg .row.end { gap: 8px; align-items: center; } dialog.depositDlg form { margin: 0; }
@media (max-width: 760px) { .tokBtns { margin-left: 2px; } .tokBtn { padding: 0 4px !important; font-size: 11px !important; } }

@media (max-width: 1440px) { .chestTxt { display: none; } .chestBtn { padding-right: 8px; } }
@media (max-width: 1440px) and (min-width: 761px) { #purse .chip { font-size: 0; gap: 6px; } #purse .chip b { font-size: 16px; } }
