/* Player cabinet (/cabinet): the game's toy style (style.css) on one screen. Desktop first: 1265x650 without scroll. */
@font-face { font-family: Exo2; font-weight: 500 800; font-display: swap; src: url(/fonts/exo2-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Exo2; font-weight: 500 800; font-display: swap; src: url(/fonts/exo2-lat.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212; }
:root {
  --brown: #5a2812; --cream: #fff6dc; --cream2: #ffe7a8; --muted: #8a5a3a;
  --orange: linear-gradient(180deg, #ffe05a 0%, #ffb02e 45%, #ff7a1a 100%);
  --orangeHi: linear-gradient(180deg, #fff07a 0%, #ffc03e 45%, #ff8a2a 100%);
  --edge: 0 5px 0 var(--brown), 0 10px 20px rgba(0,0,0,.22);
  --shine: inset 0 3px 0 rgba(255,255,255,.6);
  --outline: 0 3px 0 var(--brown), 2px 0 0 var(--brown), -2px 0 0 var(--brown), 0 -2px 0 var(--brown), 2px 2px 0 var(--brown), -2px 2px 0 var(--brown);
  --gap: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; font: 700 14px/1.3 Exo2, system-ui, "Segoe UI", sans-serif; color: var(--brown);
  background: #bfe3f6 url(/img/cab-bg.webp) center / cover no-repeat; }
body::before { content: ""; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(255,248,225,.35), rgba(255,240,200,.15)); pointer-events: none; }
.hidden { display: none !important; }
small { font-size: 12px; color: var(--muted); font-weight: 700; }

.plaque { position: relative; background: linear-gradient(180deg, #fffaf0 0%, var(--cream) 55%, var(--cream2) 100%);
  border: 4px solid var(--brown); box-shadow: var(--edge), var(--shine); border-radius: 22px; }
button { font: inherit; font-weight: 800; color: var(--brown); cursor: pointer; user-select: none; border: 3px solid var(--brown); border-radius: 14px; padding: 6px 14px;
  background: linear-gradient(180deg, #fffaf0, var(--cream2)); box-shadow: 0 4px 0 var(--brown), var(--shine); transition: box-shadow .12s, background .12s; white-space: nowrap; }
button:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff, #fff0c4); box-shadow: 0 4px 0 var(--brown), var(--shine), 0 6px 16px rgba(90,40,18,.25); }
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--brown), var(--shine); }
button:disabled { opacity: .45; cursor: default; }
button.primary, button.on { background: var(--orange); color: #fff; text-shadow: var(--outline); }
button.primary:hover:not(:disabled), button.on:hover:not(:disabled) { background: var(--orangeHi); }
button.chip { padding: 4px 14px; border-radius: 999px; font-size: 13px; }
.knob { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 19px; flex: none; }
.coinTag { display: inline-flex; align-items: center; gap: 3px; }
.coinTag img { width: 17px; height: 17px; object-fit: contain; margin: -3px 0; }
.err { color: #c3123a; min-height: 1.2em; margin: 0; }

/* ---------- login ---------- */
#auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 2; }
.authCard { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.authLogo { height: clamp(120px, 34vh, 250px); max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0,0,0,.3)); }
.authCard h1 { margin: -4px 0 4px; font-size: 24px; color: #fff; text-shadow: var(--outline); }
#authForm { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 24px;
  background: linear-gradient(180deg, #fffaf0 0%, var(--cream) 60%, var(--cream2) 100%); border: 4px solid var(--brown); box-shadow: var(--edge), var(--shine); }
#authForm input { font: inherit; font-weight: 800; padding: 10px 16px; border-radius: 999px; border: 3px solid var(--brown); background: #fff; color: var(--brown); text-align: center; }
.authBtns { display: flex; gap: 8px; }
.authBtns button { flex: 1; font-size: 16px; padding: 9px 10px; }
.back { color: #fff; text-shadow: var(--outline); text-decoration: none; font-weight: 800; }

/* ---------- one-screen layout ---------- */
#app { position: relative; height: 100vh; display: flex; flex-direction: column; gap: var(--gap); padding: 12px 18px 20px; max-width: 1500px; margin: 0 auto; }
#top { flex: none; height: 66px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 8px; }
#top .logo img { height: 74px; margin: -14px 0 -10px; display: block; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.who { min-width: 0; }
.who .nick { font-size: 21px; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.who .lvl { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.xpbar { width: 130px; height: 10px; border-radius: 6px; background: #f3dca4; box-shadow: inset 0 0 0 2px var(--brown); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4be06b, #b6f05a); box-shadow: inset 0 0 0 2px var(--brown); transition: width .4s; }
.grow { flex: 1; }
.stat { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 6px; border-radius: 999px; background: rgba(90,40,18,.08); }
.stat img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat.coins { padding-right: 4px; }
.stat .plus { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; margin-left: 4px; }

main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); }
#left { min-height: 0; display: flex; flex-direction: column; padding: 12px 14px 14px; }
#tabs { display: flex; gap: 8px; margin-bottom: 12px; }
#tabs button { font-size: 16px; padding: 6px 20px; border-radius: 999px; }
.tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* pig portrait: one drawn pig, colour overlay masked by its own shape, hat on top */
.ppw { container-type: size; flex: 1; min-height: 0; width: 100%; padding-top: 12%; display: flex; align-items: flex-end; justify-content: center; }
.pp { position: relative; aspect-ratio: 480 / 410; width: min(100cqw, calc(100cqh * 480 / 410)); flex: none; }
.pp > img.body { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pp > .tint { position: absolute; inset: 0; -webkit-mask: url(/img/cab-pig.webp) center / contain no-repeat; mask: url(/img/cab-pig.webp) center / contain no-repeat; pointer-events: none; }
.pp.skin-spotted > .tint { mix-blend-mode: multiply; background:
  radial-gradient(circle at 30% 24%, #9a5a3a 0 6%, transparent 6.5%), radial-gradient(circle at 70% 32%, #9a5a3a 0 8%, transparent 8.5%),
  radial-gradient(circle at 40% 52%, #9a5a3a 0 4.5%, transparent 5%), radial-gradient(circle at 78% 58%, #9a5a3a 0 5%, transparent 5.5%),
  radial-gradient(circle at 22% 62%, #9a5a3a 0 4%, transparent 4.5%), radial-gradient(circle at 58% 12%, #9a5a3a 0 4%, transparent 4.5%); }
.pp.skin-choco > .tint { mix-blend-mode: multiply; background: linear-gradient(180deg, #b0703f 0 68%, transparent 73%); }
.pp.skin-gold > .tint { mix-blend-mode: color; background: linear-gradient(180deg, #ffc61a 0 68%, transparent 73%); }
.pp.skin-gold > img.body { filter: brightness(1.08) saturate(1.2); }
.pp > img.hat { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.pp > img.hat-helmet { top: -18%; width: 52%; transform: translateX(-49%); }
.pp > img.hat-beret { top: -13%; width: 44%; transform: translateX(-40%) rotate(-8deg); }
.pp > img.hat-straw { top: -17%; width: 64%; }

/* brigade: 10 tiles, 5 x 2 */
#pigGrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px 6px 8px; border-radius: 18px; cursor: pointer;
  background: rgba(255,255,255,.55); border: 3px solid transparent; transition: box-shadow .15s; text-align: center; }
.tile:hover { box-shadow: 0 6px 16px rgba(90,40,18,.22); }
.tile.sel { border-color: var(--brown); background: #fff; box-shadow: 0 4px 0 var(--brown); }
.tile .nm { font-size: 15px; font-weight: 800; line-height: 1.15; }
.tile .sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; }
.tile .arm { display: inline-flex; align-items: center; gap: 1px; }
.tile .arm img { width: 18px; height: 18px; object-fit: contain; }
.tile .flag { position: absolute; top: 6px; left: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 var(--brown), 1px 0 0 var(--brown), -1px 0 0 var(--brown), 0 -1px 0 var(--brown);
  background: var(--orange); box-shadow: 0 0 0 2px var(--brown); }
.tile.locked { cursor: default; background: rgba(255,255,255,.3); }
.tile.locked .ppw { filter: brightness(0) opacity(.18); }
.tile.locked button { font-size: 13px; padding: 4px 10px; }
.tile.locked .nm { color: var(--muted); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; }
.foot .hint { color: var(--muted); font-size: 12px; }
#squadTxt.bad { color: #c3123a; }

/* shop: 2 x 2 boxes */
.shopGrid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.box { min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 18px; background: rgba(255,255,255,.55); }
.box h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.box h3 small { font-weight: 700; }
.items { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.item { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 4px 4px 6px; border-radius: 14px; text-align: center; background: rgba(255,246,220,.8); }
.item .ic { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; }
.item .ic > img { position: absolute; inset: 0; margin: auto; max-width: 78%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); }
.item .t { font-size: 13px; font-weight: 800; line-height: 1.1; }
.item .d { font-size: 11px; color: var(--muted); line-height: 1.15; }
.item button { font-size: 12px; padding: 3px 10px; border-width: 2.5px; box-shadow: 0 3px 0 var(--brown), var(--shine); }
.item.have { background: #fff; box-shadow: inset 0 0 0 3px #4bbf5e; }
.item .ok { font-size: 12px; color: #2e8c3e; font-weight: 800; padding: 4px 0; }
.item.soon { opacity: .55; }
.item.soon .ic img { filter: grayscale(.8); }
.look { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.look .row { flex: 1; min-height: 0; display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 6px; align-items: stretch; }
.look .lbl { align-self: center; font-size: 13px; color: var(--muted); }
.look .item { padding: 3px 3px 5px; gap: 2px; }
.look .item .t { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.look .item .ok { padding: 2px 0; }
.item .ic .ppw { padding-top: 0; }
.look .item .col { display: contents; }
.boxText { font-size: 12px; color: var(--muted); line-height: 1.25; }
.stock { font-size: 12px; color: var(--brown); }
.btns2 { display: flex; gap: 4px; }

/* rating */
#tab-rating { overflow: hidden; }
#rateTbl { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; }
#rateTbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 12px 2px; }
#rateTbl td { padding: 6px 12px; background: rgba(255,255,255,.6); }
#rateTbl td:first-child { border-radius: 12px 0 0 12px; width: 70px; font-weight: 800; }
#rateTbl td:last-child { border-radius: 0 12px 12px 0; }
#rateTbl td.num, #rateTbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
#rateTbl tr.me td { background: var(--orange); color: #fff; text-shadow: 0 1px 0 var(--brown), 1px 0 0 var(--brown), -1px 0 0 var(--brown), 0 -1px 0 var(--brown); }
#rateTbl tr.gap td { background: none; padding: 0 12px; color: var(--muted); line-height: .6; }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; color: #fff; box-shadow: 0 0 0 2px var(--brown); text-shadow: 0 1px 0 var(--brown); }
.m1 { background: #ffc61a; } .m2 { background: #c9d3de; } .m3 { background: #d98a4a; }

/* right column: chosen pig, stats, big В БОЙ */
#right { min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
#pigCard { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px 12px; text-align: center; }
#pigCard .name { display: flex; gap: 6px; align-items: center; justify-content: center; width: 100%; }
#pigCard .name input { font: inherit; font-size: 20px; font-weight: 800; color: var(--brown); text-align: center; width: 170px; padding: 2px 8px; border-radius: 12px; border: 3px solid transparent; background: transparent; }
#pigCard .name input:hover, #pigCard .name input:focus { border-color: var(--brown); background: #fff; outline: none; }
#pigCard .facts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; font-size: 13px; }
#pigCard .facts span { padding: 2px 10px; border-radius: 999px; background: rgba(90,40,18,.08); }
#pigCard .act { display: flex; gap: 8px; }
#stats { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px 10px; text-align: center; }
#stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
#stats span { font-size: 11px; color: var(--muted); }
#stats .last { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
a.go { flex: none; display: grid; place-items: center; height: 74px; border-radius: 26px; text-decoration: none; font-size: 32px; font-weight: 800; color: #fff; letter-spacing: .5px;
  text-shadow: var(--outline); background: var(--orange); border: 4px solid var(--brown); box-shadow: 0 7px 0 var(--brown), 0 14px 26px rgba(0,0,0,.3), var(--shine); transition: box-shadow .12s; }
a.go:hover { background: var(--orangeHi); box-shadow: 0 7px 0 var(--brown), 0 16px 32px rgba(0,0,0,.38), var(--shine); }
a.go:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--brown), var(--shine); }
a.go.off { filter: grayscale(.6); opacity: .7; pointer-events: none; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(40,25,10,.35); backdrop-filter: blur(3px); }
.card { width: min(430px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; border-radius: 26px;
  background: linear-gradient(180deg, #fffaf0 0%, var(--cream) 60%, var(--cream2) 100%); border: 5px solid var(--brown); box-shadow: 0 8px 0 var(--brown), 0 20px 40px rgba(0,0,0,.35), var(--shine); }
.card.wide { width: min(720px, 100%); }
.card h2 { margin: 0; font-size: 26px; color: #fff; text-shadow: var(--outline); }
.card table { border-collapse: separate; border-spacing: 0 3px; font-size: 13px; }
.card td { padding: 3px 8px; vertical-align: top; font-weight: 600; }
.card td:first-child { font-weight: 800; white-space: nowrap; }
.testNote { padding: 10px 14px; border-radius: 14px; background: #fff; font-size: 14px; box-shadow: inset 0 0 0 3px #ffb02e; }
#packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; }
.pack img { width: 44px; height: 44px; object-fit: contain; }
.pack b { font-size: 20px; }
.pack i { font-style: normal; font-size: 11px; font-weight: 800; color: #2f8a3e; }
.pack span { font-size: 14px; font-weight: 800; color: var(--muted); }
.custom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.custom label { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.custom input { width: 130px; padding: 8px 12px; border-radius: 12px; border: 3px solid var(--brown); font: inherit; font-weight: 800; background: #fff; }
#customEur { font-weight: 800; color: var(--muted); min-width: 70px; }
button.big { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 20px; padding: 10px 16px; }
button.big img { width: 34px; height: 34px; object-fit: contain; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 20; padding: 8px 22px; border-radius: 999px; font-weight: 800;
  background: var(--cream); border: 3px solid var(--brown); box-shadow: var(--edge); }
#toast.bad { background: #ffe1e1; }
/* language / currency (js/i18n.js + js/currency.js): pill in the top bar, round knob on the login screen, currency row in the coin shop */
.authLoc { position: fixed; top: 16px; right: 16px; z-index: 3; }
.curRow { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.curRow .hr-loc { height: 32px; }

/* big screens: the same layout scaled up (designed at 1265x650), so tiles do not turn into tall empty columns */
@media (min-width: 1500px) and (min-height: 820px) { #app { zoom: 1.3; height: calc(100vh / 1.3); } }
@media (min-width: 1800px) and (min-height: 1000px) { #app { zoom: 1.45; height: calc(100vh / 1.45); } }
