:root {
  --ink: #1a1410;
  --paper: #f3e6c4;
  --wood: #6a4424;
  --wood2: #4a2e16;
  --rust: #c8502a;
  --gold: #ffcf4a;
  --green: #6ad04a;
  --red: #e04a3a;
  --panel: rgba(26, 18, 10, .82);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a0705; overflow: hidden; color: var(--paper); font-family: 'Oswald', 'Arial Narrow', sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#wrap { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: center center; overflow: hidden; background: #000; box-shadow: 0 0 60px #000; }
canvas#game { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

/* ---- panels ---- */
.panel { background: var(--panel); border: 2px solid #3a2a18; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 8px rgba(0,0,0,.4); }
#topbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 10px; align-items: stretch; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; }
.big { font-family: 'Rye', serif; font-size: 26px; color: var(--gold); line-height: 1.05; text-shadow: 0 2px 0 #000; }
.small { font-size: 13px; opacity: .85; }
.cashbox { padding: 6px 14px; min-width: 130px; }
.brew { display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 8px; text-align: left; transition: transform .1s, border-color .2s; }
.brew:hover { border-color: var(--gold); transform: translateY(-1px); }
.brew.off { opacity: .55; }
.brew .ico { width: 36px; height: 36px; }
.meterbox { padding: 6px 12px; width: 230px; }
.meter { position: relative; height: 22px; border-radius: 11px; background: #1a0e06; border: 2px solid #000; overflow: hidden; margin-top: 3px; }
#meterFill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #c8302a, #ff9a2a, #ffd84a); transition: width .15s; }
#meterFill.full { animation: pulse 0.7s infinite alternate; }
#meterTxt { position: absolute; inset: 0; text-align: center; font-weight: 700; font-size: 13px; line-height: 18px; text-shadow: 0 1px 2px #000; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }
.bases { flex: 1; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.baserow { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.baserow span { width: 82px; opacity: .8; }
.bar { flex: 1; height: 12px; background: #1a0e06; border: 2px solid #000; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; width: 100%; transition: width .2s; }
.fill.green { background: linear-gradient(#8ae05a, #3a9a2a); }
.fill.red { background: linear-gradient(#ff6a4a, #a82a1a); }
.tbtns { display: flex; gap: 6px; }
.ibtn { width: 46px; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.ibtn svg { width: 22px; height: 22px; }
.ibtn:hover { border-color: var(--gold); }
.ibtn.off { opacity: .45; }

/* ---- bottom bar ---- */
#bottombar { position: absolute; left: 0; right: 0; bottom: 0; height: 112px; display: flex; align-items: flex-end; gap: 10px; padding: 0 10px 10px; background: linear-gradient(transparent, rgba(0,0,0,.6) 40%); }
#cards { display: flex; gap: 6px; }
.card { position: relative; width: 84px; height: 96px; border-radius: 10px; background: linear-gradient(#7a5230, #4a2e16); border: 2px solid #2a1a0c; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 0 #1a0e06; overflow: hidden; transition: transform .08s; padding: 0; }
.card:hover { transform: translateY(-3px); }
.card:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 0 #1a0e06; }
.card img { position: absolute; left: 50%; top: 2px; width: 64px; height: 58px; transform: translateX(-50%); pointer-events: none; }
.card .nm { position: absolute; left: 0; right: 0; top: 58px; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.card .cost { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-family: 'Rye', serif; color: var(--gold); font-size: 15px; text-shadow: 0 1px 0 #000; }
.card .key { position: absolute; top: 3px; left: 5px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.5); border-radius: 4px; padding: 0 4px; }
.card .cdov { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.55); pointer-events: none; }
.card.poor { filter: grayscale(.85) brightness(.7); }
.card.flashok { animation: cardflash .25s; }
@keyframes cardflash { 50% { box-shadow: 0 0 0 3px var(--gold); } }
#minimap { flex: none; width: 300px; height: 46px; border-radius: 8px; border: 2px solid #3a2a18; background: rgba(0,0,0,.6); cursor: pointer; margin-bottom: 2px; margin-left: auto; }
#abils { display: flex; gap: 6px; }
.abil { position: relative; width: 74px; height: 96px; border-radius: 10px; background: linear-gradient(#5a2a1e, #3a160e); border: 2px solid #1a0a06; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 4px 0 #120604; overflow: hidden; padding: 0; transition: transform .08s; }
.abil:hover { transform: translateY(-3px); }
.abil svg { position: absolute; left: 50%; top: 8px; width: 46px; height: 46px; transform: translateX(-50%); }
.abil .nm { position: absolute; left: 0; right: 0; top: 54px; font-size: 10.5px; text-align: center; line-height: 1.1; padding: 0 2px; }
.abil .cost { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-weight: 700; color: #ffb04a; font-size: 13px; }
.abil .key { position: absolute; top: 3px; left: 5px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.5); border-radius: 4px; padding: 0 4px; }
.abil .cdov { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.6); pointer-events: none; }
.abil.poor { filter: grayscale(.9) brightness(.65); }
.abil.ready { box-shadow: 0 0 12px 2px rgba(255,160,60,.6), 0 4px 0 #120604; }
.abil.active { outline: 3px solid var(--gold); }

#banner { position: absolute; top: 215px; left: 0; right: 0; text-align: center; font-family: 'Rye', serif; font-size: 52px; pointer-events: none; text-shadow: 0 4px 0 #000, 0 0 30px rgba(0,0,0,.8); opacity: 0; transition: opacity .3s; }
#banner.show { opacity: 1; animation: bannerIn .5s; }
@keyframes bannerIn { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#toast { position: absolute; top: 300px; left: 50%; transform: translateX(-50%); max-width: 760px; text-align: center; padding: 8px 18px; border-radius: 8px; background: rgba(0,0,0,.75); border: 2px solid var(--gold); font-size: 16px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#toast.show { opacity: 1; }
#tip { position: absolute; bottom: 120px; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,.88); border: 1px solid #6a4424; font-size: 13px; max-width: 240px; pointer-events: none; opacity: 0; transition: opacity .15s; }
#tip.show { opacity: 1; }
#tip b { color: var(--gold); font-weight: 600; }

/* ---- screens ---- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at center, rgba(0,0,0,.15), rgba(0,0,0,.75)); }
.screen h2, .overlay h2 { font-family: 'Rye', serif; font-size: 48px; margin: 0; color: var(--gold); text-shadow: 0 4px 0 #000; }
.logo { text-align: center; transform: rotate(-3deg); margin-top: -40px; }
.logo1 { font-family: 'Rye', serif; font-size: 92px; line-height: .9; color: #ffd24a; text-shadow: 0 6px 0 #6a2a0a, 0 10px 0 #000, 0 0 40px rgba(255,160,40,.4); }
.logo2 { font-family: 'Rye', serif; font-size: 120px; line-height: .9; color: #8ae04a; text-shadow: 0 6px 0 #1a4a0a, 0 10px 0 #000, 0 0 40px rgba(120,255,60,.35); animation: wobble 3s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(1.5deg) scale(1.02); } }
.sub { font-size: 22px; letter-spacing: 3px; text-transform: uppercase; margin-top: 10px; text-shadow: 0 2px 0 #000; }
.menu { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mbtn { font-family: 'Rye', serif; font-size: 28px; min-width: 280px; padding: 10px 26px; border-radius: 12px; color: #2a1406;
  background: linear-gradient(#ffe28a, #e8a83a); border: 3px solid #2a1406; box-shadow: 0 5px 0 #2a1406, inset 0 2px 0 rgba(255,255,255,.6); transition: transform .08s; }
.mbtn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.mbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #2a1406; }
.mbtn.small { font-size: 18px; min-width: 180px; padding: 7px 18px; }
.mbtn.danger { background: linear-gradient(#ff8a6a, #c8402a); }
.mbtn:disabled { filter: grayscale(1) brightness(.6); cursor: default; transform: none; }
.credit { position: absolute; bottom: 12px; font-size: 12px; opacity: .6; }
.credit a { color: inherit; }
.row { display: flex; gap: 12px; align-items: center; justify-content: center; }
.capsline { font-size: 18px; display: flex; align-items: center; gap: 6px; }
.capsline b { font-family: 'Rye', serif; color: var(--gold); font-size: 24px; }
.cap { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #e8e8e0 30%, #a8a8a0 32%, #d8d8d0 60%); border: 2px dashed #6a6a62; }

#levelGrid { display: grid; grid-template-columns: repeat(5, 210px); gap: 12px; }
.lvl { position: relative; height: 108px; border-radius: 12px; border: 3px solid #2a1406; overflow: hidden; text-align: left; padding: 10px 12px; box-shadow: 0 5px 0 #000; transition: transform .1s; }
.lvl:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); }
.lvl .n { font-family: 'Rye', serif; font-size: 34px; color: #fff; text-shadow: 0 3px 0 #000; }
.lvl .t { font-size: 17px; font-weight: 600; text-shadow: 0 2px 0 #000; }
.lvl .st { position: absolute; bottom: 8px; left: 12px; font-size: 22px; letter-spacing: 2px; }
.lvl .st i { font-style: normal; color: rgba(0,0,0,.5); }
.lvl .st i.on { color: var(--gold); text-shadow: 0 0 6px rgba(255,200,60,.7), 0 2px 0 #000; }
.lvl:disabled { filter: grayscale(1) brightness(.4); cursor: default; }
.lvl .lock { position: absolute; right: 12px; bottom: 8px; font-size: 14px; }

#shopList { display: grid; grid-template-columns: repeat(2, 520px); gap: 10px; max-height: 470px; overflow-y: auto; padding: 4px; }
.sitem { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 2px solid #3a2a18; }
.sitem img, .sitem .sico { width: 56px; height: 56px; flex: none; }
.sitem .info { flex: 1; }
.sitem .info b { font-size: 17px; }
.sitem .info div { font-size: 13px; opacity: .8; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 16px; height: 8px; border-radius: 3px; background: #2a1a0c; border: 1px solid #000; }
.pips i.on { background: var(--gold); }
.sbuy { font-family: 'Rye', serif; font-size: 16px; padding: 6px 12px; border-radius: 8px; background: linear-gradient(#ffe28a, #e8a83a); color: #2a1406; border: 2px solid #2a1406; min-width: 82px; }
.sbuy:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
.sitem.locked { opacity: .45; }

#howtoList { max-width: 1140px; columns: 2; column-gap: 40px; font-size: 15px; line-height: 1.4; background: var(--panel); padding: 20px 20px 20px 50px; border-radius: 12px; border: 2px solid #3a2a18; }
#howtoList li { margin: 0 0 8px; break-inside: avoid; }
#howtoList b { color: var(--gold); }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.overlay .box { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 30px 50px; border-radius: 16px; background: linear-gradient(#3a2414, #22140a); border: 3px solid #000; box-shadow: 0 10px 40px #000, inset 0 1px 0 rgba(255,255,255,.1); min-width: 440px; }
.stars { font-size: 64px; letter-spacing: 8px; }
.stars i { font-style: normal; color: #2a1a0c; display: inline-block; text-shadow: 0 3px 0 #000; }
.stars i.on { color: var(--gold); animation: starPop .5s backwards; text-shadow: 0 0 20px rgba(255,200,50,.8), 0 3px 0 #000; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.4); } }
#resInfo { font-size: 19px; text-align: center; line-height: 1.6; }
#resInfo b { color: var(--gold); }

#rotate { display: none; position: fixed; inset: 0; background: #0a0705; color: var(--paper); font-size: 24px; place-items: center; z-index: 9; font-family: 'Rye', serif; }
@media (orientation: portrait) and (max-width: 800px) { #rotate { display: grid; } }

/* ---- currencies ---- */
svg.cur { width: 22px; height: 22px; vertical-align: -5px; }
.wallet { display: flex; gap: 14px; font-size: 18px; }
.wallet span { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 2px solid #3a2a18; border-radius: 20px; padding: 3px 14px 3px 6px; }
.wallet b { font-family: 'Rye', serif; color: var(--gold); font-size: 20px; }
.wallet.corner { position: absolute; top: 14px; right: 14px; }
.loot { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 10px; font-weight: 700; font-size: 15px; min-width: 78px; }
.loot svg.cur { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }

/* ---- crates ---- */
#packList { display: flex; gap: 26px; }
.pack { width: 250px; padding: 16px; border-radius: 16px; background: var(--panel); border: 3px solid #3a2a18; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 6px 0 #000; transition: transform .15s; }
.pack:hover { transform: translateY(-4px); }
.pack.p-cooler { border-color: #3a8ae0; box-shadow: 0 6px 0 #000, 0 0 24px rgba(58,138,224,.35); }
.pack.p-safe { border-color: #ffb820; box-shadow: 0 6px 0 #000, 0 0 30px rgba(255,184,32,.45); }
.pimg svg { width: 170px; height: 140px; filter: drop-shadow(0 6px 4px rgba(0,0,0,.6)); }
.pack:hover .pimg svg { animation: wiggle .5s infinite; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.pname { font-family: 'Rye', serif; font-size: 24px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.pdesc { font-size: 14px; opacity: .85; text-align: center; min-height: 36px; }
.pbuy { display: flex; align-items: center; gap: 6px; font-size: 20px; padding: 8px 20px; }
.pbuy svg.cur { width: 22px; height: 22px; }
.pity { font-size: 14px; opacity: .7; }

/* ---- collectible card ---- */
.gcard { position: relative; width: 150px; height: 214px; perspective: 800px; cursor: pointer; flex: none; }
.gcard .face { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; transition: transform .55s cubic-bezier(.3,1.4,.5,1); }
.gcard .front { background: linear-gradient(#4a3420, #24160a); border: 4px solid var(--rc); box-shadow: 0 0 18px var(--rg), 0 5px 0 #000; overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.gcard .back { background: repeating-linear-gradient(45deg, #5a2a14 0 10px, #4a2210 10px 20px); border: 4px solid #2a1406; box-shadow: 0 5px 0 #000; transform: rotateY(180deg); display: grid; place-items: center; }
.gcard.down .front { transform: rotateY(-180deg); }
.gcard.down .back { transform: rotateY(0); }
.gcard:not(.down) .back { transform: rotateY(180deg); }
.backlogo { font-family: 'Rye', serif; font-size: 52px; color: #ffd24a; text-shadow: 0 4px 0 #000; transform: rotate(-8deg); }
.backlogo span { color: #8ae04a; }
.gcard.down:hover .back { filter: brightness(1.2); }
.r-common { --rc: #9aa0a8; --rg: rgba(0,0,0,0); }
.r-rare { --rc: #3a8ae0; --rg: rgba(80,160,255,.55); }
.r-epic { --rc: #b04ae8; --rg: rgba(190,90,255,.6); }
.r-legendary { --rc: #ffb820; --rg: rgba(255,200,60,.8); }
.rbar { width: 100%; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; background: var(--rc); color: #120a04; padding: 1px 0; }
.art { width: 132px; height: 112px; margin-top: 2px; border-radius: 8px; background: radial-gradient(circle at 50% 60%, var(--rg), rgba(0,0,0,.25) 70%); display: grid; place-items: center; }
.art img { width: 122px; height: 122px; margin-top: -6px; }
.cname { font-family: 'Rye', serif; font-size: 14px; text-align: center; line-height: 1.05; margin-top: 3px; padding: 0 4px; color: #fff; }
.csub { font-size: 10px; opacity: .6; text-transform: uppercase; letter-spacing: 1px; }
.perks { font-size: 11px; text-align: center; color: #b8ff9a; line-height: 1.25; margin-top: 2px; }
.ccount { position: absolute; top: 20px; right: 6px; font-weight: 700; font-size: 13px; background: rgba(0,0,0,.7); border-radius: 8px; padding: 0 6px; }
.cnew { position: absolute; top: 18px; left: -4px; background: #e83a2a; color: #fff; font-weight: 700; font-size: 12px; padding: 1px 8px; border-radius: 0 6px 6px 0; transform: rotate(-8deg); box-shadow: 0 2px 0 #000; }
.cscrap { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 11px; color: #ffcf4a; font-weight: 700; }
.gcard.locked .art img { filter: brightness(0) opacity(.55); }
.r-legendary:not(.down) .front::after { content: ''; position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%); animation: shine 2.2s infinite; pointer-events: none; }
.r-epic:not(.down) .front::after { content: ''; position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.25) 50%, transparent 58%); animation: shine 3s infinite; pointer-events: none; }
@keyframes shine { from { transform: translateX(-60%); } to { transform: translateX(60%); } }

/* ---- opening ---- */
#opening { background: radial-gradient(circle, #2a1a0c, #050302 75%); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; overflow: hidden; }
#crateStage { position: relative; width: 300px; height: 240px; display: grid; place-items: center; }
#crateStage .crate svg { width: 260px; height: 220px; filter: drop-shadow(0 10px 8px rgba(0,0,0,.7)); }
#crateStage .hint { position: absolute; bottom: -10px; font-size: 18px; opacity: 0; }
#crateStage.shake .crate { animation: crateShake 1.1s ease-in; }
@keyframes crateShake { 0% { transform: scale(.4) translateY(200px); } 25% { transform: scale(1.05); } 40%,60%,80% { transform: rotate(-5deg) scale(1.05); } 50%,70%,90% { transform: rotate(5deg) scale(1.08); } 100% { transform: scale(1.2); } }
#crateStage.burst { height: 60px; }
#crateStage.burst .crate { animation: crateGone .4s forwards; }
#crateStage.burst .hint { opacity: .8; transition: opacity .5s .6s; }
@keyframes crateGone { to { transform: scale(1.8); opacity: 0; } }
.rays { position: absolute; width: 700px; height: 700px; left: 50%; top: 50%; margin: -350px 0 0 -350px; opacity: 0; background: repeating-conic-gradient(var(--ray) 0 8deg, transparent 8deg 20deg); border-radius: 50%; mask-image: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); }
#crateStage.shake .rays { animation: raysIn 1.1s forwards, spin 8s linear infinite; }
#crateStage.burst .rays { opacity: .7; top: 180%; animation: spin 8s linear infinite; }
@keyframes raysIn { to { opacity: .8; } }
@keyframes spin { to { transform: rotate(360deg); } }
#opening { --ray: rgba(255,240,200,.25); }
#opening.best-rare { --ray: rgba(80,160,255,.35); }
#opening.best-epic { --ray: rgba(190,90,255,.4); }
#opening.best-legendary { --ray: rgba(255,200,60,.5); }
#openCards { display: flex; gap: 16px; min-height: 220px; z-index: 1; }
.gcard.deal { animation: deal .5s backwards cubic-bezier(.2,1.4,.5,1); }
@keyframes deal { from { transform: translateY(-260px) scale(.3) rotate(-30deg); opacity: 0; } }
.gcard.flip { animation: pop .45s; }
@keyframes pop { 50% { transform: scale(1.12); } }
.openBtns { z-index: 1; }
.sflash { position: absolute; inset: 0; pointer-events: none; animation: sflash .7s forwards; mix-blend-mode: screen; }
@keyframes sflash { from { opacity: .8; } to { opacity: 0; } }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px currentColor; animation: spark 0.9s ease-out forwards; z-index: 2; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.mbtn.gift { background: linear-gradient(#9aff7a, #3aa82a); animation: pulse .8s infinite alternate; }

/* ---- armory ---- */
#arsenal { gap: 10px; justify-content: flex-start; padding-top: 18px; }
#arsenal h2 { font-size: 38px; }
.arsenal { display: flex; gap: 14px; width: 1180px; }
#unitTabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 300px; align-content: start; }
.utab { display: flex; align-items: center; gap: 8px; padding: 2px 10px 2px 4px; border-radius: 10px; background: var(--panel); border: 2px solid #3a2a18; text-align: left; font-size: 12px; height: 40px; padding-right: 6px; }
.utab img { width: 34px; height: 34px; }
.utab span { flex: 1; }
.utab i { font-style: normal; font-family: 'Rye', serif; color: var(--gold); }
.utab.on { border-color: var(--gold); background: #4a2e16; }
.utab.locked { opacity: .35; }
#unitDetail { flex: 1; background: var(--panel); border: 2px solid #3a2a18; border-radius: 14px; padding: 12px 16px; }
.uhead { display: flex; gap: 18px; }
.ubig { width: 170px; height: 170px; border-radius: 14px; border: 4px solid var(--rc); background: radial-gradient(circle, var(--rg), rgba(0,0,0,.4) 70%); display: grid; place-items: center; box-shadow: 0 0 20px var(--rg); flex: none; }
.ubig img { width: 160px; height: 160px; }
.ubig.levelup { animation: lvlup .6s; }
@keyframes lvlup { 40% { transform: scale(1.12); filter: brightness(1.8); } }
.ustats { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.uname { font-family: 'Rye', serif; font-size: 28px; color: var(--gold); }
.udesc { font-size: 14px; opacity: .75; margin-bottom: 4px; }
.srow { display: flex; justify-content: space-between; max-width: 300px; font-size: 16px; border-bottom: 1px dashed rgba(255,255,255,.12); }
.srow b { color: #b8ff9a; }
.wup { align-self: flex-start; margin-top: 6px; display: flex; align-items: center; gap: 4px; font-size: 17px; }
.wup svg.cur { width: 18px; height: 18px; }
.scrapline { font-size: 13px; opacity: .8; }
.skinrow { display: flex; gap: 10px; margin-top: 6px; align-items: flex-end; }
.gcard.small { width: 112px; height: 160px; }
.gcard.small .art { width: 98px; height: 78px; }
.gcard.small .art img { width: 88px; height: 88px; }
.gcard.small .cname { font-size: 11px; }
.gcard.small .perks { font-size: 9.5px; }
.gcard.small .csub { display: none; }
.gcard.eq .front, .mini.eq { outline: 3px solid #8ae04a; outline-offset: 2px; }
.mini { width: 90px; height: 120px; border-radius: 10px; background: var(--panel); border: 3px solid #6a6a6a; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; }
.mini img { width: 80px; height: 80px; }
.charmbar { width: 1180px; display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid #3a2a18; border-radius: 14px; padding: 8px 14px; }
#charmSlots { display: flex; gap: 8px; }
.cslot { width: 92px; height: 74px; border-radius: 10px; border: 3px dashed #6a5a40; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; text-align: center; cursor: pointer; }
.cslot[class*="r-"] { border-style: solid; border-color: var(--rc); box-shadow: 0 0 10px var(--rg); }
.cslot img { width: 46px; height: 46px; }
#charmList { display: flex; gap: 8px; overflow-x: auto; flex: 1; }
.cpick { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; border: 2px solid var(--rc); font-size: 11px; cursor: pointer; flex: none; max-width: 200px; background: rgba(0,0,0,.3); }
.cpick img { width: 44px; height: 44px; }
.cpick b { font-size: 12px; }
.hint2 { opacity: .6; font-size: 13px; }
#charmList::-webkit-scrollbar { height: 6px; } #charmList::-webkit-scrollbar-thumb { background: #6a4424; border-radius: 3px; } #charmList::-webkit-scrollbar-track { background: transparent; }
#charmList { scrollbar-color: #6a4424 transparent; scrollbar-width: thin; }
.scrapline svg.cur { width: 16px; height: 16px; }

/* ---- album ---- */
#album { gap: 8px; justify-content: flex-start; padding-top: 14px; }
#album h2 { font-size: 36px; }
#albumProg { display: flex; align-items: center; gap: 10px; font-family: 'Rye', serif; color: var(--gold); font-size: 20px; }
.abar { width: 300px; height: 16px; border-radius: 8px; background: #1a0e06; border: 2px solid #000; overflow: hidden; }
.abar div { height: 100%; background: linear-gradient(90deg, #8ae04a, #ffd24a); }
#milestones { display: flex; gap: 8px; }
.ms { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 20px; background: var(--panel); border: 2px solid #3a2a18; font-size: 13px; }
.ms svg.cur, .gift svg.cur { width: 16px; height: 16px; vertical-align: -3px; }
.msn { width: 28px; height: 28px; border-radius: 50%; background: #3a2a18; display: grid; place-items: center; font-family: 'Rye', serif; color: var(--gold); }
.ms.ready { border-color: #8ae04a; animation: pulse .7s infinite alternate; cursor: pointer; }
.ms.done { opacity: .5; }
.msok { color: #8ae04a; font-weight: 700; }
#albumSets { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; justify-content: center; }
.aset { background: var(--panel); border: 2px solid #3a2a18; border-radius: 12px; padding: 4px 6px 6px; }
.aset.wide { grid-column: span 4; }
.aset.full { border-color: #8ae04a; box-shadow: 0 0 14px rgba(138,224,74,.35); }
.ahead { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-bottom: 3px; }
.ahead span { color: var(--gold); font-weight: 700; }
.ahead em { margin-left: auto; font-style: normal; font-size: 10px; opacity: .6; }
.aset.full .ahead em { color: #8ae04a; opacity: 1; }
.acards { display: flex; gap: 4px; }
.gcard.tiny { width: 66px; height: 96px; cursor: default; }
.gcard.tiny .front { border-width: 3px; }
.gcard.tiny .rbar { font-size: 7px; letter-spacing: 0; }
.gcard.tiny .art { width: 58px; height: 50px; }
.gcard.tiny .art img { width: 58px; height: 58px; margin-top: -2px; }
.gcard.tiny .cname { font-size: 8.5px; font-family: 'Oswald', sans-serif; }
.gcard.tiny .csub, .gcard.tiny .perks { display: none; }
.gcard.tiny .ccount { top: 12px; font-size: 9px; }

/* ---- store ---- */
#store { gap: 10px; }
#storeList, #exchList { display: flex; gap: 12px; }
.prod { position: relative; width: 168px; padding: 12px 10px 10px; border-radius: 14px; background: linear-gradient(#3a2414, #22140a); border: 3px solid #4a3420; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 5px 0 #000; }
.prod.t-popular { border-color: #3a8ae0; box-shadow: 0 5px 0 #000, 0 0 18px rgba(58,138,224,.4); }
.prod.t-best { border-color: #ffb820; box-shadow: 0 5px 0 #000, 0 0 22px rgba(255,184,32,.5); }
.prod.t-starter { border-color: #8ae04a; box-shadow: 0 5px 0 #000, 0 0 22px rgba(138,224,74,.45); }
.prod.owned { opacity: .5; }
.ptag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #e83a2a; color: #fff; font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 2px 0 #000; }
.t-best .ptag { background: #e8a020; color: #2a1406; }
.t-starter .ptag { background: #3aa82a; }
.pico { height: 92px; width: 100%; display: grid; place-items: center; }
.pile { position: relative; width: 120px; height: 90px; }
.pile span { position: absolute; transform: translateX(-50%); }
.pile svg.cur { width: 38px; height: 38px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.6)); }
.starter svg { width: 110px; height: 90px; }
.starter img { height: 96px; border-radius: 6px; box-shadow: 0 0 18px rgba(255,184,32,.6); }
#oddsBox { margin: 6px auto 0; max-width: 760px; font-size: 13px; }
#oddsBox summary { cursor: pointer; opacity: .85; text-decoration: underline; }
#oddsBox table { margin: 8px auto; border-collapse: collapse; background: rgba(0,0,0,.45); }
#oddsBox th, #oddsBox td { padding: 3px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
#oddsBox td:first-child { text-align: left; }
#oddsBox p { opacity: .7; margin: 4px 0 0; }
.pamt { font-size: 15px; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; min-height: 40px; }
.pamt b { font-family: 'Rye', serif; color: var(--gold); font-size: 20px; }
.pbonus { font-size: 12px; color: #8ae04a; font-weight: 700; min-height: 15px; }
.prod .sbuy { width: 100%; font-size: 18px; display: flex; justify-content: center; align-items: center; gap: 4px; }
.prod.exch { width: 190px; }
#storeNote { font-size: 14px; color: #ffb04a; min-height: 18px; }
.wallet span { cursor: pointer; }
.wallet .plus { font-style: normal; font-weight: 700; background: #3aa82a; color: #fff; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 14px; line-height: 1; }
#store { justify-content: flex-start; padding-top: 12px; gap: 8px; }
#store h2 { font-size: 38px; }
/* title menu: two columns so all entries fit */
#title .menu { display: grid; grid-template-columns: repeat(2, 260px); gap: 10px 14px; }
#title .menu .mbtn { min-width: 0; font-size: 23px; padding: 8px 12px; }
#title .menu .mbtn[data-go="levels"] { grid-column: span 2; font-size: 32px; padding: 12px; }
#title .menu .mbtn.small, #title .menu .gift { grid-column: span 2; justify-self: center; min-width: 220px; font-size: 18px; }
#title .logo { margin-top: -10px; }
#title .logo1 { font-size: 78px; } #title .logo2 { font-size: 100px; }
.mbtn.storeb { background: linear-gradient(#a8ff8a, #4ab83a); }

/* ---- quests ---- */
#quests { gap: 10px; }
#dailyCal { display: flex; gap: 8px; }
.dday { position: relative; width: 112px; height: 106px; border-radius: 12px; background: var(--panel); border: 3px solid #3a2a18; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.dday.big { width: 150px; border-color: #ffb820; }
.dday .dn { font-family: 'Rye', serif; color: var(--gold); }
.dday .dr { text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; align-items: center; font-weight: 700; }
.dday.now { border-color: #8ae04a; box-shadow: 0 0 18px rgba(138,224,74,.5); animation: wiggle 1.2s infinite; }
.dday.done { opacity: .45; }
.dok { position: absolute; top: 4px; right: 8px; color: #8ae04a; font-weight: 700; font-size: 18px; }
#streakTxt { font-size: 16px; opacity: .85; }
#questList { display: flex; flex-direction: column; gap: 8px; width: 760px; }
.quest { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 2px solid #3a2a18; }
.quest.ready { border-color: #8ae04a; }
.quest.claimed { opacity: .5; }
.qt { width: 260px; font-size: 16px; }
.qbar { position: relative; flex: 1; height: 20px; border-radius: 10px; background: #1a0e06; border: 2px solid #000; overflow: hidden; }
.qbar div { height: 100%; background: linear-gradient(90deg, #3aa82a, #8ae04a); }
.qbar span { position: absolute; inset: 0; text-align: center; font-size: 12px; font-weight: 700; line-height: 16px; text-shadow: 0 1px 2px #000; }
.qr { width: 130px; display: flex; gap: 4px; align-items: center; font-weight: 700; }
.qbtn { position: relative; }
.badge { position: absolute; top: -8px; right: -8px; font-style: normal; background: #e83a2a; color: #fff; font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 700; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #2a1406; animation: pulse .7s infinite alternate; }
#title .menu #langBtn { grid-column: auto; justify-self: stretch; min-width: 0; font-size: 23px; padding: 8px 12px; }

/* ---- endless ---- */
.lvl.endlesscard { width: 1098px; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-color: #e83a2a; }
.lvl.endlesscard .n { font-size: 44px; }
.lvl.endlesscard .st { position: static; font-size: 16px; margin-left: auto; text-shadow: 0 2px 0 #000; }
#hud.endless #hpZ { background: linear-gradient(#ffd84a, #e8a020); }
.wavebig { font-family: 'Rye', serif; font-size: 54px; color: #ff6a4a; text-shadow: 0 4px 0 #000; }

#opening { z-index: 20; }
#result, #pause { z-index: 10; }

/* ---- waves ---- */
#wavebox { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); min-width: 300px; padding: 6px 12px 8px; text-align: center; pointer-events: auto; }
#wavebox .wtop { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
#wavebox .wtop b { font-family: 'Rye', serif; color: var(--gold); font-size: 17px; }
#wavebox .wtop span { font-size: 14px; opacity: .9; }
#wavebox .wbar { height: 6px; background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; margin-top: 4px; }
#waveFill { height: 100%; background: linear-gradient(90deg, #e04a3a, #ff8a3a); transition: width .2s; }
#wavebox.prep #waveFill { background: linear-gradient(90deg, #6ad04a, #b8f06a); }
#wavePrev { display: none; gap: 4px; justify-content: center; margin-top: 4px; flex-wrap: wrap; align-items: center; }
#wavebox.prep #wavePrev { display: flex; }
#wavePrev .zp { position: relative; width: 42px; height: 42px; border-radius: 8px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); }
#wavePrev .zp.big { border-color: #ff5a3a; box-shadow: 0 0 8px rgba(255,80,40,.6); }
#wavePrev .zp img { width: 42px; height: 42px; }
#wavePrev .zp i { position: absolute; right: 1px; bottom: 0; font-style: normal; font-weight: 700; font-size: 12px; text-shadow: 0 1px 2px #000; }
#wavePrev .hz { font-size: 12px; color: #ff8a6a; margin-left: 4px; }
#callBtn { display: none; margin-top: 6px; padding: 4px 16px; font-size: 15px; }
#wavebox.prep #callBtn { display: inline-block; }
.ibtn.wide { width: auto; padding: 0 10px; display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 14px; }
.ibtn.wide svg { width: 18px; height: 18px; }
#stanceBtn { color: #8ad0ff; }
#stanceBtn.atk { color: #ff7a5a; }

/* ---- build menu ---- */
#buildMenu { position: absolute; top: 250px; width: 380px; padding: 10px 12px 12px; z-index: 3; }
#buildMenu .bmx { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
#buildMenu .bmh { font-family: 'Rye', serif; color: var(--gold); font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#buildMenu .bmh svg { width: 30px; height: 30px; }
#buildMenu .bmh i { font-family: 'Oswald', sans-serif; font-style: normal; font-size: 13px; color: #ddd; }
#buildMenu .bmd { font-size: 13px; opacity: .9; margin-bottom: 8px; }
#buildMenu .bmgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#buildMenu .bmi { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 3px; border-radius: 8px; background: linear-gradient(#5a3e22, #3a2612); border: 2px solid #2a1a0c; color: #fff; cursor: pointer; font-family: inherit; }
#buildMenu .bmi svg { width: 34px; height: 34px; }
#buildMenu .bmi b { font-size: 12px; font-weight: 600; white-space: nowrap; }
#buildMenu .bmi span { font-family: 'Rye', serif; color: var(--gold); font-size: 13px; }
#buildMenu .bmi:hover { border-color: var(--gold); }
#buildMenu .bmi.locked { filter: grayscale(1) brightness(.6); cursor: default; }
#buildMenu .bmi.locked span { font-family: 'Oswald', sans-serif; font-size: 11px; color: #ccc; }
#buildMenu .poor { filter: grayscale(.8) brightness(.7); }
#buildMenu .bmrow { display: flex; gap: 6px; flex-wrap: wrap; }
#buildMenu .bmrow .sbuy { flex: 1; padding: 6px 8px; font-size: 14px; }
#buildMenu .sell { background: linear-gradient(#8a3a2a, #5a2014); }
#wavePrev .zp.new { border-color: #ffd84a; box-shadow: 0 0 10px rgba(255,216,74,.7); }
#wavePrev .zp em { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9px; font-weight: 700; background: #ffd84a; color: #1a1410; border-radius: 3px; padding: 0 3px; }
#bossbar { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); width: 420px; text-align: center; pointer-events: none; }
#bossbar b { font-family: 'Rye', serif; color: #ff9a5a; font-size: 18px; text-shadow: 0 2px 0 #000; }
#bossbar .bb { height: 10px; background: rgba(0,0,0,.6); border: 2px solid #2a1a0c; border-radius: 6px; overflow: hidden; margin-top: 2px; }
#bossFill { height: 100%; background: linear-gradient(90deg, #a01a10, #ff5a2a); transition: width .15s; }
#wavebox.prep:not(.hidden) ~ #bossbar { top: 232px; }

/* ---- village ---- */
#village { justify-content: flex-start; padding-top: 14px; gap: 8px; background: #120c08; }
#village .vtop { width: 1240px; justify-content: space-between; align-items: center; }
#village h2 { font-size: 40px; }
#vLevel { font-size: 18px; display: flex; gap: 6px; align-items: center; }
#vLevel b { color: var(--gold); font-family: 'Rye', serif; font-size: 22px; }
#villageCv { width: 1240px; height: 470px; border-radius: 12px; border: 3px solid #2a1a0c; box-shadow: 0 6px 20px rgba(0,0,0,.6); cursor: pointer; }
#village .vbottom { width: 1240px; align-items: stretch; gap: 12px; }
#vPanel { flex: 1; display: flex; gap: 14px; align-items: center; background: linear-gradient(#3a2614, #24160a); border: 2px solid #2a1a0c; border-radius: 10px; padding: 8px 14px; min-height: 88px; }
#vPanel .vinfo { flex: 1; font-size: 14px; }
#vPanel .vinfo b { font-family: 'Rye', serif; color: var(--gold); font-size: 20px; }
#vPanel .vinfo i { font-style: normal; opacity: .8; margin-left: 6px; }
#vPanel .vfx { margin-top: 4px; color: #cfe8b0; }
#vPanel .vfx span { color: #9aff7a; }
#vPanel .vhint { opacity: .85; font-size: 15px; }
#vPanel .sbuy { padding: 10px 18px; font-size: 16px; white-space: nowrap; }
#village .vside { display: flex; flex-direction: column; gap: 8px; }
#village .vside .mbtn { min-width: 220px; font-size: 18px; padding: 8px 12px; }
.mbtn.villb { background: linear-gradient(#e8b070, #b8642a); }

#vResearch { position: absolute; left: 30px; right: 30px; top: 330px; display: flex; gap: 8px; align-items: stretch; background: rgba(20,12,6,.88); border: 2px solid #2a1a0c; border-radius: 10px; padding: 8px 10px; }
#vResearch .rh { font-family: 'Rye', serif; color: var(--gold); font-size: 18px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
#vResearch .rcard { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 8px; background: linear-gradient(#5a3e22, #3a2612); border: 2px solid #2a1a0c; color: #fff; font-family: inherit; cursor: pointer; }
#vResearch .rcard svg { width: 36px; height: 36px; }
#vResearch .rcard b { font-size: 13px; }
#vResearch .rcard span { font-size: 12px; display: flex; gap: 3px; align-items: center; }
#vResearch .rcard:disabled { cursor: default; }
#vResearch .rcard.locked { filter: grayscale(1) brightness(.55); }
#vResearch .rcard.done { border-color: #6ad04a; background: linear-gradient(#3a5a22, #1e3a12); }
#vResearch .rcard:not(:disabled):hover { border-color: var(--gold); }
#buildMenu .bmi span { font-size: 12px; }

#levels { gap: 12px; }
#worldTabs { display: grid; grid-template-columns: repeat(10, 106px); gap: 6px; }
.wtab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; border: 2px solid #2a1406; background: linear-gradient(var(--wc), #2a1a0c); color: #fff; cursor: pointer; font-family: inherit; box-shadow: 0 3px 0 #000; opacity: .8; }
.wtab i { font-style: normal; font-family: 'Rye', serif; font-size: 18px; }
.wtab b { font-size: 12px; white-space: nowrap; }
.wtab span { font-size: 12px; color: var(--gold); display: flex; align-items: center; }
.wtab.on { opacity: 1; border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 6px 0 #000, 0 0 14px rgba(255,216,74,.4); }
.wtab.locked { filter: grayscale(1) brightness(.5); cursor: default; }
.lvl .lvmeta { position: absolute; right: 10px; top: 10px; font-size: 12px; opacity: .85; text-shadow: 0 1px 2px #000; }
.lvl.bosslvl { border-color: #e83a2a; box-shadow: 0 5px 0 #000, 0 0 12px rgba(232,58,42,.5); }
#levelGrid .lvl { display: flex; flex-direction: column; justify-content: flex-start; }
#levelGrid .lvl .n { font-size: 28px; line-height: 1.05; }
#levelGrid .lvl .t { font-size: 15px; line-height: 1.15; }
#levelGrid .lvl .st { bottom: 5px; font-size: 18px; }

/* ---- squad ---- */
#squad { z-index: 12; }
.squadbox { width: 1100px; }
#squadHint { opacity: .85; margin-bottom: 8px; }
#squadGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 10px; }
.sqcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 10px; background: linear-gradient(#5a3e22, #2a1a0c); border: 3px solid #2a1a0c; color: #fff; font-family: inherit; cursor: pointer; filter: grayscale(.7) brightness(.7); transition: transform .08s; }
.sqcard.on { filter: none; border-color: var(--gold); box-shadow: 0 0 12px rgba(255,216,74,.5); }
.sqcard.fun::after { content: '★'; position: absolute; left: 6px; top: 4px; color: #ff8ae0; font-size: 14px; }
.sqcard:hover { transform: translateY(-2px); }
.sqcard img { width: 80px; height: 74px; }
.sqcard i { position: absolute; right: 6px; top: 4px; font-style: normal; font-family: 'Rye', serif; background: var(--gold); color: #1a1410; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; }
.sqcard b { font-size: 14px; }
.sqcard span { font-family: 'Rye', serif; color: var(--gold); font-size: 14px; }
.sqcard em { font-style: normal; font-size: 11px; opacity: .8; line-height: 1.2; min-height: 40px; }
#squadCount { font-family: 'Rye', serif; font-size: 20px; color: var(--gold); margin-right: 12px; }
.lvl .evbadge { position: absolute; right: 8px; bottom: 7px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: rgba(0,0,0,.6); color: var(--ec); border: 1px solid var(--ec); }

/* installable web app */
#title .menu .minirow { grid-column: span 2; display: flex; gap: 12px; justify-content: center; }
#title .menu .minirow .mbtn.small { min-width: 200px; }
.mbtn.inst { background: linear-gradient(#8ad8ff, #2a8ad0); }
#installBox .isteps { margin: 0; padding-left: 26px; font-size: 20px; line-height: 1.5; color: #f4e8d0; }
#installBox .isteps li { margin: 6px 0; }
#installBox .isteps li span { margin-right: 8px; }
#installBox .isteps svg { vertical-align: middle; }
#installBox .ihint { margin: 0; max-width: 420px; text-align: center; color: #c8b898; font-size: 16px; }

/* 24 defenders: keep squad, armory and album inside the 720px screen */
#squadGrid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
.sqcard { padding: 4px 3px; }
.sqcard img { width: 60px; height: 56px; }
.sqcard b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sqcard span { font-size: 13px; }
.sqcard em { font-size: 10px; min-height: 0; max-height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.sqcard i { width: 20px; height: 20px; line-height: 20px; font-size: 13px; right: 4px; top: 3px; }
#unitTabs { align-content: start; max-height: 520px; overflow-y: auto; }
.utab { height: 32px; font-size: 11.5px; }
.utab img { width: 28px; height: 28px; }
#milestones { flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 1220px; }
.ms { padding: 2px 10px 2px 3px; font-size: 12px; }
#albumSets { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 6px 12px; }
.msr { white-space: nowrap; }
.msn { width: 24px; height: 24px; font-size: 12px; }

/* garage */
#vResearch .gcard em { font-style: normal; font-size: 11px; color: #cfe8b0; text-align: center; line-height: 1.15; min-height: 26px; }
.gpips { display: flex; gap: 3px; }
.gpips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(0,0,0,.55); border: 1px solid #6a4a2a; }
.gpips i.on { background: #ffd84a; border-color: #ffd84a; }
.gpips i.cap { opacity: .3; }
#vResearch .rcard span svg { width: 15px; height: 15px; }

/* ---- touch / small phones: bigger HUD, no hover-only UI ---- */
html, body { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
img { -webkit-user-drag: none; }
#albumSets, #unitTabs, #charmList, #levelGrid, #howtoList, .scroll { touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
body.mobile #tip { display: none; }
body.mobile .card .key, body.mobile .abil .key { display: none; }
body.mobile #topbar { top: 6px; left: 8px; right: 8px; gap: 7px; }
body.mobile .lbl { font-size: 14px; }
body.mobile .big { font-size: 31px; }
body.mobile .small { font-size: 15px; }
body.mobile .cashbox { min-width: 138px; padding: 5px 12px; }
body.mobile .brew .ico { width: 42px; height: 42px; }
body.mobile .meterbox { width: 210px; }
body.mobile .meter { height: 26px; }
body.mobile #meterTxt { font-size: 15px; line-height: 22px; }
body.mobile .baserow { font-size: 13px; }
body.mobile .baserow span { width: 90px; }
body.mobile .bar { height: 15px; }
body.mobile .loot { font-size: 17px; min-width: 84px; }
body.mobile .ibtn { width: 58px; font-size: 19px; }
body.mobile .ibtn.wide { width: auto; padding: 0 12px; }
body.mobile .ibtn svg { width: 28px; height: 28px; }
body.mobile #bottombar { height: 124px; padding: 0 8px 8px; gap: 8px; }
body.mobile #cards { gap: 6px; }
body.mobile .card { width: 100px; height: 112px; }
body.mobile .card img { width: 76px; height: 68px; }
body.mobile .card .nm { top: 66px; font-size: 13.5px; }
body.mobile .card .cost { font-size: 18px; }
body.mobile .abil { width: 84px; height: 112px; }
body.mobile .abil svg { width: 52px; height: 52px; top: 8px; }
body.mobile .abil .nm { top: 62px; font-size: 12.5px; }
body.mobile .abil .cost { font-size: 15px; }
body.mobile #minimap { position: absolute; top: 108px; right: 10px; width: 260px; height: 44px; margin: 0; }
body.mobile #wavebox { top: 100px; transform: translateX(-50%) scale(1.2); transform-origin: top center; }
body.mobile #wavebox.prep:not(.hidden) ~ #bossbar { top: 262px; }
body.mobile #bossbar { top: 168px; }
body.mobile #buildMenu { transform: scale(1.18); transform-origin: top left; top: 190px; }
body.mobile #banner { font-size: 56px; }
body.mobile #toast { font-size: 19px; top: 320px; }
/* menus */
body.mobile .sqcard em { display: none; }
body.mobile .sqcard img { width: 74px; height: 68px; }
body.mobile .sqcard b { font-size: 14.5px; }
body.mobile .sqcard span { font-size: 16px; }
body.mobile .sqcard { padding: 8px 3px; }
body.mobile .utab { height: 40px; font-size: 14px; }
body.mobile .utab img { width: 34px; height: 34px; }
body.mobile .mbtn.small { font-size: 20px; }

.mbtn.nudge { animation: pulse .9s infinite alternate; }

/* =====================================================================
   Touch menus: everything readable and thumb-sized on small phones.
   The 1280×720 frame is scaled down ~0.5 on an iPhone SE, so sizes here
   are roughly doubled; screens scroll vertically instead of overflowing.
   ===================================================================== */
.rdesc { display: none; }
#mBack { position: absolute; top: 14px; left: 14px; z-index: 9; width: 104px; height: 84px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(#ffe28a, #e8a83a); border: 3px solid #2a1406; box-shadow: 0 5px 0 #2a1406, inset 0 2px 0 rgba(255,255,255,.6); }
#mBack:active { transform: translateY(3px); box-shadow: 0 2px 0 #2a1406; }
body.mobile .screen { justify-content: flex-start; overflow-y: auto; overflow-x: hidden; padding: 18px 0 48px; gap: 18px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.mobile .screen > * { flex-shrink: 0; }
body.mobile .screen .mbtn[data-go="title"] { display: none; }
body.mobile .screen h2 { font-size: 58px; min-height: 84px; display: flex; align-items: center; }
body.mobile .wallet { gap: 12px; font-size: 24px; }
body.mobile .wallet span { padding: 6px 18px 6px 8px; border-radius: 26px; }
body.mobile .wallet b { font-size: 30px; }
body.mobile .wallet svg.cur { width: 32px; height: 32px; }
body.mobile .wallet .plus { width: 28px; height: 28px; font-size: 22px; }
body.mobile .wallet.corner { top: 18px; right: 18px; }
body.mobile .lbl { font-size: 20px; }
body.mobile .mbtn { font-size: 32px; padding: 14px 28px; }
body.mobile .mbtn.small { font-size: 26px; min-width: 240px; padding: 14px 26px; }
body.mobile .sbuy { font-size: 24px; padding: 14px 18px; min-width: 130px; border-radius: 12px; }
body.mobile svg.cur { width: 28px; height: 28px; vertical-align: -6px; }

/* title */
body.mobile #title { justify-content: safe center; padding-top: 14px; gap: 10px; }
body.mobile #title .logo { margin-top: 0; }
body.mobile #title .logo1 { font-size: 66px; } body.mobile #title .logo2 { font-size: 86px; }
body.mobile .sub { font-size: 22px; margin-top: 6px; }
body.mobile #title .menu { grid-template-columns: repeat(3, 340px); gap: 12px 14px; }
body.mobile #title .menu .mbtn { font-size: 30px; padding: 16px 10px; }
body.mobile #title .menu .mbtn[data-go="levels"] { grid-column: span 3; font-size: 42px; padding: 16px; }
body.mobile #title .menu .minirow { grid-column: span 3; }
body.mobile #title .menu .minirow .mbtn.small, body.mobile #title .menu #langBtn { font-size: 26px; min-width: 300px; padding: 14px 20px; }
body.mobile #title .menu .gift { grid-column: span 3; font-size: 28px; }
body.mobile .credit { position: static; margin: 18px 0 8px; font-size: 18px; opacity: .7; }
body.mobile .credit a { display: inline-block; padding: 10px 6px; }
body.mobile .badge { width: 34px; height: 34px; font-size: 19px; top: -12px; right: -12px; }

/* levels */
body.mobile #worldTabs { grid-template-columns: repeat(5, 236px); gap: 10px; }
body.mobile .wtab { padding: 10px 4px; border-radius: 14px; }
body.mobile .wtab i { font-size: 28px; }
body.mobile .wtab b { font-size: 20px; }
body.mobile .wtab span { font-size: 19px; }
body.mobile #levelGrid { grid-template-columns: repeat(5, 236px); gap: 12px; }
body.mobile #levelGrid .lvl { height: 150px; padding: 12px 14px; }
body.mobile #levelGrid .lvl .n { font-size: 40px; }
body.mobile #levelGrid .lvl .t { font-size: 21px; }
body.mobile .lvl .lvmeta { font-size: 17px; top: 12px; right: 12px; }
body.mobile #levelGrid .lvl .st { font-size: 28px; }
body.mobile .lvl .lock { font-size: 19px; }
body.mobile .lvl.endlesscard { width: 1228px; height: 100px; }
body.mobile .lvl.endlesscard .n { font-size: 56px; }
body.mobile .lvl.endlesscard .t { font-size: 26px; }
body.mobile .lvl.endlesscard .st { font-size: 22px; }

/* workshop */
body.mobile #shopList { grid-template-columns: repeat(2, 610px); max-height: none; overflow: visible; gap: 14px; }
body.mobile .sitem { padding: 14px 16px; gap: 16px; }
body.mobile .sitem img, body.mobile .sitem .sico { width: 76px; height: 76px; }
body.mobile .sitem .info b { font-size: 26px; }
body.mobile .sitem .info div { font-size: 19px; }
body.mobile .pips i { width: 24px; height: 12px; }

/* how to */
body.mobile #howtoList { max-width: 1220px; font-size: 22px; line-height: 1.35; padding: 22px 26px 22px 56px; }
body.mobile #howtoList li { margin-bottom: 12px; }

/* crates */
body.mobile #packList { gap: 24px; }
body.mobile .pack { width: 370px; padding: 20px; gap: 10px; }
body.mobile .pimg svg { width: 210px; height: 170px; }
body.mobile .pname { font-size: 34px; }
body.mobile .pdesc { font-size: 21px; }
body.mobile .pbuy { font-size: 30px; padding: 14px 30px; }
body.mobile .pbuy svg.cur { width: 32px; height: 32px; }
body.mobile .pity { font-size: 20px; }
body.mobile #oddsBox { font-size: 18px; max-width: none; }
body.mobile #oddsBox summary { padding: 12px; }
body.mobile #oddsBox th, body.mobile #oddsBox td { padding: 6px 8px; }

/* armory */
body.mobile #arsenal { gap: 14px; padding-top: 18px; }
body.mobile #arsenal h2 { font-size: 54px; }
body.mobile .arsenal { width: 1240px; gap: 14px; }
body.mobile #unitTabs { width: 400px; max-height: 560px; gap: 6px; touch-action: pan-y; }
body.mobile .utab { height: 62px; font-size: 18px; gap: 8px; border-radius: 12px; }
body.mobile .utab img { width: 50px; height: 50px; }
body.mobile .utab i { font-size: 22px; }
body.mobile #unitDetail { padding: 14px 18px; }
body.mobile .ubig { width: 200px; height: 200px; }
body.mobile .ubig img { width: 188px; height: 188px; }
body.mobile .uname { font-size: 40px; }
body.mobile .udesc { font-size: 21px; }
body.mobile .srow { font-size: 24px; max-width: 420px; padding: 2px 0; }
body.mobile .wup { font-size: 28px; padding: 14px 26px; }
body.mobile .wup svg.cur { width: 28px; height: 28px; }
body.mobile .scrapline { font-size: 20px; }
body.mobile .scrapline svg.cur { width: 22px; height: 22px; }
body.mobile .skinrow { flex-wrap: wrap; gap: 12px; }
body.mobile .gcard.small { width: 138px; height: 196px; }
body.mobile .gcard.small .art { width: 122px; height: 96px; }
body.mobile .gcard.small .art img { width: 110px; height: 110px; }
body.mobile .gcard.small .cname { font-size: 15px; }
body.mobile .gcard.small .perks { font-size: 13px; }
body.mobile .gcard.small .rbar { font-size: 13px; }
body.mobile .mini { width: 116px; height: 156px; font-size: 17px; }
body.mobile .mini img { width: 96px; height: 96px; }
body.mobile .charmbar { width: 1240px; flex-wrap: wrap; padding: 12px 16px; gap: 14px; }
body.mobile .charmbar .lbl { width: 100%; }
body.mobile .cslot { width: 132px; height: 110px; font-size: 15px; }
body.mobile .cslot img { width: 60px; height: 60px; }
body.mobile #charmList { flex-basis: 100%; gap: 12px; padding-bottom: 8px; touch-action: pan-x; }
body.mobile .cpick { max-width: 330px; font-size: 16px; padding: 8px 12px; gap: 10px; }
body.mobile .cpick img { width: 60px; height: 60px; }
body.mobile .cpick b { font-size: 18px; }
body.mobile .hint2 { font-size: 19px; }

/* album */
body.mobile #album { padding-top: 18px; }
body.mobile #albumProg { font-size: 30px; }
body.mobile .abar { width: 420px; height: 22px; }
body.mobile #milestones { max-width: 1240px; gap: 8px; }
body.mobile .ms { font-size: 18px; padding: 5px 14px 5px 5px; }
body.mobile .msn { width: 38px; height: 38px; font-size: 17px; }
body.mobile .ms svg.cur { width: 22px; height: 22px; }
body.mobile #albumSets { grid-template-columns: repeat(2, auto); overflow: visible; flex: none; gap: 10px; }
body.mobile .aset.wide { grid-column: span 2; }
body.mobile .aset { padding: 8px 10px 10px; }
body.mobile .ahead { font-size: 22px; }
body.mobile .ahead em { font-size: 16px; }
body.mobile .acards { gap: 8px; flex-wrap: wrap; }
body.mobile .gcard.tiny { width: 136px; height: 194px; }
body.mobile .gcard.tiny .rbar { font-size: 12px; letter-spacing: 1px; }
body.mobile .gcard.tiny .art { width: 122px; height: 104px; }
body.mobile .gcard.tiny .art img { width: 116px; height: 116px; }
body.mobile .gcard.tiny .cname { font-size: 16px; }
body.mobile .gcard.tiny .ccount { font-size: 15px; top: 22px; }

/* shop */
body.mobile #store { padding-top: 18px; gap: 14px; }
body.mobile #storeList, body.mobile #exchList { flex-wrap: wrap; justify-content: center; max-width: 1240px; gap: 22px 16px; }
body.mobile .prod { width: 380px; padding: 18px 14px 14px; gap: 8px; }
body.mobile .prod.exch { width: 380px; }
body.mobile .pico { height: 120px; }
body.mobile .pile { transform: scale(1.3); }
body.mobile .pamt { font-size: 21px; }
body.mobile .pamt b { font-size: 30px; }
body.mobile .pbonus { font-size: 18px; }
body.mobile .ptag { font-size: 18px; top: -16px; padding: 3px 14px; }
body.mobile .prod .sbuy { font-size: 28px; }
body.mobile #storeNote { font-size: 20px; }

/* quests */
body.mobile #dailyCal { flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 1240px; }
body.mobile .dday { width: 160px; height: 140px; font-size: 19px; }
body.mobile .dday.big { width: 200px; }
body.mobile .dday .dn { font-size: 24px; }
body.mobile .dok { font-size: 24px; }
body.mobile #streakTxt { font-size: 22px; }
body.mobile #questList { width: 1180px; gap: 12px; }
body.mobile .quest { padding: 14px 18px; gap: 18px; }
body.mobile .qt { width: 420px; font-size: 23px; }
body.mobile .qbar { height: 32px; border-radius: 16px; }
body.mobile .qbar span { font-size: 18px; line-height: 28px; }
body.mobile .qr { width: 170px; font-size: 22px; }

/* village */
body.mobile #village { padding-top: 8px; gap: 10px; }
body.mobile #village .vtop { padding-left: 120px; width: 1240px; box-sizing: border-box; }
body.mobile #village h2 { font-size: 46px; }
body.mobile #vLevel { font-size: 22px; } body.mobile #vLevel b { font-size: 28px; }
body.mobile #vPanel { min-height: 120px; padding: 12px 18px; }
body.mobile #vPanel .vinfo { font-size: 20px; }
body.mobile #vPanel .vinfo b { font-size: 30px; }
body.mobile #vPanel .vhint { font-size: 22px; }
body.mobile #vPanel .sbuy { font-size: 24px; padding: 16px 22px; }
body.mobile #village .vside .mbtn { min-width: 250px; font-size: 24px; padding: 14px 12px; }
body.mobile #vResearch { top: 200px; left: 16px; right: 16px; flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
body.mobile #vResearch .rh { writing-mode: horizontal-tb; transform: none; width: 100%; font-size: 26px; text-align: left; }
body.mobile #vResearch .rcard { flex: 1 1 180px; padding: 10px 6px; gap: 4px; }
body.mobile #vResearch .rcard svg { width: 52px; height: 52px; }
body.mobile #vResearch .rcard b { font-size: 19px; }
body.mobile #vResearch .rcard span { font-size: 18px; }
body.mobile #vResearch .rcard span svg { width: 22px; height: 22px; }
body.mobile #vResearch .gcard em, body.mobile .rdesc { display: block; font-style: normal; font-size: 15px; line-height: 1.2; color: #cfe8b0; text-align: center; }
body.mobile .gpips i { width: 14px; height: 14px; }

/* overlays */
body.mobile .overlay .box { padding: 30px 46px; gap: 18px; }
body.mobile #resInfo { font-size: 24px; }
body.mobile .sqcard b { font-size: 17px; }
body.mobile .sqcard span { font-size: 19px; }
body.mobile #squadHint { font-size: 22px; }
body.mobile #squadCount { font-size: 28px; }
body.mobile .gcard:not(.small):not(.tiny) { width: 196px; height: 280px; }
body.mobile .gcard:not(.small):not(.tiny) .art { width: 176px; height: 150px; }
body.mobile .gcard:not(.small):not(.tiny) .art img { width: 168px; height: 168px; }
body.mobile .gcard:not(.small):not(.tiny) .cname { font-size: 20px; }
body.mobile .gcard:not(.small):not(.tiny) .csub { font-size: 13px; }
body.mobile .gcard:not(.small):not(.tiny) .perks { font-size: 16px; }
body.mobile .gcard:not(.small):not(.tiny) .rbar { font-size: 14px; }
body.mobile .gcard:not(.small):not(.tiny) .cscrap { font-size: 15px; }
body.mobile #crateStage .hint { font-size: 26px; }
body.mobile #installBox .isteps { font-size: 26px; }
body.mobile #installBox .ihint { font-size: 20px; max-width: 560px; }
body.mobile #album h2, body.mobile #store h2, body.mobile #arsenal h2 { font-size: 58px; }
body.mobile #village h2 { font-size: 50px; min-height: 0; }
body.mobile #unitTabs { grid-template-columns: 1fr; width: 330px; }
body.mobile .utab { height: 70px; font-size: 23px; padding-left: 8px; }
body.mobile .utab img { width: 56px; height: 56px; }
body.mobile #vResearch { position: static; width: 1240px; box-sizing: border-box; }
body.mobile .sqcard img { width: 86px; height: 78px; }
body.mobile .sqcard b { font-size: 20px; }
body.mobile .sqcard span { font-size: 22px; }
body.mobile .sqcard i { width: 30px; height: 30px; line-height: 30px; font-size: 18px; }
body.mobile .squadbox { width: 1200px; padding: 20px 24px; }
body.mobile #squadGrid { gap: 8px; }
body.mobile .overlay { overflow-y: auto; touch-action: pan-y; }
body.mobile #helpBox { overflow: hidden; }
body.mobile #squad { place-items: start center; padding: 10px 0; }
body.mobile .squadbox .row { position: sticky; bottom: -20px; z-index: 2; width: calc(100% + 48px); margin: 0 -24px -20px; padding: 14px 0 18px; background: linear-gradient(rgba(36,22,10,.6), #24160a 35%); border-radius: 0 0 16px 16px; }

/* ---- help ("?") ---- */
.helpq { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; margin-left: 12px; vertical-align: middle; border-radius: 50%; border: 2px solid #f2c230; background: rgba(0,0,0,.45); color: #f2c230; cursor: pointer; }
.helpq svg { width: 24px; height: 24px; }
.helpq.panel { border-radius: 10px; width: 46px; height: auto; margin: 0; border: 0; color: #ffd84a; background: none; }
#hud .tbtns .helpq.panel { background: linear-gradient(#3a2414, #22140a); border: 2px solid #000; }
#whatBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#whatBtn svg { width: 22px; height: 22px; }
body.mobile #whatBtn svg { width: 30px; height: 30px; }
#helpBox { z-index: 60; }
#helpBox .helpcard { width: min(860px, 92%); max-height: 94%; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 22px 26px; border-radius: 16px; background: linear-gradient(#3a2414, #22140a); border: 3px solid #000; box-shadow: 0 10px 40px #000; }
#helpBox h3 { margin: 0; font-family: 'Rye', serif; font-size: 30px; color: #ffd24a; text-align: center; }
#helpBox .helplist { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding-right: 6px; touch-action: pan-y; }
#helpBox .hitem { background: rgba(0,0,0,.3); border-radius: 10px; padding: 10px 14px; }
#helpBox .hitem b { color: #ffd84a; font-size: 17px; }
#helpBox .hitem p { margin: 4px 0 0; font-size: 15px; line-height: 1.35; color: #f2e6cc; }
#helpBox .mbtn { align-self: center; min-width: 220px; }
body.mobile .helpq { width: 52px; height: 52px; }
body.mobile .helpq svg { width: 34px; height: 34px; }
body.mobile .helpq.panel { width: 58px; height: auto; }
body.mobile #helpBox .helpcard { width: 96%; max-height: 94%; padding: 18px; }
body.mobile #helpBox h3 { font-size: 40px; }
body.mobile #helpBox .helplist { grid-template-columns: 1fr; }
body.mobile #helpBox .hitem b { font-size: 29px; }
body.mobile #helpBox .hitem p { font-size: 26px; }
body.mobile #helpBox .mbtn { min-width: 320px; font-size: 28px; padding: 14px; }

/* unit roles */
.rolechip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--rc); color: #1a1006; font: 700 12px Oswald, Arial; letter-spacing: .3px; text-transform: uppercase; }
.urole { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.urole span:last-child { opacity: .75; font-size: 14px; }
.uuse { font-size: 14px; line-height: 1.35; color: #e8dcc0; margin-bottom: 6px; }
.sqcard .rolechip { font-size: 10px; padding: 0 6px; white-space: nowrap; margin: 1px 0; }
body.mobile .rolechip { font-size: 18px; padding: 2px 12px; }
body.mobile .sqcard .rolechip { font-size: 14px; padding: 0 8px; }
body.mobile .uuse { font-size: 21px; }
body.mobile .urole span:last-child { font-size: 20px; }
#helpBox .helpintro { margin: 0; font-size: 15px; color: #e8dcc0; text-align: center; }
#helpBox .uitem { display: flex; gap: 12px; align-items: flex-start; }
#helpBox .uitem img { width: 56px; height: 56px; object-fit: contain; flex: none; background: rgba(255,255,255,.05); border-radius: 8px; }
#helpBox .uitem small { opacity: .7; }
#helpBox .uitem.locked img { filter: grayscale(1) brightness(.6); }
.unitsBtn.inh2 { margin-left: 14px; vertical-align: middle; font-size: 15px; padding: 5px 14px; min-width: 0; }
body.mobile #helpBox .helpintro { font-size: 22px; }
body.mobile #helpBox .uitem img { width: 90px; height: 90px; }
body.mobile #helpBox .uitem small { font-size: 21px; }
body.mobile .unitsBtn.inh2 { font-size: 22px; padding: 8px 18px; }

#helpBox .uitem.unseen img { filter: brightness(.25); }
#helpBox .uitem.unseen b { opacity: .6; }
#helpBox .ztip { display: block; font-style: normal; color: #9ae06a; margin-top: 3px; }
#helpBox .hitem.wide { grid-column: 1 / -1; }
.echip { display: inline-block; padding: 0 8px; border-radius: 999px; border: 2px solid var(--ec); color: var(--ec); font-size: 13px; margin: 2px 2px 0 0; }
#helpBox .helprow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#helpBox .helprow .mbtn { min-width: 0; }
#wavePrev .zp { cursor: pointer; }
body.mobile .echip { font-size: 19px; }

/* coach bubble (Grandpa Jeb's first-time tips) */
#coach { position: absolute; z-index: 55; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #fff4d6; color: #2a1406; border: 3px solid #2a1406; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
#coach.hidden { display: none; }
#coach .cface img { width: 64px; height: 64px; object-fit: contain; background: #e8d2a0; border-radius: 50%; border: 2px solid #2a1406; }
#coach .ctext { flex: 1; }
#coach p { margin: 0 0 8px; font-size: 17px; line-height: 1.35; }
#coach .cbtns { display: flex; gap: 14px; align-items: center; }
#coach .cbtns .mbtn { min-width: 110px; }
#coach .cskip { background: none; border: 0; color: #7a5a3a; text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }
#coach .carrow { position: absolute; width: 22px; height: 22px; background: #fff4d6; border: 3px solid #2a1406; transform: translateX(-50%) rotate(45deg); }
#coach.below .carrow { top: -14px; border-right: 0; border-bottom: 0; }
#coach.above .carrow { bottom: -14px; border-left: 0; border-top: 0; }
#coach:not(.below):not(.above) .carrow { display: none; }
.coachmark { outline: 4px solid #ffd84a; outline-offset: 3px; animation: coachpulse 1s ease-in-out infinite; }
@keyframes coachpulse { 50% { outline-color: rgba(255,216,74,.25); } }
body.mobile #coach p { font-size: 26px; }
body.mobile #coach .cface img { width: 96px; height: 96px; }
body.mobile #coach .cbtns .mbtn { font-size: 26px; padding: 10px 26px; }
body.mobile #coach .cskip { font-size: 21px; }

#helpBox .cardview { flex-direction: row; align-items: center; gap: 26px; width: min(760px, 92%); }
#helpBox .cvcard .gcard.cvbig { transform: scale(1.35); transform-origin: center; margin: 40px 34px; pointer-events: none; }
#helpBox .cvtext { flex: 1; display: flex; flex-direction: column; gap: 10px; }
#helpBox .cvtext h3 { text-align: left; }
#helpBox .cvtext p { margin: 0; font-size: 17px; color: #f2e6cc; line-height: 1.4; }
#helpBox .cvtext p.dim { opacity: .65; font-size: 14px; }
#helpBox .cvtext .helprow { justify-content: flex-start; }
.acards .gcard { cursor: pointer; }
#crateHintTxt { margin-top: 10px; font-size: 15px; color: #ffe9a8; opacity: .85; text-align: center; }
body.mobile #helpBox .cvtext p { font-size: 25px; }
body.mobile #helpBox .cvtext p.dim { font-size: 20px; }
body.mobile #crateHintTxt { font-size: 22px; }
body.mobile #helpBox .cvcard .gcard.cvbig { transform: none; margin: 6px; }

#buildMenu .bmq { margin-left: 10px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #f2c230; background: rgba(0,0,0,.4); color: #f2c230; font: 700 16px Oswald, Arial; cursor: pointer; padding: 0; vertical-align: middle; }
#buildMenu .bmtip { font-style: normal; color: #9ae06a; font-size: 12px; }
#helpBox .dico { flex: none; width: 56px; height: 56px; display: grid; place-items: center; background: rgba(255,255,255,.05); border-radius: 8px; }
#helpBox .dico svg { width: 46px; height: 46px; }
body.mobile #buildMenu .bmq { width: 44px; height: 44px; font-size: 26px; }
body.mobile #buildMenu .bmtip { font-size: 18px; }
body.mobile #helpBox .dico { width: 90px; height: 90px; } body.mobile #helpBox .dico svg { width: 72px; height: 72px; }

.sitem .pips em { font-style: normal; margin-left: 8px; font-size: 12px; opacity: .8; }
.sitem .sbuy svg { width: 16px; height: 16px; vertical-align: -2px; margin-right: 3px; }
#resetBtn { opacity: .55; font-size: 13px; padding: 4px 12px; min-width: 0; }
body.mobile .sitem .info > div:not(.pips) { font-size: 20px; }
body.mobile .sitem .pips em { font-size: 19px; }
body.mobile #resetBtn { font-size: 18px; padding: 6px 16px; }
body.mobile #shopList .sitem .info > div:not(.pips) { font-size: 20px; line-height: 1.25; }
body.mobile #shopList .sitem .pips em { font-size: 19px; }

#worldInfo { max-width: 1100px; margin: 4px auto 8px; padding: 6px 14px; border-radius: 10px; background: rgba(0,0,0,.45); font-size: 14px; color: #f2e6cc; text-align: center; }
#worldInfo b { color: #ffd84a; }
#helpBox .wn { color: #ffd84a; font-size: inherit; }
body.mobile #worldInfo { font-size: 21px; max-width: none; margin: 6px 16px 10px; }

body.mobile #howtoList { columns: 1; font-size: 27px; max-width: none; margin: 0 16px; }
#howtoLinks { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 1140px; }
#howtoLinks .mbtn { min-width: 0; }
body.mobile #howtoLinks .mbtn { font-size: 24px; padding: 10px 20px; }

/* menus never cut off their buttons: scroll when taller than the screen; the
   floating back button (top left) is there on every device */
.screen { justify-content: safe center; overflow-y: auto; overflow-x: hidden; }
body:not(.mobile) #mBack { top: 12px; left: 12px; width: 64px; height: 52px; border-radius: 14px; }
body:not(.mobile) #mBack svg { width: 30px; height: 30px; }

/* crypt seal: the part of the crypt bar that cannot be destroyed yet */
.bar { position: relative; }
#hpZseal { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: repeating-linear-gradient(-45deg, rgba(176,255,112,.55) 0 4px, rgba(40,80,20,.55) 4px 8px); border-right: 2px solid #b0ff70; pointer-events: none; transition: width .4s; }
