:root {
  --bg: #1b1430; --panel: #2a2046; --panel2: #372a5c; --line: #4d3d7d; --ink: #fff7e8; --dim: #b9aee0;
  --gold: #ffcf3f; --gold2: #f08c1a; --red: #ff5a52; --green: #5be07a; --blue: #4c9dff;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
h1, h2, .logo { font-family: 'Lilita One', 'Nunito', sans-serif; font-weight: 400; letter-spacing: 1px; margin: 0; }
h2 { font-size: 26px; text-shadow: 0 3px 0 rgba(0,0,0,.35); }

/* ---------- buttons ---------- */
.btn { font: inherit; font-weight: 900; color: var(--ink); background: linear-gradient(#5a4a92, #43357a); border: 3px solid #1a1030; border-radius: 14px; padding: 10px 18px; box-shadow: 0 5px 0 #1a1030, inset 0 2px 0 rgba(255,255,255,.25); cursor: pointer; text-shadow: 0 2px 0 rgba(0,0,0,.4); transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #1a1030, inset 0 2px 0 rgba(255,255,255,.2); }
.btn.big { font-size: 20px; padding: 12px 22px; min-width: 240px; display: block; margin: 10px auto; }
.btn.sm { font-size: 14px; padding: 6px 12px; border-width: 2px; border-radius: 10px; box-shadow: 0 3px 0 #1a1030; }
.btn.gold { background: linear-gradient(#ffd94f, #f59a1d); color: #4a2600; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.danger { background: linear-gradient(#ff6b5f, #c7302a); margin-top: 18px; }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 20; }
.screen.show { display: flex; }
#loading { background: radial-gradient(circle at 50% 40%, #3b2a6a, #140e24); flex-direction: column; z-index: 50; }
.logo { font-size: clamp(44px, 9vw, 92px); color: var(--gold); text-shadow: 0 5px 0 #b3560c, 0 10px 0 #4a2008, 0 14px 30px rgba(0,0,0,.6); -webkit-text-stroke: 2px #4a2008; line-height: 1; text-align: center; }
.logo.big { font-size: clamp(52px, 12vw, 120px); }
.sub { font-family: 'Lilita One'; font-size: clamp(18px, 3vw, 28px); color: #fff; letter-spacing: 6px; text-transform: uppercase; margin: 10px 0 18px; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
.loadbar { width: min(420px, 80vw); height: 18px; border-radius: 10px; background: #0f0a1c; border: 3px solid #000; overflow: hidden; margin-top: 20px; }
#loadfill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd94f, #f59a1d); transition: width .1s; }
#loadtxt { margin-top: 10px; color: var(--dim); }
#menu { background: linear-gradient(90deg, rgba(20,12,40,.75), rgba(20,12,40,.15) 55%, rgba(0,0,0,0)); justify-content: flex-start; }
.menubox { margin-left: max(4vw, 20px); padding: 20px; }
.menufoot { text-align: center; color: var(--dim); margin-top: 18px; font-size: 14px; letter-spacing: 2px; }
.panelscreen { background: rgba(12,8,24,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.panelscreen.dim { background: rgba(12,8,24,.7); }
.panel { background: linear-gradient(var(--panel2), var(--panel)); border: 4px solid #140c26; border-radius: 22px; box-shadow: 0 10px 0 #140c26, 0 20px 50px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.12); padding: 18px 20px; width: min(560px, 94vw); max-height: 92vh; display: flex; flex-direction: column; }
.panel.wide { width: min(1080px, 96vw); }
.panel.small { width: min(400px, 92vw); text-align: center; }
.panel.scroll, .panel .levels, .panel .races, .panel .roster, .howto { overflow-y: auto; }
.phead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.phead > div { min-width: 70px; text-align: right; }
.pfoot { margin-top: 12px; }
.starcount { color: var(--gold); font-size: 18px; }

/* ---------- campaign ---------- */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 40vw), 1fr)); gap: 12px; padding: 4px 4px 10px; }
.lvl { position: relative; border-radius: 16px; border: 3px solid #140c26; padding: 10px; min-height: 118px; cursor: pointer; box-shadow: 0 5px 0 #140c26; overflow: hidden; transition: transform .1s; }
.lvl:hover { transform: translateY(-2px); }
.lvl .num { font-family: 'Lilita One'; font-size: 30px; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.lvl .nm { font-size: 14px; line-height: 1.15; margin-top: 4px; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.lvl .foe { position: absolute; right: 8px; top: 6px; font-size: 26px; }
.lvl .stars { position: absolute; bottom: 8px; left: 10px; font-size: 18px; letter-spacing: 2px; }
.lvl .thm { position: absolute; bottom: 10px; right: 10px; font-size: 11px; opacity: .85; }
.lvl.locked { filter: grayscale(1) brightness(.5); cursor: not-allowed; }
.lvl.locked::after { content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.star.on { color: var(--gold); text-shadow: 0 2px 0 #7a3a00; } .star { color: rgba(0,0,0,.45); }

/* ---------- race select ---------- */
.rs-level { color: var(--dim); margin: -4px 0 10px; font-size: 14px; }
.races { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; flex-shrink: 0; }
.race { border: 3px solid #140c26; border-radius: 14px; padding: 8px 6px; text-align: center; cursor: pointer; background: #2f2552; box-shadow: 0 4px 0 #140c26; transition: transform .1s; }
.race img { width: 100%; max-width: 96px; aspect-ratio: 1; display: block; margin: 0 auto; }
.race .rn { font-family: 'Lilita One'; font-size: 18px; }
.race.sel { background: linear-gradient(#ffd94f, #f59a1d); color: #3a1c00; transform: translateY(-3px); }
.roster { margin-top: 12px; background: rgba(0,0,0,.2); border-radius: 14px; padding: 10px; flex: 1; min-height: 120px; }
.roster .rdesc { color: var(--dim); font-size: 14px; margin-bottom: 8px; }
.roster .rspell { font-size: 14px; margin-bottom: 8px; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ucard { background: #2f2552; border-radius: 12px; padding: 6px; display: flex; gap: 6px; align-items: center; border: 2px solid #140c26; }
.ucard img { width: 46px; height: 46px; }
.ucard .un { font-size: 12px; line-height: 1.1; }
.ucard .tags { font-size: 11px; color: var(--dim); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.form label { color: var(--dim); font-size: 14px; margin-top: 6px; }
.form label.chk { color: var(--ink); display: flex; gap: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-weight: 800; font-size: 14px; padding: 7px 12px; border-radius: 999px; border: 2px solid #140c26; background: #3a2e66; color: var(--ink); cursor: pointer; }
.chip.sel { background: var(--gold); color: #3a1c00; }
input[type=range] { width: 100%; accent-color: var(--gold); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- how to ---------- */
.howto { font-weight: 600; font-size: 15px; line-height: 1.45; padding-right: 6px; }
.howto h3 { font-family: 'Lilita One'; font-weight: 400; color: var(--gold); margin: 14px 0 6px; font-size: 20px; }
.howto b { font-weight: 900; }
table.dmg { border-collapse: collapse; margin: 6px 0; font-size: 14px; }
table.dmg td, table.dmg th { border: 2px solid #140c26; padding: 5px 8px; text-align: center; }
table.dmg th { background: #3a2e66; }
td.good { background: #2f7a3a; } td.bad { background: #8a2f2f; } td.ok { background: #3a3358; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 10px; gap: 8px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.res { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.gold { background: rgba(20,12,40,.82); border: 3px solid #140c26; border-radius: 14px; padding: 4px 12px 4px 8px; font-size: 22px; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 0 #140c26; }
.gold b { color: var(--gold); font-family: 'Lilita One'; font-weight: 400; min-width: 50px; }
.gold.flash b { color: #fff; }
.inc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gold); background: rgba(20,12,40,.7); border-radius: 10px; padding: 2px 8px; }
.tickbar { width: 60px; height: 6px; background: #000; border-radius: 4px; overflow: hidden; }
#tickfill { height: 100%; background: var(--gold); width: 0; }
.rally { background: #b0392e; border-radius: 10px; font-size: 12px; padding: 2px 8px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: brightness(1.4); } }
.castles { display: flex; align-items: center; gap: 8px; background: rgba(20,12,40,.82); border: 3px solid #140c26; border-radius: 14px; padding: 5px 10px; box-shadow: 0 3px 0 #140c26; }
.cbar { display: flex; align-items: center; gap: 6px; font-size: 20px; }
.cbar .hp { width: clamp(70px, 16vw, 190px); height: 14px; background: #000; border-radius: 8px; overflow: hidden; border: 2px solid #000; }
.cbar.me .hp div { background: linear-gradient(#7ee88f, #2fae4a); height: 100%; width: 100%; transition: width .2s; }
.cbar.them .hp div { background: linear-gradient(#ff8a80, #d0342c); height: 100%; width: 100%; transition: width .2s; margin-left: auto; }
.cbar.them .hp { display: flex; justify-content: flex-end; }
.army { font-size: 13px; color: var(--dim); min-width: 26px; text-align: center; }
.clock { font-family: 'Lilita One'; font-size: 16px; color: var(--dim); }
.tbtns { display: flex; gap: 6px; }
#minimap { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: min(420px, 60vw); height: 48px; border-radius: 10px; border: 3px solid #140c26; background: rgba(20,12,40,.6); cursor: pointer; }
.intel { position: absolute; right: 10px; top: 58px; background: rgba(20,12,40,.8); border: 3px solid #140c26; border-radius: 12px; padding: 6px 8px; font-size: 12px; width: 150px; }
.intel .row { display: flex; align-items: center; gap: 5px; margin: 2px 0; }
.intel .bar { flex: 1; height: 7px; background: #000; border-radius: 4px; overflow: hidden; }
.intel .bar div { height: 100%; }
.intel .hint { margin-top: 4px; color: var(--gold); line-height: 1.2; }
.intel .ttl { color: var(--dim); margin-bottom: 2px; cursor: pointer; }
.intel.min .row, .intel.min .sub2 { display: none; }
.intel { cursor: pointer; }
.alert { position: absolute; top: 116px; left: 50%; transform: translateX(-50%); font-family: 'Lilita One'; font-size: 24px; color: #fff; text-shadow: 0 3px 0 #000, 0 0 20px rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.alert.show { opacity: 1; }
.tip { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%); background: rgba(20,12,40,.92); border: 3px solid var(--gold); border-radius: 14px; padding: 10px 14px; max-width: min(520px, 90vw); font-size: 15px; text-align: center; cursor: pointer; }
.tip small { display: block; color: var(--dim); margin-top: 4px; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px calc(8px + var(--safe-b)); pointer-events: none; }
#bottom > * { pointer-events: auto; }
.leftbtns { display: flex; flex-direction: column; gap: 8px; }
.rbtn { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #140c26; background: radial-gradient(circle at 40% 30%, #6a58b0, #33275e); color: #fff; font-size: 28px; box-shadow: 0 4px 0 #140c26; cursor: pointer; overflow: hidden; padding: 0; }
.rbtn .ic { position: relative; z-index: 1; }
.rbtn small { position: absolute; bottom: 3px; right: 10px; font-size: 10px; color: var(--dim); z-index: 1; }
.rbtn .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); height: 0; }
.rbtn.ready { box-shadow: 0 4px 0 #140c26, 0 0 18px var(--gold); background: radial-gradient(circle at 40% 30%, #ffd94f, #f08c1a); }
.rbtn.active { outline: 4px solid #fff; }
.badge { position: absolute; top: 3px; right: 7px; font-family: 'Lilita One'; font-size: 14px; color: var(--gold); z-index: 1; }
.buildbar { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.card { position: relative; flex: 0 0 auto; width: 78px; height: 104px; border-radius: 12px; border: 3px solid #140c26; background: linear-gradient(#4a3c82, #2f2552); box-shadow: 0 4px 0 #140c26; cursor: pointer; padding: 2px; text-align: center; overflow: hidden; }
.card img { width: 64px; height: 64px; display: block; margin: 0 auto; pointer-events: none; }
.card .cn { font-size: 10px; line-height: 1.05; height: 21px; overflow: hidden; }
.card .cost { position: absolute; top: 2px; left: 4px; font-size: 12px; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.card .hk { position: absolute; top: 2px; right: 5px; font-size: 10px; color: var(--dim); }
.card .types { position: absolute; top: 44px; right: 2px; font-size: 13px; line-height: 1; display: flex; flex-direction: column; gap: 1px; }
.card.poor { filter: grayscale(.6) brightness(.75); }
.card.lock { filter: grayscale(1) brightness(.45); }
.card.lock::after { content: attr(data-lock); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; background: rgba(0,0,0,.35); }
.card.sel { border-color: #fff; transform: translateY(-6px); box-shadow: 0 10px 0 #140c26, 0 0 18px var(--gold); }
.card.tier2 { background: linear-gradient(#6a4a9a, #3a2a62); } .card.tier3 { background: linear-gradient(#9a5a3a, #5a2a3a); }
.card.econ { background: linear-gradient(#8a7a2a, #4a3a1a); } .card.tower { background: linear-gradient(#3a6a8a, #22384a); }

.info { position: absolute; right: 10px; bottom: 132px; width: min(340px, 92vw); background: rgba(20,12,40,.93); border: 3px solid #140c26; border-radius: 16px; padding: 10px 12px; font-size: 13px; box-shadow: 0 6px 0 #140c26; }
.info .ih { display: flex; gap: 10px; align-items: center; }
.info img { width: 64px; height: 64px; }
.info .t { font-family: 'Lilita One'; font-size: 20px; line-height: 1.05; }
.info .d { color: var(--dim); font-weight: 600; margin: 4px 0; }
.info .st { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.info .vs { margin-top: 6px; padding-top: 6px; border-top: 2px solid rgba(255,255,255,.1); }
.info .vs .g { color: var(--green); } .info .vs .b { color: var(--red); }
.info .acts { display: flex; gap: 8px; margin-top: 8px; }
.info .close { position: absolute; top: 6px; right: 8px; font-size: 18px; cursor: pointer; color: var(--dim); }
.info .prog { height: 6px; background: #000; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.info .prog div { height: 100%; background: var(--gold); }

.castlepanel { position: absolute; left: 80px; bottom: 124px; width: min(330px, 80vw); background: rgba(20,12,40,.95); border: 3px solid #140c26; border-radius: 16px; padding: 10px 12px; font-size: 13px; box-shadow: 0 6px 0 #140c26; }
.castlepanel h3 { font-family: 'Lilita One'; font-weight: 400; margin: 0 0 6px; font-size: 20px; }
.castlepanel .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
.castlepanel .row div { line-height: 1.2; }
.castlepanel small { color: var(--dim); font-weight: 600; display: block; }
.castlepanel .btn { white-space: nowrap; }

#floats { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.float { position: absolute; left: 0; top: 0; font-family: 'Lilita One'; font-size: 16px; text-shadow: 0 2px 0 #000; white-space: nowrap; }

.bigstars { font-size: 52px; margin: 8px 0; letter-spacing: 6px; }
.bigstars .star { display: inline-block; animation: pop .5s both; }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
#end-title { font-size: 54px; color: var(--gold); text-shadow: 0 4px 0 #7a3a00, 0 8px 20px #000; }
#end-title.lose { color: #ff8a80; text-shadow: 0 4px 0 #5a1010; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; text-align: left; margin: 10px auto; font-size: 15px; width: 80%; }
.stats span:nth-child(even) { color: var(--gold); text-align: right; }
.endbtns .btn.big { min-width: 200px; }

.rotate { display: none; position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--dim); z-index: 30; pointer-events: none; }

/* ---------- mobile / small ---------- */
@media (max-width: 760px), (max-height: 520px) {
  .races { grid-template-columns: repeat(3, 1fr); }
  .race img { max-width: 64px; }
  .card { width: 64px; height: 90px; }
  .card img { width: 52px; height: 52px; }
  .card .types { top: 36px; font-size: 11px; }
  .rbtn { width: 54px; height: 54px; font-size: 24px; }
  .info { bottom: 112px; font-size: 12px; }
  .intel { top: 104px; width: 130px; font-size: 11px; }
  #minimap { top: 54px; height: 40px; }
  .gold { font-size: 18px; }
  .castles { padding: 3px 6px; }
  .cbar { font-size: 16px; }
  .castlepanel { left: 66px; bottom: 104px; }
  .tip { bottom: 130px; font-size: 13px; }
}
@media (max-width: 600px) {
  #topbar { flex-wrap: wrap; row-gap: 4px; }
  .res { min-width: 0; }
  .castles { order: 3; width: 100%; justify-content: center; }
  #minimap { top: 122px; width: 94vw; }
  .intel { top: 170px; }
  .alert { top: 230px; font-size: 18px; }
  .menubox { margin: 0 auto; }
  #menu { background: rgba(20,12,40,.45); justify-content: center; }
}
@media (max-height: 460px) {
  .intel { display: none; }
  #minimap { height: 34px; }
}
@media (orientation: portrait) and (max-width: 600px) { .rotate { display: block; } }
@media (max-height: 420px) {
  .card { width: 56px; height: 80px; }
  .card img { width: 44px; height: 44px; }
  .card .types { top: 30px; }
  .card .cn { font-size: 9px; }
  .rbtn { width: 46px; height: 46px; font-size: 20px; }
  .leftbtns { gap: 4px; }
  .info { bottom: 92px; max-height: calc(100vh - 150px); overflow-y: auto; }
  .castlepanel { bottom: 60px; left: 60px; }
  .tip { bottom: 96px; }
}

/* ============================================================
   MOBILE-FIRST PORTRAIT HUD (Android / phones held upright)
   #hud gets class .pt when the screen is taller than wide
   ============================================================ */
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
button, .card, .chip, .lvl, .race { touch-action: manipulation; -webkit-touch-callout: none; }
.panel { max-height: calc(100dvh - 24px); }
.btn.big { min-width: min(280px, 82vw); }
#hud { --top: 96px; --tray: 190px; }
#hud.pt #topbar { flex-wrap: wrap; padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 0; gap: 6px; }
#hud.pt .res { flex-direction: row; align-items: center; gap: 6px; min-width: 0; order: 1; flex-wrap: wrap; }
#hud.pt .gold { font-size: 20px; padding: 3px 10px 3px 6px; }
#hud.pt .gold b { min-width: 42px; }
#hud.pt .inc { font-size: 12px; padding: 4px 8px; }
#hud.pt .tickbar { width: 38px; }
#hud.pt .rally { font-size: 11px; }
#hud.pt .tbtns { order: 2; margin-left: auto; }
#hud.pt .tbtns .btn { min-width: 46px; min-height: 42px; font-size: 16px; }
#hud.pt .castles { order: 3; width: 100%; justify-content: space-between; padding: 4px 8px; }
#hud.pt .cbar { font-size: 18px; }
#hud.pt .cbar .hp { width: calc(50vw - 96px); height: 13px; }
#hud.pt #minimap { top: calc(var(--top) + 8px); left: 6px; transform: none; width: 30px; height: calc(100% - var(--top) - var(--tray) - 28px); max-height: 360px; }
#hud.pt .intel { display: block; top: calc(var(--top) + 8px); right: 8px; width: auto; max-width: 64vw; font-size: 12px; }
#hud.pt .alert { top: calc(var(--top) + 64px); font-size: 19px; white-space: normal; text-align: center; width: 88vw; }
#hud.pt #bottom { flex-direction: column; align-items: stretch; gap: 0; padding: 18px 6px calc(6px + var(--safe-b)); background: linear-gradient(rgba(20,12,40,0), rgba(20,12,40,.88) 22%); pointer-events: auto; }
#hud.pt .leftbtns { position: absolute; right: 10px; bottom: calc(100% + 4px); flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
#hud.pt .rbtn { width: 64px; height: 64px; font-size: 28px; }
#hud.pt .rbtn.castle { width: 54px; height: 54px; font-size: 24px; }
#hud.pt .rbtn small { display: none; }
#hud.pt .buildbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; overflow: visible; padding: 0; }
#hud.pt .card { width: auto; height: auto; aspect-ratio: 0.8; border-radius: 12px; padding: 2px 1px; }
#hud.pt .card img { width: 80%; height: auto; aspect-ratio: 1; }
#hud.pt .card .cn { font-size: 10px; height: 22px; }
#hud.pt .card .hk { display: none; }
#hud.pt .card .types { top: 34%; font-size: 12px; }
#hud.pt .card.sel { transform: translateY(-5px); }
#hud.pt .info { left: 8px; right: 82px; width: auto; bottom: calc(var(--tray) + 8px); max-height: calc(100% - var(--tray) - var(--top) - 70px); overflow-y: auto; font-size: 12.5px; padding: 8px 10px; }
#hud.pt .info img { width: 52px; height: 52px; }
#hud.pt .info .t { font-size: 18px; }
#hud.pt .info .btn.sm { min-height: 40px; }
#hud.pt .castlepanel { left: 8px; right: 82px; width: auto; bottom: calc(var(--tray) + 8px); }
#hud.pt .castlepanel .btn.sm { min-height: 40px; min-width: 76px; }
#hud.pt .tip { bottom: calc(var(--tray) + 12px); left: 8px; right: 82px; transform: none; max-width: none; font-size: 13px; }
.card.press { transform: scale(.94); }
@media (hover: none) { .btn:hover { filter: none; } }

.info.compact { padding: 6px 8px; }
.info .ih.mini img { width: 48px; height: 48px; }
.info .ih.mini .t { font-size: 17px; }
.minibtns { display: flex; flex-direction: column; gap: 6px; }
.minibtns .btn.sm { min-width: 40px; min-height: 36px; padding: 4px 8px; }

@media (max-width: 600px) { .lvl { min-height: 104px; } .lvl .nm { font-size: 13px; } }
