/* Village pages in the Monster Hunter Rise layout, in the clay style:
   indigo header ribbon with tabs, list on the left, washi-paper detail on the right, key hints at the bottom. */
:root { --ai: #3a4887; --ai2: #29336a; --shu: #e8553a; --washi: #fff7e6; }

#panel.rz .panelbox { width: min(96vw, 176vh); height: min(94vh, 720px); }
#panel.rz .ptitle { display: none; }
.rz-body { flex-direction: column; gap: 1.1vh; }

/* ---------- header ribbon ---------- */
.rz-head { flex: none; display: flex; align-items: center; gap: 1.2vh; min-height: 52px; padding: 3px 50px 3px 6px;
  background: linear-gradient(#4b5ba2, #2f3a74); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, .26), inset 0 -4px 0 rgba(0, 0, 0, .18); }
.rz-title { flex: none; display: flex; align-items: center; gap: .6vh; font-size: clamp(16px, 3.6vh, 30px); color: #fff8ea; text-shadow: var(--ol-s); white-space: nowrap; }
.rz-title .rz-ico { width: clamp(32px, 6.6vh, 52px); height: clamp(32px, 6.6vh, 52px); }
.rz-tabs { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .9vh; }
.rz-tab { pointer-events: auto; cursor: pointer; font-family: inherit; font-weight: 900; font-size: clamp(13px, 2.5vh, 20px); white-space: nowrap;
  min-height: 46px; min-width: 56px; padding: 0 1.1em; border-radius: 14px; border: 2.5px solid rgba(20, 12, 30, .65);
  background: rgba(255, 248, 234, .14); color: #f3dfbd; text-shadow: 0 2px 0 rgba(20, 12, 30, .6); transition: transform .12s, background .12s; }
.rz-tab:hover { background: rgba(255, 248, 234, .26); }
.rz-tab.on { background: linear-gradient(#ffb66c, #e8603a); color: #fff8ea; text-shadow: var(--ol-s); border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, .5); transform: translateY(-2px); }
.rz-tab:active, .rz-tab.press { transform: scale(.94); }
.rz-gold { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 12px 2px 4px; border-radius: 99px; background: rgba(20, 12, 30, .45);
  border: 2.5px solid var(--ink); color: #fff8ea; text-shadow: var(--ol-s); font-size: clamp(15px, 2.9vh, 23px); }
.rz-gold .rz-ico { width: clamp(26px, 5.4vh, 40px); height: clamp(26px, 5.4vh, 40px); }
.rz-k { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.65em; padding: 0 .4em; border-radius: 8px; flex: none;
  background: #1f1733; color: #fff3dc; border: 2px solid #f3dfbd; font-size: clamp(12px, 1.9vh, 15px); font-style: normal; text-shadow: none; line-height: 1; }
#panel.touch .rz-k, #panel.touch .rz-hints { display: none; }

/* ---------- list (rows) and item box (grid) ---------- */
.rz-main { flex: 1; min-height: 0; display: flex; gap: 1.4vh; }
.rz-list { flex: 0 0 clamp(190px, 35%, 400px); min-width: 0; display: flex; flex-direction: column; gap: .9vh; overflow-x: hidden; overflow-y: auto;
  padding: 4px 8px 8px 14px; scrollbar-width: thin; scrollbar-color: rgba(74, 42, 18, .5) transparent; }
.rz-list::-webkit-scrollbar { width: 7px; }
.rz-list::-webkit-scrollbar-thumb { background: rgba(74, 42, 18, .5); border-radius: 8px; }
.rz-list.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 1.1vh; }
.rz-list > * { animation: rzRow .24s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rzRow { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; } }

.rz-ico { position: relative; display: inline-block; flex: none; }
.rz-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.rz-ico.dim img, .dim > .rz-ico img { filter: grayscale(1) brightness(.8) opacity(.7); }

.rz-row { pointer-events: auto; cursor: pointer; font-family: inherit; font-weight: 900; color: var(--ink); text-align: left; position: relative; flex: none;
  display: flex; align-items: center; gap: 1vh; min-height: 48px; padding: .5vh 1vh .5vh .6vh;
  background: linear-gradient(#fff9ec, #f2ddb6); border: 3px solid var(--ink2); border-radius: 14px; box-shadow: 0 3px 0 rgba(74, 42, 18, .55);
  transition: transform .14s, box-shadow .14s; }
.rz-row > .rz-ico { width: clamp(36px, 8.4vh, 64px); height: clamp(36px, 8.4vh, 64px); }
.rz-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.rz-rt b { font-size: clamp(13px, 2.5vh, 20px); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rz-sl { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
/* the sub line (level, stat, meal buff) wraps instead of running past the row's edge */
.rz-sl small { min-width: 0; font-size: clamp(12px, 1.9vh, 15px); color: var(--ink2); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.rz-row:hover { filter: brightness(1.04); }
.rz-row.sel { background: linear-gradient(#fff3c8, #ffd57a); border-color: var(--ink); box-shadow: 0 0 0 3px var(--shu), 0 4px 0 var(--ink); transform: translateX(5px); }
.rz-row.sel::before { content: ""; position: absolute; left: -15px; top: 50%; margin-top: -9px; border-left: 11px solid var(--shu); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.rz-row:active, .rz-row.press { transform: translateX(5px) scale(.97); }
.rz-price { flex: none; display: flex; align-items: center; gap: 2px; font-size: clamp(13px, 2.4vh, 19px); }
.rz-price .rz-ico { width: clamp(22px, 4.4vh, 32px); height: clamp(22px, 4.4vh, 32px); }

.rz-cell { pointer-events: auto; cursor: pointer; position: relative; aspect-ratio: 1; min-width: 0; min-height: 44px; padding: 0; overflow: hidden; font-family: inherit;
  border-radius: 14px; border: 3px solid var(--ink2); background: radial-gradient(circle at 35% 30%, #fffdf6, #efd9ae); box-shadow: 0 3px 0 rgba(74, 42, 18, .55); transition: transform .14s; }
.rz-cell > .rz-ico { position: absolute; inset: 12%; }
.rz-cnt { position: absolute; right: 4px; bottom: 1px; font-size: clamp(13px, 2.3vh, 19px); color: #fff8ea; text-shadow: var(--ol-s); }
.rz-mark { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.rz-cell.sel { border-color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff8da, #ffd57a); box-shadow: 0 0 0 3px var(--shu), 0 4px 0 var(--ink); transform: scale(1.04); }
.rz-cell:active, .rz-cell.press { transform: scale(.94); }

.rz-tag { display: inline-block; font-size: clamp(12px, 1.8vh, 14px); line-height: 1.3; padding: 0 7px; border-radius: 99px; border: 2px solid var(--ink); white-space: nowrap;
  background: #cdbd9f; color: var(--ink); }
.rz-tag.eq { background: #92d264; }
.rz-tag.up { background: #ffb44a; }
.rz-tag.short, .rz-tag.lock { background: #e2d6c0; color: #806a52; border-color: #9a8466; }
.rz-tag.done { background: #8fd6cd; }
.rz-tag.new { background: #ff7a5a; color: #fff8ea; }
.rz-tag.max { background: var(--gold); }

/* ---------- detail (washi paper with a stitched edge) ---------- */
.rz-detail { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1vh; padding: 1.3vh 1.7vh;
  background: radial-gradient(ellipse at 25% 0%, #fffdf6, #fbeccf 75%); border: 3px solid var(--ink2); border-radius: 18px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6), inset 0 -5px 0 rgba(74, 42, 18, .12); }
.rz-detail::before { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(107, 61, 28, .26); border-radius: 13px; pointer-events: none; }
.rz-detail > * { animation: rzIn .2s ease-out both; position: relative; }
@keyframes rzIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rz-dtop { flex: none; display: flex; gap: 1.6vh; align-items: center; }
.rz-ico.big { width: clamp(60px, 19vh, 170px); height: clamp(60px, 19vh, 170px); border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, .95), rgba(255, 228, 170, .55) 55%, rgba(255, 228, 170, 0) 71%); }
.rz-ico.big img { inset: 6%; width: 88%; height: 88%; }
.rz-dhead { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .6vh; }
.rz-name { font-size: clamp(17px, 3.7vh, 31px); line-height: 1.15; color: #fff8ea; text-shadow: var(--ol-s); }
.rz-chips { display: flex; flex-wrap: wrap; gap: .6vh; }
.rz-chip { font-size: clamp(12px, 1.9vh, 15px); line-height: 1.35; padding: 0 9px; border-radius: 99px; background: var(--ai); color: #fff3dc; border: 2px solid var(--ink); white-space: nowrap; }
.rz-chip.lv { background: var(--shu); }
.rz-chip.eq { background: #4fa836; }
.rz-chip.done { background: var(--teal); }
.rz-chip.star { background: var(--gold); color: var(--ink); }
.rz-chip.gray { background: #9a8a74; }
.rz-desc { font-size: clamp(12px, 2.1vh, 17px); font-weight: 700; line-height: 1.32; color: var(--ink); }
.rz-dmid { flex: 1; min-height: 0; display: flex; gap: 1.4vh; overflow-y: auto; overflow-x: hidden; }
.rz-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .55vh; align-self: flex-start; max-height: 100%;
  background: rgba(255, 255, 255, .6); border: 2.5px solid rgba(107, 61, 28, .45); border-radius: 14px; padding: .8vh 1.2vh 1vh; }
.rz-bh { align-self: flex-start; font-size: clamp(12px, 2vh, 16px); line-height: 1.35; padding: 0 10px; border-radius: 8px; background: var(--ai); color: #fff3dc; border: 2px solid var(--ink); margin-bottom: .2vh; }
.rz-stats { display: grid; grid-template-columns: max-content minmax(28px, 1fr) max-content; gap: .55vh 1vh; align-items: center; font-size: clamp(12px, 2.1vh, 17px); }
.rz-stats .l { color: var(--ink2); white-space: nowrap; }
.rz-stats .v { text-align: right; white-space: nowrap; }
.rz-stats .bar { height: 1.5vh; min-height: 8px; }
.rz-stats .arr { color: var(--ink2); }
.rz-stats .up, .rz-mat .ct b { color: #2f9a3a; }
.rz-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 1.2vh; font-size: clamp(12px, 2.1vh, 17px); }
.rz-kv .l { flex: none; color: var(--ink2); white-space: nowrap; }
.rz-kv .v { min-width: 0; text-align: right; }
.rz-big { font-size: clamp(15px, 3vh, 24px); color: var(--teal2); line-height: 1.25; }
.rz-li { font-size: clamp(12px, 2.1vh, 17px); font-weight: 700; line-height: 1.3; padding-left: 1em; position: relative; }
.rz-li::before { content: ""; position: absolute; left: .2em; top: .5em; width: .42em; height: .42em; border-radius: 50%; background: var(--orange); border: 1.5px solid var(--ink); }
.rz-mat { display: flex; align-items: center; gap: .8vh; font-size: clamp(12px, 2.1vh, 17px); }
.rz-mat .rz-ico { width: clamp(24px, 5vh, 40px); height: clamp(24px, 5vh, 40px); }
.rz-mat .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rz-mat .ct { flex: none; white-space: nowrap; }
.rz-mat.short .ct { color: var(--red); }
.rz-mat.ok .ct::after { content: " ✔"; color: #2f9a3a; }
.rz-acts { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 1.4vh; flex-wrap: wrap; }
.rz-acts .btn { min-width: clamp(104px, 21vh, 190px); min-height: 46px; }
.rz-note { margin-right: auto; font-size: clamp(13px, 2.3vh, 18px); color: var(--ink2); }
.btn.short { filter: grayscale(.7) brightness(.96); }
.btn.short:hover, .btn.short.focus { filter: grayscale(.55) brightness(1.04); }
.btn.go { font-size: clamp(15px, 2.9vh, 23px); }

/* ---------- key hints ---------- */
.rz-hints { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 2.6vh; padding: 0 1vh; font-size: clamp(12px, 2vh, 16px); color: #fff8ea; text-shadow: var(--ol-s); }
.rz-hint { display: flex; align-items: center; gap: .5vh; }

/* ---------- confirm popup ---------- */
#rzConfirm { z-index: 45; background: rgba(20, 12, 30, .4); }
#rzConfirm .panelbox { width: min(74vw, 96vh); text-align: center; display: flex; flex-direction: column; gap: 1.2vh; }
#rzConfirm .ptitle { font-size: clamp(16px, 3.5vh, 28px); margin: 0 .4em; line-height: 1.25; }
.rz-cfbody { display: flex; flex-direction: column; gap: .6vh; text-align: left; background: rgba(255, 255, 255, .6); border-radius: 14px; border: 2.5px solid rgba(107, 61, 28, .45); padding: .8vh 1.4vh; }
.rz-cfbtns { display: flex; justify-content: center; gap: 2.4vh; }
.rz-cfbtns .btn { min-width: 32%; min-height: 46px; }
