/* Story quest card (js/questhelper.js) + the Battle Basics tutorial card (main.js), stacked in #quests.
   Desktop: a clean card with the current step and a progress bar. Touch: a compact chip (mobile.css). */
.sq {
  position: relative; overflow: hidden; color: var(--text, #f2f5ff); font-family: Nunito, system-ui, sans-serif;
  background: var(--panel, rgba(13, 21, 44, .86)); border: 1px solid var(--line-2, rgba(170, 195, 255, .26)); border-radius: 16px;
  box-shadow: 0 3px 10px rgba(2, 6, 20, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sq-head {
  width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 12px 9px; text-align: left;
  color: inherit; font: inherit; cursor: pointer;
}
.sq-ic { width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 10px; color: #3a2400; background: linear-gradient(#ffe07a, #f0a51c); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 4px rgba(0,0,0,.25); }
.sq-head-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sq-act { font-size: 10.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted, #a3b3d9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-title { color: var(--gold, #ffcf4a); font-weight: 900; font-size: 15px; line-height: 1.2; }
.sq-count { font-size: 12px; font-weight: 900; color: var(--muted, #a3b3d9); font-variant-numeric: tabular-nums; }
.sq-chev { width: 20px; height: 20px; flex: none; color: var(--muted, #a3b3d9); transition: transform .18s; transform: rotate(180deg); }
.sq.collapsed .sq-chev { transform: none; }
.sq-body { padding: 0 12px 10px 52px; }
.sq.collapsed .sq-body { display: none; }
.sq-desc { font-size: 13px; font-weight: 700; line-height: 1.4; color: #dde5ff; }
.sq-reward { font-size: 12px; color: #ffd98a; margin-top: 5px; font-weight: 800; }
.sq-side { font-size: 12px; font-weight: 800; color: var(--muted, #a3b3d9); margin-top: 4px; }
.sq-side span { color: #ffd98a; font-weight: 700; }
.sq-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sq-where { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #c8e7ff; }
.sq-where svg { width: 15px; height: 15px; flex: none; }
.sq-log { flex: none; border: 1px solid var(--line-2, rgba(170,195,255,.26)); background: rgba(255,255,255,.07); color: #fff; font: 800 12px Nunito, sans-serif; padding: 5px 10px; border-radius: 9px; cursor: pointer; min-height: 30px; }
.sq-log:hover { background: rgba(255,255,255,.14); }
.sq-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .35); }
.sq-bar > div { height: 100%; background: linear-gradient(90deg, #ffd85e, #f3a51e); transition: width .4s; }

/* tutorial: a second, smaller card under the story card (never over the player) */
.tut {
  padding: 9px 12px 10px; font-size: 12.5px; cursor: pointer; color: var(--text, #f2f5ff);
  background: var(--panel, rgba(13, 21, 44, .86)); border: 1px solid rgba(255, 207, 74, .45); border-radius: 16px;
  box-shadow: 0 3px 10px rgba(2, 6, 20, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tut[hidden] { display: none; }
.tut-head { display: flex; align-items: center; gap: 8px; }
.tut-head b { flex: 1; font-size: 13.5px; color: var(--gold, #ffcf4a); }
.tut-badge { font-size: 9.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: #3a2400; background: var(--gold, #ffcf4a); border-radius: 6px; padding: 1px 6px; }
.tut-n { font-size: 12px; font-weight: 900; color: var(--muted, #a3b3d9); }
.tut-bar { height: 3px; border-radius: 2px; background: rgba(0,0,0,.35); margin: 7px 0 6px; overflow: hidden; }
.tut-bar > div { height: 100%; background: linear-gradient(90deg, #ffd85e, #f3a51e); transition: width .4s; }
.tut-step { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; color: var(--muted, #a3b3d9); padding: 2px 0; }
.tut-step i { width: 14px; height: 14px; flex: none; margin-top: 2px; border-radius: 50%; border: 2px solid currentColor; }
.tut-step small { display: block; font-weight: 700; color: #c8e7ff; }
.tut-step.now { color: #fff; }
.tut-step.now i { border-color: var(--gold, #ffcf4a); box-shadow: inset 0 0 0 3px var(--panel-solid, #121c3a); background: var(--gold, #ffcf4a); }
.tut-step.done { opacity: .6; }
.tut-step.done i { background: #3ee07a; border-color: #3ee07a; }
.tut-reward { margin-top: 5px; color: #ffd25a; font-weight: 800; font-size: 12px; }

/* ---------------------------------------------------------------- profile chip + compact quest widget (js/profilehud.js)
   Top of #quests: a round trainer avatar with name and level (tap: Profile · Settings), then one line per quest
   (current story step, a side quest or the next step, today's daily mission; tap: the Quest log on that tab).
   Plain glyphs in colour, no tiles behind them. */
.phud { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pf-chip {
  align-self: flex-start; max-width: 100%; display: flex; align-items: center; gap: 8px; height: 44px; padding: 4px 14px 4px 4px;
  border-radius: 22px; color: var(--text, #f2f5ff); font-family: Nunito, system-ui, sans-serif; text-align: left; cursor: pointer;
  background: var(--panel, rgba(13, 21, 44, .86)); border: 1px solid var(--line-2, rgba(170, 195, 255, .26));
  box-shadow: 0 3px 10px rgba(2, 6, 20, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pf-chip:hover { border-color: rgba(255, 207, 74, .55); }
.pf-chip:active { transform: scale(.97); }
.pf-ava {
  width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #34508f, #16244e 70%); box-shadow: 0 0 0 2px var(--gold, #ffcf4a);
}
/* the outfit portrait is a full-body render: zoom onto head and shoulders */
.pf-ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.7) translateY(17%); }
.pf-ava .ic { width: 22px; height: 22px; color: #cfd8ff; }
.pf-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pf-name { font-size: 13px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-sub { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: var(--muted, #a3b3d9); white-space: nowrap; }
.pf-sub > span:first-child:not(.pf-bdg) { color: var(--gold, #ffcf4a); }
.pf-bdg { display: inline-flex; align-items: center; gap: 2px; }
.pf-bdg .ic { width: 13px; height: 13px; }

.qw {
  display: flex; flex-direction: column; padding: 3px; border-radius: 14px; font-family: Nunito, system-ui, sans-serif;
  background: var(--panel, rgba(13, 21, 44, .86)); border: 1px solid var(--line-2, rgba(170, 195, 255, .26));
  box-shadow: 0 3px 10px rgba(2, 6, 20, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.qw:empty { display: none; }
.qw-row {
  width: 100%; display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 4px 7px; border: 0; border-radius: 10px;
  background: none; color: #dde5ff; font: 800 12.5px/1.2 Nunito, system-ui, sans-serif; text-align: left; cursor: pointer;
}
.qw-row:hover { background: rgba(255, 255, 255, .07); }
.qw-row:active { background: rgba(255, 255, 255, .12); }
.qw-ic { width: 16px; height: 16px; flex: none; }
.qw-ic.story { color: var(--gold, #ffcf4a); }
.qw-ic.side { color: #8cc8ff; }
.qw-ic.next { color: var(--muted, #a3b3d9); }
.qw-ic.daily { color: #6fe0a6; }
.qw-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-row.story .qw-t { color: #fff; font-weight: 900; }
.qw-row.next .qw-t { color: var(--muted, #a3b3d9); }
.qw-row.ready .qw-t { color: var(--gold, #ffcf4a); }
.qw-row.all .qw-t { color: var(--muted, #a3b3d9); }
.qw-n { flex: none; font-size: 11px; font-weight: 900; color: var(--muted, #a3b3d9); font-variant-numeric: tabular-nums; }
.qw-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 2px rgba(255, 90, 90, .25); }

/* ---------------------------------------------------------------- Profile panel: Profile · Settings switch in the header */
.pf-panel .mh-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pf-panel .mh-actions { flex: 1; min-width: 0; display: flex; }
.pf-switch { flex: none; }
.pf-switch .seg-b { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; }
.pf-switch .seg-b .ic { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Quest log (panels.quests): Story · Daily · Side · Done */
.ql-panel .qc-reward span small { font-size: 11px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--muted, #a3b3d9); margin-right: 6px; }
.ql-total { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface, rgba(255,255,255,.04)); border: 1px solid var(--line, rgba(170,195,255,.16)); font-size: 12.5px; font-weight: 800; color: var(--muted, #a3b3d9); }
.ql-total .ic { width: 16px; height: 16px; color: var(--gold, #ffcf4a); }
.ql-total b { color: #fff; font-variant-numeric: tabular-nums; }
.ql-total .ql-bar { grid-column: 1 / -1; }
.ql-bar { display: block; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.ql-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd85e, #f3a51e); }
.ql-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.ql-reset { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: var(--muted, #a3b3d9); text-transform: none; letter-spacing: 0; }
.ql-reset .ic { width: 14px; height: 14px; }
.ql-reset b { color: #fff; }
.qd { padding: 11px 12px; }
.qd-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.qd-top b { flex: 1; min-width: 0; font-size: 13.5px; }
.qd-ic { width: 20px; height: 20px; flex: none; color: #6fe0a6; }
.qd-n { flex: none; font-size: 12px; font-weight: 900; color: var(--muted, #a3b3d9); font-variant-numeric: tabular-nums; }
.qd .ql-bar > i { background: linear-gradient(90deg, #6fe0a6, #2fbf7a); }
.qd-sub { display: block; margin: -2px 0 6px; font-size: 12px; color: var(--muted, #a3b3d9); font-weight: 700; }
.qd-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.qd-foot > small { font-size: 11px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--muted, #a3b3d9); }
.qd-foot .pg-rws { flex: 1; min-width: 0; }
.qd-claim { min-height: 34px; padding: 4px 16px; }
.qd-done { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; color: var(--ok, #3ee07a); }
.qd-done .ic { width: 15px; height: 15px; }
.qd.ready { border-color: rgba(255, 207, 74, .5); }
.qd.claimed { opacity: .7; }
.qd.chest .qd-ic { color: var(--gold, #ffcf4a); }
.ql-more { width: 100%; display: flex; align-items: center; gap: 8px; justify-content: flex-start; margin-top: 4px; }
.ql-more span { flex: 1; text-align: left; }
.ql-more .ic { width: 16px; height: 16px; }

/* wallet beside the profile chip: money over diamonds; diamonds have a "+" (opens the Mall) */
.pf-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pf-row .pf-chip { min-width: 0; }
.pf-wallet { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 0 1 auto; }
.pf-cur {
  display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 2px 0 3px; border-radius: 10px; cursor: pointer;
  background: var(--panel, rgba(13, 21, 44, .86)); border: 1px solid var(--line-2, rgba(170, 195, 255, .26)); color: #fff;
  font: 900 11px/1 Nunito, system-ui, sans-serif; font-variant-numeric: tabular-nums; box-shadow: 0 2px 6px rgba(2, 6, 20, .3);
}
.pf-cur:hover { border-color: rgba(255, 207, 74, .55); }
.pf-cur b { flex: 1; min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.pf-cur .wl-cur { width: 14px; height: 14px; outline-offset: -4px; font-size: 9px; }
.pf-cur .dia { width: 14px; height: 14px; flex: none; }
.pf-plus { display: grid; place-items: center; width: 15px; height: 15px; flex: none; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 900; line-height: 1; background: var(--gold, #ffcf4a); color: #13204a; }
.pf-cur::after { content: ''; position: absolute; inset: -4px 0; }   /* taller hit area, no gap between the two */
.pf-cur { position: relative; }
.pf-cur.money { cursor: default; padding-right: 5px; }
.pf-cur.money:hover { border-color: var(--line-2, rgba(170, 195, 255, .26)); }
.pf-wallet { align-items: stretch; min-width: 62px; }

/* Settings: two tabs (Game · Account & Help), each one page of headed sections */
.settings.two { grid-template-columns: minmax(0, 1fr); }
.settings.two .set-sec + .set-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, rgba(170, 195, 255, .14)); }
.set-h { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font: 900 13px/1.2 Nunito, system-ui, sans-serif; color: var(--gold, #ffcf4a); letter-spacing: .02em; }
.set-h .ic { width: 16px; height: 16px; }

/* four Profile tabs (Card · Online · Account · Settings): on phones they share the width beside the close button, every
   one labelled (icon over a short word) so Account and Settings are easy to find */
@media (max-width: 520px) {
  .pf-panel .mh-icon { display: none; }
  .pf-switch { flex: 1 1 0; width: 100%; min-width: 0; display: flex; }
  .pf-switch .seg-b { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; padding: 4px 2px; gap: 2px; line-height: 1.1; }
  html.touch .pf-panel .pf-switch .seg-b { min-height: 44px; padding: 4px 2px; font-size: 11.5px; }
  .pf-switch .seg-b span { font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* the Account tab: its tab already says Account, and the help card names itself, so no repeated headings */
.settings.two [data-sec="account"] > .set-h, .settings.two [data-sec="support"] > .set-h { display: none; }

/* the gold Mall button beside the wallet, always in view (owner, 24 Nov 2026: make the Mall easy to find and
   attractive; no sale tags). A light sweeps across it now and then and it breathes gently. Phones use the gold bubble
   under the minimap instead (mobile.css). */
.pf-mall { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; flex: none;
  width: 64px; height: 54px; padding: 2px 0 4px; border: 2px solid #fff2a8; border-radius: 16px; cursor: pointer; color: #13204a;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) no-repeat -120% 0 / 60% 100%,
    linear-gradient(#ffe680, #ffc22e 55%, #f29b12);
  font: 400 14px/1 'Lilita One', Nunito, system-ui, sans-serif; letter-spacing: .4px; text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  box-shadow: 0 3px 0 #b86f0c, 0 0 14px 3px rgba(255, 196, 46, .6); animation: pf-mall-shine 3.6s ease-in-out infinite, pf-mall-breathe 3.6s ease-in-out infinite; }
.pf-mall .ic-tile { width: 30px; height: 30px; margin: 0 0 -2px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3)); }
.pf-mall:hover { filter: brightness(1.07); } .pf-mall:active { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 #b86f0c, 0 0 10px 2px rgba(255, 196, 46, .5); }
.pf-mall:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@keyframes pf-mall-shine { 0%, 55% { background-position: -120% 0, 0 0; } 85%, 100% { background-position: 240% 0, 0 0; } }
@keyframes pf-mall-breathe { 0%, 100% { transform: none; } 50% { transform: scale(1.05); } }
html.touch .pf-mall { display: none; }
html.reduce-motion .pf-mall { animation: none; }
@media (prefers-reduced-motion: reduce) { .pf-mall { animation: none; } }
