/* ELIXIR: THE HOME SCREENS inside the game frame (between duels): the top bar (king level, gold, gems), five tabs (Shop, Cards,
   Battle, Wager, League) and the bottom nav; the chest opening, the card, the road, tasks, the pass. The original's language with
   the tokens of site.css: bright blue panels with a navy outline, recessed strips for lists, chunky glossy buttons, outlined
   lettering. The chosen thing is lit in its own colour, the rest stays blue; nothing animates for ever. */
.home { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; background: var(--lattice), linear-gradient(180deg, #3584ec 0%, #2a6ad6 32%, #2259c0 66%, #1c4aa3 100%); }
body.is-duel .home, body.is-watch .home { display: none; }
.frame { container-type: inline-size; }

/* ---- the top bar: king level and name, gold, gems */
.h-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px 9px; background: linear-gradient(180deg, #1d52b3 0%, #17439d 100%); border-bottom: 3px solid var(--ol); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 3px 0 rgba(0, 10, 40, 0.22); position: relative; z-index: 1; }
.kl { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; text-align: left; }
.kl-badge { position: relative; width: 44px; height: 44px; flex: none; }
.kl-badge img { width: 44px; height: 44px; display: block; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.8)); }
.kl-badge b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 19px/1 var(--f-d); color: #fff; text-shadow: var(--stroke); padding-bottom: 2px; }
.kl-txt { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.kl-txt > b { font: 400 18px/1 var(--f-d); letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: var(--stroke); padding-bottom: 2px; }
.xp { position: relative; height: 17px; border-radius: 7px; background: #0b2257; border: 2px solid var(--ol); overflow: hidden; max-width: 150px; box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.35); }
.xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #a6ebff 0%, #4fbcff 48%, #2a92f2 52%, #2382e2 100%); }
.xp em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 11.5px/1 var(--f-d); font-style: normal; letter-spacing: 0.02em; color: #fff; text-shadow: var(--st1); }
.cur { position: relative; display: flex; align-items: center; height: 32px; padding: 0 10px 0 37px; border-radius: 9px; background: rgba(6, 22, 64, 0.55); border: 2px solid var(--ol); box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.08); flex: none; }
.cur img { position: absolute; left: -9px; top: -7px; width: 42px; height: 42px; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.7)); }
.cur b { font: 400 17px/1 var(--f-d); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; min-width: 3.4ch; text-align: right; text-shadow: var(--st1); }
.cur .plus { margin: 0 -6px 0 8px; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ol); background: linear-gradient(180deg, #b6f77a 0%, #7fe04a 48%, #5ccc2c 52%, #46b81e 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55); color: #fff; font: 400 19px/1 var(--f-d); text-shadow: var(--st1); display: flex; align-items: center; justify-content: center; padding-bottom: 2px; }

/* ---- the body and its views */
.h-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 14px; scrollbar-width: thin; scrollbar-color: #0f3070 transparent; }
.view { display: none; flex-direction: column; gap: 11px; }
.view.is-on { display: flex; }
.v-sub { display: flex; align-items: center; gap: 10px; margin-top: 3px; padding: 8px 12px 9px; border-radius: 11px; background: linear-gradient(180deg, #1a4aa6 0%, #153f90 100%); border: 2.5px solid var(--ol); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 3px 0 var(--ol); font: 400 19px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); }
.v-sub span { margin-left: auto; font: 600 12px/1.2 var(--f-t); color: var(--ink2); text-shadow: none; letter-spacing: 0; text-align: right; }
.v-head { display: flex; align-items: center; gap: 10px; }
.v-title { font: 400 25px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); padding-bottom: 3px; white-space: nowrap; }
@container (max-width: 430px) { .v-head { gap: 7px; } .v-title { font-size: 21px; } .v-head .deck-tabs { gap: 4px; } .v-head .deck-tabs button { width: 26px; height: 28px; font-size: 14px; } .avg { padding-right: 8px; } }
.hint { color: var(--ink); font-size: 13px; text-align: center; text-shadow: 0 1px 0 rgba(0, 10, 40, 0.5); }
.avg { margin-left: auto; display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 5px; border-radius: 10px; background: rgba(6, 22, 64, 0.5); border: 2px solid var(--ol); font: 400 17px/1 var(--f-d); color: var(--elixir-l); text-shadow: var(--st1); }
.avg img { width: 24px; height: 24px; }

/* ---- battle: the arena, the modes, the deck, the button, the chests */
.arena-card { position: relative; height: clamp(150px, calc(100vh - 800px), 320px); flex: none; border-radius: 16px; overflow: hidden; border: 3px solid var(--ol); box-shadow: 0 4px 0 var(--ol), 0 10px 22px rgba(0, 10, 40, 0.3); }
.arena-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.arena-card::before { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 13px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); pointer-events: none; }
.arena-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 80, 0) 42%, rgba(10, 30, 80, 0.88) 100%); pointer-events: none; }
.arena-meta { position: absolute; left: 14px; bottom: 11px; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.arena-no { font: 400 15px/1 var(--f-d); letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); text-shadow: var(--st1); }
.arena-meta b { font: 400 31px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); padding-bottom: 3px; }
.road-btn { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px 0 5px; border-radius: 13px; border: 2.5px solid var(--ol);
  background: linear-gradient(180deg, #8dd0ff 0%, #5aafff 46%, #3e94f6 54%, #2f80ea 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 #1c62c9, 0 3px 0 var(--ol); }
.road-btn img { width: 36px; height: 36px; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.6)); }
.road-btn b { font: 400 22px/1 var(--f-d); color: #fff; text-shadow: var(--stroke); padding-bottom: 2px; }
.road-btn span { font: 400 12.5px/1.05 var(--f-d); color: #fff; text-shadow: var(--st1); max-width: 56px; text-align: left; }
.road-btn.has { background: linear-gradient(180deg, #ffe873 0%, #ffd53a 46%, #ffbe1c 54%, #ffaa10 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 #dd8400, 0 3px 0 var(--ol); }
.road-btn.has::after { content: '!'; position: absolute; top: -9px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ol); background: #ff4a3d; color: #fff; font: 400 15px/18px var(--f-d); text-align: center; text-shadow: var(--st1); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: none; }
.mode { --mc: linear-gradient(180deg, #ffe873 0%, #ffcc33 48%, #ffb21a 52%, #ffa30f 100%); --mlow: #dd8400; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 8px; border-radius: 14px; border: 2.5px solid var(--ol);
  background: linear-gradient(180deg, #5a9df0 0%, #3b7fe0 50%, #3171d6 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38), inset 0 -3px 0 rgba(0, 20, 70, 0.25), 0 3px 0 var(--ol); transition: transform 0.08s; }
.mode img { width: 42px; height: 42px; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.55)); }
.mode b { font: 400 19px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); padding-bottom: 2px; }
.mode span { font: 600 11px/1.2 var(--f-t); color: var(--ink2); text-align: center; min-height: 13px; text-shadow: 0 1px 0 rgba(0, 10, 40, 0.5); }
.mode.m-ladder { --mc: linear-gradient(180deg, #ffe873 0%, #ffcc33 48%, #ffb21a 52%, #ffa30f 100%); --mlow: #dd8400; }
.mode.m-ranked { --mc: linear-gradient(180deg, #f7b6ff 0%, #dc74f7 48%, #c25bea 52%, #a845d8 100%); --mlow: #7d2cae; }
.mode.m-wager { --mc: linear-gradient(180deg, #b6f77a 0%, #7fe04a 48%, #5ccc2c 52%, #46b81e 100%); --mlow: #2e8f12; }
.mode.is-on { background: var(--mc); box-shadow: inset 0 2.5px 0 rgba(255, 255, 255, 0.62), inset 0 -4px 0 var(--mlow), 0 3px 0 var(--ol), 0 0 0 3px rgba(255, 255, 255, 0.85); transform: translateY(-2px); }
.mode.is-on span { color: #fff; text-shadow: var(--st1); }
.mode-info { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 18px; font-size: 13.5px; color: var(--ink); text-align: center; text-shadow: 0 1px 0 rgba(0, 10, 40, 0.55); }
.mode-info b { font: 400 16px/1 var(--f-d); color: var(--gold); text-shadow: var(--st1); }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tier { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 9px; border-radius: 12px; border: 2.5px solid var(--ol); background: linear-gradient(180deg, #5a9df0 0%, #3b7fe0 50%, #3171d6 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38), 0 3px 0 var(--ol); }
.tier b { font: 400 18px/1 var(--f-d); color: #fff; text-shadow: var(--st1); }
.tier span { font: 600 11px/1 var(--f-t); color: var(--ink2); }
.tier.is-on { background: linear-gradient(180deg, #b6f77a 0%, #7fe04a 48%, #5ccc2c 52%, #46b81e 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 #2e8f12, 0 3px 0 var(--ol), 0 0 0 3px rgba(255, 255, 255, 0.85); }
.tier.is-on span { color: #fff; text-shadow: var(--st1); }
.tier:disabled { filter: grayscale(0.7) brightness(0.8); }
.deck-row { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; border-radius: 14px; background: var(--rec2); border: 2.5px solid var(--ol); box-shadow: inset 0 3px 5px rgba(0, 10, 40, 0.35); }
.deck-head { display: flex; align-items: center; gap: 8px; }
.deck-lbl { font: 400 15px/1 var(--f-d); letter-spacing: 0.02em; color: #fff; text-shadow: var(--st1); margin-right: auto; padding-left: 2px; }
.deck-tabs { display: flex; gap: 5px; flex: none; }
.deck-tabs button { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--ol); background: linear-gradient(180deg, #6fb0ff 0%, #3e8cf0 55%, #3279e2 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 2px 0 var(--ol); font: 400 16px/1 var(--f-d); color: #fff; text-shadow: var(--st1); padding-bottom: 1px; }
.deck-tabs button.is-on { background: linear-gradient(180deg, #ffe873 0%, #ffcc33 50%, #ffaa10 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 2px 0 var(--ol); }
.deck-row .deck-tabs { gap: 4px; }
.deck-row .deck-tabs button { width: 26px; height: 24px; border-radius: 7px; font-size: 14px; box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.45), 0 2px 0 var(--ol); }
.deck-row .deck-mini { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; min-width: 0; cursor: pointer; }
.deck-mini canvas { width: 100%; aspect-ratio: 0.8; display: block; filter: drop-shadow(0 2px 0 rgba(6, 18, 50, 0.7)); }
.btn.battle { height: 66px; font-size: 38px; width: 100%; flex: none; border-radius: 16px; border-width: 3px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.62), inset 0 -6px 0 var(--b-low), 0 4px 0 var(--ol), 0 10px 22px rgba(0, 10, 40, 0.35); }
.btn.battle kbd { position: absolute; right: 14px; }
.chestrow { display: grid; grid-template-columns: 60px 1fr 60px; gap: 6px; align-items: stretch; flex: none; padding: 6px; border-radius: 15px; background: var(--rec2); border: 2.5px solid var(--ol); box-shadow: inset 0 3px 5px rgba(0, 10, 40, 0.35); }
.sidechest { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 11px; border: 2px solid var(--ol); padding: 4px 2px 5px; background: linear-gradient(180deg, #4b8ff0 0%, #3274dc 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 var(--ol); }
.sidechest img { width: 46px; height: 46px; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.6)); }
.sidechest span { font: 400 11.5px/1.05 var(--f-d); color: #fff; text-shadow: var(--st1); text-align: center; }
.sidechest.ready { background: linear-gradient(180deg, #ffe873 0%, #ffcc33 50%, #ffaa10 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 2px 0 var(--ol); }
.sidechest.ready::after { content: '!'; position: absolute; top: -8px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ol); background: #ff4a3d; color: #fff; font: 400 13px/16px var(--f-d); text-align: center; text-shadow: var(--st1); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.slot { position: relative; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 4px 2px 6px; border-radius: 11px; border: 2px solid var(--ol); background: linear-gradient(180deg, #4b8ff0 0%, #3274dc 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 var(--ol); overflow: hidden; }
.slot img { width: 66px; height: 66px; margin-bottom: auto; margin-top: -2px; filter: drop-shadow(0 3px 0 rgba(11, 28, 66, 0.5)); }
.slot .st { font: 400 13px/1.1 var(--f-d); color: #fff; text-shadow: var(--st1); white-space: nowrap; }
.slot .ar { position: absolute; top: 3px; left: 5px; font: 400 10px/1 var(--f-d); color: var(--ink2); }
.slot.empty { background: rgba(6, 22, 64, 0.32); border: 2px dashed rgba(169, 200, 242, 0.35); box-shadow: none; justify-content: center; }
.slot.empty .st { color: var(--ink3); white-space: normal; text-align: center; font-size: 12.5px; text-shadow: none; }
.slot.unlocking { background: linear-gradient(180deg, #7cc8ff 0%, #45a0f8 100%); }
.slot.unlocking .st { color: #fff; }
.slot.ready { background: linear-gradient(180deg, #ffe873 0%, #ffcc33 50%, #ffaa10 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 2px 0 var(--ol); }
.slot.ready .st { font-size: 15px; }
.slot .gem { display: inline-flex; align-items: center; gap: 2px; font: 400 11px/1 var(--f-d); color: var(--green-l); }
.slot .gem img, .slot .tm img { width: 13px; height: 13px; margin: 0; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qbtn { position: relative; display: flex; align-items: center; gap: 7px; height: 44px; white-space: nowrap; min-width: 0; padding: 0 11px 0 7px; border-radius: 12px; border: 2.5px solid var(--ol); background: linear-gradient(180deg, #6fb0ff 0%, #4a94f4 46%, #3a82ea 54%, #3274dc 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(0, 30, 100, 0.25), 0 3px 0 var(--ol); font: 400 16px/1 var(--f-d); color: #fff; text-shadow: var(--st1); }
.qbtn img { width: 30px; height: 30px; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.55)); }
.qbtn b { margin-left: auto; font: 400 15px/1 var(--f-d); color: var(--gold); text-shadow: var(--st1); }
.qbtn.has::after { content: '!'; position: absolute; top: -9px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ol); background: #ff4a3d; color: #fff; font: 400 15px/18px var(--f-d); text-align: center; text-shadow: var(--st1); }

/* ---- cards */
.c-deck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 8px; padding: 11px 10px; border-radius: 15px; background: var(--rec2); border: 2.5px solid var(--ol); box-shadow: inset 0 3px 6px rgba(0, 10, 40, 0.35); }
.c-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
@container (min-width: 470px) { .c-grid { grid-template-columns: repeat(5, 1fr); } }
.ccard { position: relative; display: flex; flex-direction: column; gap: 0; cursor: pointer; transition: transform 0.08s; }
.ccard canvas { width: 100%; aspect-ratio: 0.8; display: block; filter: drop-shadow(0 3px 0 rgba(6, 18, 50, 0.55)); }
.ccard .lv { position: relative; z-index: 1; align-self: center; margin: -13px 0 3px; padding: 3px 8px 4px; border-radius: 7px; background: linear-gradient(180deg, #2a5bb6, #193f8a); border: 2px solid var(--ol); font: 400 12.5px/1 var(--f-d); letter-spacing: 0.01em; color: #fff; text-shadow: var(--st1); white-space: nowrap; }
.ccard .pb { position: relative; height: 18px; border-radius: 6px; background: #0b2257; overflow: hidden; border: 2px solid var(--ol); box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.35); }
.ccard .pb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #a6ebff 0%, #4fbcff 48%, #2a92f2 52%, #2382e2 100%); }
.ccard .pb em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 12px/1 var(--f-d); font-style: normal; color: #fff; text-shadow: var(--st1); }
.ccard.up .pb i { background: linear-gradient(180deg, #c6fb8e 0%, #7fe04a 48%, #5ccc2c 52%, #46b81e 100%); }
.ccard.up::after { content: '▲'; position: absolute; top: -7px; right: -5px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ol); background: linear-gradient(180deg, #b6f77a, #46b81e); color: #fff; font: 400 11px/20px var(--f-d); text-align: center; text-shadow: var(--st1); box-shadow: 0 2px 0 var(--ol); }
.ccard.in { opacity: 0.45; }
.ccard.sel { transform: translateY(-4px); filter: drop-shadow(0 0 7px #fff) drop-shadow(0 0 3px var(--gold)); }
.ccard.max .pb i { background: linear-gradient(180deg, #ffe873 0%, #ffcc33 50%, #ffaa10 100%); }
.c-grid.locked .ccard { cursor: default; }
.c-grid.locked canvas { filter: grayscale(1) brightness(0.45); }
.c-grid.locked .lv { margin-top: -11px; background: rgba(6, 22, 64, 0.85); color: var(--ink2); font-size: 11px; white-space: normal; text-align: center; max-width: 100%; }

/* ---- shop tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 7px 8px; border-radius: 14px; border: 2.5px solid var(--ol); text-align: center;
  background: radial-gradient(90% 60% at 50% 30%, rgba(255, 255, 255, 0.3), transparent 70%), linear-gradient(180deg, #7ab8ff 0%, #4e95f2 45%, #3c80e4 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 0 rgba(0, 20, 70, 0.2), 0 3px 0 var(--ol); }
.tile > img, .tile > canvas { width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(11, 28, 66, 0.45)); }
.tile > canvas { width: 58px; height: 72px; }
.tile .nm { font: 400 15px/1.05 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--st1); min-height: 32px; display: flex; align-items: center; }
.tile .sub { font: 600 11px/1.2 var(--f-t); color: #fff; min-height: 13px; text-shadow: 0 1px 0 rgba(0, 10, 40, 0.6); }
.tile .price { width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; height: 33px; border-radius: 10px; border: 2px solid var(--ol); background: linear-gradient(180deg, #b6f77a 0%, #7fe04a 46%, #5ccc2c 54%, #46b81e 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 #2e8f12, 0 2px 0 var(--ol); font: 400 15.5px/1 var(--f-d); color: #fff; text-shadow: var(--st1); }
.tile .price img { width: 21px; height: 21px; }
.tile .price.gold { background: linear-gradient(180deg, #ffe873 0%, #ffd53a 46%, #ffbe1c 54%, #ffaa10 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 #dd8400, 0 2px 0 var(--ol); }
.tile .price.coin { background: linear-gradient(180deg, #f7b6ff 0%, #dc74f7 46%, #c25bea 54%, #a845d8 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 #7d2cae, 0 2px 0 var(--ol); font-size: 13.5px; }
.tile .price.free { background: linear-gradient(180deg, #8dd0ff 0%, #5aafff 46%, #3e94f6 54%, #2f80ea 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 #1c62c9, 0 2px 0 var(--ol); }
.tile.sold { filter: grayscale(0.6) brightness(0.75); } .tile.sold .price { background: #3b5a94; box-shadow: none; }
.tile .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 4px 8px 5px; border-radius: 8px; border: 2px solid var(--ol); background: linear-gradient(180deg, #ff7b6e, #e2392c); font: 400 11.5px/1 var(--f-d); letter-spacing: 0.02em; color: #fff; text-shadow: var(--st1); white-space: nowrap; }
.tile .tag.leg { background: linear-gradient(90deg, #36d2ff, #b46bff, #ffb03a); }
.gems .tile .nm b { color: var(--green-l); font-weight: 400; }
.tiles.deals { grid-auto-rows: 1fr; }

/* ---- wager */
.wallet-card { padding: 12px 13px; border-radius: 15px; border: 3px solid var(--ol); display: flex; flex-direction: column; gap: 9px;
  background: var(--lattice), linear-gradient(180deg, #45c27a 0%, #2c9e5c 52%, #24894f 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38), inset 0 -3px 0 rgba(0, 40, 20, 0.25), 0 4px 0 var(--ol); }
.w-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.w-addr { font: 600 11.5px/1 var(--f-m); color: #e3ffe9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-addr.ok { color: #fff; }
.w-bal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.w-bal b { font: 400 32px/1 var(--f-d); color: #fff; text-shadow: var(--stroke); font-variant-numeric: tabular-nums; padding-bottom: 3px; }
.w-bal span { font: 400 14px/1 var(--f-d); color: #e3ffe9; text-shadow: var(--st1); }
.w-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.w-note { font-size: 12.5px; color: #effff3; min-height: 15px; text-shadow: 0 1px 0 rgba(0, 30, 10, 0.5); }
.w-win { display: flex; justify-content: space-between; align-items: center; padding: 10px 13px; border-radius: 12px; background: var(--rec2); border: 2.5px solid var(--ol); box-shadow: inset 0 3px 5px rgba(0, 10, 40, 0.3); font-size: 14px; color: var(--ink); }
.w-win b { font: 400 21px/1 var(--f-d); color: var(--green-l); text-shadow: var(--st1); }
.lobby .lob { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 12px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.5); }
.lob img { width: 30px; height: 30px; }
.lob .n { font: 400 15px/1.15 var(--f-d); text-shadow: var(--st1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lob .n span { display: block; font: 600 11px/1.2 var(--f-t); color: var(--ink2); text-shadow: none; }
.lob b { font: 400 15px/1 var(--f-d); color: var(--green-l); text-shadow: var(--st1); white-space: nowrap; }
.w-post { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.w-join { display: flex; gap: 6px; margin-left: auto; }
.w-join input { width: 92px; height: 36px; border-radius: 10px; border: 2.5px solid var(--ol); background: #eef5ff; color: #0f2552; font: 400 17px/1 var(--f-d); text-transform: uppercase; text-align: center; letter-spacing: 0.1em; outline: none; box-shadow: inset 0 3px 0 rgba(11, 28, 66, 0.14); user-select: text; -webkit-user-select: text; }
.w-join input:focus { box-shadow: inset 0 3px 0 rgba(11, 28, 66, 0.14), 0 0 0 3px var(--gold); }

/* ---- league */
.league-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 3px solid var(--ol);
  background: var(--lattice), radial-gradient(80% 90% at 15% 50%, rgba(255, 220, 255, 0.35), transparent 60%), linear-gradient(180deg, #b06ff5 0%, #8a48dc 52%, #7438c8 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(40, 0, 80, 0.25), 0 4px 0 var(--ol); }
.lg-badge { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 4px 0 rgba(11, 28, 66, 0.55)); }
.lg-txt { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.lg-txt > b { font: 400 29px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); padding-bottom: 3px; }
.lg-txt > span { font: 400 16px/1.15 var(--f-d); color: #ffe2ff; text-shadow: var(--st1); }
.lg-bar { height: 16px; border-radius: 7px; background: #2a1060; border: 2px solid var(--ol); overflow: hidden; box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.35); }
.lg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #fff1a8 0%, #ffd23f 50%, #ffb21a 51%, #ffa30f 100%); }
.lg-txt .lg-next { font: 600 12px/1.25 var(--f-t); color: #f6e8ff; text-shadow: 0 1px 0 rgba(40, 0, 80, 0.6); }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-grid > div { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 11px; border-radius: 13px; background: var(--rec2); border: 2.5px solid var(--ol); box-shadow: inset 0 3px 5px rgba(0, 10, 40, 0.3); }
.pay-grid b { font: 400 22px/1.05 var(--f-d); color: var(--gold); text-shadow: var(--stroke); font-variant-numeric: tabular-nums; padding-bottom: 2px; }
.pay-grid em { font: 600 11px/1.25 var(--f-t); font-style: normal; color: var(--ink2); }
.pay-grid .btn { align-self: flex-start; }
.addrrow { display: flex; gap: 6px; }
.addrrow input { flex: 1; min-width: 0; font: 600 12.5px/1 var(--f-m) !important; }
.l-tabs { flex-wrap: wrap; justify-content: center; }
.board .brow { display: grid; grid-template-columns: 28px 28px 1fr auto; gap: 7px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: 13.5px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); }
.board .brow:nth-child(even) { background: rgba(6, 22, 64, 0.28); }
.board .brow.me { background: rgba(255, 210, 63, 0.26); border-color: var(--gold); }
.brow .rk { font: 400 17px/1 var(--f-d); color: #fff; text-shadow: var(--st1); text-align: center; }
.brow img { width: 26px; height: 26px; }
.brow .nm { font: 400 15px/1.15 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--st1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .v { font: 400 15px/1 var(--f-d); color: var(--gold); text-shadow: var(--st1); text-align: right; white-space: nowrap; }
.brow .v span { color: var(--ink2); margin-left: 5px; font: 600 11.5px/1 var(--f-t); text-shadow: none; }
.logrow { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 11px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); font-size: 12.5px; }
.logrow .r { font: 400 14px/1 var(--f-d); text-align: center; border-radius: 8px; padding: 6px 0; border: 2px solid var(--ol); color: #fff; text-shadow: var(--st1); }
.logrow .r.win { background: linear-gradient(180deg, #8dd0ff, #3e94f6); } .logrow .r.loss { background: linear-gradient(180deg, #ff8f86, #e2392c); } .logrow .r.draw { background: linear-gradient(180deg, #a9bcd8, #6f86ad); }
.logrow .m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logrow .m b { font: 400 14.5px/1.15 var(--f-d); text-shadow: var(--st1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logrow .m span { font: 600 11px/1.2 var(--f-t); color: var(--ink2); }
.logrow .d { font: 400 14px/1.2 var(--f-d); text-align: right; white-space: nowrap; text-shadow: var(--st1); }
.logrow .d.g { color: var(--gold); }

/* ---- the bottom nav: the chosen tab rises and says its name */
.h-nav { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1a4aa6 0%, #133a86 100%); border-top: 3px solid var(--ol); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16); position: relative; z-index: 1; }
.h-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 58px; border-radius: 12px; border: 2px solid rgba(11, 28, 66, 0.55); background: rgba(6, 22, 64, 0.3); color: #fff; font: 400 14px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--st1); transition: transform 0.08s; }
.h-nav button img { width: 38px; height: 38px; transition: transform 0.1s; filter: drop-shadow(0 2px 0 rgba(11, 28, 66, 0.6)); }
.h-nav button span { display: none; }
.h-nav button.is-on { border-color: var(--ol); background: linear-gradient(180deg, #8dd0ff 0%, #5aafff 46%, #3e94f6 54%, #2f80ea 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 #1c62c9, 0 3px 0 var(--ol); transform: translateY(-6px); }
.h-nav button.is-on span { display: block; }
.h-nav button.is-on img { width: 36px; height: 36px; transform: scale(1.12) translateY(-2px); }
.h-nav .badge { position: absolute; top: -7px; right: 12%; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 2px solid var(--ol); background: #ff4a3d; color: #fff; font: 400 13px/18px var(--f-d); font-style: normal; text-align: center; text-shadow: var(--st1); }

/* ---- watching a duel (TV) */
.watchbar { position: absolute; left: 10px; top: 10px; z-index: 4; display: flex; align-items: center; gap: 10px; }
.watchbar span { font: 400 14px/1 var(--f-d); color: #fff; text-shadow: var(--st1); padding: 8px 11px; border-radius: 10px; background: rgba(8, 26, 70, 0.85); border: 2px solid var(--ol); }

/* ---- sheets: the end, the chest, the card, the road, tasks, the pass */
.e-chest { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 14px; background: var(--rec2); border: 2.5px solid var(--ol); }
.e-chest img { width: 60px; height: 60px; }
.e-chest span { font: 400 16px/1.25 var(--f-d); color: #fff; text-shadow: var(--st1); text-align: left; }
.chest-sheet { width: min(430px, calc(100vw - 16px)); min-height: min(580px, calc(100vh - 24px)); justify-content: space-between;
  background: repeating-conic-gradient(from 0deg at 50% 44%, rgba(255, 255, 255, 0.07) 0deg 9deg, transparent 9deg 18deg), radial-gradient(60% 50% at 50% 44%, #6cb7ff 0%, #2f6fda 55%, #1d4fae 100%); }
.ch-stage { position: relative; width: 100%; flex: 1; min-height: 340px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-img { width: 220px; height: 220px; filter: drop-shadow(0 18px 24px rgba(0, 10, 40, 0.55)); }
.ch-img.shake { animation: shake 0.42s ease-in-out; }
.ch-img.pop { animation: pop 0.38s ease-out forwards; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg) scale(1.04); } 40% { transform: rotate(6deg) scale(1.06); } 60% { transform: rotate(-4deg) scale(1.04); } 80% { transform: rotate(3deg); } }
@keyframes pop { 0% { transform: scale(1); opacity: 1; } 60% { transform: scale(1.25); opacity: 0.9; } 100% { transform: scale(0.4) translateY(80px); opacity: 0; } }
.ch-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.ch-card canvas { width: 184px; height: 230px; animation: cardin 0.36s cubic-bezier(.2, 1.4, .4, 1); filter: drop-shadow(0 5px 0 rgba(11, 28, 66, 0.7)) drop-shadow(0 14px 22px rgba(0, 10, 40, 0.5)); }
.ch-card.r-epic canvas { filter: drop-shadow(0 0 22px #e08bff) drop-shadow(0 5px 0 rgba(11, 28, 66, 0.7)); }
.ch-card.r-legendary canvas { filter: drop-shadow(0 0 30px #8ff3ff) drop-shadow(0 0 12px #ffe28a); }
.ch-card.r-rare canvas { filter: drop-shadow(0 0 16px #ffc261) drop-shadow(0 5px 0 rgba(11, 28, 66, 0.7)); }
@keyframes cardin { 0% { transform: scale(0.2) rotateY(90deg) translateY(80px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.ch-new { position: absolute; top: 3%; padding: 7px 14px 8px; border-radius: 10px; border: 2.5px solid var(--ol); background: linear-gradient(180deg, #ff8f86, #e2392c); font: 400 20px/1 var(--f-d); letter-spacing: 0.02em; color: #fff; text-shadow: var(--st1); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--ol); }
.ch-n { font: 400 40px/1 var(--f-d); color: var(--gold); text-shadow: var(--stroke); padding-bottom: 3px; }
.ch-name { font: 400 22px/1 var(--f-d); letter-spacing: 0.01em; text-shadow: var(--stroke); }
.ch-prog { position: relative; width: 180px; height: 20px; border-radius: 7px; background: #0b2257; overflow: hidden; border: 2px solid var(--ol); box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.35); }
.ch-prog i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #a6ebff 0%, #4fbcff 48%, #2a92f2 52%, #2382e2 100%); transition: width 0.5s; }
.ch-prog.up i { background: linear-gradient(180deg, #c6fb8e 0%, #7fe04a 48%, #5ccc2c 52%, #46b81e 100%); }
.ch-prog em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 13px/1 var(--f-d); font-style: normal; color: #fff; text-shadow: var(--st1); }
.ch-sum { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: center; animation: cardin 0.3s ease-out; }
.ch-sum .it { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ch-sum canvas { width: 100%; aspect-ratio: 0.8; filter: drop-shadow(0 3px 0 rgba(11, 28, 66, 0.6)); }
.ch-sum b { font: 400 17px/1 var(--f-d); color: var(--gold); text-shadow: var(--stroke); }
.ch-sum .cur2 { grid-column: 1 / -1; display: flex; justify-content: center; gap: 18px; font: 400 22px/1 var(--f-d); text-shadow: var(--stroke); }
.ch-sum .cur2 span { display: flex; align-items: center; gap: 5px; } .ch-sum .cur2 img { width: 34px; height: 34px; }
.cd-top { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; }
.cd-top canvas { width: 124px; height: 155px; flex: none; filter: drop-shadow(0 4px 0 rgba(11, 28, 66, 0.6)); }
.cd-txt { display: flex; flex-direction: column; gap: 7px; }
.cd-txt .sh-title { font-size: 28px; }
.cd-lv { font: 400 17px/1 var(--f-d); color: var(--gold); text-shadow: var(--st1); }
.cd-line { text-align: left; font-size: 14.5px; }
.cd-stats { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.cd-stats div { display: flex; flex-direction: column; gap: 4px; padding: 8px 11px 9px; border-radius: 11px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); text-align: left; }
.cd-stats span { font: 400 11.5px/1 var(--f-d); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }
.cd-stats b { font: 400 18px/1.15 var(--f-d); color: #fff; text-shadow: var(--st1); }
.cd-stats b i { font-style: normal; color: var(--green-l); margin-left: 6px; font-size: 15px; }
.road { width: 100%; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #0f3070 transparent; }
.rstep { display: grid; grid-template-columns: 76px 46px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); text-align: left; }
.rstep .at { display: flex; align-items: center; gap: 4px; font: 400 18px/1 var(--f-d); color: var(--gold); text-shadow: var(--st1); }
.rstep .at img { width: 24px; height: 24px; }
.rstep > img { width: 46px; height: 46px; }
.rstep .w { font: 400 15px/1.15 var(--f-d); color: #fff; text-shadow: var(--st1); }
.rstep.can { background: rgba(255, 210, 63, 0.22); border-color: var(--gold); }
.rstep.got { opacity: 0.5; }
.rstep.arena { background: rgba(176, 111, 245, 0.32); }
.tasks { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); text-align: left; }
.task b { font: 400 16px/1.15 var(--f-d); text-shadow: var(--st1); }
.task .pb { grid-column: 1; position: relative; height: 15px; border-radius: 6px; background: #0b2257; border: 2px solid var(--ol); overflow: hidden; }
.task .pb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #a6ebff 0%, #4fbcff 48%, #2a92f2 52%, #2382e2 100%); }
.task .rw { grid-row: 1 / 3; grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 400 14px/1 var(--f-d); text-shadow: var(--st1); }
.task .rw img { width: 32px; height: 32px; }
.pass { width: 100%; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #0f3070 transparent; }
.prow { display: grid; grid-template-columns: 48px 1fr 1fr; gap: 8px; align-items: stretch; }
.prow .tn { display: flex; align-items: center; justify-content: center; font: 400 20px/1 var(--f-d); color: var(--ink2); text-shadow: var(--st1); border-radius: 11px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); }
.prow.reached .tn { color: #fff; background: linear-gradient(180deg, #ffe873, #ffbe1c 60%, #ffaa10); border-color: var(--ol); }
.pcell { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 11px; background: var(--rec); border: 2px solid rgba(11, 28, 66, 0.45); text-align: left; font: 400 14px/1.15 var(--f-d); color: #fff; text-shadow: var(--st1); min-height: 54px; }
.pcell img { width: 40px; height: 40px; flex: none; }
.pcell.roy { background: rgba(255, 210, 63, 0.16); }
.pcell.can { border-color: var(--gold); background: rgba(255, 210, 63, 0.3); cursor: pointer; }
.pcell.got { opacity: 0.45; }
.pcell.lock { opacity: 0.6; }

/* ---- phones: the home fills the screen, the side columns go */
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .h-top { padding-top: 7px; }
  .arena-card { height: clamp(140px, calc(100vh - 700px), 260px); }
  .slot { height: 88px; }
  .slot img { width: 58px; height: 58px; }
  .qbtn { font-size: 14.5px; padding: 0 9px 0 6px; } .qbtn b { font-size: 13.5px; }
}
/* ---- short screens (a 768 px laptop): the battle tab fits without scrolling */
@media (max-height: 820px) and (min-width: 901px) {
  .h-body { padding: 9px 10px 10px; } .view { gap: 8px; }
  .arena-card { height: 106px; } .arena-meta b { font-size: 23px; } .road-btn { height: 40px; } .road-btn img { width: 30px; height: 30px; }
  .deck-row { gap: 4px; padding: 5px 7px 6px; } .deck-row .deck-tabs button { height: 21px; }
  .mode { padding: 5px 4px 6px; } .mode img { width: 30px; height: 30px; } .mode b { font-size: 16px; }
  .btn.battle { height: 52px; font-size: 30px; }
  .slot { height: 76px; } .slot img { width: 50px; height: 50px; } .sidechest img { width: 38px; height: 38px; }
  .qbtn { height: 36px; } .qbtn img { width: 24px; height: 24px; } .h-nav button { height: 50px; } .h-nav button img { width: 30px; height: 30px; }
}
