/* Hanzo's Workshop, the inventory mini-game (hanzo.js). */
.hanzo [hidden] { display: none !important; }
.hanzo { --hz-line: rgba(231, 190, 106, .22); --hz-card: rgba(14, 12, 9, .82); --hz-cell: rgba(255, 255, 255, .045); position: relative; }
.hanzo h1 { margin: 0 0 4px; }
.hanzo h2 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.hanzo h3 { margin: 0 0 8px; font-size: 14px; }
.hanzo__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.hanzo__head p { margin: 0; color: var(--muted); max-width: 620px; }
.hanzo__links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hanzo__links a { color: var(--gold); }
.hanzo__note { padding: 10px 14px; border: 1px solid var(--hz-line); border-radius: 10px; background: rgba(231, 190, 106, .07); color: var(--muted); }
.hanzo__rules { padding: 12px 16px; border: 1px solid var(--hz-line); border-radius: 12px; background: var(--hz-card); margin-bottom: 14px; }
.hanzo__rules p { margin: 6px 0; color: var(--muted); }
.hanzo__start { display: flex; justify-content: center; padding: 50px 0; }
.hanzo__btn { cursor: pointer; border: 1px solid var(--hz-line); border-radius: 10px; padding: 8px 14px; color: var(--text); background: linear-gradient(180deg, #4a3714, #2a1f0c); font: inherit; font-weight: 600; }
.hanzo__btn:hover:not(:disabled) { border-color: var(--gold); }
.hanzo__btn:disabled { opacity: .45; cursor: default; }
.hanzo__btn--big { font-size: 18px; padding: 14px 36px; }
.hanzo__btn--ghost { background: transparent; }
.hanzo__muted { color: var(--muted); font-size: 13px; }
.hanzo__good { color: var(--green); font-weight: 600; }
.hanzo__bad { color: var(--red); display: block; margin-top: 6px; }
.hanzo__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hanzo__zen { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: #e8d9a8; color: #2b220c; vertical-align: middle; }
.hanzo__money { color: #ffe1a1; font-weight: 700; white-space: nowrap; }
.hanzo__pts { color: #ff9f4a; font-weight: 700; white-space: nowrap; }

.hanzo__game { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hanzo__left, .hanzo__right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hanzo__card { padding: 14px; border: 1px solid var(--hz-line); border-radius: 14px; background: var(--hz-card); }
.hanzo__card > .hanzo__row:first-child { margin-bottom: 10px; }

/* board */
.hanzo__board { --n: 8; position: relative; width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr);
    border: 1px solid var(--hz-line); border-radius: 6px; background: #0b0a08; overflow: hidden; touch-action: none; user-select: none; }
.hanzo__cell { border-right: 1px solid var(--hz-cell); border-bottom: 1px solid var(--hz-cell); }
.hanzo__item { position: absolute; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(231, 190, 106, .35);
    background: radial-gradient(circle at 50% 55%, rgba(231, 190, 106, .13), rgba(0, 0, 0, .25) 70%); box-sizing: border-box; cursor: default; transition: box-shadow .15s; }
.hanzo__item img { max-width: 86%; max-height: 86%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.hanzo__item.is-order { cursor: pointer; border-color: var(--gold); box-shadow: inset 0 0 0 2px rgba(231, 190, 106, .7), 0 0 14px rgba(231, 190, 106, .35); }
.hanzo__item.is-chest { cursor: pointer; }
.hanzo__item.is-target { cursor: pointer; box-shadow: inset 0 0 0 2px #8ab4ff, 0 0 12px rgba(138, 180, 255, .5); }
.hanzo__item.is-merge { box-shadow: inset 0 0 0 3px var(--green); }
.hanzo__item.is-flash { animation: hz-flash .7s ease-out; }
.hanzo__item.is-fail { animation: hz-fail .7s ease-out; }
@keyframes hz-flash { 0% { box-shadow: 0 0 0 0 rgba(255, 220, 120, .95), inset 0 0 30px rgba(255, 220, 120, .8); } 100% { box-shadow: none; } }
@keyframes hz-fail { 0%, 40% { box-shadow: inset 0 0 30px rgba(255, 80, 80, .9); transform: translateX(-2px); } 20%, 60% { transform: translateX(2px); } 100% { box-shadow: none; transform: none; } }
.hanzo__lvl { position: absolute; top: 4px; left: 4px; font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 5px; color: #2a1d06; background: linear-gradient(180deg, #ffe39a, #d9a441); line-height: 1.3; }
.hanzo__old { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font-size: 12px; opacity: .85; }
.hanzo__chesttag { position: absolute; top: 3px; right: 4px; font-size: 12px; color: var(--gold); }
.hanzo__ghost { position: absolute; border: 2px dashed var(--green); background: rgba(102, 209, 158, .12); pointer-events: none; box-sizing: border-box; }
.hanzo__ghost.is-bad { border-color: var(--red); background: rgba(255, 125, 125, .12); }
.hanzo__float { position: fixed; z-index: 50; pointer-events: none; display: flex; align-items: center; justify-content: center; opacity: .85; }
.hanzo__float img { max-width: 90%; max-height: 90%; object-fit: contain; }

/* hand */
.hanzo__handbox { display: grid; grid-template-columns: 1fr 1fr 1fr 0.9fr; grid-template-areas: "hand hand hand trash" "reroll reroll reroll trash" "next next next next" "hint hint hint hint";
    gap: 10px; padding: 14px; border: 1px solid var(--hz-line); border-radius: 14px; background: var(--hz-card); }
.hanzo__hand { grid-area: hand; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hanzo__slot { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid var(--hz-line); border-radius: 10px; background: rgba(0, 0, 0, .35); cursor: grab; touch-action: none; user-select: none; }
.hanzo__slot:hover:not(.is-empty) { border-color: var(--gold); }
.hanzo__slot.is-empty { cursor: default; opacity: .5; }
.hanzo__slot img { max-width: 70%; max-height: 80%; object-fit: contain; pointer-events: none; }
.hanzo__size { position: absolute; top: 5px; left: 5px; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px; color: #ffb067; background: rgba(120, 50, 10, .7); border: 1px solid rgba(255, 140, 60, .5); }
.hanzo__slot .hanzo__lvl { left: auto; right: 5px; }
.hanzo__trash { grid-area: trash; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--hz-line); border-radius: 10px; cursor: pointer; padding: 8px; }
.hanzo__trash.is-armed { border-color: var(--red); background: rgba(255, 125, 125, .08); }
.hanzo__trash-icon { font-size: 26px; filter: grayscale(1) brightness(1.6); }
.hanzo__scrolls { display: flex; gap: 4px; }
.hanzo__scrolls i { width: 20px; height: 20px; background: url('../item_images/14/10.webp') center / contain no-repeat; opacity: .2; }
.hanzo__scrolls i.is-on { opacity: 1; }
.hanzo__trash-buy { display: flex; gap: 4px; }
.hanzo__trash-buy i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); }
.hanzo__trash-buy i.is-on { background: var(--gold); }
.hanzo__reroll { grid-area: reroll; padding: 12px; }
.hanzo__reroll b { color: var(--green); }
.hanzo__next { grid-area: next; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.hanzo__next img { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--hz-line); border-radius: 6px; padding: 2px; }
.hanzo__hint { grid-area: hint; margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* stats */
.hanzo__label { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.hanzo__record { color: var(--muted); font-size: 13px; }
.hanzo__score { font-size: 40px; line-height: 1.15; color: #ffbe6b; font-weight: 800; }
.hanzo__stats .hanzo__money { font-size: 22px; }
.hanzo__stage { min-width: 32px; height: 34px; display: grid; place-items: center; font-weight: 800; color: #2a1d06; background: linear-gradient(180deg, #ffe39a, #d9a441); clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); }
.hanzo__bar { position: relative; flex: 1; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.hanzo__bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #2f7fd6, #3ea0f0); transition: width .3s; }
.hanzo__bar span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 13px; font-weight: 700; }
.hanzo__rep { padding: 4px 10px; border-radius: 13px; border: 1px solid var(--gold); color: var(--gold); font-weight: 700; font-size: 13px; }
.hanzo__rep.is-low { border-color: var(--red); color: var(--red); }

/* orders */
.hanzo__orders { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.hanzo__order { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--hz-line); border-radius: 10px; }
.hanzo__order.is-ready { border-style: solid; border-color: var(--gold); box-shadow: 0 0 12px rgba(231, 190, 106, .25); }
.hanzo__order .hanzo__lvl { position: static; }
.hanzo__order img { height: 56px; object-fit: contain; align-self: center; }
.hanzo__order .hanzo__pts { font-size: 13px; padding: 1px 6px; border: 1px solid rgba(255, 159, 74, .45); border-radius: 5px; }
.hanzo__xp { font-size: 12px; font-weight: 700; color: #8ac4ff; padding: 1px 6px; border: 1px solid rgba(138, 196, 255, .45); border-radius: 5px; }
.hanzo__refuse { cursor: pointer; border: 1px solid rgba(255, 91, 91, .6); border-radius: 14px; background: rgba(120, 20, 20, .25); color: var(--text); font: inherit; font-size: 13px; padding: 3px 8px; }
.hanzo__refuse:disabled { opacity: .4; cursor: default; }

/* shop */
.hanzo__shop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hanzo__jewel { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--hz-line); border-radius: 10px; background: rgba(0, 0, 0, .3); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.hanzo__jewel:hover { border-color: var(--gold); }
.hanzo__jewel.is-armed { border-color: #8ab4ff; box-shadow: 0 0 12px rgba(138, 180, 255, .4); }
.hanzo__jewel img { width: 30px; height: 30px; object-fit: contain; }
.hanzo__jewel > span { flex: 1; font-size: 13px; font-weight: 600; }
.hanzo__jewel > b { color: var(--green); white-space: nowrap; }
.hanzo__jewel > b.is-poor { color: var(--red); }
.hanzo__tip { display: none; position: absolute; z-index: 20; left: 0; bottom: calc(100% + 6px); width: 260px; padding: 10px 12px; border: 1px solid var(--hz-line); border-radius: 10px; background: #15120d; color: var(--muted); font-style: normal; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 20px rgba(0, 0, 0, .6); }
.hanzo__jewel:hover .hanzo__tip { display: block; }
.hanzo__chances { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 6px; color: var(--text); }
.hanzo__chances b { color: var(--green); }

/* chest */
.hanzo__chest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hanzo__chestbox { padding: 10px; border: 1px solid var(--hz-line); border-radius: 10px; min-height: 110px; }
.hanzo__trophies { display: flex; flex-wrap: wrap; gap: 6px; }
.hanzo__trophy { position: relative; display: flex; flex-direction: column; align-items: center; width: 50px; padding-top: 4px; }
.hanzo__trophy img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--hz-line); border-radius: 6px; }
.hanzo__trophy .hanzo__lvl { top: 0; left: 0; font-size: 10px; }
.hanzo__trophy small { font-size: 11px; color: var(--muted); }
.hanzo__sum { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hz-line); }
.hanzo__sum b { color: #ffbe6b; }

/* mastery */
.hanzo__mastery { margin-top: 18px; }
.hanzo__mastery .hanzo__bar { margin: 6px 0 14px; }
.hanzo__tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hanzo__branch { padding: 10px; border: 1px solid var(--hz-line); border-radius: 10px; }
.hanzo__skill { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.hanzo__skill p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.hanzo__skill.is-on b { color: var(--gold); }

/* overlays */
.hanzo__toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 18px; border: 1px solid var(--hz-line); border-radius: 12px; background: #15120d; color: var(--text); box-shadow: 0 10px 24px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px); }
.hanzo__toast.is-bad { border-color: var(--red); }
.hanzo__itemtip { position: absolute; z-index: 30; transform: translate(-50%, calc(-100% - 6px)); padding: 8px 12px; border: 1px solid var(--hz-line); border-radius: 10px; background: #15120d; pointer-events: none; white-space: nowrap; display: flex; flex-direction: column; gap: 4px; }
.hanzo__modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0, 0, 0, .65); padding: 16px; }
.hanzo__modal[hidden] { display: none; }
.hanzo__modal-box { width: min(420px, 100%); padding: 24px; text-align: center; border: 1px solid var(--gold); border-radius: 16px; background: #15120d; }
.hanzo__modal-box h2 { font-size: 20px; margin-bottom: 6px; }
.hanzo.is-armed .hanzo__item:not(.is-target) { opacity: .45; }

@media (max-width: 900px) {
    .hanzo__game { grid-template-columns: 1fr; }
    .hanzo__score { font-size: 32px; }
    .hanzo__chest, .hanzo__shop { grid-template-columns: 1fr; }
    .hanzo__lvl { font-size: 10px; padding: 0 3px; top: 2px; left: 2px; }
    .hanzo__chesttag, .hanzo__old { font-size: 10px; }
    .hanzo__tip { width: min(260px, 80vw); }
}

/* list and leaderboard */
.hanzo__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.hanzo__gamecard { display: flex; gap: 16px; align-items: center; color: var(--text); text-decoration: none; }
.hanzo__gamecard:hover { border-color: var(--gold); }
.hanzo__gamecard img { width: 72px; height: 96px; object-fit: contain; }
.hanzo__gamecard p { margin: 6px 0 10px; }
.hanzo__tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.hanzo__tabs a { padding: 6px 14px; border: 1px solid var(--hz-line); border-radius: 16px; color: var(--muted); text-decoration: none; }
.hanzo__tabs a.is-on { color: #2a1d06; background: var(--gold); border-color: var(--gold); }
.hanzo__table { width: 100%; border-collapse: collapse; }
.hanzo__table th, .hanzo__table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.hanzo__table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.hanzo__table tr.is-top td:first-child { color: var(--gold); font-weight: 800; }
.hanzo__links a.hanzo__btn { text-decoration: none; }

/* game over */
.hanzo__badge { display: inline-block; padding: 6px 16px; border-radius: 16px; background: linear-gradient(180deg, #ffe39a, #e6b25a); color: #2a1d06; font-weight: 800; }
.hanzo__badge--small { padding: 1px 8px; font-size: 11px; border-radius: 8px; background: rgba(231, 190, 106, .25); color: var(--gold); }
.hanzo__overlvl { display: flex; gap: 14px; align-items: center; text-align: left; margin: 14px 0; padding: 12px; border: 1px solid var(--hz-line); border-radius: 12px; }
.hanzo__overlvl > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.hanzo__stage--big { min-width: 48px; height: 56px; font-size: 22px; }
.hanzo__xpgain { color: #4ab0ff; font-weight: 800; font-size: 18px; }
.hanzo__bar--thin { height: 8px; flex: none; }
.hanzo__bar--thin i { background: linear-gradient(90deg, #cfe3ff, #ffffff); }
.hanzo__overgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 16px; text-align: left; }
.hanzo__overcell { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--hz-line); border-radius: 12px; font-size: 14px; }
.hanzo__overimg { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--hz-line); border-radius: 8px; color: var(--gold); font-size: 22px; }
.hanzo__overimg img { max-width: 44px; max-height: 44px; object-fit: contain; }
.hanzo__overimg .hanzo__lvl { top: -6px; left: -6px; font-size: 10px; }
.hanzo__overbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hanzo__btn--gold { background: linear-gradient(180deg, #ffd77a, #e3a63c); color: #2a1d06; border-color: #ffd77a; }
.hanzo__modal-box { width: min(560px, 100%); }
@media (max-width: 560px) { .hanzo__overgrid { grid-template-columns: 1fr; } }

/* the board and hand fit one screen */
.hanzo__board { max-width: var(--hz-size); margin: 0 auto; }
.hanzo__handbox { width: 100%; max-width: var(--hz-size); margin: 0 auto; box-sizing: border-box; }
/* The left track has a size of its own (screen height, capped by the room left), never its content: a long hint or a fuller hand no longer resizes the board. */
.hanzo__game { grid-template-columns: min(calc(100% - 358px), var(--hz-size)) minmax(340px, 480px); justify-content: center; }
.hanzo__left { width: 100%; }
.hanzo__scrolls i { display: inline-block; }
.hanzo__trash-icon { font-size: 30px; }
@media (max-width: 900px) {
    .hanzo__game { grid-template-columns: 1fr; }
    .hanzo__left { width: 100%; }
    .hanzo__board, .hanzo__handbox { max-width: none; }
}
.hanzo__item { cursor: grab; touch-action: none; }
.hanzo__item.is-dragged { opacity: .3; }
.hanzo__item.is-mergeable,
.hanzo__slot.is-mergeable { border-color: #3fd69a; box-shadow: inset 0 0 0 1px rgba(63, 214, 154, .7), 0 0 10px rgba(63, 214, 154, .25); }
.hanzo__slot.is-mergeable .hanzo__size { color: #6bf0b8; background: rgba(10, 80, 50, .75); border-color: rgba(63, 214, 154, .6); }
.hanzo__item.is-order.is-mergeable { box-shadow: inset 0 0 0 2px rgba(231, 190, 106, .7), 0 0 12px rgba(63, 214, 154, .45); }
.hanzo__gamecard img.hanzo__gameicon { width: 96px; height: 96px; }
.hanzo__headicon { width: 84px; height: 84px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.hanzo__headtext { flex: 1; min-width: 220px; }
@media (max-width: 560px) { .hanzo__headicon { width: 60px; height: 60px; } }

/* shop tooltips: icon, name, text; Soul's chance grid (owner's reference, 2026-10-21) */
.hanzo__tip { width: 300px; padding: 14px 16px; border-radius: 14px; background: rgba(22, 19, 15, .97); border-color: rgba(255, 255, 255, .08); color: var(--text); font-size: 14px; }
.hanzo__tip--right { left: auto; right: 0; top: calc(100% + 8px); bottom: auto; width: 320px; }
.hanzo__tiprow { display: flex; gap: 12px; align-items: flex-start; }
.hanzo__tiprow + .hanzo__tiprow { margin-top: 14px; }
.hanzo__tiprow > img { width: 34px; height: 34px; object-fit: contain; flex: none; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.hanzo__tiprow > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hanzo__tiprow b { color: #fff; font-weight: 700; }
.hanzo__tiptext { color: var(--muted); line-height: 1.4; }
.hanzo__chances { display: grid; grid-template-columns: auto auto auto auto; gap: 5px 14px; margin-top: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hanzo__chances b { color: #4ee36b; font-weight: 700; }
.hanzo__tip .hanzo__bad { color: #ff5b5b; margin-top: 8px; }
.hanzo__shophint { display: inline-flex; align-items: center; gap: 8px; }
.hanzo__info { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; font-size: 11px; font-weight: 700; font-style: italic; cursor: help; }
.hanzo__info:hover .hanzo__tip, .hanzo__info:focus .hanzo__tip { display: block; }
.hanzo__info .hanzo__tip { font-style: normal; font-weight: 400; text-align: left; }
@media (max-width: 560px) { .hanzo__tip, .hanzo__tip--right { width: min(300px, 86vw); } }

/* an item an order takes: green frame and a "to order" bar (owner's reference, 2026-10-21) */
.hanzo__item.is-order { border: 2px solid #4ccf2e; box-shadow: 0 0 12px rgba(76, 207, 46, .35); }
.hanzo__item.is-order.is-mergeable { box-shadow: 0 0 12px rgba(76, 207, 46, .45); }
.hanzo__toorder { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 2px; background: #3fb51f; color: #10230a; font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.hanzo__toorder::before { content: "🎁 "; }
.hanzo__item.is-order .hanzo__old { bottom: 18px; }
@media (max-width: 560px) { .hanzo__toorder { font-size: 9px; } .hanzo__toorder::before { content: ""; } }

/* nothing on the game page may widen it: tooltips open inwards, and the scrollbar keeps its place (2026-10-21) */
html { scrollbar-gutter: stable; }
.hanzo { overflow-x: clip; overflow-y: visible; }
.hanzo__shop .hanzo__jewel:nth-child(even) .hanzo__tip { left: auto; right: 0; }
.hanzo__itemtip { max-width: 260px; white-space: normal; }

/* start screen: the menu over a dimmed board, how to play beside it (MUDream's layout) */
.hanzo__crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.hanzo__crumbs a { color: var(--muted); text-decoration: none; }
.hanzo__crumbs a:hover { color: var(--gold); }
.hanzo__crumbs b { color: var(--text); }
.hanzo__start { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; padding: 0; }
.hanzo__menu { position: relative; aspect-ratio: 1; border: 1px solid var(--hz-line); border-radius: 14px; overflow: hidden; background: #0b0a08; }
.hanzo__demo { position: absolute; inset: 0; opacity: .42; filter: saturate(.7); background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: calc(100% / var(--n)) calc(100% / var(--n)); }
.hanzo__demo span { position: absolute; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(231, 190, 106, .35); box-sizing: border-box; }
.hanzo__demo img { max-width: 80%; max-height: 80%; object-fit: contain; }
.hanzo__menubox { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; box-sizing: border-box; text-align: center;
    background: radial-gradient(ellipse at center, rgba(8, 7, 5, .82) 30%, rgba(8, 7, 5, .35) 75%); }
.hanzo__menuicon { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7)); }
.hanzo .hanzo__menutitle { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; color: #ffc93c; text-shadow: 0 3px 14px rgba(0, 0, 0, .8); }
.hanzo__menutext { margin: 0; max-width: 420px; color: var(--text); opacity: .85; }
.hanzo__menurecord { margin: 0; font-size: 18px; color: var(--muted); }
.hanzo__menurecord b { color: var(--text); font-size: 22px; margin-left: 4px; }
.hanzo__menulevel { display: flex; gap: 14px; align-items: center; width: min(100%, 380px); padding: 12px 14px; border: 1px solid var(--hz-line); border-radius: 12px; background: rgba(14, 12, 9, .9); text-align: left; }
.hanzo__menulevel > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.hanzo__freepts { min-width: 22px; padding: 1px 8px; border-radius: 10px; font-weight: 800; text-align: center; color: #2a1d06; background: linear-gradient(180deg, #ffe39a, #d9a441); }
.hanzo__menubtns { display: flex; flex-direction: column; gap: 10px; width: min(100%, 320px); }
.hanzo__menubtns .hanzo__btn--big { width: 100%; font-size: 16px; padding: 12px 18px; }
.hanzo__menubtns small { display: block; font-size: 12px; font-weight: 600; opacity: .8; }
.hanzo__howto { display: flex; flex-direction: column; gap: 10px; }
.hanzo__how { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--hz-line); border-radius: 12px; background: rgba(0, 0, 0, .25); }
.hanzo__how h3 { margin: 0 0 4px; font-size: 16px; color: var(--text); }
.hanzo__how p { margin: 0; color: var(--muted); font-size: 13px; }
.hanzo__howpic { flex: none; width: 190px; height: 84px; display: flex; gap: 8px; align-items: center; justify-content: center; border-radius: 8px; background: #0b0a08; }
.hanzo__howpic i { font-style: normal; color: var(--muted); font-weight: 700; }
.hanzo__mini { position: relative; width: 46px; height: 62px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(231, 190, 106, .35); border-radius: 4px;
    background: radial-gradient(circle at 50% 55%, rgba(231, 190, 106, .13), rgba(0, 0, 0, .25) 70%); }
.hanzo__mini img { max-width: 80%; max-height: 80%; object-fit: contain; }
.hanzo__mini .hanzo__lvl { top: 2px; left: 2px; font-size: 10px; padding: 0 4px; }
.hanzo__mini.is-empty { border-style: dashed; background: none; }
.hanzo__mini.is-order { width: 58px; border-color: #47d16b; box-shadow: 0 0 12px rgba(71, 209, 107, .45); }
.hanzo__mini.is-order em { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 9px; font-weight: 700; color: #08260f; background: #47d16b; }
.hanzo__mini.is-gold { border-color: var(--gold); box-shadow: 0 0 12px rgba(231, 190, 106, .45); }
.hanzo__chestico { font-size: 34px; color: #ffc93c; }
@media (max-width: 900px) {
    .hanzo__start { grid-template-columns: 1fr; }
    .hanzo__menu { aspect-ratio: auto; min-height: 520px; }
}
@media (max-width: 560px) { .hanzo__howpic { width: 120px; transform: scale(.8); transform-origin: left center; } }

/* Smaller scale: the board, the hand and the Change button fit one screen (owner, 2026-10-21). */
.hanzo { --hz-size: max(300px, calc(100vh - 420px)); }
.hanzo__slot { aspect-ratio: 5 / 4; }
.hanzo__hand { gap: 8px; }
.hanzo__handbox { gap: 8px; }
.hanzo__reroll { padding: 7px 12px; }
.hanzo__trash-icon { font-size: 24px; }
.hanzo__handbox { padding: 10px; }

/* leaderboard: podium for the top three, MU characters in every row */
.hanzo__lb { padding: 20px; }
.hanzo__lbhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hanzo .hanzo__lbtitle { font-size: 18px; letter-spacing: .04em; text-transform: none; color: var(--text); }
.hanzo__lb .hanzo__tabs { margin: 0; }
.hanzo__podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 18px; align-items: end; margin: 10px 0 24px; }
.hanzo__place { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.hanzo__place > img { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.hanzo__place--1 > img { width: 132px; height: 132px; }
.hanzo__pedestal { align-self: stretch; margin-top: 8px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--text); border: 1px solid var(--hz-line); border-bottom: 0; border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .01)); height: 70px; }
.hanzo__place--1 .hanzo__pedestal { height: 104px; color: #ffe39a; border-color: rgba(231, 190, 106, .55); background: linear-gradient(180deg, rgba(231, 190, 106, .35), rgba(231, 190, 106, .04)); }
.hanzo__place--3 .hanzo__pedestal { height: 52px; color: #e0a87a; }
.hanzo__who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.hanzo__whoimg { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--hz-line); flex: none; background: #0b0a08; }
.hanzo__whobody { display: flex; flex-direction: column; min-width: 0; }
.hanzo__whobody b a { color: var(--gold); text-decoration: none; }
.hanzo__whobody b a:hover { text-decoration: underline; }
.hanzo__whobody small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hanzo__who--big .hanzo__whoimg { width: 48px; height: 48px; }
.hanzo__who--big b { font-size: 17px; }
.hanzo__lblist { position: relative; display: flex; flex-direction: column; gap: 8px; }
.hanzo__lbrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 110px; gap: 12px; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--hz-line); border-radius: 10px; background: rgba(0, 0, 0, .25); }
.hanzo__lbrow .hanzo__pts { text-align: right; }
.hanzo__lbpos { font-weight: 800; color: var(--muted); }
.hanzo__lbrow.is-ghost { border-color: transparent; background: rgba(255, 255, 255, .04); }
.hanzo__lbempty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 520px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; text-align: center;
    border: 1px solid rgba(231, 190, 106, .45); border-radius: 14px; background: rgba(14, 12, 9, .96); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.hanzo__lbempty > span { width: 52px; height: 52px; display: grid; place-items: center; font-size: 24px; color: #ffe39a; border: 1px solid rgba(231, 190, 106, .55); border-radius: 50%; }
.hanzo__lbempty b { font-size: 18px; }
.hanzo__lbempty p { margin: 0; color: var(--muted); }
@media (max-width: 640px) {
    .hanzo__podium { gap: 8px; }
    .hanzo__place > img { width: 64px; height: 64px; }
    .hanzo__place--1 > img { width: 80px; height: 80px; }
    .hanzo__who--big { flex-direction: column; text-align: center; gap: 4px; }
    .hanzo__who--big .hanzo__whobody { align-items: center; }
    .hanzo__who--big .hanzo__whobody small { white-space: normal; }
    .hanzo__lbrow { grid-template-columns: 30px minmax(0, 1fr) 80px; }
    .hanzo__lbrow > .hanzo__muted { display: none; }
}
.hanzo__links a.hanzo__btn--gold, .hanzo__lbempty a.hanzo__btn--gold { color: #2a1d06; text-decoration: none; }
/* header buttons: one look for all, the crown in gold, "End game" in red (it cannot be undone) */
.hanzo__links .hanzo__btn { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.hanzo__links .hanzo__btn--crown { color: #ffe39a; }
.hanzo__links .hanzo__btn[data-danger] { color: #ff9d9d; border-color: rgba(255, 125, 125, .35); }
.hanzo__links .hanzo__btn[data-danger]:hover { border-color: var(--red); background: rgba(255, 125, 125, .08); }
/* the one tooltip of the game: items, buttons, bars (no browser titles) */
.hanzo__tipplain { color: var(--text); font-size: 13px; line-height: 1.4; }
.hanzo__tipwarn { color: #ffb4b4; font-size: 13px; line-height: 1.4; }
.hanzo__ask { max-width: 420px; text-align: center; }
.hanzo__ask h3 { font-size: 18px; margin-bottom: 10px; color: var(--text); }
.hanzo__ask .hanzo__tipwarn { margin: 0 0 14px; }
.hanzo__btn--danger { background: linear-gradient(180deg, #7a2a22, #4a1712); border-color: rgba(255, 125, 125, .5); color: #fff; }
.hanzo__refuse[data-off], .hanzo__reroll[data-off] { opacity: .4; cursor: default; }
.hanzo__gametabs { margin-bottom: 14px; }

/* leaderboard: one plate per game with its icon, the chosen one framed in gold */
.hanzo__gametabs { gap: 10px; }
.hanzo__gametabs a { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; border-radius: 10px; color: var(--muted); font-weight: 600;
    background: linear-gradient(180deg, rgba(40, 33, 24, .9), rgba(16, 13, 10, .9)); border: 1px solid var(--hz-line); transition: border-color .15s, color .15s; }
.hanzo__gametabs a img { width: 40px; height: 40px; object-fit: contain; filter: grayscale(.6) brightness(.8); transition: filter .15s; }
.hanzo__gametabs a:hover { color: var(--text); border-color: rgba(231, 190, 106, .5); }
.hanzo__gametabs a:hover img { filter: none; }
.hanzo__gametabs a.is-on { color: #ffe39a; background: linear-gradient(180deg, rgba(70, 52, 22, .95), rgba(24, 18, 10, .95)); border-color: var(--gold); box-shadow: 0 0 14px rgba(231, 190, 106, .25), inset 0 0 0 1px rgba(255, 228, 150, .15); }
.hanzo__gametabs a.is-on img { filter: drop-shadow(0 0 6px rgba(255, 210, 120, .6)); }
.hanzo__lbtitle::first-letter { text-transform: uppercase; }

/* game cards: text at the top, the buttons of all cards on one line at the bottom */
.hanzo__gamecard { align-items: stretch; }
.hanzo__gamecard > img { align-self: center; }
.hanzo__gamecard > div { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.hanzo__gamecard > div .hanzo__btn { margin-top: auto; }
