:root {
  --ink: #f6eedd;
  --ink-soft: #cdbf9f;
  --panel: rgba(28, 22, 18, 0.88);
  --panel-edge: #a8823f;
  --gold: #f2c14e;
  --gold-deep: #b8862b;
  --red: #e2483d;
  --hp: #4ccf6a;
  --mana: #4d8dff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --title: "Cinzel", Georgia, serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; background: #120e0b; color: var(--ink); font-family: var(--body); }

#app {
  min-height: 100vh;
  min-height: 100dvh;
  background: #120e0b center / cover no-repeat;
  position: relative;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

.screen { min-height: 100vh; min-height: 100dvh; display: flex; }

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 220, 150, 0.08);
  backdrop-filter: blur(4px);
}

.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--gold); font-weight: 800; }
.title { font-family: var(--title); font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0.1em 0; color: var(--gold); text-shadow: 0 3px 0 #5a3a12, 0 6px 18px rgba(0,0,0,.5); }
.lead { margin: 0 0 1rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-weight: 400; }
.emoji { font-size: 1.5rem; line-height: 1; }

.btn {
  border: 2px solid var(--panel-edge);
  background: #3a2c20;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-weight: 800;
  transition: transform .1s, filter .15s, background .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:disabled { opacity: .5; }
.btn.primary { background: linear-gradient(#f6cf62, #c9932d); color: #2b1a06; border-color: #ffe39a; box-shadow: 0 3px 0 #7a5312; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.big { padding: 0.85rem 1.2rem; font-size: 1.05rem; width: 100%; }
.btn small { font-weight: 400; opacity: .7; }

.chip {
  border: 2px solid #5b4630; background: #2a2018; border-radius: 999px; padding: .4rem 1rem; font-weight: 700;
}
.chip.on { border-color: var(--gold); background: #4a3720; color: var(--gold); }

.rank-badge {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em;
  border-radius: 6px; background: var(--gold); color: #2b1a06; font-weight: 900; font-size: .85em;
}

.el-icon { width: 44px; height: 44px; display: block; }
.el-icon.small { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }

.player-sprite { filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.45)); }

/* ---------- Create ---------- */

.create { align-items: center; justify-content: center; gap: 2rem; padding: 1.5rem; }
.create-preview { flex: 0 1 380px; display: flex; justify-content: center; align-self: flex-end; }
.preview-avatar { height: min(86vh, 800px); max-width: 100%; }
.create-panel { flex: 0 1 560px; padding: 1.5rem 1.6rem; max-height: calc(100vh - 3rem); overflow-y: auto; }

.field { display: block; margin-bottom: 1.1rem; }
.label { display: block; font-weight: 800; margin-bottom: .45rem; }
.field input {
  width: 100%; padding: .7rem .9rem; border-radius: 10px; border: 2px solid #5b4630; background: #1d1611;
  color: var(--ink); font: inherit; font-size: 1.05rem;
}
.field input:focus { outline: none; border-color: var(--gold); }
.toggle { display: flex; gap: .5rem; }

.element-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.element-card, .weapon-card {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center;
  padding: .7rem .4rem; border-radius: 12px; border: 2px solid #4a3a2a; background: #221a14;
  transition: transform .12s, border-color .12s, background .12s;
}
.element-card small, .weapon-card small { color: var(--ink-soft); font-size: .72rem; line-height: 1.2; }
.element-card:hover, .weapon-card:hover { transform: translateY(-2px); }
.element-card.on { border-color: var(--el); background: color-mix(in srgb, var(--el) 22%, #221a14); box-shadow: 0 0 16px color-mix(in srgb, var(--el) 45%, transparent); }
.weapon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.weapon-card.on { border-color: var(--gold); background: #3a2b1b; }

/* ---------- Hub ---------- */

.hub { align-items: flex-end; justify-content: center; gap: 3rem; padding: 1.5rem; }
.hub-stage { flex: 0 1 360px; display: flex; justify-content: center; }
.hub-stage img { height: min(78vh, 720px); max-width: 100%; object-fit: contain; }
.hub-panel { flex: 0 1 380px; padding: 1.4rem; align-self: center; }
.hub-panel .name { font-family: var(--title); font-size: 2rem; margin: .1em 0; color: var(--gold); }
.rank-line { margin: 0 0 1rem; display: flex; gap: .5rem; align-items: center; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; }
.stats div { background: #1d1611; border-radius: 10px; padding: .6rem .8rem; border: 1px solid #4a3a2a; }
.stats dt { font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; }
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 800; }
.kit { display: grid; gap: .5rem; margin-bottom: 1rem; }
.kit-row { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.kit-row .el-icon { width: 32px; height: 32px; }
.notice { background: rgba(242, 193, 78, .12); border-left: 3px solid var(--gold); padding: .6rem .8rem; border-radius: 6px; margin: 0 0 1rem; }
.hub-actions { display: grid; gap: .6rem; }

/* ---------- Modal / quest board ---------- */

.modal {
  position: fixed; inset: 0; background: rgba(8, 6, 4, .6); display: grid; place-items: center;
  padding: 1rem; z-index: 20; animation: fade .2s ease-out;
}
.board { width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .5rem; }
.board-head h2 { font-family: var(--title); margin: 0; color: var(--gold); }
.quest-list { overflow-y: auto; padding: .5rem 1.2rem 1.2rem; display: grid; gap: .7rem; }
.quest {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 1rem; align-items: center;
  background: #f1e3c4; color: #3a2a18; border-radius: 10px; padding: .8rem 1rem;
  box-shadow: 0 3px 0 #b49a6c; position: relative;
}
.quest::before { content: ""; position: absolute; top: 6px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #b0372c; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.quest-monster { width: 76px; height: 64px; object-fit: contain; }
.quest h3 { margin: 0 0 .2rem; display: flex; gap: .4rem; align-items: center; font-size: 1.05rem; }
.quest p { margin: 0; font-size: .9rem; }
.quest-meta { margin-top: .35rem !important; color: #6d5536; font-weight: 700; font-size: .8rem !important; }
.quest.locked { filter: grayscale(.6); opacity: .78; }   /* faded but still readable */
.quest.locked .quest-monster { opacity: .7; }
.lock { font-weight: 800; font-size: .85rem; white-space: nowrap; }
.quest-meta.hard { color: #b0372c; }
.quest-why { margin-top: .3rem !important; font-weight: 800; font-size: .82rem !important; color: #7a3b22; }
.rank-head { margin: .6rem 0 0; display: flex; align-items: center; gap: .45rem; font-family: var(--title); color: var(--gold); font-size: 1rem; }
.rank-head:first-child { margin-top: 0; }
.rank-head.locked { color: #a8957a; }
.quest-later { margin: .4rem 0 0; text-align: center; color: var(--ink-soft); font-size: .85rem; }
.quest-sheet { width: min(620px, 100%); }
.quest-detail { display: grid; grid-template-columns: 150px 1fr; gap: 1.2rem; align-items: center; padding: .4rem 1.2rem 1.3rem; }
.quest-detail-monster { width: 150px; height: 140px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.quest-story { margin: 0 0 .6rem; line-height: 1.45; }
.quest-detail .quest-meta { color: var(--ink-soft); }
.quest-detail .rewards { justify-content: flex-start; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; }
.quest-detail .row { display: flex; gap: .6rem; justify-content: flex-end; }
.quest-warn { margin: 0 0 .7rem; color: #ff9b7a; font-weight: 700; font-size: .88rem; }
.lv-tag { font-size: .72rem; font-weight: 800; background: #2a1f15; color: var(--gold); border: 1px solid #6b5435; border-radius: 6px; padding: 0 .35rem; }

/* ---------- Battle ---------- */

.battle { flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; padding: .9rem 1.2rem 0; align-items: start; }
.zone-name { background: var(--panel); border: 1px solid var(--panel-edge); padding: .35rem .9rem; border-radius: 999px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.fighter-card { background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 12px; padding: .6rem .8rem; max-width: 340px; box-shadow: var(--shadow); }
.fighter-card.right { justify-self: end; width: 100%; }
.fc-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.fighter-card.right .fc-head { justify-content: flex-end; }
.bar { position: relative; height: 18px; background: #1a120c; border-radius: 6px; overflow: hidden; margin-top: 4px; border: 1px solid #000; }
.bar span { position: absolute; inset: 0 auto 0 0; transition: width .35s ease-out; }
.bar.hp span { background: linear-gradient(#7af08f, var(--hp)); }
.bar.mana { height: 12px; }
.bar.mana span { background: linear-gradient(#8db6ff, var(--mana)); }
.bar em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .72rem; font-weight: 800; text-shadow: 0 1px 2px #000; }
.bar.mana em { font-size: .62rem; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .4rem; min-height: 1.4rem; }
.fighter-card.right .chips { justify-content: flex-end; }
.chip-s { font-size: .72rem; font-weight: 800; padding: .1rem .5rem; border-radius: 999px; background: #2b2119; border: 1px solid #5b4630; }
.chip-s.burn { border-color: #ff6a2b; }
.chip-s.stun { border-color: #f2c14e; }
.chip-s.dodge { border-color: #4fe0b0; }
.chip-s.guard { border-color: #9fb3c8; }

.stage { flex: 1; position: relative; min-height: 0; }
.fighter { position: absolute; bottom: 4%; transition: transform .2s; }
#sprite-player { left: 10%; height: 86%; max-height: 580px; }
.fighter.monster { right: 16%; height: calc(78% * var(--size, .7)); max-height: calc(520px * var(--size, .7)); filter: drop-shadow(0 10px 8px rgba(0,0,0,.45)) drop-shadow(0 0 10px rgba(255,255,255,.25)); }

.lunge-right { animation: lunge-right .6s cubic-bezier(.3, 0, .2, 1); }
.lunge-left { animation: lunge-left .55s cubic-bezier(.3, 0, .2, 1); }
.hit { animation: hit .45s ease-out; }
.defeated { animation: defeated .8s ease-in forwards; }

/* Melee: lean back to wind up, dash in leaning forward, then step back to place. */
@keyframes lunge-right {
  0% { transform: none; }
  25% { transform: translateX(-14px) rotate(-3deg); }
  55% { transform: translateX(80px) rotate(5deg) scale(1.03); }
  100% { transform: none; }
}
@keyframes lunge-left {
  0% { transform: none; }
  25% { transform: translateX(14px) scale(1.04, .94); }
  55% { transform: translateX(-80px) scale(1.06); }
  100% { transform: none; }
}
@keyframes hit {
  0% { filter: drop-shadow(0 0 0 var(--flash)) brightness(2.2); transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); filter: drop-shadow(0 0 18px var(--flash)) brightness(1.4); }
  60% { transform: translateX(-6px); }
  100% { transform: translateX(0); }
}
@keyframes defeated { to { opacity: 0; transform: translateY(20px) scale(.9); filter: grayscale(1); } }
@keyframes fade { from { opacity: 0; } }

.orb {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; z-index: 5;
  background: radial-gradient(circle, #fff 0 20%, var(--el) 45%, transparent 72%);
  box-shadow: 0 0 24px 8px var(--el);
  animation: orb .45s ease-in forwards;
}
@keyframes orb { to { transform: translate(var(--dx), var(--dy)) scale(1.6); opacity: .2; } }

.popup {
  position: absolute; transform: translateX(-50%); font-weight: 900; font-size: 2rem; z-index: 6; pointer-events: none;
  color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,.6); animation: popup 1s ease-out forwards;
}
.popup.crit { color: #ffd34d; font-size: 2.6rem; }
.popup.super { color: #ff8a5c; }
.popup.weak { color: #b9c3cf; font-size: 1.6rem; }
.popup.heal { color: #7af08f; }
.popup.miss { color: #e5e5e5; font-size: 1.4rem; }
/* words above the number: Crit! / Strong! / Weak! / Stunned! / Burn! */
.popup.word { font-size: 1.35rem; letter-spacing: .03em; animation-delay: .08s; opacity: 0; font-style: italic; }
.popup.word.crit { color: #ffd34d; font-size: 1.6rem; }
.popup.word.super { color: #ff8a5c; }
.popup.word.weak { color: #b9c3cf; }
.popup.word.stun { color: #ffe56b; }
.popup.word.burn { color: #ff7a3c; }
/* skill name sweeping across the top of the battle, in the element's colour */
.skill-banner {
  position: absolute; top: 6%; left: 0; right: 0; z-index: 7; pointer-events: none; display: flex; justify-content: center;
  animation: banner-in 1.3s ease-out forwards;
}
.skill-banner span {
  font-family: var(--title); font-weight: 900; font-size: clamp(1.3rem, 3.6vw, 2.4rem); letter-spacing: .08em; text-transform: uppercase;
  color: #fff; padding: .25em 1.6em; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 14px var(--el);
  background: linear-gradient(90deg, transparent, var(--el) 18%, var(--el) 82%, transparent);
  box-shadow: 0 0 28px var(--el); opacity: .95;
}
.skill-banner.enemy span { font-size: clamp(1rem, 2.6vw, 1.7rem); }
@keyframes banner-in {
  0% { opacity: 0; transform: translateX(-30%) skewX(-12deg); }
  15% { opacity: 1; transform: translateX(0) skewX(-12deg); }
  75% { opacity: 1; transform: translateX(2%) skewX(-12deg); }
  100% { opacity: 0; transform: translateX(10%) skewX(-12deg); }
}
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

.bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; padding: 0 1.2rem 1rem; align-items: end; }

/* ---------- Turn-order bar ---------- */
.turn-bar { display: flex; align-items: center; gap: 1rem; padding: 0 1.2rem .55rem; }
.turn-bar .track {
  position: relative; flex: 1; height: 12px; margin: 0 18px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(20,15,10,.75), rgba(60,45,25,.75)); border: 2px solid var(--panel-edge);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
.turn-bar .track::after { content: "⚔"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 1rem; }
.pin {
  position: absolute; top: 50%; width: 34px; height: 34px; margin-left: -17px; margin-top: -17px; border-radius: 50%;
  overflow: hidden; border: 2px solid #fff; background: #241a12; transition: left .3s ease-out; z-index: 1;
}
.pin.instant { transition: none; }
.pin.player { border-color: #7ad0ff; }
.pin.monster { border-color: #ff7a6b; display: grid; place-items: center; }
.pin.monster img { width: 120%; height: 120%; object-fit: contain; }
.pin.ready { box-shadow: 0 0 0 3px var(--gold), 0 0 12px var(--gold); z-index: 2; }
.pin .portrait { width: 100%; height: 100%; border: 0; box-shadow: none; }
.turn-bar .next { display: flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .75rem; font-weight: 800; }
.turn-bar .next small { color: var(--ink-soft); margin-right: .1rem; }
.nx { padding: .1rem .45rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-edge); max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; }
.nx.player { color: #9edcff; }
.nx.monster { color: #ffa093; }
.nx.now { border-color: var(--gold); color: var(--gold); }
@media (max-width: 760px) {
  .turn-bar { padding: 0 .8rem .4rem; gap: .5rem; flex-wrap: wrap; }
  .turn-bar .next { width: 100%; justify-content: center; order: 2; font-size: .68rem; }
  .turn-bar .next small { display: none; }
  .nx { flex-shrink: 0; max-width: 5.5em; padding: .05rem .35rem; }
  .pin { width: 28px; height: 28px; margin-left: -14px; margin-top: -14px; }
}
.log {
  overflow: hidden;
  list-style: none; margin: 0; padding: .7rem .9rem; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  font-size: .88rem; min-height: 6.4rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .15rem;
}
.log li { opacity: .65; }
.log li:last-child { opacity: 1; font-weight: 700; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.actions.busy .act { opacity: .55; pointer-events: none; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  min-height: 96px; padding: .6rem .4rem; border-radius: 12px; border: 2px solid var(--panel-edge);
  background: linear-gradient(#3e2f22, #261c14); box-shadow: 0 4px 0 #120c08; text-align: center;
  transition: transform .1s, filter .15s;
}
.act:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.15); }
.act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #120c08; }
.act small { font-size: .72rem; color: var(--ink-soft); }
.act.skill { border-color: var(--el); background: linear-gradient(color-mix(in srgb, var(--el) 35%, #2b2018), #221a14); }
.act.skill .el-icon { width: 40px; height: 40px; }
.act:disabled { filter: grayscale(.7) brightness(.7); }
.cd {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 900;
  background: rgba(0,0,0,.45); border-radius: 10px; color: #fff; text-shadow: 0 2px 0 #000;
}

.result { padding: 1.6rem 1.8rem; text-align: center; width: min(440px, 100%); animation: pop .3s ease-out; }
.result h2 { font-family: var(--title); font-size: 2rem; margin: .2em 0; color: var(--gold); }
.result.lose h2 { color: #e57b6f; }
.rewards { display: flex; justify-content: center; gap: .8rem; margin: 1rem 0; }
.rewards span { background: #1d1611; border: 1px solid var(--gold-deep); border-radius: 999px; padding: .4rem .9rem; font-weight: 800; }
.result .row { display: flex; gap: .6rem; justify-content: center; margin-top: 1rem; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .create, .hub { flex-direction: column; align-items: stretch; padding: 1rem; gap: 0; }
  .create-preview, .hub-stage { align-self: center; }
  .preview-avatar { height: 36vh; }
  .hub-stage img { height: 38vh; }
  .create-panel { max-height: none; }
  .element-grid { grid-template-columns: repeat(3, 1fr); }
  .weapon-grid { grid-template-columns: repeat(2, 1fr); }
  .hud { grid-template-columns: 1fr 1fr; padding: .6rem 1rem 0; gap: .5rem; }
  .zone-name { display: none; }
  .fighter-card { padding: .5rem; }
  #sprite-player { left: 0; }
  .fighter.monster { right: 6%; }
  .bottom { grid-template-columns: 1fr; padding: 0 1rem 1rem; }
  .log { min-height: 4.6rem; font-size: .8rem; order: 2; }
  .actions, .actions.wide { grid-template-columns: repeat(3, 1fr); gap: .4rem; }
  .act { min-height: 64px; padding: .35rem .25rem; }
  .act strong { font-size: .78rem; }
  .act small { font-size: .62rem; }
  .quest { grid-template-columns: 56px 1fr; }
  .quest-monster { width: 56px; height: 52px; }
  .quest .btn, .quest .lock { grid-column: 1 / -1; }
  .quest-detail { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .quest-detail-monster { width: 120px; height: 110px; }
  .quest-detail .rewards, .quest-detail .row { justify-content: center; }
}

/* Battle animations are part of the gameplay, so they stay on with "reduce motion";
   only decorative hover/scroll transitions are switched off. */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layered characters ---------- */

.avatar { position: relative; flex: none; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.45)); }
.avatar .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar .layer:not([src]) { visibility: hidden; }

.portrait {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none;
  background: radial-gradient(circle at 50% 35%, #5d4630, #241a12); border: 3px solid var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.portrait .avatar, .thumb .avatar {
  position: absolute; height: var(--zoom, 520%); left: 50%; top: 50%; filter: none;
  transform: translate(calc(var(--hx, .5) * -100%), calc(var(--hy) * -100%));
}

.hair-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; }
.hair-card { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .45rem .2rem; border-radius: 12px; border: 2px solid #4a3a2a; background: #221a14; }
.hair-card .portrait { width: 54px; height: 54px; border-width: 2px; border-color: #6b5435; }
.hair-card small { font-size: .68rem; color: var(--ink-soft); text-align: center; line-height: 1.1; }
.hair-card.on { border-color: var(--gold); background: #3a2b1b; }
.hair-card.on .portrait { border-color: var(--gold); }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 2px solid #1a120c; box-shadow: 0 0 0 2px #5b4630; }
.swatch.on { box-shadow: 0 0 0 3px var(--gold); transform: scale(1.1); }

/* ---------- Village hub ---------- */

.village { position: relative; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: block; }
.map-scroll { position: absolute; inset: 0; overflow: auto; scrollbar-width: none; }
.map-scroll::-webkit-scrollbar { display: none; }
/* the map always covers the whole screen, under the bottom bar too (user 2026-10-21), and the picture has countryside
   all around the village (2784 x 1421), so any window shape sees forest at its edges; the view starts on the village
   and can be scrolled. */
.map {
  position: relative; background: center / 100% 100% no-repeat; margin: 0 auto;
  width: max(100vw, calc(100vh * 2784 / 1421)); width: max(100vw, calc(100dvh * 2784 / 1421));   /* set by fitMap() */
  aspect-ratio: 2784 / 1421;
}
.map-scroll { background: radial-gradient(ellipse at 50% 40%, #6e9a3e, #3d5f25 70%); }
.building {
  position: absolute; border: 0; padding: 0; background: transparent; border-radius: 40%; z-index: 1;
  transition: background .2s, box-shadow .2s;
}
.building:hover, .building:focus-visible {
  background: radial-gradient(closest-side, rgba(255, 236, 170, .35), rgba(255, 236, 170, 0));
  outline: none;
}
.sign {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; z-index: 2; text-align: center;
  font-family: var(--title); font-weight: 900; font-size: clamp(.8rem, 1.4vw, 1.25rem); color: #2b1a06;
  padding: .3em .9em .35em; border-radius: 8px; border: 3px solid #3a2410;
  background: linear-gradient(#fff6dc, #e8d3a2); box-shadow: 0 4px 0 #3a2410, 0 8px 18px rgba(0,0,0,.4);
  transition: transform .15s, filter .15s;
}
.sign.hover { transform: translate(-50%, -58%) scale(1.1); filter: brightness(1.08); }
.sign small { display: block; font-family: var(--body); font-size: .6em; font-weight: 800; color: #7a5a2e; letter-spacing: .02em; }
.sign.is-soon { filter: saturate(.6); }
.sign.is-soon small { color: #9a8a74; text-transform: uppercase; letter-spacing: .08em; }

.hud-tl {
  position: absolute; top: 12px; left: 12px; display: flex; gap: .7rem; align-items: center; z-index: 5;
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 50px 14px 14px 50px; padding: .45rem .9rem .45rem .45rem;
  box-shadow: var(--shadow); width: min(360px, calc(100vw - 24px));
}
.hud-tl .portrait { width: 76px; height: 76px; }
.hud-info { flex: 1; min-width: 0; }
.hud-name { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; margin-bottom: 2px; }
.hud-name strong { font-family: var(--title); color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-tl .bar { height: 17px; margin-top: 4px; }
.hud-tl .bar.mana, .hud-tl .bar.xp { height: 15px; }
.hud-tl .bar em, .hud-tl .bar.mana em, .hud-tl .bar.xp em { font-size: .72rem; line-height: 1; letter-spacing: .02em; }
.bar.xp span { background: linear-gradient(#ffe38a, #d9a23a); }
.bar.xp em { font-size: .6rem; }

.hud-tr {
  position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; align-items: center; gap: .4rem;
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 999px; padding: .4rem 1rem; box-shadow: var(--shadow);
}
/* next goal (rank exam) at the top of the village */
.goal-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap;
  display: flex; align-items: center; gap: .45rem; font: inherit; font-weight: 800; font-size: .92rem; color: var(--ink);
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 999px; padding: .45rem 1.1rem; box-shadow: var(--shadow);
}
.goal-banner.done { color: var(--ink-soft); }
.goal-banner.ready { cursor: pointer; color: #2a1c0e; background: linear-gradient(#ffe38a, #d9a23a); border-color: #fff1b8; animation: goal-glow 1.8s ease-in-out infinite; }
.goal-banner.ready:hover { filter: brightness(1.08); }
@keyframes goal-glow { 50% { box-shadow: 0 0 0 4px rgba(255, 220, 120, .35), var(--shadow); } }
@media (max-width: 1000px) { .goal-banner { top: 112px; font-size: .82rem; padding: .35rem .9rem; } }
/* number badge (dailies left) on the Guild Hall sign and the Quests button */
.badge {
  position: absolute; top: -.55em; right: -.55em; min-width: 1.5em; height: 1.5em; padding: 0 .35em; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font: 900 .78rem/1 system-ui, sans-serif; font-style: normal;
  color: #fff; background: #d23c2c; border: 2px solid #fff3d4; box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.bottom-bar button { position: relative; }
.bottom-bar .badge { top: -.35em; right: -.25em; }
.daily-reset { margin-left: auto; font: 700 .75rem system-ui, sans-serif; color: var(--ink-soft); text-transform: none; }
.quest.daily { border: 2px solid #7fbf6a; }
.quest.daily.done { opacity: .6; filter: grayscale(.5); }
.quest.daily.done .lock { color: #3f7a2e; }
.quest.exam { border: 2px solid #d9a23a; background: linear-gradient(#fff3d4, #f1e3c4); }
.quest-note { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .85rem; }
.hud-tr .coin { font-size: 1.4rem; }
.hud-tr strong { font-size: 1.3rem; color: var(--gold); }
.hud-tr small { color: var(--ink-soft); }

.bottom-bar {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 5;
  display: flex; gap: .4rem; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 18px; padding: .4rem;
  box-shadow: var(--shadow); max-width: calc(100vw - 20px);
}
.bottom-bar button {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 76px; padding: .4rem .6rem;
  border-radius: 12px; border: 2px solid transparent; background: #2b2119; font-weight: 800; font-size: .78rem;
}
.bottom-bar button span { font-size: 1.5rem; line-height: 1.1; }
.bottom-bar button:hover { border-color: var(--gold); }
.bottom-bar button.main { background: linear-gradient(#f6cf62, #c9932d); color: #2b1a06; border-color: #ffe39a; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 30; max-width: min(520px, calc(100vw - 32px));
  background: var(--panel); border: 2px solid var(--gold); border-radius: 12px; padding: .7rem 1.1rem; font-weight: 700; text-align: center;
  box-shadow: var(--shadow); animation: toast 3.2s ease forwards; pointer-events: none;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.modal > .panel { max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: var(--title); color: var(--gold); margin: .2em 0 .5em; font-size: 1.8rem; }
.story { width: min(520px, 100%); padding: 1.4rem 1.6rem; line-height: 1.55; }
.row { display: flex; gap: .6rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.btn.danger { background: #6b1f1a; border-color: #e2483d; }
.options { width: min(440px, 100%); padding: 0 1.2rem 1.2rem; }
.profile .name { font-family: var(--title); color: var(--gold); font-size: 1.6rem; margin: 0; }
.kit-row.small { font-weight: 400; font-size: .85rem; align-items: flex-start; }
.look-editor { width: min(1060px, 96vw); padding: 0 1.4rem 1.4rem; max-height: 94vh !important; }
.look-body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1.6rem; align-items: start; }
#look-preview { display: flex; justify-content: center; position: sticky; top: 0; }
.look-avatar { height: min(66vh, 560px); }
#look-picker { flex: 1; min-width: 0; }

/* ---------- Battle extras ---------- */

.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.fc-head .portrait { width: 34px; height: 34px; border-width: 2px; }
.cast { animation: cast .5s ease-out; }
@keyframes cast { 30% { transform: translateY(-8px) scale(1.03); filter: brightness(1.3) drop-shadow(0 0 14px var(--gold)); } }

@media (max-width: 760px) {
  .hair-grid { grid-template-columns: repeat(3, 1fr); }
  .hud-tl .portrait { width: 58px; height: 58px; }
  .bottom-bar button { min-width: 0; padding: .35rem .45rem; font-size: .68rem; }
  .bottom-bar button span { font-size: 1.2rem; }
  .profile-body, .look-body { flex-direction: column; align-items: center; }
  .profile-avatar, .look-avatar { height: 240px; }
  .look-body { grid-template-columns: 1fr; }
  #look-preview { position: static; }
  .style-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .fc-head .portrait { display: none; }
}

.avatar.fighter { position: absolute; }

/* ---------- Look picker tabs ---------- */

.look-picker { margin-bottom: 1.1rem; }
.tabs { display: flex; gap: .3rem; margin-bottom: .6rem; border-bottom: 2px solid #4a3a2a; }
.tab { border: 0; background: transparent; padding: .45rem .9rem; font-weight: 800; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .55rem; margin-bottom: .8rem; }
.style-card { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .45rem .2rem; border-radius: 12px; border: 2px solid #4a3a2a; background: #221a14; }
.thumb { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 9px;
  background: radial-gradient(circle at 50% 30%, #5d4630, #241a12); border: 2px solid #6b5435; }
.style-card small { font-size: .8rem; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.15; }
.style-card.on { border-color: var(--gold); background: #3a2b1b; }
.style-card.on .thumb { border-color: var(--gold); }
.style-card.on small { color: var(--gold); }
.swatch.natural { background: linear-gradient(135deg, #b8b8b8 0 45%, #6e6e6e 55% 100%); }

/* ---------- Bigger profile ---------- */

.profile { width: min(1060px, 96vw); padding: 0 1.4rem 1.4rem; max-height: 94vh !important; }
.profile .board-head { padding: 1rem 0 .4rem; }
.profile-body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1.6rem; align-items: start; }
.profile-left { display: flex; flex-direction: column; align-items: center; text-align: center; position: sticky; top: 0; }
.profile-avatar { height: min(62vh, 520px); }
/* drawn stances: a weapon on the shoulder or raised can reach well above the head, so leave headroom */
.profile-avatar.is-anim, .look-avatar.is-anim { height: min(52vh, 440px); margin-top: min(12vh, 100px); }
.profile-left .name { margin-top: .4rem; }
.outfit-line { margin: 0; color: var(--ink-soft); font-size: .85rem; }
.profile-right section { margin-bottom: 1.1rem; }
.profile-right h4 { margin: 0 0 .5rem; font-family: var(--title); color: var(--gold); font-size: 1.05rem; letter-spacing: .04em;
  border-bottom: 1px solid #4a3a2a; padding-bottom: .25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: #1d1611; border: 1px solid #4a3a2a; border-radius: 10px; padding: .55rem .7rem; }
.stat dt { font-size: .75rem; color: var(--ink-soft); font-weight: 700; }
.stat dd { margin: .1rem 0 0; font-size: 1.35rem; font-weight: 900; color: var(--ink); }
.stat small { display: block; font-size: .68rem; color: #9a8a74; }
.profile-right .kit-row { margin-bottom: .45rem; }

@media (max-width: 760px) {
  .style-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-body { grid-template-columns: 1fr; }
  .profile-left { position: static; }
  .profile-avatar { height: 260px; }
  .profile-avatar.is-anim, .look-avatar.is-anim { height: 220px; margin-top: 50px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Levels ---------- */

#hud-portrait { position: relative; }
.level-badge {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(#f6cf62, #c9932d); color: #2b1a06; font-weight: 900; font-size: .72rem;
  padding: .05rem .5rem; border-radius: 999px; border: 2px solid #3a2410;
}
.level-up {
  display: grid; gap: .25rem; margin: .8rem 0; padding: .7rem .9rem; border-radius: 12px;
  background: linear-gradient(rgba(242, 193, 78, .25), rgba(242, 193, 78, .08)); border: 2px solid var(--gold);
  animation: pop .4s ease-out;
}
.level-up strong { font-family: var(--title); color: var(--gold); font-size: 1.25rem; }
.level-up span { font-size: .88rem; }
.small-note { font-size: .85rem; margin: 0 0 1rem; }

/* ---------- Blacksmith ---------- */

.smithy { width: min(1100px, 97vw); padding: 0 1.4rem 1.4rem; max-height: 95vh !important; }
.smithy .board-head { gap: 1rem; padding: 1rem 0 .6rem; }
.smithy .board-head h2 { margin-right: auto; }
.smith-purse { font-weight: 800; color: var(--gold); }
.smith-body { display: grid; grid-template-columns: 1fr 290px; gap: 1.2rem; align-items: start; }
.w-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem 1rem; }

.w-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem;
  border: 0; background: transparent; padding: .9rem 0 0; cursor: pointer;
}
.w-level {
  position: absolute; top: 0; left: 4px; z-index: 2; font-weight: 900; font-size: 1.15rem; color: #ffd34d;
  text-shadow: 0 2px 0 #3a2410, 0 0 3px #3a2410, 1px 1px 0 #3a2410, -1px -1px 0 #3a2410;
}
.w-tile {
  width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(#fafafa, #dcdcdc); border: 6px solid #b8915a; box-shadow: inset 0 0 0 3px #3a2410, 0 4px 0 #3a2410;
  transition: transform .12s;
}
.w-card:hover .w-tile { transform: translateY(-3px); }
.w-card.on .w-tile { border-color: var(--gold); box-shadow: inset 0 0 0 3px #3a2410, 0 0 0 3px var(--gold), 0 4px 0 #3a2410; }
.w-icon { position: relative; display: grid; place-items: center; width: 82%; height: 82%; }
.w-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.w-icon img + .w-emoji { visibility: hidden; }
.w-emoji { font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.w-icon.small { width: 44px; height: 44px; flex: none; background: linear-gradient(#fafafa, #dcdcdc); border-radius: 8px; border: 2px solid #b8915a; }
.w-icon.small .w-emoji { font-size: 1.6rem; }
.w-icon.big { width: 100%; height: 100%; }
.w-icon.big .w-emoji { font-size: 4.5rem; }
.w-icon.act-icon { width: 38px; height: 38px; }
.w-icon.act-icon .w-emoji { font-size: 1.5rem; }

.w-foot { font-weight: 900; font-size: .95rem; padding: .3rem .8rem; border-radius: 999px; white-space: nowrap; }
.w-foot.price { background: linear-gradient(#e8963a, #a55a14); color: #fff6dc; border: 2px solid #5a3008; text-shadow: 0 1px 0 #5a3008; }
.w-foot.owned { color: #ff5a4a; font-size: 1.1rem; text-shadow: 0 2px 0 #3a0a06; }
.w-foot.equipped { background: var(--gold); color: #2b1a06; border: 2px solid #5a3008; }
.w-card.locked .w-tile { filter: grayscale(.6) brightness(.55); }
.w-card.locked .w-foot { filter: grayscale(1) brightness(.6); }
.w-lock {
  position: absolute; top: .9rem; left: 0; right: 0; aspect-ratio: 1; display: grid; place-items: center; text-align: center;
  padding: .5rem; z-index: 3; font-weight: 900; font-size: .95rem; color: #fff; text-shadow: 0 2px 4px #000; line-height: 1.2;
}
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1rem; font-weight: 900; font-size: 1.1rem; }

.w-detail {
  position: sticky; top: 0; background: #f4ecd8; color: #2b1a06; border-radius: 16px; padding: 1rem 1.1rem 1.1rem;
  border: 3px solid #3a2410; box-shadow: 0 6px 0 #3a2410;
}
.w-detail-tile { aspect-ratio: 1.4; display: grid; place-items: center; background: linear-gradient(#fff, #e2e2e2); border-radius: 12px; border: 2px solid #b8915a; margin-bottom: .6rem; padding: .6rem; }
.w-detail h3 { margin: 0; font-size: 1.3rem; }
.w-detail .muted { color: #7a5a2e; margin: .1rem 0 .5rem; }
.w-damage { margin: .2rem 0 .4rem; font-weight: 900; font-size: 1.25rem; color: #c42a1e; }
.w-damage .up { color: #1f8a3a; font-size: .85rem; margin-left: .4rem; }
.w-damage .down { color: #a33; font-size: .85rem; margin-left: .4rem; }
.w-effects { margin: 0 0 .9rem; padding-left: 1.1rem; font-weight: 700; line-height: 1.45; }
.w-detail .btn.big { margin-top: .3rem; }

/* ---------- Loot ---------- */
.loot-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 .8rem; }
.loot-row small { color: var(--ink-soft); font-weight: 800; }
.loot { position: relative; display: flex; align-items: center; gap: .3rem; padding: .2rem .55rem .2rem .25rem; border-radius: 999px;
  background: #2b2119; border: 1px solid #6b5435; font-size: .75rem; }
.loot .w-icon { width: 30px; height: 30px; }
.loot em { font-style: normal; font-weight: 800; color: #c9a1ff; }
.loot.have { opacity: .6; }
.loot b { color: #7fd16a; }
.loot-drop { display: flex; align-items: center; gap: .6rem; justify-content: center; margin: .6rem 0; padding: .5rem .8rem; border-radius: 12px;
  background: linear-gradient(90deg, rgba(150,90,255,.15), rgba(255,210,80,.15)); border: 1px solid #b08cff; font-weight: 700; }
.loot-drop .w-icon { width: 42px; height: 42px; }

/* ---------- Shop ---------- */
.outfit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.outfit-item { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .55rem; border-radius: 12px;
  background: #221a14; border: 2px solid #4a3a2a; text-align: center; }
.outfit-item.owned { border-color: #6b8a4a; }
.outfit-item .outfit-thumb { width: 100%; }
.outfit-item .thumb { aspect-ratio: 1 / 2; }
.outfit-item .btn { width: 100%; }
.hud-tr .gem { margin-left: .5rem; font-size: 1.15rem; }
.shop .rank-head { margin: .4rem 0 .6rem; }
.bundle {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.2rem; align-items: center; margin-bottom: 1rem;
  background: linear-gradient(135deg, #2a1424, #1b1018); border: 2px solid #b0407e; border-radius: 16px; padding: 1rem;
  box-shadow: 0 0 24px rgba(200, 60, 140, .25);
}
.bundle-art { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #5a2346, #1b1018 70%); border-radius: 12px; padding: .5rem; }
.bundle-art img { max-height: 340px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.bundle-info h3 { margin: 0 0 .4rem; font-family: var(--title); color: #ff9bd2; font-size: 1.4rem; }
.bundle-info p { margin: 0 0 .6rem; }
.bundle-items { margin: 0 0 .6rem; padding-left: 0; list-style: none; display: grid; gap: .35rem; font-weight: 700; }
.bundle-items li { display: flex; align-items: center; gap: .4rem; }
.bundle-items .w-icon { width: 30px; height: 30px; }
.owned-tag { font: 800 .75rem system-ui, sans-serif; color: #1b120a; background: #7fd16a; border-radius: 6px; padding: .1rem .45rem; vertical-align: middle; }
@media (max-width: 760px) {
  .bundle { grid-template-columns: 1fr; }
  .bundle-art img { max-height: 240px; }
}

/* ---------- Affinity Ceremony ---------- */
.affinity-intro { margin: 0 0 .7rem; color: var(--ink-soft); }
.affinity .tab { display: flex; align-items: center; gap: .3rem; }
.affinity .tab .el-icon { width: 22px; height: 22px; }
.affinity .tab.on { color: var(--el); border-bottom-color: var(--el); }
.affinity .tab.mine { opacity: .7; }
.affinity-body { border: 2px solid var(--el); border-radius: 16px; padding: 1rem; background: linear-gradient(160deg, color-mix(in srgb, var(--el) 14%, #1b140f), #1b140f 60%); }
.affinity-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-bottom: .9rem; }
.affinity-head > .el-icon { width: 72px; height: 72px; }
.affinity-head h3 { margin: 0; font-family: var(--title); font-size: 1.6rem; color: var(--el); }
.affinity-head p { margin: .1rem 0; }
.affinity-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.affinity-skill { display: grid; gap: .25rem; }
.academy .tab.awaken { color: var(--gold); }
.academy .tab.change { margin-left: auto; font-size: .8rem; }
@media (max-width: 760px) {
  .affinity-head { grid-template-columns: auto 1fr; }
  .affinity-action { grid-column: 1 / -1; }
  .affinity .tabs { flex-wrap: wrap; }
}

/* ---------- Magic Academy ---------- */
.academy .smith-body { grid-template-columns: 1fr 330px; }
.loadout { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .7rem; }
.slot {
  display: flex; align-items: center; gap: .35rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; font: inherit;
  font-weight: 800; font-size: .82rem; color: var(--ink); background: #2b2119; border: 2px solid var(--el, #4a3a2a);
}
.slot .el-icon { width: 22px; height: 22px; }
.slot.empty { color: var(--ink-soft); border-style: dashed; border-color: #5a4836; padding: .3rem .9rem; }
.academy .tab { display: flex; align-items: center; gap: .35rem; }
.academy .tab .el-icon { width: 22px; height: 22px; }
.skill-list { display: grid; gap: .5rem; }
.skill-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; text-align: left; font: inherit;
  padding: .55rem .8rem; border-radius: 12px; color: var(--ink); background: #2b2119; border: 2px solid #4a3a2a;
}
.skill-row:hover { border-color: var(--el); }
.skill-row.on { border-color: var(--el); box-shadow: 0 0 0 2px var(--el) inset; background: #33271d; }
.skill-row.locked { opacity: .62; }
.skill-row strong { display: block; }
.skill-row small { color: var(--ink-soft); font-weight: 700; }
.skill-row .w-level { position: static; }
.skill-card { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; padding: .6rem .7rem; border-radius: 12px;
  background: #fffaf0; border: 2px solid var(--el); color: #2b1a06; }
.skill-card p { margin: .15rem 0 0; }
.skill-card .muted { color: #7a5a2e; font-size: .8rem; margin: 0; }
.skill-card.next { background: #f0fbe9; border-style: dashed; }
.skill-card.small { margin-bottom: .45rem; background: #2b2119; color: var(--ink); font-size: .85rem; }
.skill-card.small .muted { color: var(--ink-soft); }
.skill-rank { font-size: .72rem; font-weight: 900; padding: 0 .4rem; border-radius: 6px; background: var(--el); color: #1b120a; }
.rank-arrow { text-align: center; font-weight: 900; color: #1f8a3a; margin: .35rem 0; }
.academy-actions { display: grid; gap: .45rem; margin-top: .8rem; }
.academy-actions .btn:not(.primary) { background: #4a3a2a; color: #f4e6c8; border-color: #2b1a06; }
.center { text-align: center; }
.skill-icon { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--el, #ff6a2b); }
/* 4 skills in battle: 6 action buttons in 2 rows of 3 */
.actions.wide { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 860px) {
  .academy .smith-body { grid-template-columns: 1fr; }
  .smith-body { grid-template-columns: 1fr; }
  .w-detail { position: static; order: -1; }
  .w-grid { grid-template-columns: repeat(3, 1fr); }
}

.style-grid.tall .thumb { aspect-ratio: 1 / 2; }
.style-grid.tall { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 760px) { .style-grid.tall { grid-template-columns: repeat(3, 1fr); } }
.w-detail .btn:disabled { opacity: 1; background: #d9cdb2; border-color: #a8916a; color: #5a4630; box-shadow: none; }

/* ---------- Weapon in hand ---------- */

.avatar .weapon { position: absolute; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.avatar .weapon { transform: rotate(var(--rest, 0deg)); }
.w-swing { animation: w-swing .6s cubic-bezier(.3, 0, .2, 1); }
.w-thrust { animation: w-thrust .45s ease-out; }
.w-punch { animation: w-punch .4s ease-out; }
/* Rotations are relative to the resting pose (--rest), around the grip in the hand. */
@keyframes w-swing {
  0% { transform: rotate(var(--rest)); }
  35% { transform: rotate(calc(var(--rest) - 150deg)); }   /* raise the blade up and back */
  70% { transform: rotate(calc(var(--rest) + 15deg)); }    /* slash down and forward */
  100% { transform: rotate(var(--rest)); }
}
@keyframes w-thrust {
  0% { transform: rotate(var(--rest)); }
  30% { transform: translate(-8%, 0) rotate(calc(var(--rest) - 50deg)); }  /* level it, pull back */
  60% { transform: translate(30%, 0) rotate(calc(var(--rest) - 50deg)); }  /* stab forward */
  100% { transform: rotate(var(--rest)); }
}
@keyframes w-punch { 0% { transform: none; } 40% { transform: translate(25%, -8%) scale(1.15); } 100% { transform: none; } }

/* ---------- Idle life ---------- */

/* Fighters breathe gently while waiting (any attack/hit animation replaces this while it plays). */
:where(.avatar.fighter, .fighter.monster) { transform-origin: 50% 100%; animation: breathe 2.6s ease-in-out infinite; }
:where(.fighter.monster) { animation-name: bob; animation-duration: 1.9s; }
.preview-avatar:where(*), .look-avatar:where(*), .profile-avatar:where(*) { transform-origin: 50% 100%; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.012, 1.018); } }
@keyframes bob { 50% { transform: translateY(-5px) scale(1.02, .98); } }
:where(.avatar .weapon:not(.w-swing, .w-thrust, .w-punch)) { animation: w-idle 2.6s ease-in-out infinite; }
@keyframes w-idle { 50% { transform: rotate(calc(var(--rest) + 3deg)); } }
/* Afterimages that trail a swing. */
.avatar .weapon.ghost { pointer-events: none; filter: brightness(1.6) blur(1px); }

.avatar .fist { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.avatar .weapon .w-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar .weapon .w-fist { position: absolute; }

/* Drawn "fist holding weapon" piece: replaces the outfit's own fist (which is masked out of the outfit layer). */
.avatar .held { position: absolute; z-index: 4; pointer-events: none; }
.avatar .held.w-swing { animation-name: held-swing; }
.avatar .held.w-thrust { animation-name: held-thrust; }
@keyframes held-swing { 0% { transform: none; } 35% { transform: rotate(-55deg); } 70% { transform: rotate(12deg); } 100% { transform: none; } }
@keyframes held-thrust { 0% { transform: none; } 30% { transform: translate(-6%, -4%) rotate(-30deg); } 60% { transform: translate(22%, 6%) rotate(-30deg); } 100% { transform: none; } }
:where(.avatar .held:not(.w-swing, .w-thrust, .w-punch)) { animation: held-idle 2.6s ease-in-out infinite; }
@keyframes held-idle { 50% { transform: rotate(2deg); } }

/* Running to / from the enemy: a quick forward lean with a little bounce. */
.fighter.running { animation: run .3s ease-in-out; }
@keyframes run { 25% { transform: translateY(-6px) rotate(3deg); } 75% { transform: translateY(-3px) rotate(2deg); } }
.fighter.monster.running { animation-name: run-monster; }
@keyframes run-monster { 50% { transform: translateY(-8px) scale(1.04, .96); } }

.avatar svg.puppet { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* Drawn animations (outfit + weapon art): back hair, body frame, front hair */
.avatar .anim-layer { position: absolute; pointer-events: none; }
.avatar .anim-layer:not([src]) { visibility: hidden; }
.avatar .hair-back { z-index: 0; } .avatar .anim-body { z-index: 1; } .avatar .hair-front { z-index: 2; } .avatar .anim-front { z-index: 3; }

/* ---------- Pack fights (2 enemies) ---------- */
.monster-cards { display: grid; gap: .4rem; justify-items: end; width: 100%; }
.monster-cards.pack .fighter-card { cursor: pointer; padding: .45rem .7rem; }
.monster-cards.pack .fighter-card.aimed { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.fighter-card.down { opacity: .45; filter: grayscale(.8); }
.fighter.monster.pack { cursor: pointer; }
.fighter.monster.pack.slot-0 { right: 22%; z-index: 2; }
.fighter.monster.pack.slot-1 { right: 3%; bottom: 13%; z-index: 1; height: calc(70% * var(--size, .7)); }
.target-mark {
  position: absolute; z-index: 6; transform: translate(-50%, -100%); pointer-events: none;
  color: var(--gold); font-size: 1.6rem; text-shadow: 0 2px 0 #000, 0 0 10px rgba(255,200,80,.8); animation: target-bob 1s ease-in-out infinite;
}
@keyframes target-bob { 50% { margin-top: -6px; } }
.pack-tag { font-size: .72rem; font-weight: 900; color: #fff; background: #8a3a2a; border-radius: 6px; padding: 0 .35rem; }
.pack-note { color: #ffb08a; font-weight: 700; }
@media (max-width: 760px) {
  .fighter.monster.pack.slot-0 { right: 30%; height: calc(62% * var(--size, .7)); }
  .fighter.monster.pack.slot-1 { right: 0; height: calc(56% * var(--size, .7)); }
  .monster-cards.pack .fighter-card { padding: .3rem .45rem; }
  .monster-cards.pack .fighter-card .fc-head strong { font-size: .78rem; }
}

/* ---------- Guild Hall and guilds ---------- */
.guild-tag { display: inline-block; font: 900 .7rem/1.4 system-ui, sans-serif; letter-spacing: .06em; color: #fff;
  background: var(--g); border: 1px solid rgba(255,255,255,.45); border-radius: 5px; padding: 0 .35rem; margin-right: .3rem;
  vertical-align: middle; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.hall { width: min(720px, 100%); padding: 0 0 1.2rem; overflow: hidden; }
.hall-art { background-size: cover; background-position: center 35%; position: relative; padding-bottom: 4.5rem; }
.hall-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(20,14,10,.55), rgba(20,14,10,.2) 40%, var(--panel)); }
.hall-art > * { position: relative; z-index: 1; }
.hall-art h2 { text-shadow: 0 2px 6px #000; }
.hall-lead { margin: 0; padding: 0 1.2rem; font-weight: 700; text-shadow: 0 1px 4px #000; }
.hall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; padding: 0 1.2rem; margin-top: -2.8rem; position: relative; z-index: 2; }
.hall-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; cursor: pointer;
  padding: 1rem .8rem; border-radius: 14px; color: #3a2a18; font: inherit;
  background: #f1e3c4; border: 3px solid var(--g, #b49a6c); box-shadow: 0 4px 0 #8a7148; transition: transform .12s; }
.hall-card:hover { transform: translateY(-3px); }
.hall-icon { font-size: 2.6rem; line-height: 1.1; }
.hall-card strong { font-family: var(--title); font-size: 1.25rem; color: #5a3a12; }
.hall-card small { font-weight: 700; color: #6d5536; }
.guilds { width: min(720px, 100%); }
.guilds .board-head { gap: .6rem; }
.guilds .board-head h2 { margin-right: auto; }
.guild-body { overflow-y: auto; padding: .3rem 1.2rem 1.2rem; display: grid; gap: .7rem; }
.guild-create { display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .8rem 1rem; border-radius: 12px;
  background: rgba(242, 193, 78, .1); border: 2px dashed var(--gold-deep); }
.guild-create small { display: block; color: var(--ink-soft); }
.guild-card, .guild-banner { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .8rem 1rem; border-radius: 12px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--g) 30%, #221a14), #221a14 70%); border: 2px solid var(--g); }
.guild-banner { grid-template-columns: auto 1fr; }
.guild-card h3, .guild-banner h3 { margin: 0 0 .15rem; font-size: 1.1rem; }
.guild-card p, .guild-banner p { margin: 0 0 .2rem; font-style: italic; color: var(--ink-soft); }
.guild-card small, .guild-banner small { color: var(--ink-soft); font-weight: 700; }
.guild-emblem { width: 58px; height: 58px; display: grid; place-items: center; font-size: 2rem; border-radius: 50%;
  background: color-mix(in srgb, var(--g) 45%, #120e0b); border: 3px solid var(--g); box-shadow: 0 0 12px color-mix(in srgb, var(--g) 50%, transparent); }
.guild-perks { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .35rem; font-weight: 700; }
.guild-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.member { display: grid; grid-template-columns: auto 1fr; column-gap: .45rem; align-items: center; padding: .45rem .6rem; border-radius: 10px;
  background: #221a14; border: 1px solid #4a3a2a; }
.member small { grid-column: 2; color: var(--ink-soft); font-size: .75rem; }
.member.me { border-color: var(--gold); }
.guild-form .field { margin-bottom: 0; }
.emblem-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.emblem { aspect-ratio: 1; font-size: 1.4rem; border-radius: 10px; background: #1d1611; border: 2px solid #4a3a2a; cursor: pointer; }
.emblem.on { border-color: var(--gold); background: #3a2b1b; }
.guild-form .row { justify-content: flex-end; margin-top: 0; }
.guild-bonus { margin: .3rem 0 0; text-align: center; font-size: .85rem; color: var(--ink-soft); }
.guild-line { margin: .1rem 0 .3rem; color: var(--ink-soft); font-weight: 700; }
@media (max-width: 560px) {
  .hall-grid { grid-template-columns: 1fr; }
  .guild-card { grid-template-columns: auto 1fr; }
  .guild-card .btn { grid-column: 1 / -1; }
  .guild-create { flex-direction: column; align-items: stretch; }
  .emblem-grid { grid-template-columns: repeat(6, 1fr); }
  .guilds .smith-purse { display: none; }
  .guilds .board-head { padding-inline: .8rem; gap: .3rem; }
  .guilds .board-head h2 { font-size: 1.25rem; }
}
.guilds .board-head h2, .board-head .btn { white-space: nowrap; }

/* ---------- Small phones (checked down to 320 px wide) ---------- */
@media (max-width: 600px) {
  /* village HUD: portrait card on top, Tilts/Gems below it, next goal below that (nothing overlaps) */
  .hud-tl { top: 8px; left: 8px; width: calc(100vw - 16px); padding: .3rem .7rem .3rem .3rem; gap: .5rem; }
  .hud-tl .portrait { width: 54px; height: 54px; }
  .hud-name { font-size: .95rem; }
  .hud-tl .bar { height: 15px; margin-top: 3px; }
  .hud-tl .bar.mana, .hud-tl .bar.xp { height: 13px; }
  .hud-tr { top: 100px; left: 8px; right: auto; padding: .25rem .8rem; font-size: .9rem; }
  .hud-tr small { display: none; }
  .hud-tr .coin { font-size: 1rem; }
  .hud-tr strong { font-size: .95rem; }
  .hud-tr .gem { margin-left: .3rem; font-size: .9rem; }
  .goal-banner { top: 140px; left: 8px; transform: none; font-size: .72rem; padding: .3rem .7rem; }
  .goal-banner.ready { max-width: calc(100vw - 16px); }
  .goal-banner .rank-badge { flex: none; }
  /* screens that open over the village use the whole phone screen */
  .modal { padding: .35rem; }
  .modal > .panel { max-height: calc(100dvh - .7rem); }
  .smithy { width: 100%; padding: 0 .8rem .8rem; max-height: calc(100dvh - .7rem) !important; }
  .board-head { padding: .8rem .9rem .4rem; }
  .smithy .board-head { flex-wrap: wrap; row-gap: .1rem; padding: .8rem 0 .4rem; }
  .smithy .board-head h2 { font-size: 1.35rem; }
  .smith-purse { order: 3; width: 100%; font-size: .85rem; }
  .tabs { flex-wrap: wrap; }
  .tab { padding: .4rem .6rem; }
  .w-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .outfit-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .outfit-item .thumb { aspect-ratio: 3 / 5; }
  /* battle: 2 x 2 buttons (3 x 2 with 4 skills), a shorter log, more room for the fight */
  .actions { grid-template-columns: repeat(2, 1fr); }
  .actions.wide { grid-template-columns: repeat(3, 1fr); }
  .act { min-height: 52px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .45rem; justify-items: start;
    align-content: center; text-align: left; padding: .35rem .5rem; }
  .act > :first-child { grid-row: span 2; }
  .act strong { font-size: .8rem; line-height: 1.1; }
  .act small { font-size: .62rem; line-height: 1.15; }
  .act .el-icon, .act.skill .el-icon, .w-icon.act-icon { width: 28px; height: 28px; }
  .w-icon.act-icon .w-emoji, .act .emoji { font-size: 1.2rem; }
  .log { min-height: 3.3rem; max-height: 3.3rem; padding: .4rem .7rem; }
  .bottom { padding: 0 .6rem .6rem; gap: .4rem; }
  .hud { padding: .5rem .6rem 0; }
  .fighter-card .fc-head strong { font-size: .85rem; }
  .result { padding: 1.2rem 1rem; }
  .result h2 { font-size: 1.6rem; }
  .rewards { flex-wrap: wrap; gap: .4rem; }
}

/* ---------- Phones held sideways (short screens) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  /* battle: slim cards on top, one row of buttons, a one-line log, the rest is the fight */
  .hud { padding: .35rem .6rem 0; gap: .5rem; }
  .fighter-card { padding: .3rem .55rem; }
  .fc-head { margin-bottom: .15rem; }
  .fc-head .portrait { display: none; }
  .fighter-card .bar { height: 13px; margin-top: 2px; }
  .fighter-card .bar.mana { height: 12px; }
  .chips { min-height: 0; margin-top: .2rem; }
  .turn-bar { padding: 0 .6rem .2rem; gap: .5rem; flex-wrap: nowrap; }
  .turn-bar .next { width: auto; order: 0; font-size: .66rem; }
  .turn-bar .next small { display: none; }
  .pin { width: 26px; height: 26px; margin-left: -13px; margin-top: -13px; }
  .bottom { grid-template-columns: 1fr; padding: 0 .6rem .4rem; gap: .3rem; }
  .log { order: 2; min-height: 1.7rem; max-height: 1.7rem; padding: .25rem .7rem; font-size: .75rem; }
  .actions, .actions.wide { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: .35rem; }
  .act { min-height: 44px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .4rem; justify-items: start;
    align-content: center; text-align: left; padding: .25rem .45rem; }
  .act > :first-child { grid-row: span 2; }
  .act strong { font-size: .76rem; line-height: 1.1; }
  .act small { font-size: .6rem; line-height: 1.1; }
  .act .el-icon, .act.skill .el-icon, .w-icon.act-icon { width: 26px; height: 26px; }
  .w-icon.act-icon .w-emoji, .act .emoji { font-size: 1.1rem; }
  .cd { font-size: 1.5rem; }
  /* village HUD smaller so more of the map shows */
  .hud-tl { width: min(300px, 46vw); padding: .25rem .6rem .25rem .25rem; }
  .hud-tl .portrait { width: 48px; height: 48px; }
  .hud-tl .bar { height: 13px; margin-top: 2px; }
  .hud-tl .bar.mana, .hud-tl .bar.xp { height: 11px; }
  .hud-tr { top: 8px; right: 8px; left: auto; padding: .2rem .7rem; }
  .goal-banner { top: 56px; left: auto; right: 8px; transform: none; font-size: .72rem; padding: .25rem .7rem; }
  .bottom-bar button { padding: .2rem .5rem; font-size: .66rem; }
  .bottom-bar button span { font-size: 1rem; }
  /* screens over the village use the whole height */
  .modal { padding: .3rem; }
  .modal > .panel, .smithy { max-height: calc(100dvh - .6rem) !important; }
  .board-head { padding: .5rem .9rem .3rem; }
  .profile-avatar, .look-avatar, .profile-avatar.is-anim, .look-avatar.is-anim { height: 200px; margin-top: 0; }
  .hall-art { padding-bottom: 3.6rem; }
  .hall-icon { font-size: 1.8rem; }
  .hall-card { padding: .6rem; }
}

/* ---------- Leaderboard ---------- */
.leaderboard { width: min(620px, 100%); }
.leaderboard .board-head h2 { margin-right: auto; margin-left: .3rem; }
.lb-note { margin: 0; font-size: .85rem; }
.leaderboard .guild-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.lb-list { list-style: none; margin: 0; padding: 0 .2rem 0 0; display: grid; gap: .4rem; position: relative; overflow-y: auto; min-height: 0; flex: 1; }
.lb-row { display: grid; grid-template-columns: 2.2rem auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .5rem .8rem;
  border-radius: 10px; background: #221a14; border: 1px solid #4a3a2a; }
.lb-row:nth-child(-n+3) { background: linear-gradient(90deg, rgba(242, 193, 78, .14), #221a14 60%); border-color: #6b5435; }
.lb-row.me { border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(242, 193, 78, .3); }
.lb-pos { text-align: center; font-weight: 900; font-size: 1.05rem; color: var(--ink-soft); }
.lb-row:nth-child(-n+3) .lb-pos { font-size: 1.4rem; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { color: var(--ink-soft); }
.lb-row .lb-name > small { display: block; font-size: .75rem; }
.lb-emblem { font-size: 1.5rem; width: 2rem; text-align: center; }
.lb-score { font-weight: 900; color: var(--gold); text-align: right; white-space: nowrap; }
.lb-score small { display: block; font-size: .65rem; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 600px) {
  .lb-row { gap: .4rem; padding: .4rem .55rem; grid-template-columns: 1.8rem auto minmax(0, 1fr) auto; }
  .lb-name { white-space: normal; overflow-wrap: anywhere; }
  .leaderboard .board-head { padding-inline: .8rem; gap: .3rem; }
  .leaderboard .board-head h2 { font-size: 1.25rem; }
  .lb-emblem { font-size: 1.2rem; width: 1.5rem; }
  .hall-grid { grid-template-columns: 1fr; }
}

/* ---------- Pets ---------- */
.pet-pic { display: inline-grid; place-items: center; line-height: 1; font-size: 1.6rem; filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.pet-pic.small { font-size: 1.8rem; width: 44px; height: 44px; }
.pet-pic.big { font-size: 4.2rem; }
img.pet-pic { object-fit: contain; }
img.pet-pic.big { width: 100%; height: 100%; padding: 6px; }
.pet-art { overflow: hidden; }
.pet-art > img.pet-pic { height: 110px; }
img.pet-pic.small { width: 44px; height: 44px; }
.pet-intro { margin: 0 0 .8rem; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.pet-card { display: flex; flex-direction: column; gap: .3rem; padding: .7rem; border-radius: 14px; background: #221a14;
  border: 2px solid color-mix(in srgb, var(--el, #6b5435) 70%, #221a14); }
.pet-card.owned { background: linear-gradient(160deg, color-mix(in srgb, var(--el, #6b5435) 18%, #221a14), #221a14 70%); }
.pet-card.with { border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, .35); }
.pet-card.locked { opacity: .65; }
/* legendary pets: shimmering gold frame, an aura around the creature */
.pet-card.legend { border: 2px solid transparent; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--el, #c9962e) 22%, #1d1410), #150f0b 70%) padding-box,
              linear-gradient(135deg, #ffe38a, #b46cff, #ffe38a, #6fd3ff) border-box; }
.pet-card.legend .pet-art { background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--el, #f2c14e) 55%, #2b2119), #120c08 72%); }
.pet-card.legend h3 { color: #ffe38a; }
.pet-pic.legend { filter: drop-shadow(0 0 6px var(--el, #ffe38a)) drop-shadow(0 0 16px var(--el, #ffe38a)); animation: legend-aura 2.4s ease-in-out infinite; }
@keyframes legend-aura { 50% { filter: drop-shadow(0 0 10px var(--el, #ffe38a)) drop-shadow(0 0 26px var(--el, #ffe38a)); transform: translateY(-3px); } }
.pet-story { font-style: italic; color: var(--ink-soft); }
.pet-tag { font-size: .75rem; font-weight: 800; padding: .05rem .45rem; border-radius: 999px; color: #1b120a;
  background: color-mix(in srgb, var(--el, #f2c14e) 75%, #fff); }
.btn.legend-buy { background: linear-gradient(#c9a1ff, #7b4cc9); color: #fff; border-color: #e6d4ff; text-shadow: 0 1px 0 #3a1a6b; }
.legend-head { color: #ffe38a; }
.pet-art { height: 110px; display: grid; place-items: center; border-radius: 10px;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--el, #8a7148) 35%, #2b2119), #1b140f 75%); }
.pet-card h3 { margin: .2rem 0 0; font-size: 1.1rem; }
.pet-card h3 small { color: var(--ink-soft); font-weight: 700; font-size: .78rem; }
.pet-card p { margin: 0; font-size: .85rem; }
.pet-el { display: flex; align-items: center; gap: .3rem; color: var(--ink-soft); font-weight: 700; }
.pet-el .el-icon { width: 18px; height: 18px; }
.pet-dmg { color: var(--ink-soft); }
.pet-dmg strong { color: var(--gold); }
.pet-card .btn, .pet-card .lock { margin-top: auto; }
.pet-card .lock { text-align: center; padding: .45rem; color: var(--ink-soft); white-space: normal; }
/* in battle: the pet stands in front of the player */
.fighter.pet { left: 23%; bottom: 2%; z-index: 3; display: grid; place-items: end center; height: 30%; aspect-ratio: 1;
  filter: drop-shadow(0 8px 6px rgba(0,0,0,.4)); }
.fighter.pet .pet-pic { font-size: min(13vh, 96px); }
.fighter.pet img.pet-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
/* alive: the pet breathes while it waits (legendary ones also keep their glow), a soft shadow under its feet */
.fighter.pet::before { content: ""; position: absolute; left: 18%; right: 18%; bottom: -2%; height: 9%; border-radius: 50%;
  background: rgba(0,0,0,.45); filter: blur(3px); }
.fighter.pet .pet-pic { transform-origin: 50% 100%; animation: pet-breathe 2.6s ease-in-out infinite; }
.fighter.pet .pet-pic.legend { animation: pet-breathe 2.6s ease-in-out infinite, legend-aura 2.4s ease-in-out infinite; }
/* its attack: crouch, pounce at the enemy, land and run back (user 2026-10-18: pets should look natural) */
.pet-hop { animation: pet-hop .75s cubic-bezier(.4, 0, .3, 1); z-index: 6; }
@keyframes pet-hop {
  0% { transform: none; }
  15% { transform: translate(-6%, 0) scale(1.08, .88); }
  45% { transform: translate(90%, -28%) rotate(10deg); }
  60% { transform: translate(140%, 0) scale(1.1, .9); }
  72% { transform: translate(130%, 0); }
  100% { transform: none; } }
@media (max-width: 600px) {
  .fighter.pet { left: 30%; height: 18%; }
  .fighter.pet .pet-pic { font-size: min(9vh, 60px); }
  .pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .pet-card { min-width: 0; overflow-wrap: anywhere; padding: .55rem; }
  .pet-card h3 small { display: block; }
  .pet-art { height: 80px; }
  .pet-art > img.pet-pic { height: 80px; }
  .pet-pic.big { font-size: 3rem; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .fighter.pet .pet-pic { font-size: min(14vh, 60px); }
}

/* ---------- Stable (your pets) ---------- */
.hall-grid.two { grid-template-columns: 1fr 1fr; }
.stable .board-head h2 { margin-right: auto; margin-left: .3rem; }
.pet-lv { display: flex; align-items: center; gap: .45rem; }
.pet-lv .bar { flex: 1; height: 14px; margin: 0; }
.pet-lv .bar em { font-size: .65rem; }
.pet-moves { list-style: none; margin: .2rem 0 .3rem; padding: 0; display: grid; gap: .3rem; }
.pet-moves li { padding: .3rem .45rem; border-radius: 8px; background: rgba(0,0,0,.25); border-left: 3px solid var(--el, var(--gold)); }
.pet-moves li strong { display: block; font-size: .85rem; }
.pet-moves li small { color: var(--ink-soft); font-size: .72rem; }
.pet-moves li.locked { opacity: .55; border-left-color: #5a4836; }
.pet-learns { display: flex; flex-wrap: wrap; gap: .25rem; }
.pet-learns span { font-size: .7rem; font-weight: 800; padding: .05rem .4rem; border-radius: 6px; background: rgba(0,0,0,.3); color: var(--ink-soft); }
.pet-learns span.known { color: #1b120a; background: color-mix(in srgb, var(--el, #f2c14e) 70%, #fff); }
.pet-empty { margin: 1rem 0; text-align: center; color: var(--ink-soft); }
.pet-gain { display: flex; align-items: center; gap: .6rem; justify-content: center; margin: .6rem 0; padding: .45rem .8rem; border-radius: 12px;
  background: rgba(242, 193, 78, .1); border: 1px solid var(--gold-deep); text-align: left; }
.pet-gain .pet-pic.small { width: 48px; height: 48px; }
@media (max-width: 600px) {
  .bottom-bar button { padding: .3rem .3rem; }
  .hall-grid.two { grid-template-columns: 1fr 1fr; }
}

/* ---------- Login screen (the landing page): never cut off, compact on short and narrow screens ---------- */
.login { padding: 1rem; }
.login .login-panel { flex: 0 0 auto; width: min(460px, 100%); max-height: none; overflow: visible; padding: 1.4rem 1.5rem; margin: auto; }
.login .title { font-size: clamp(2rem, 4.2vw, 2.9rem); }
.login .lead { font-size: .98rem; }
.login .field { margin-bottom: .85rem; }
.login .tabs { margin-bottom: .8rem; }
.login .small-note { margin: 0 0 .5rem; }
.login .quest-warn:empty { display: none; }
@media (max-height: 700px) {
  .login .login-panel { padding: 1rem 1.3rem; }
  .login .eyebrow { display: none; }
  .login .title { font-size: 2rem; margin: 0 0 .1em; }
  .login .lead { margin-bottom: .6rem; font-size: .9rem; }
  .login .field { margin-bottom: .6rem; }
  .login .label { margin-bottom: .25rem; }
  .login .field input { padding: .5rem .8rem; font-size: 1rem; }
  .login .tabs { margin-bottom: .5rem; }
  .login .tab { padding: .3rem .8rem; }
  .login .btn.big { padding: .6rem 1rem; }
  .login .small-note { font-size: .78rem; }
}
@media (max-height: 520px) {
  .login .lead { display: none; }
  .login .title { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  .login { padding: .6rem; }
  .login .login-panel { padding: 1.1rem 1rem; }
}

/* ---------- Daily rewards calendar ---------- */
.calendar { width: min(620px, 100%); }
.cal-body { padding: 0 1.2rem 1.2rem; display: grid; gap: .7rem; }
.cal-sub { margin: 0; font-weight: 700; }
.cal-sub .muted { display: block; font-weight: 400; font-size: .85rem; }
.cal-got { padding: .6rem .8rem; border-radius: 12px; background: linear-gradient(90deg, rgba(242, 193, 78, .22), rgba(242, 193, 78, .05));
  border: 1px solid var(--gold); animation: pop .35s ease-out; }
.cal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  min-height: 92px; padding: .5rem .35rem; border-radius: 12px; background: #221a14; border: 2px solid #4a3a2a; }
.cal-day.big { grid-column: span 2; background: linear-gradient(135deg, #2a1f14, #3a2410); border-color: #8a6a2a; }
.cal-n { font-size: .72rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.cal-r { font-weight: 800; font-size: .9rem; line-height: 1.25; }
.cal-day.done { opacity: .55; border-color: #6b8a4a; }
.cal-check { position: absolute; top: 4px; right: 8px; color: #7fd16a; font-weight: 900; }
.cal-day.today { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(242, 193, 78, .45); animation: cal-glow 1.6s ease-in-out infinite; }
@keyframes cal-glow { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(242, 193, 78, .7); } }
.cal-next, .cal-boost { margin: 0; text-align: center; }
.cal-boost { color: #ffe38a; font-weight: 700; }
.hud-cal { margin-left: .4rem; border: 0; background: transparent; font-size: 1.15rem; padding: 0 .1rem; line-height: 1; }
.hud-cal:hover { transform: scale(1.15); }
.boost-chip { position: absolute; top: 62px; right: 12px; z-index: 5; font-weight: 800; font-size: .8rem; color: #2a1c0e;
  background: linear-gradient(#ffe38a, #d9a23a); border: 2px solid #fff1b8; border-radius: 999px; padding: .2rem .7rem; box-shadow: var(--shadow); }
@media (max-width: 600px) {
  .cal-grid { grid-template-columns: repeat(3, 1fr); gap: .35rem; }
  .cal-day { min-height: 78px; }
  .cal-day.big { grid-column: span 3; }
  .cal-r { font-size: .8rem; }
  .boost-chip { top: 100px; right: 8px; font-size: .72rem; }
}

.cal-pic { height: 64px; width: 100%; display: grid; place-items: center; }
.cal-icon { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.cal-pet { height: 64px; width: 64px; }
img.cal-pet { object-fit: contain; }
span.cal-pet { font-size: 2.4rem; }
.cal-thumb { height: 72px; width: 40px; overflow: hidden; border-radius: 8px; }
.cal-thumb .thumb { width: 100%; aspect-ratio: 5 / 9; border: 0; }
.cal-day.big .cal-pic, .cal-day.today .cal-pic { height: 72px; }
.cal-day.today .cal-n { color: var(--gold); }
.cal-claim { animation: cal-glow 1.6s ease-in-out infinite; }
.cal-error:empty { display: none; }
@media (max-width: 600px) {
  .cal-pic, .cal-day.big .cal-pic, .cal-day.today .cal-pic { height: 48px; }
  .cal-icon { font-size: 1.7rem; }
  .cal-pet { height: 48px; width: 48px; }
  .cal-thumb { height: 48px; width: 27px; }
}
/* bundle price: the full price crossed out, the bundle price, and how much it saves */
.bundle-price { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; }
.bundle-price s { color: #9a8a96; font-weight: 600; }
.save-tag { font: 800 .75rem system-ui, sans-serif; color: #fff; background: #d43a7a; border-radius: 6px; padding: .15rem .45rem; }
.w-foot.price.gems { color: #8fd8ff; }
/* bundles: a compact row with the picture on the left */
.bundle { grid-template-columns: 150px 1fr; }
.bundle-art img { max-height: 200px; }
@media (max-width: 760px) { .bundle { grid-template-columns: 100px 1fr; gap: .7rem; } .bundle-art img { max-height: 140px; } }
/* bundle offers: round buttons on the left of the village, under the player card */
.offer-bubbles { position: absolute; top: 132px; left: 16px; z-index: 5; display: grid; gap: .7rem; }
.offer-bubble {
  position: relative; width: 78px; height: 78px; border-radius: 50%; padding: 0; cursor: pointer; overflow: visible;
  background: radial-gradient(circle at 50% 35%, #7a2c5c, #2a1424 72%); border: 3px solid #ff9bd2;
  box-shadow: 0 0 0 0 rgba(255, 120, 190, .6), var(--shadow); animation: offer-pulse 2s ease-out infinite;
}
.offer-bubble img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; border-radius: 50%; }
.offer-bubble i { position: absolute; top: -6px; right: -10px; font: 800 .72rem system-ui, sans-serif; font-style: normal;
  color: #fff; background: #d43a7a; border: 2px solid #fff; border-radius: 999px; padding: .1rem .35rem; }
.offer-bubble small { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 800 .7rem var(--title), serif; color: #2a1424; background: linear-gradient(#ffd6ec, #ff9bd2); border-radius: 999px; padding: .05rem .5rem; }
.offer-bubble:hover { filter: brightness(1.12); }
@keyframes offer-pulse { 70% { box-shadow: 0 0 0 14px rgba(255, 120, 190, 0), var(--shadow); } 100% { box-shadow: 0 0 0 0 rgba(255, 120, 190, 0), var(--shadow); } }
@media (max-width: 760px) { .offer-bubbles { top: 120px; left: 10px; } .offer-bubble { width: 62px; height: 62px; } }
/* the bundle offer popup */
.panel.offer { position: relative; max-width: 420px; text-align: center; display: grid; gap: .6rem; justify-items: center;
  background: linear-gradient(160deg, #2a1424, #1b1018); border: 2px solid #b0407e; color: #f6e8f0;
  animation: offer-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.panel.offer h2 { margin: 0; font-family: var(--title); color: #ff9bd2; }
.panel.offer p { margin: 0; }
.offer-x { position: absolute; top: .5rem; right: .5rem; }
.offer-art { position: relative; background: radial-gradient(circle at 50% 40%, #5a2346, #1b1018 70%); border-radius: 14px; padding: .4rem; }
.offer-art img { max-height: 260px; display: block; }
.save-tag.big { position: absolute; top: .4rem; right: .4rem; font-size: 1rem; padding: .25rem .6rem; }
.panel.offer .bundle-items { justify-items: center; }
@keyframes offer-pop { from { transform: scale(.6); opacity: 0; } }

/* an image that has no picture (yet) must never show the browser's empty-image box */
img:not([src]), img[src=""] { visibility: hidden; }

/* Chat (global + guild) */
.chat-panel .panel { width: min(560px, 100%); display: flex; flex-direction: column; max-height: min(640px, 92vh); }
.chat-tabs { margin-bottom: .5rem; }
.chat-log { flex: 1; min-height: 240px; overflow-y: auto; background: rgba(0,0,0,.28); border: 1px solid var(--panel-edge);
  border-radius: 10px; padding: .5rem .6rem; display: flex; flex-direction: column; gap: .3rem; }
.chat-line { display: flex; gap: .45rem; align-items: baseline; line-height: 1.35; word-break: break-word; }
.chat-line small { color: var(--ink-soft); font-size: .72rem; flex: none; }
.chat-line strong { color: var(--gold); flex: none; }
.chat-line.mine strong { color: #9fd3ff; }
.chat-line span { flex: 1; }
.chat-report { background: none; border: 0; color: var(--ink-soft); cursor: pointer; opacity: .5; padding: 0 .2rem; }
.chat-report:hover { opacity: 1; color: var(--red); }
.chat-form { display: flex; gap: .5rem; margin-top: .6rem; }
.chat-input { flex: 1; min-width: 0; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--panel-edge);
  background: #1c1610; color: var(--ink); font: inherit; }
.chat-note { min-height: 1.2em; margin: .4rem 0 0; color: var(--ink-soft); font-size: .85rem; }

/* Co-op */
.coop-head { margin: .9rem 0 .4rem; font-family: var(--title); color: var(--gold); font-size: 1rem; }
.coop-friends { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; }
.coop-friend { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border: 1px solid #4a3a2a; border-radius: 8px; }
.coop-friend strong { flex: none; }
.coop-friend small { flex: 1; color: var(--ink-soft); }
.coop-friend.busy { opacity: .55; }
.quest.coop { border-color: #6fb3ff; }
.coop .hero-cards { display: flex; flex-direction: column; gap: .35rem; }
.coop .hero-cards .fighter-card { padding: .4rem .6rem; }
.coop .hero-cards .fighter-card.me { border-color: #7ad0ff; }
.coop .fc-portrait .portrait { width: 30px; height: 30px; }
.you-tag { margin-left: auto; font-size: .7rem; font-weight: 900; color: #2b1a06; background: #7ad0ff; border-radius: 6px; padding: 0 .35rem; }
/* co-op formation (like Shinobi Warfare): me in front, my friend a step back up the road; each pet stands just
   behind its owner (to the left, everyone faces right) at the owner's depth, fully visible */
.coop #sprite-h0, .coop #sprite-h1 { max-height: 500px; }
.coop .fighter.hero.me { left: 33%; bottom: 2%; height: 70%; z-index: 4; }
.coop .fighter.hero.friend { left: 15%; bottom: 24%; height: 60%; z-index: 2; }
.coop .fighter.coop-pet { aspect-ratio: 1; }
.coop .fighter.coop-pet.me { left: 20%; bottom: 2%; height: 27%; z-index: 4; }
.coop .fighter.coop-pet.friend { left: 4%; bottom: 24%; height: 23%; z-index: 2; }
/* the road: the background scrolls while the party walks, then the enemies step in */
/* the road picture is always wide enough for the whole walk (no repeat seam on the right on wide screens) */
#app.coop-road { background-size: max(160vw, 177.8vh) auto; background-repeat: no-repeat; background-position: 0 100%; }
#app.coop-road:has(.screen.walking) { animation: road-scroll 2.2s linear; }
@keyframes road-scroll { from { background-position-x: 0; } to { background-position-x: -60vw; } }
.coop.walking .fighter.hero, .coop.walking .fighter.coop-pet { animation: walk-bob .36s ease-in-out infinite; }
@keyframes walk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5%); } }
.coop .fighter.monster.enter { animation: monster-enter 2.2s ease-out; }
@keyframes monster-enter { 0%, 55% { transform: translateX(70vw); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
/* fighters (people) are mirrored with scale: -1 1, which flips a translate too: theirs slide in from the right as well */
.coop .fighter.monster.human.enter { animation-name: monster-enter-flip; }
@keyframes monster-enter-flip { 0%, 55% { transform: translateX(-70vw); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.road-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .25rem; padding: .3rem .7rem;
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 999px; align-self: start; }
.road-bar small { flex-basis: 100%; text-align: center; color: var(--ink-soft); font-size: .72rem; }
.road-stop { width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: #2a211a;
  border: 2px solid #5a4a3a; font-size: .85rem; opacity: .55; }
.road-stop.done { opacity: .9; border-color: var(--hp); }
.road-stop.now { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); }
.road-path { width: 2rem; height: 3px; background: repeating-linear-gradient(90deg, #8a7458 0 6px, transparent 6px 10px); }
.pin.player.me { border-color: #ffe39a; }
.coop-wait-note { grid-column: 1 / -1; margin: 0; padding: .9rem; text-align: center; color: var(--ink-soft); font-weight: 800; }
@media (max-width: 720px) {
  .coop .fighter.hero.me { left: 26%; }
  .coop .fighter.hero.friend { left: 4%; }
  .coop .fighter.coop-pet.me { left: 8%; height: 18%; }
  .coop .fighter.coop-pet.friend { left: -6%; height: 15%; }
}

/* Midnight Rose: rose petals drifting around the wearer (rig.js) */
.rose-aura { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 9; }
.rose-aura i { position: absolute; top: -4%; left: var(--x); width: max(5px, 3.2%); aspect-ratio: .75; opacity: 0;
  background: radial-gradient(ellipse at 40% 35%, #ff7a96, #c2123f 60%, #6d0a22);
  border-radius: 70% 0 70% 0; transform: scale(var(--s)); animation: rose-fall var(--t) linear var(--d) infinite; }
@keyframes rose-fall {   /* down the whole character, swaying (sizes relative to the character, so portraits work too) */
  0% { opacity: 0; top: -4%; margin-left: 0; transform: rotate(0deg) scale(var(--s)); }
  10% { opacity: .9; }
  50% { margin-left: -8%; transform: rotate(200deg) scale(var(--s)); }
  85% { opacity: .8; }
  100% { opacity: 0; top: 100%; margin-left: 6%; transform: rotate(420deg) scale(var(--s)); }
}
@media (prefers-reduced-motion: reduce) { .rose-aura i { animation: none; opacity: .8; top: calc(var(--s) * 70% - 30%); } }

/* ---------- Pet Shop / Pet House (Shinobi Warfare style, user 2026-10-18) ---------- */
.pet-store .panel, .pet-house .panel { max-width: 980px; }
.ps-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: .8rem; }
.ps-left, .ph-main { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.ps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; padding: .7rem; border-radius: 12px; background: #3a2a1e; }
.ps-tile { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid #1a120c; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #fbfbfb, #c9c9c9 85%); transition: transform .12s, box-shadow .12s; }
.ps-tile.legend { background: radial-gradient(circle at 50% 40%, #fff3a0, #f4c51c 55%, #c98a0a); }
.ps-tile:hover { transform: translateY(-2px); }
.ps-tile.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(242, 193, 78, .6); }
/* a portrait: the pet's head and shoulders fill the tile */
.ps-tile img.pet-pic { position: absolute; width: 150%; height: 150%; left: -18%; top: -6%; object-fit: contain; object-position: 50% 0;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); animation: none; }
.ps-tile .pet-pic:not(img) { font-size: 2.6rem; width: 100%; height: 100%; }
.ps-own { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #2e9d4a; color: #fff; font-weight: 900; font-size: .8rem; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ps-pager { display: flex; justify-content: flex-end; align-items: center; gap: .7rem; font-weight: 900; font-size: 1.1rem; }
.ph-list .ps-pager { justify-content: center; margin-top: auto; }
.ps-moves, .ph-moves { padding: .6rem; border-radius: 12px; background: #3a2a1e; min-height: 96px; }
.ps-right { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.ps-info { padding: .8rem 1rem; border-radius: 10px; background: #150d08; min-height: 130px; }
.ps-info h3 { margin: 0; text-align: center; color: var(--gold); font-size: 1.5rem; }
.ps-info p { margin: .35rem 0 0; font-size: .9rem; }
.ps-kind { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: .8rem !important; }
.ps-price { font-size: 1.5rem; font-weight: 900; padding: .5rem; display: flex; justify-content: center; align-items: center; gap: .5rem;
  background: linear-gradient(#2a6a8a, #174a63); color: #9cff6a; border: 3px solid #6c8fa0; border-radius: 12px; text-shadow: 0 2px 0 #0b2a12; }
.ps-price.gem { color: #bfe9ff; }
.ps-price i { font-style: normal; font-size: 1.6rem; }
.ps-price[data-pet-leave] { font-size: 1rem; color: #fff; }

/* the pet's stage: a dark box, a soft paw behind it, the pet hops in and then breathes */
.pet-stage { position: relative; height: 230px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--el, #6b5435) 22%, #1a110b), #120b07 70%); }
.pet-stage::before { content: "\1F43E"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 150px; opacity: .07; filter: grayscale(1); }
.pet-stage.empty span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; opacity: .12; filter: grayscale(1); }
.pet-stage.legend { background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--el) 45%, #2b2119), #120c08 72%); }
.pet-shadow { position: absolute; left: 22%; right: 22%; bottom: 7%; height: 9%; border-radius: 50%; background: rgba(0,0,0,.55); filter: blur(4px);
  animation: pet-shadow 2.6s ease-in-out .6s infinite; }
.pet-live { position: absolute; left: 10%; right: 10%; top: 6%; bottom: 9%; transform-origin: 50% 100%;
  animation: pet-in .6s cubic-bezier(.3, 1.6, .5, 1) both, pet-breathe 2.6s ease-in-out .6s infinite; }
.pet-live img.pet-pic { width: 100%; height: 100%; padding: 0; object-fit: contain; object-position: 50% 100%; }
@keyframes pet-in { 0% { transform: translateY(-40%) scale(.6); opacity: 0; } 60% { transform: translateY(0) scale(1.08, .92); opacity: 1; } 100% { transform: none; } }
@keyframes pet-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .965) translateY(1%); } }
@keyframes pet-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.05); opacity: .85; } }

/* attacks by level: picture tile, "Lv N", an Info button */
.pmv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: .5rem; }
.pmv { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.pmv-icon { width: 58px; height: 58px; display: grid; place-items: center; font-size: 2rem; border-radius: 6px;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--el) 70%, #fff), color-mix(in srgb, var(--el) 60%, #0d3a3a));
  border: 3px solid #2fa83a; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.pmv b { color: var(--gold); font-size: 1.05rem; text-shadow: 0 2px 0 #000; }
.pmv-info { padding: .1rem .7rem; font-size: .78rem; background: linear-gradient(#3d7bff, #1d4fc4); color: #fff; border-color: #0f2f7a; }
.pmv.on .pmv-icon { border-color: var(--gold); box-shadow: 0 0 12px rgba(242, 193, 78, .7); }
.pmv.locked .pmv-icon { filter: grayscale(.85) brightness(.6); border-color: #5a4836; }
.pmv.locked b { color: var(--ink-soft); }
.pmv-detail { margin-top: .5rem; padding: .5rem .7rem; border-radius: 8px; background: rgba(0,0,0,.35); font-size: .85rem; }
.pmv-detail p { margin: .25rem 0 0; }
.pmv-detail em { color: var(--ink-soft); }

/* Pet House */
.ph-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: .8rem; }
.ph-list { display: flex; flex-direction: column; gap: .5rem; padding: .6rem; border-radius: 12px; background: #3a2a1e; }
.ph-entry { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 12px; border: 2px solid transparent;
  background: #0d0805; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.ph-entry strong { display: block; font-size: 1.05rem; }
.ph-entry em { font-style: normal; color: var(--gold); font-weight: 800; }
.ph-entry em b { color: #5ff0ff; }
.ph-entry.on { border-color: var(--el, var(--gold)); box-shadow: 0 0 10px color-mix(in srgb, var(--el, #f2c14e) 60%, transparent); }
.ph-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: .6rem; padding: .7rem; border-radius: 12px; background: #3a2a1e; }
.ph-stats { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.ph-name { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ph-name h3 { margin: 0; font-size: 1.5rem; }
.ph-lv { margin-left: auto; font-weight: 900; font-size: 1.2rem; }
.ph-rename-btn { padding: .15rem .6rem; font-size: .8rem; background: linear-gradient(#3d7bff, #1d4fc4); color: #fff; }
.ph-rename { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: .3rem .5rem; border-radius: 8px; border: 2px solid var(--gold); background: #120b07; color: var(--ink); }
.ph-kind { margin: 0; color: var(--ink-soft); font-size: .82rem; font-weight: 700; }
.ph-bar { display: flex; align-items: center; gap: .5rem; }
.ph-bar b { width: 2.4rem; font-weight: 900; }
.ph-bar .bar { flex: 1; height: 20px; margin: 0; }
.ph-bar .bar.atk span { background: linear-gradient(#ff7a4a, #d8381a); }
.ph-bar .bar em { font-size: .75rem; }
.ph-equip { align-self: center; min-width: 9rem; margin-top: .2rem; }
.ph-equip.btn.danger { background: linear-gradient(#e2412f, #a11d12); color: #fff; border-color: #5e0d06; }
.pet-stage.ph-stage { height: 210px; }

@media (max-width: 700px) {
  .ps-layout, .ph-layout, .ph-card { grid-template-columns: minmax(0, 1fr); }
  .ps-right { order: -1; }
  .ps-info { min-height: 0; }
  .pet-stage, .pet-stage.ph-stage { height: 170px; }
  .ps-grid { gap: .4rem; padding: .5rem; }
  .ph-list { flex-direction: row; flex-wrap: wrap; }
  .ph-entry { flex: 1 1 140px; }
  .pmv-icon { width: 46px; height: 46px; font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .pet-live, .pet-shadow { animation: none; } }
.pmv-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.volume-row { display: flex; align-items: center; gap: .6rem; margin: .6rem 0; font-weight: 800; }
.volume-row input { flex: 1; accent-color: var(--gold); }
/* casting a skill: a glow in the element's colour gathers around the caster (rig.js cast) */
.casting { animation: casting-glow .9s ease-in-out; }
@keyframes casting-glow {
  0% { filter: none; }
  45% { filter: drop-shadow(0 0 10px var(--cast, #ffd36b)) drop-shadow(0 0 24px var(--cast, #ffd36b)) brightness(1.15); }
  100% { filter: none; } }
/* monster attacks, one motion per kind of move (user 2026-10-18); monsters face left, so forward = -x */
.m-slam { animation: m-slam .7s cubic-bezier(.3, 0, .2, 1); }
@keyframes m-slam {
  0% { transform: none; }
  30% { transform: translate(18px, -6px) rotate(6deg) scale(.96, 1.06); }   /* rear back */
  52% { transform: translate(-70px, 4px) rotate(-8deg) scale(1.12, .9); }  /* smash down */
  64% { transform: translate(-60px, 2px) scale(.96, 1.04); }
  100% { transform: none; } }
.m-jab { animation: m-jab .6s ease-out; }
@keyframes m-jab {
  0% { transform: none; }
  20% { transform: translateX(14px) rotate(4deg); }
  35% { transform: translateX(-60px) rotate(-10deg); }
  50% { transform: translateX(-20px) rotate(-2deg); }
  65% { transform: translateX(-66px) rotate(-12deg); }
  100% { transform: none; } }
.m-rake { animation: m-rake .65s ease-out; }
@keyframes m-rake {
  0% { transform: none; }
  20% { transform: translate(-40px, -14px) rotate(-14deg); }
  38% { transform: translate(-70px, 6px) rotate(10deg); }
  56% { transform: translate(-50px, -10px) rotate(-12deg); }
  72% { transform: translate(-74px, 4px) rotate(8deg); }
  100% { transform: none; } }
.m-spit { animation: m-spit .7s ease-out; }
@keyframes m-spit {
  0% { transform: none; }
  35% { transform: translate(16px, -4px) scale(.94, 1.1); }      /* draw in breath */
  50% { transform: translate(-26px, 2px) scale(1.12, .9); }      /* let it fly */
  70% { transform: translate(-10px, 0) scale(.98, 1.02); }
  100% { transform: none; } }
.m-jiggle { animation: m-jiggle .7s ease-in-out; }
@keyframes m-jiggle {
  0%, 100% { transform: none; }
  20% { transform: scale(1.12, .88); } 40% { transform: scale(.9, 1.12); } 60% { transform: scale(1.06, .94); } 80% { transform: scale(.98, 1.02); } }
.m-hop { animation: m-hop .6s ease-out; }
@keyframes m-hop {
  0% { transform: none; }
  25% { transform: scale(1.08, .9); }
  55% { transform: translate(30px, -60px) rotate(8deg); }
  80% { transform: translate(36px, 0) scale(1.06, .94); }
  100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .m-slam, .m-jab, .m-rake, .m-spit, .m-jiggle, .m-hop { animation-duration: .01s; } }
/* fighter enemies (people): the player's puppet, mirrored to face left */
.fighter.monster.human { scale: -1 1; filter: drop-shadow(0 12px 10px rgba(0,0,0,.45)); }
.fighter.monster.human .rose-aura { display: none; }

/* ---------- Arena (user 2026-10-19) ---------- */
.arena .panel { max-width: 860px; }
.arena-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem; border-radius: 12px;
  background: linear-gradient(120deg, #3a2a1e, #1a120c); border: 1px solid #5a4430; margin-bottom: .6rem; }
.arena-tier { display: flex; align-items: center; gap: .7rem; }
.arena-tier > span { font-size: 2.6rem; line-height: 1; }
.arena-tier strong { display: block; font-size: 1.4rem; color: var(--gold); }
.arena-tier small, .arena-left small { color: var(--ink-soft); font-weight: 700; }
.arena-left { text-align: center; }
.arena-left strong { display: block; font-size: 1.8rem; line-height: 1; }
.arena-rivals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: .6rem 0; }
.arena-card { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .6rem; border-radius: 14px; background: #221a14;
  border: 2px solid #4a3a2a; text-align: center; }
.arena-card h3 { margin: 0; font-size: 1.15rem; }
.arena-card p { margin: 0; }
.arena-pic { width: 100%; height: 210px; position: relative; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #4a3626, #150d08 75%); }
.arena-pic .avatar { position: absolute; left: 50%; bottom: -30%; height: 150%; transform: translateX(-50%) scaleX(-1); }
.arena-kit { display: flex; gap: .3rem; align-items: center; justify-content: center; }
.arena-card .btn { width: 100%; margin-top: .2rem; }
.arena-msg { padding: .4rem .7rem; border-radius: 8px; background: rgba(242, 193, 78, .15); }
.arena-result { margin: .5rem 0; padding: .5rem .8rem; border-radius: 10px; background: rgba(0,0,0,.3); font-size: 1.05rem; }
.arena-result strong { color: var(--gold); }
.pin.monster b { display: grid; place-items: center; width: 100%; height: 100%; font-size: .9rem; }
@media (max-width: 700px) {
  .arena-rivals { grid-template-columns: minmax(0, 1fr); }
  .arena-card { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; }
  .arena-pic { width: 90px; height: 120px; }
  .arena-card .btn { width: auto; }
}

/* ---------- Guild House (user 2026-10-19) ---------- */
.guild-house { display: flex; flex-direction: column; height: 100%; }
.gh-top { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; background: linear-gradient(rgba(10,6,3,.85), rgba(10,6,3,.4)); }
.gh-banner { display: flex; align-items: center; gap: .6rem; padding: .35rem .9rem; border-radius: 12px; margin: 0 auto;
  background: color-mix(in srgb, var(--g, #c9962e) 35%, #1a110b); border: 2px solid var(--g, #c9962e); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.gh-banner .guild-emblem { font-size: 1.8rem; }
.gh-banner strong { display: block; font-size: 1.15rem; }
.gh-banner small { color: var(--ink-soft); font-style: italic; }
.gh-role { font-weight: 800; color: var(--gold); }
.gh-hall { position: relative; flex: 1; min-height: 0; }
.gh-flag { position: absolute; left: 50%; top: 2%; transform: translateX(-50%); font-size: clamp(2.5rem, 7vh, 4.5rem);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.gh-spot { position: absolute; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem .8rem;
  border-radius: 12px; border: 2px solid var(--gold); background: rgba(20,12,6,.82); color: var(--ink); font: inherit; font-weight: 800;
  cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.55); transition: transform .15s; }
.gh-spot:hover { transform: translateY(-3px) scale(1.04); }
.gh-spot span { font-size: 1.7rem; line-height: 1; }
.gh-spot small { color: var(--ink-soft); font-weight: 700; }
.gh-spot.notice { left: 50%; top: 30%; transform: translateX(-50%); }
.gh-spot.notice:hover { transform: translateX(-50%) translateY(-3px) scale(1.04); }
.gh-spot.hearth { right: 14%; top: 52%; }
.gh-spot.door { left: 5%; top: 50%; }
.gh-spot.door small { color: #ff9a7a; }
.guild-house .avatar.gh-me { position: absolute; left: 28%; bottom: 2%; height: 62%; }
.hall-card.house { border-color: var(--g, var(--gold)); }
.gh-members { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .35rem; max-height: 50vh; overflow: auto; }
.gh-members li { display: flex; align-items: center; gap: .6rem; padding: .4rem .7rem; border-radius: 8px; background: rgba(0,0,0,.3); }
.gh-members li.me { border: 1px solid var(--gold); }
.gh-members small { margin-left: auto; color: var(--ink-soft); }
@media (max-width: 700px) {
  .gh-top { flex-wrap: wrap; gap: .4rem; }
  .gh-banner { order: 3; width: 100%; }
  .gh-spot { padding: .3rem .5rem; font-size: .8rem; }
  .gh-spot span { font-size: 1.3rem; }
  .guild-house .avatar.gh-me { left: 50%; transform: translateX(-50%); height: 50%; }
}

/* ---------- Chat box, bottom left of the village (user 2026-10-21) ---------- */
.chat-dock { position: absolute; left: 12px; bottom: 12px; z-index: 6; width: min(340px, calc(100vw - 24px)); height: 230px;
  display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: rgba(14, 9, 5, .55); border: 1px solid rgba(242, 193, 78, .35); backdrop-filter: blur(3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.4); transition: background .2s; }
.chat-dock:hover, .chat-dock:focus-within { background: rgba(14, 9, 5, .82); }
.cd-head { display: flex; align-items: center; gap: .2rem; padding: .25rem .3rem; background: rgba(0,0,0,.35); }
.cd-tab { border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 800; font-size: .78rem;
  padding: .2rem .5rem; border-radius: 6px; cursor: pointer; }
.cd-tab.on { color: var(--gold); background: rgba(242, 193, 78, .15); }
.cd-fold { margin-left: auto; border: 0; background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer; padding: 0 .4rem; }
.chat-dock .chat-log { flex: 1; min-height: 0; border: 0; background: transparent; padding: .3rem .5rem; font-size: .82rem;
  display: flex; flex-direction: column; gap: .15rem; }
.chat-dock .chat-line { display: block; text-shadow: 0 1px 2px #000; }
.chat-dock .chat-line strong { font-size: .8rem; }
.chat-dock .chat-form { margin: 0; padding: .3rem; gap: .3rem; background: rgba(0,0,0,.3); }
.chat-dock .chat-input { flex: 1; min-width: 0; padding: .3rem .5rem; font-size: .82rem; }
.chat-dock .chat-form .btn { padding: .25rem .6rem; }
.chat-dock .chat-note { margin: 0; padding: 0 .5rem .3rem; font-size: .72rem; color: var(--ink-soft); }
.chat-dock .chat-note:empty { display: none; }
.chat-dock.folded { height: auto; width: auto; }
.chat-dock.folded .chat-log, .chat-dock.folded .chat-form, .chat-dock.folded .chat-note { display: none; }
.chat-dock.folded .cd-fold { transform: rotate(180deg); }
/* when the screen is too narrow for the chat beside the bottom bar, it sits above the bar */
@media (max-width: 1180px) { .chat-dock { bottom: 92px; height: 190px; width: min(300px, calc(100vw - 24px)); } }
@media (max-width: 700px) { .chat-dock { bottom: 84px; height: 150px; } }

/* ---------- World Boss (weekly event, 2026-10-21) ---------- */
.boss-chip { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 5; border: 2px solid #8a2a1a;
  background: linear-gradient(#3a120a, #1a0805); color: #ffcf9a; font: inherit; font-weight: 800; font-size: .85rem;
  padding: .3rem .9rem; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.boss-chip.open { color: #fff; border-color: #ff7a3c; animation: boss-pulse 1.4s ease-in-out infinite; }
@keyframes boss-pulse { 50% { box-shadow: 0 0 18px #ff5a1f; } }
.world-boss .panel { max-width: 560px; }
.wb-art { height: 200px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle, #4a1a10, #120805 70%); }
.wb-art img { max-height: 190px; max-width: 100%; filter: drop-shadow(0 0 16px rgba(255,90,31,.6)); }
.wb-hp { height: 22px; margin: .6rem 0; }
.wb-top { margin: .4rem 0; padding-left: 1.4rem; }
.wb-top li { margin: .1rem 0; }
@media (max-width: 700px) { .boss-chip { top: auto; bottom: 250px; font-size: .75rem; } }

/* ---------- Pet evolutions (2026-10-21) ---------- */
.evo-tag { margin-left: .3rem; padding: .05rem .45rem; border-radius: 999px; font-weight: 800; color: #1b120a;
  background: linear-gradient(90deg, #ffe08a, #ff9a3c, #ffe08a); }
.evo-next { margin-left: .3rem; color: var(--ink-soft); font-weight: 700; }
.pet-pic.evolved { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--el, #ffe08a) 70%, transparent)); }
.pet-evolve { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem; margin: .5rem 0;
  border-radius: 14px; background: radial-gradient(circle, rgba(255,224,138,.25), rgba(0,0,0,.2) 70%); overflow: hidden; }
.pet-evolve img.pet-pic.big { height: 140px; width: auto; animation: evo-rise 1.2s cubic-bezier(.3, 1.4, .5, 1); }
.pet-evolve strong { color: var(--gold); font-size: 1.1rem; }
.pet-evolve small { color: var(--ink-soft); }
.pe-flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: evo-flash 1.2s ease-out; pointer-events: none; }
@keyframes evo-rise { 0% { transform: scale(.4); filter: brightness(4); } 60% { transform: scale(1.12); filter: brightness(1.6); } 100% { transform: none; } }
@keyframes evo-flash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- Advanced Class aura in battle (2026-10-21) ---------- */
.fighter.adv { animation: breathe 2.6s ease-in-out infinite, adv-aura 1.6s ease-in-out infinite; }
@keyframes adv-aura {
  0%, 100% { filter: drop-shadow(0 0 6px var(--aura)) drop-shadow(0 0 14px var(--aura)); }
  50% { filter: drop-shadow(0 0 12px var(--aura)) drop-shadow(0 0 26px var(--aura)) brightness(1.08); } }
.fighter.adv-goldenAscension::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 100%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, rgba(255,210,58,.28), transparent 65%); animation: gold-flicker .5s steps(2) infinite; }
@keyframes gold-flicker { 50% { opacity: .55; } }
/* the path chooser */
.advanced .panel { max-width: 980px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; }
.adv-card { display: flex; flex-direction: column; gap: .35rem; padding: .7rem; border-radius: 14px; background: #1c140e;
  border: 2px solid color-mix(in srgb, var(--el) 50%, #3a2a1e); }
.adv-card.on { box-shadow: 0 0 16px color-mix(in srgb, var(--el) 60%, transparent); border-color: var(--el); }
.adv-card h3 { margin: 0; color: var(--el); }
.adv-card p { margin: 0; font-size: .85rem; }
.adv-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; font-size: .82rem; }
.adv-card li { display: flex; align-items: center; gap: .35rem; }
.adv-card .btn { margin-top: auto; }
.adv-aura { height: 90px; display: grid; place-items: center; border-radius: 10px; font-size: 3rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--el) 55%, transparent), #120b07 70%); }
.tab.advanced { color: var(--gold); }

/* 5-8 skills in battle (user 2026-10-21): up to 10 buttons in 2 rows of 5, a little smaller */
.actions.many { grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.actions.many .act { min-height: 78px; padding: .4rem .25rem; }
.actions.many .act strong { font-size: .82rem; line-height: 1.1; }
.actions.many .act.skill .el-icon, .actions.many .act .skill-icon { width: 32px; height: 32px; }
@media (max-width: 860px) { .actions.many { grid-template-columns: repeat(4, 1fr); } .actions.many .act { min-height: 60px; } }
