:root {
  --bg: #0a0a0c;
  --accent: #ff3e3e;
  --gold: #ffcc00;
  --text: #ffffff;
  --card: rgba(18, 18, 20, 0.80);
  --radius: 28px;
  --win: #4cd964;
  --lose: #ff3e3e;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 34px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  height: 100dvh;
  width: 100vw;
}

.coin-icon { width: 1.1em; height: 1.1em; vertical-align: middle; display: inline-block; object-fit: contain; margin-bottom: 2px; }
.acorn-icon { width: 1em; height: 1em; vertical-align: middle; display: inline-block; object-fit: contain; margin-bottom: 2px; }

.game-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: -2; transition: filter 0.5s ease, transform 0.5s ease; }
#bg-main      { background-image: url('../assets/main_menu.png'); background-color: #1a1a1a; }
#bg-fight     { background-image: url('../assets/fight_field.png'); background-color: #000; display: none; }
#bg-inventory { background-image: url('../assets/inventory.png'); background-color: #0a0a0c; display: none; }
#bg-shop      { background-image: url('../assets/shop.png'); background-color: #0a0a0c; display: none; }
#bg-farm      { background-image: url('../assets/farm.png'); background-color: #1a2a1a; display: none; }
#bg-mine      { background-image: url('../assets/mine.png'); background-color: #1a1a2a; display: none; }
#bg-forest    { background-image: url('../assets/forest.png'); background-color: #0d1f0d; display: none; }

.bg-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.45); z-index: -1; opacity: 0; transition: opacity 0.4s ease; pointer-events: none; backdrop-filter: blur(0px); }
body.dimmed .bg-overlay { opacity: 1; backdrop-filter: blur(18px); pointer-events: auto; }
body.dimmed .game-bg    { filter: brightness(0.7); transform: scale(1.05); }

.screen { display: none; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 24px; padding-top: calc(20px + var(--safe-top)); padding-bottom: calc(20px + var(--safe-bottom)); box-sizing: border-box; position: absolute; top: 0; left: 0; overflow-y: auto; }
.active { display: flex; animation: screenIn 0.4s forwards; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

#balance-header { position: fixed; top: calc(12px + var(--safe-top)); left: calc(16px + var(--safe-left)); background: rgba(0,0,0,0.5); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); padding: 10px 16px; border-radius: 100px; font-weight: 800; color: var(--gold); z-index: 1000; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); font-size: 0.95rem; }
#balance-header .sep { opacity: 0.3; font-weight: 400; }
#acorns-val { color: #c8a96e; }

#bet-deduction-notify { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(-10px); background: rgba(255,62,62,0.95); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 100px; font-weight: 800; color: #fff; font-size: 0.85rem; white-space: nowrap; opacity: 0; visibility: hidden; z-index: 999; transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; display: flex; align-items: center; gap: 4px; }
#bet-deduction-notify.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(25px); }

.notification-toast { position: fixed; top: calc(12px + var(--safe-top)); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.15); padding: 12px 24px; border-radius: 20px; color: white; font-weight: 700; font-size: 0.9rem; z-index: 6000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; box-shadow: 0 4px 20px rgba(0,0,0,0.4); text-align: center; max-width: 80%; }
.notification-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(40px); }

#rank-trigger, #profile-trigger { position: fixed; bottom: calc(20px + var(--safe-bottom)); width: 68px; height: 68px; background: rgba(30,30,34,0.85); border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3000; box-shadow: 0 10px 30px rgba(0,0,0,0.6); backdrop-filter: blur(10px); transition: transform 0.2s, opacity 0.2s; }
#rank-trigger:active, #profile-trigger:active { transform: scale(0.92); }
#rank-trigger span { font-size: 1.8rem; }
#profile-trigger img { width: 80%; height: 80%; border-radius: 50%; object-fit: cover; }
#profile-trigger { right: calc(16px + var(--safe-right)); }
#rank-trigger    { right: calc(16px + 68px + 16px + var(--safe-right)); }
body:not(.show-main-screen) #rank-trigger, body:not(.show-main-screen) #profile-trigger { display: none; }
body.show-main-screen #rank-trigger, body.show-main-screen #profile-trigger { display: flex; }

.menu-buttons { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 16px; margin-bottom: var(--safe-bottom); }

.btn-wood { background: #252528; border: 1px solid rgba(255,255,255,0.08); color: #fff; padding: 18px; border-radius: 20px; font-weight: 800; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1.2px; cursor: pointer; transition: var(--transition); text-align: center; box-shadow: 0 4px 0px #151517; position: relative; top: 0; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn-wood:active  { top: 2px; box-shadow: 0 1px 0px #151517; background: #2a2a2d; }
.btn-wood:disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; box-shadow: none; top: 0; }
.btn-play { background: var(--gold); color: #000; border: none; box-shadow: 0 4px 0px #cca300; }
.btn-play:active { background: #e6b800; box-shadow: 0 1px 0px #cca300; }

.card { background: var(--card); padding: 32px 24px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.12); width: 100%; max-width: 340px; backdrop-filter: blur(30px); box-shadow: 0 25px 50px rgba(0,0,0,0.5); transform-origin: center bottom; animation: cardPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); position: relative; }
@keyframes cardPop { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.stat-item { background: rgba(255,255,255,0.04); padding: 16px; border-radius: 20px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
.stat-val { font-size: 1.2rem; font-weight: 900; display: block; margin-bottom: 4px; }
.stat-lbl { font-size: 0.7rem; opacity: 0.4; text-transform: uppercase; font-weight: 700; }

input[type="number"], input[type="text"] { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 20px; border-radius: 18px; width: 100%; box-sizing: border-box; font-size: 1.2rem; text-align: center; margin-bottom: 16px; font-weight: 700; outline: none; transition: border-color 0.2s; }
input:focus   { border-color: var(--gold); }
input:disabled { opacity: 0.5; cursor: not-allowed; }

.arena { position: absolute; bottom: 25%; width: 100%; display: flex; justify-content: space-around; align-items: flex-end; perspective: 1000px; padding-bottom: var(--safe-bottom); }
.boar-container { width: 38%; display: flex; flex-direction: column; align-items: center; gap: 20px; position: relative; }
.boar-container.hit { animation: flashRed 0.25s ease-out; }
@keyframes flashRed { 0% { filter: brightness(1); } 50% { filter: brightness(1.8) sepia(0.3) saturate(2); transform: scale(1.1) rotate(2deg); } 100% { filter: brightness(1); } }
.dmg-popup { position: absolute; top: -40px; color: #ff3e3e; font-size: 2.2rem; font-weight: 900; text-shadow: 0 4px 12px rgba(0,0,0,0.9); pointer-events: none; animation: flyUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; z-index: 100; }
@keyframes flyUp { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 30% { opacity: 1; transform: translateY(-20px) scale(1.3); } 100% { opacity: 0; transform: translateY(-90px) scale(1); } }
.hp-bar-box { width: 100%; max-width: 130px; }
.hp-bar { width: 100%; background: rgba(255,255,255,0.1); height: 8px; border-radius: 12px; overflow: hidden; position: relative; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
.hp-fill { height: 100%; background: linear-gradient(90deg, #4cd964, #a0ffaf); transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1); width: 100%; }
.hp-txt { color: #fff; font-size: 1.2rem; font-weight: 900; text-align: center; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.boar-unit { width: 100%; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6)); }
.boar-unit img { width: 100%; height: auto; display: block; image-rendering: pixelated; }

#fight-log { position: absolute; bottom: calc(15% + var(--safe-bottom)); background: rgba(0,0,0,0.6); backdrop-filter: blur(12px); padding: 12px 28px; border-radius: 100px; font-weight: 700; font-size: 0.9rem; color: #fff; border: 1px solid rgba(255,255,255,0.15); z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,0.5); max-width: 80%; text-align: center; }

#result-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 5000; display: none; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(16px); padding: 24px; padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); padding-left: calc(24px + var(--safe-left)); padding-right: calc(24px + var(--safe-right)); box-sizing: border-box; overflow-y: auto; }
#result-card { background: var(--card); width: 100%; max-width: 320px; border-radius: 40px; padding: 40px 24px; text-align: center; border: 1px solid rgba(255,255,255,0.15); transform: translateY(60px) scale(0.9); opacity: 0; transition: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28); box-shadow: 0 40px 80px rgba(0,0,0,0.9); position: relative; margin: auto; display: flex; flex-direction: column; align-items: center; }
#result-card.active { transform: translateY(0) scale(1); opacity: 1; }
.res-icon  { font-size: 5rem; margin-bottom: 20px; display: block; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3)); }
.res-title { font-size: 2.2rem; font-weight: 900; text-transform: uppercase; margin: 0 0 12px; word-break: break-word; line-height: 1; }
.res-sum   { font-size: 1.6rem; font-weight: 800; opacity: 0.9; margin-bottom: 30px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.res-btn   { background: #fff; color: #000; border: none; padding: 18px 0; width: 100%; border-radius: 20px; font-weight: 900; font-size: 1.1rem; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 30px rgba(255,255,255,0.15); transition: transform 0.2s; display: flex; align-items: center; justify-content: center; }
.res-btn:active { transform: scale(0.96); }
.close-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; background: rgba(255,255,255,0.08); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; color: rgba(255,255,255,0.6); font-size: 24px; line-height: 1; cursor: pointer; transition: background 0.2s; }
.close-x:active { background: rgba(255,255,255,0.2); }

.rank-item { display: flex; justify-content: space-between; align-items: center; padding: 18px; background: rgba(255,255,255,0.04); border-radius: 20px; margin-bottom: 12px; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s; }
.rank-item:active { transform: scale(0.97); background: rgba(255,255,255,0.08); }
.rank-item.current-user-highlight { outline: 2px solid var(--gold); outline-offset: -2px; }
#your-rank { font-size: 0.9rem; opacity: 0.7; margin-bottom: 16px; text-align: center; font-weight: 700; }
.lb-last-seen { font-size: 0.65rem; opacity: 0.4; font-weight: 600; }
.lb-values { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lb-value-row { display: flex; align-items: center; gap: 4px; font-weight: 900; }
.lb-val-gold  { color: var(--gold); display: flex; align-items: center; gap: 3px; }
.lb-val-acorn { color: #c8a96e; display: flex; align-items: center; gap: 3px; }

#user-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 4000; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; backdrop-filter: blur(15px); padding-bottom: calc(24px + var(--safe-bottom)); }

.toggle-switch { position: relative; display: inline-block; width: 120px; height: 40px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--lose); transition: background-color 0.4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 32px; width: 32px; left: 4px; bottom: 4px; background-color: #fff; transition: transform 0.4s; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
input:checked + .slider { background-color: var(--win); }
input:checked + .slider:before { transform: translateX(76px); }

.bet-btn-row { display: flex; gap: 10px; margin-bottom: 10px; }
.bet-btn-row .btn-wood { flex: 1; }
.btn-random { background: #d9453b; color: #fff; border: none; box-shadow: 0 4px 0px #a83028; width: 100%; margin-bottom: 10px; }
.btn-random:active { background: #c23c33; box-shadow: 0 1px 0px #a83028; }

.btn-watch-fight { background: #1c3a1e; border: 1.5px solid rgba(76,217,100,0.5); color: #fff; width: 100%; padding: 14px 18px; border-radius: 20px; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.8px; cursor: pointer; transition: var(--transition); text-align: center; box-shadow: 0 4px 0px #0f2210, 0 0 20px rgba(76,217,100,0.2); position: relative; top: 0; user-select: none; -webkit-tap-highlight-color: transparent; line-height: 1.4; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-watch-fight:active { top: 2px; box-shadow: 0 1px 0px #0f2210; background: #243f26; }
.btn-watch-fight.on-cooldown { background: #1e1e21; border-color: rgba(255,255,255,0.08); box-shadow: 0 4px 0px #111113; opacity: 0.75; }
.watch-reward-line { display: flex; align-items: center; gap: 4px; color: #4cd964; font-size: 0.95rem; font-weight: 900; }
.watch-timer-line  { color: rgba(255,255,255,0.5); font-size: 0.75rem; font-weight: 600; }

/* ── МАГАЗИН ── */
#scr-shop .screen-card { background: var(--card); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.12); width: 100%; max-width: 340px; backdrop-filter: blur(30px); box-shadow: 0 25px 50px rgba(0,0,0,0.5); display: flex; flex-direction: column; justify-content: space-between; max-height: calc(100dvh - 80px); overflow: hidden; padding: 20px 16px 16px; box-sizing: border-box; animation: cardPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.shop-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-shrink: 0; }
.shop-header h3 { margin: 0; font-size: 1.3rem; }
.shop-toggle-wrap { display: flex; align-items: center; gap: 0; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; padding: 3px; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.shop-toggle-thumb { position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); border-radius: 20px; background: rgba(76,217,100,0.15); border: 1.5px solid rgba(76,217,100,0.55); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s ease, border-color 0.35s ease; z-index: 0; pointer-events: none; }
.shop-toggle-wrap.sell-mode .shop-toggle-thumb { background: rgba(255,62,62,0.15); border-color: rgba(255,62,62,0.55); }
.shop-toggle-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 12px; border-radius: 20px; z-index: 1; position: relative; transition: color 0.3s ease; white-space: nowrap; pointer-events: none; }
.shop-toggle-label.buy-label  { color: var(--win); }
.shop-toggle-label.sell-label { color: rgba(255,255,255,0.35); }
.shop-toggle-wrap.sell-mode .buy-label  { color: rgba(255,255,255,0.35); }
.shop-toggle-wrap.sell-mode .sell-label { color: var(--lose); }
.shop-items-scroll { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; overflow-y: auto; max-height: 140px; padding: 2px 2px 8px; scrollbar-width: thin; scrollbar-color: rgba(255,204,0,0.4) transparent; }
.shop-items-scroll::-webkit-scrollbar { width: 4px; }
.shop-items-scroll::-webkit-scrollbar-thumb { background: rgba(255,204,0,0.4); border-radius: 4px; }
.shop-item { background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 10px 6px 8px; text-align: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.shop-item:active { transform: scale(0.93); background: rgba(255,255,255,0.1); }
.shop-item.selected { background: rgba(255,204,0,0.15); border-color: var(--gold); }
.shop-item-img   { width: 36px; height: 36px; margin: 0 auto 6px; display: block; object-fit: contain; image-rendering: pixelated; }
.shop-item-emoji { font-size: 2rem; display: block; margin-bottom: 4px; line-height: 1; }
.shop-item-name  { font-size: 0.65rem; font-weight: 700; opacity: 0.9; line-height: 1.2; }
.shop-item-price { font-size: 0.6rem; opacity: 0.55; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.shop-detail { flex-shrink: 0; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 20px; padding: 16px 14px; margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.shop-detail-top { display: flex; align-items: center; gap: 14px; width: 100%; }
.shop-detail-icon { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; border-radius: 14px; background: rgba(255,255,255,0.05); padding: 6px; box-sizing: border-box; }
.shop-detail-icon-placeholder { font-size: 3rem; line-height: 1; }
.shop-detail-info { flex: 1; }
.shop-detail-name  { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.shop-detail-price { font-size: 0.85rem; opacity: 0.6; display: flex; align-items: center; gap: 4px; }
.shop-qty-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.qty-stepper { display: grid; grid-template-columns: 52px 1fr 52px; width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; overflow: hidden; height: 56px; }
.qty-stepper-btn { background: transparent; border: none; color: rgba(255,255,255,0.65); font-size: 1.6rem; font-weight: 300; cursor: pointer; line-height: 1; transition: background 0.15s, color 0.15s; display: flex; align-items: center; justify-content: center; height: 56px; -webkit-tap-highlight-color: transparent; user-select: none; }
.qty-stepper-btn:active { background: rgba(255,255,255,0.08); color: #fff; }
.qty-stepper-btn:disabled { opacity: 0.2; cursor: not-allowed; }
.qty-stepper-val { width: 100%; height: 56px; text-align: center; font-size: 1.2rem; font-weight: 700; color: #fff; padding: 0; margin: 0; background: transparent; border: none; border-left: 1px solid rgba(255,255,255,0.07); border-right: 1px solid rgba(255,255,255,0.07); outline: none !important; box-shadow: none !important; -webkit-appearance: none; -moz-appearance: textfield; border-radius: 0; line-height: 56px; display: block; }
.qty-stepper-val:focus { outline: none !important; box-shadow: none !important; }
.qty-stepper-val::-webkit-inner-spin-button, .qty-stepper-val::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-stepper-val:focus { background: rgba(255,204,0,0.04); }
.shop-total { font-size: 0.9rem; font-weight: 700; color: var(--gold); text-align: center; display: none; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.shop-actions { display: flex; gap: 10px; width: 100%; margin-top: 4px; align-items: stretch; }
.btn-nav-back { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.1); box-shadow: none; flex: 0 0 auto; padding: 18px 20px; order: 1; display: flex; align-items: center; justify-content: center; }
.btn-nav-back:active { background: rgba(255,255,255,0.14); }
.btn-trade { background: var(--win); color: #000; border: none; box-shadow: 0 4px 0 #2d9a4a; flex: 1; order: 2; display: flex; align-items: center; justify-content: center; }
.btn-trade.sell-mode { background: var(--lose); color: #fff; box-shadow: 0 4px 0 #cc2e27; }

/* ── ИНВЕНТАРЬ ── */
#scr-inventory { padding: 16px 12px; padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(16px + var(--safe-bottom)); align-items: center; justify-content: center; }
.inv-card { background: var(--card); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.12); width: 100%; max-width: 400px; backdrop-filter: blur(30px); box-shadow: 0 25px 50px rgba(0,0,0,0.5); display: flex; flex-direction: row; height: calc(100dvh - 80px); max-height: 680px; overflow: hidden; box-sizing: border-box; animation: cardPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.inv-sidebar { width: 64px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 12px 6px; gap: 5px; border-right: 1px solid rgba(255,255,255,0.07); background: rgba(0,0,0,0.18); }
.inv-tab { width: 52px; flex-shrink: 0; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 9px 4px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 3px; -webkit-tap-highlight-color: transparent; }
.inv-tab:active { transform: scale(0.88); background: rgba(255,255,255,0.1); }
.inv-tab.active-tab { background: rgba(255,204,0,0.15); border-color: var(--gold); }
.inv-tab-icon  { font-size: 1.35rem; line-height: 1; }
.inv-tab-label { font-size: 0.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; opacity: 0.5; text-align: center; line-height: 1.1; }
.inv-tab.active-tab .inv-tab-label { opacity: 1; color: var(--gold); }
.inv-back-tab { margin-top: auto; width: 52px; flex-shrink: 0; background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 10px 4px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 3px; -webkit-tap-highlight-color: transparent; }
.inv-back-tab:active { background: rgba(255,255,255,0.12); transform: scale(0.9); }
.inv-back-tab-icon  { font-size: 1.2rem; line-height: 1; }
.inv-back-tab-label { font-size: 0.48rem; font-weight: 800; opacity: 0.45; text-transform: uppercase; letter-spacing: 0.2px; text-align: center; }
.inv-main { flex: 1; display: flex; flex-direction: column; padding: 12px; gap: 8px; overflow: hidden; min-width: 0; }
.inv-header { display: flex; align-items: center; flex-shrink: 0; margin-bottom: 2px; }
.inv-header h3 { margin: 0; font-size: 1.15rem; font-weight: 800; opacity: 0.9; }
.inv-items-zone { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.06); border-radius: 18px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; align-content: start; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,204,0,0.3) transparent; }
.inv-items-zone::-webkit-scrollbar { width: 3px; }
.inv-items-zone::-webkit-scrollbar-thumb { background: rgba(255,204,0,0.3); border-radius: 4px; }
.inv-slot { aspect-ratio: 1; background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.06); border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; transition: all 0.2s; }
.inv-slot:active { transform: scale(0.88); background: rgba(255,255,255,0.1); }
.inv-slot.filled { border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,0.08); }
.inv-slot img { width: 60%; height: 60%; object-fit: contain; image-rendering: pixelated; }
.inv-slot-emoji { font-size: 1.6rem; line-height: 1; }
.inv-slot-count { position: absolute; bottom: 3px; right: 5px; font-size: 0.62rem; font-weight: 900; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.inv-slot-count.small { font-size: 0.52rem; }
.inv-bottom-row { flex-shrink: 0; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 9px 10px; display: flex; gap: 8px; align-items: stretch; }
.inv-equip-zone { flex: 2; display: flex; flex-direction: column; gap: 5px; }
.inv-equip-label { font-size: 0.5rem; font-weight: 800; opacity: 0.3; text-transform: uppercase; letter-spacing: 0.5px; }
.inv-equip-slots-row { display: flex; gap: 4px; }
.inv-equip-slot { flex: 1; height: 38px; background: rgba(255,255,255,0.04); border: 1.5px dashed rgba(255,255,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: rgba(255,255,255,0.15); }
.inv-potions-zone { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.inv-potions-label { font-size: 0.5rem; font-weight: 800; opacity: 0.3; text-transform: uppercase; letter-spacing: 0.5px; }
.inv-potions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.inv-potion-slot { height: 38px; background: rgba(76,217,100,0.03); border: 1.5px dashed rgba(76,217,100,0.12); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: rgba(76,217,100,0.2); }

/* ── МОДАЛКА ИНВЕНТАРЯ ── */
#item-detail-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 4800; display: none; flex-direction: column; align-items: center; justify-content: flex-end; backdrop-filter: blur(10px); padding-bottom: calc(16px + var(--safe-bottom)); box-sizing: border-box; }
.item-detail-card { background: rgba(22,22,26,0.98); border: 1px solid rgba(255,255,255,0.13); border-radius: 28px 28px 24px 24px; width: 100%; max-width: 400px; padding: 20px 20px 16px; box-sizing: border-box; box-shadow: 0 -10px 40px rgba(0,0,0,0.6); animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.item-detail-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.item-detail-img { width: 72px; height: 72px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 8px; box-sizing: border-box; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.item-detail-img-emoji { width: 72px; height: 72px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.item-detail-info { flex: 1; min-width: 0; }
.item-detail-name  { font-size: 1.2rem; font-weight: 900; margin: 0 0 4px; line-height: 1.1; }
.item-detail-count { font-size: 1rem; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 4px; }
.item-detail-desc  { font-size: 0.78rem; opacity: 0.5; line-height: 1.55; margin-bottom: 16px; }
.item-detail-actions { display: flex; gap: 10px; }
.item-detail-actions .btn-wood { flex: 1; padding: 14px; font-size: 0.8rem; }

/* ── ФЕРМА ── */
.farm-slots-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0; }
.farm-slot { flex: 1; aspect-ratio: 1; background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; padding: 6px; -webkit-tap-highlight-color: transparent; }
.farm-slot:active { transform: scale(0.94); }
.farm-slot.locked { background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.06); }
.farm-slot.unlocked-empty { background: rgba(76,217,100,0.05); border-color: rgba(76,217,100,0.2); border-style: dashed; }
.farm-slot.planted { background: rgba(100,180,80,0.1); border-color: rgba(76,217,100,0.35); }
.farm-slot.ready   { background: rgba(255,204,0,0.12); border-color: var(--gold); animation: farmReady 1.5s ease-in-out infinite; }
@keyframes farmReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,204,0,0); } 50% { box-shadow: 0 0 14px 3px rgba(255,204,0,0.3); } }
.farm-slot-icon { font-size: 1.8rem; line-height: 1; }
.farm-slot-icon img { width: 2rem; height: 2rem; object-fit: contain; image-rendering: pixelated; display: block; }
.farm-slot-label { font-size: 0.52rem; font-weight: 800; text-transform: uppercase; opacity: 0.6; text-align: center; letter-spacing: 0.2px; line-height: 1.2; }
.farm-slot-cost  { font-size: 0.48rem; font-weight: 700; opacity: 0.45; text-align: center; line-height: 1.3; }
.farm-slot-timer { font-size: 0.7rem; font-weight: 900; color: var(--win); letter-spacing: 0.5px; }
.farm-slot.ready .farm-slot-timer { color: var(--gold); }

#farm-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 4500; display: none; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(12px); padding: 16px; padding-bottom: calc(16px + var(--safe-bottom)); box-sizing: border-box; }
.farm-modal-card { background: rgba(20,20,24,0.97); border: 1px solid rgba(255,255,255,0.13); border-radius: 28px; width: 100%; max-width: 380px; max-height: calc(100dvh - 80px); display: flex; flex-direction: column; padding: 20px 18px 18px; box-sizing: border-box; box-shadow: 0 20px 60px rgba(0,0,0,0.7); animation: cardPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.farm-modal-body-scroll { overflow-y: auto; flex: 1; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.farm-modal-title { font-size: 1.1rem; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.farm-modal-title .close-x { position: static; margin-left: auto; }
.farm-item-picker { display: flex; gap: 8px; margin-bottom: 14px; }
.farm-pick-item { flex: 1; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 10px 6px; text-align: center; cursor: pointer; transition: all 0.2s; }
.farm-pick-item.selected { background: rgba(76,217,100,0.15); border-color: var(--win); }
.farm-pick-item:active { transform: scale(0.93); }
.farm-pick-icon { font-size: 1.8rem; display: block; margin-bottom: 4px; line-height: 1; }
.farm-pick-icon img { width: 2rem; height: 2rem; object-fit: contain; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
.farm-pick-name  { font-size: 0.65rem; font-weight: 700; opacity: 0.8; }
.farm-pick-count { font-size: 0.58rem; opacity: 0.5; margin-top: 2px; }
.farm-drop-info  { background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.72rem; max-height: 130px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.farm-drop-info::-webkit-scrollbar { width: 3px; }
.farm-drop-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); align-items: center; }
.farm-drop-row:last-child { border-bottom: none; }
.farm-drop-chance { opacity: 0.4; font-weight: 700; font-size: 0.65rem; }
.farm-drop-reward { font-weight: 700; color: rgba(255,255,255,0.85); }
.farm-grow-time   { font-size: 0.78rem; opacity: 0.6; margin-bottom: 12px; text-align: center; font-weight: 700; }
.farm-confirm-row { display: flex; gap: 8px; flex-shrink: 0; padding-bottom: 4px; }
.farm-confirm-row .btn-wood { flex: 1; font-size: 0.85rem; padding: 15px; margin-bottom: 0 !important; width: auto; box-sizing: border-box; border: none !important; outline: none; }
.farm-unlock-cost { background: rgba(255,204,0,0.07); border: 1px solid rgba(255,204,0,0.2); border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.farm-unlock-cost-row { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; padding: 3px 0; }
.farm-unlock-cost-row span { opacity: 0.5; font-size: 0.7rem; margin-left: auto; }

/* ── ЛОКАЦИЯ ЗАГЛУШКА ── */
#scr-location .location-stub { background: rgba(0,0,0,0.5); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.12); border-radius: 28px; padding: 40px 28px; text-align: center; max-width: 300px; width: 100%; animation: cardPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
#scr-location .location-stub h2 { margin: 0 0 12px; font-size: 1.8rem; }
#scr-location .location-stub p  { opacity: 0.5; margin: 0 0 28px; font-size: 0.95rem; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 360px) {
  #profile-trigger, #rank-trigger { width: 60px; height: 60px; right: 12px; bottom: calc(16px + var(--safe-bottom)); }
  .card { padding: 24px 16px; }
  .menu-buttons { max-width: 280px; }
  .res-title { font-size: 1.8rem; }
  .res-icon  { font-size: 4rem; }
  .inv-items-zone { grid-template-columns: repeat(3, 1fr); }
  .inv-card { max-width: 100%; }
  .inv-sidebar { width: 56px; }
  .inv-tab, .inv-back-tab { width: 44px; }
}

/* ============================================================
   КАРТА МИРА
   ============================================================ */

#scr-map {
  padding: 16px 14px;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
}
.map-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  width: 100%; max-width: 380px;
  backdrop-filter: blur(30px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  padding: 20px 16px 16px;
  box-sizing: border-box;
  animation: cardPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  display: flex; flex-direction: column; gap: 14px;
}
.map-header { display: flex; align-items: center; justify-content: space-between; }
.map-header h3 { margin: 0; font-size: 1.25rem; font-weight: 900; }
.map-locations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-loc-card {
  border-radius: 18px; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; position: relative;
  transition: all 0.15s; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.map-loc-card.unlocked { background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.14); }
.map-loc-card.unlocked:active { transform: scale(0.95); background: rgba(255,255,255,0.12); }
.map-loc-card.boss-loc { background: rgba(255,62,62,0.08); border-color: rgba(255,62,62,0.3); }
.map-loc-card.locked { background: rgba(0,0,0,0.25); border: 1.5px solid rgba(255,255,255,0.05); opacity: 0.5; cursor: default; }
.map-loc-emoji { font-size: 2.2rem; line-height: 1; }
.map-loc-name  { font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.map-loc-desc  { font-size: 0.6rem; opacity: 0.45; line-height: 1.4; font-weight: 600; }
.map-loc-lock  { position: absolute; top: 8px; right: 8px; font-size: 0.75rem; opacity: 0.6; }
.map-loc-boss-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--lose); color: #fff;
  font-size: 0.45rem; font-weight: 900;
  padding: 2px 5px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ============================================================
   RPG БОЙ — панель СНИЗУ, не перекрывает кабанов
   ============================================================ */

/* Арена — кабаны занимают только верхние 60% экрана */
#scr-fight .arena {
  position: absolute;
  bottom: 38%;
  top: calc(var(--safe-top) + 50px);
  width: 100%;
  height: auto;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

/* Лог боя — прямо над панелью кнопок, не перекрывает кабанов */
#scr-fight #fight-log {
  position: absolute;
  bottom: calc(36% + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.82rem;
  z-index: 45;
}

/* На широких экранах — кабаны крупнее */
@media (min-aspect-ratio: 4/3) {
  #scr-fight .arena {
    bottom: 35%;
  }
  #scr-fight #fight-log {
    bottom: calc(33% + var(--safe-bottom));
  }
  .boar-container { width: 30%; }
  .boar-unit img  { max-width: 180px; margin: 0 auto; }
}

/* Панель кнопок — прижата к низу */
#rpg-fight-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 12px;
  padding-bottom: calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.0) 100%);
}

/* Строка стамины */
.rpg-sta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 100px;
  padding: 6px 14px;
}
.rpg-sta-block { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rpg-sta-block.right { align-items: flex-end; }
.rpg-sta-label {
  font-size: 0.52rem; font-weight: 800;
  text-transform: uppercase; opacity: 0.45;
  display: flex; align-items: center; gap: 3px;
}
.rpg-sta-track { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 100px; overflow: hidden; }
.rpg-sta-fill  {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, #3b9eff, #7dc8ff);
  transition: width 0.35s cubic-bezier(0.33,1,0.68,1);
}
.rpg-round-badge-inline {
  font-size: 0.6rem; font-weight: 900; color: var(--gold);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; opacity: 0.9;
}

/* Подменю зелий */
.rpg-potion-submenu { display: none; gap: 8px; animation: rpgFadeIn 0.15s ease; }
.rpg-potion-submenu.open { display: flex; }
@keyframes rpgFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.rpg-potion-btn {
  flex: 1;
  background: #252528;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 0 3px 0 #151517;
  position: relative; top: 0;
  transition: all 0.12s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.rpg-potion-btn:active:not(:disabled) { top: 2px; box-shadow: 0 1px 0 #151517; background: #2a2a2d; }
.rpg-potion-btn:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; top: 0; }
.rpg-potion-icon  { font-size: 1.4rem; line-height: 1; }
.rpg-potion-label { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; opacity: 0.8; }
.rpg-potion-count { font-size: 0.5rem; color: var(--gold); font-weight: 800; }

/* Карточки действий — 4 в ряд, заполняют ширину */
.rpg-main-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rpg-card-btn {
  background: #252528;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  min-height: 80px;
  padding: 10px 4px 8px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 0 #151517;
  position: relative; top: 0;
  transition: all 0.1s cubic-bezier(0.4,0,0.2,1);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.rpg-card-btn:active:not(:disabled) {
  top: 3px;
  box-shadow: 0 1px 0 #151517;
  filter: brightness(1.1);
}
.rpg-card-btn:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; top: 0; }

/* Цветная полоска сверху */
.rpg-card-btn::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: 18px 18px 0 0;
}
.rpg-card-attack { border-color: rgba(255,80,80,0.4); }
.rpg-card-attack::before { background: #ff3e3e; }
.rpg-card-block  { border-color: rgba(59,158,255,0.4); }
.rpg-card-block::before  { background: #3b9eff; }
.rpg-card-wait   { border-color: rgba(76,217,100,0.4); }
.rpg-card-wait::before   { background: #4cd964; }
.rpg-card-potion { border-color: rgba(180,100,255,0.4); }
.rpg-card-potion::before { background: #b464ff; }

.rpg-card-icon  {
  font-size: 1.8rem; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.rpg-card-label {
  font-size: 0.62rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.3px;
  color: rgba(255,255,255,0.9); text-align: center;
}
.rpg-card-cost {
  font-size: 0.5rem; opacity: 0.45; font-weight: 700; text-align: center;
}

/* Слот зелья в инвентаре — поддержка filled */
.inv-potion-slot.filled {
  background: rgba(180,100,255,0.12);
  border-color: rgba(180,100,255,0.3);
  border-style: solid;
}


.field-tab-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 13px 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.field-tab-btn:active { opacity: 0.8; }
.field-tab-btn.active {
  background: rgba(255,204,0,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.field-tab-content { display: flex; flex-direction: column; gap: 10px; }


/* ── СКИНЫ ── */
.skin-selector {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 16px;
}

.skin-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.skin-carousel-inner {
  flex: 1;
  display: flex;
  gap: 10px;
  overflow: hidden;
}

.skin-card {
  flex-shrink: 0;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.skin-card.active-skin {
  border-color: var(--gold);
  background: rgba(255,204,0,0.10);
}

.skin-card.locked {
  cursor: default;
}

.skin-preview {
  width: 90px;
  height: 90px;
  image-rendering: pixelated;
  object-fit: contain;
  transition: filter 0.3s;
}

.skin-card.locked .skin-preview {
  filter: brightness(0.3) grayscale(1);
}

.skin-lock-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 20px;
}

.skin-lock-icon { font-size: 2rem; }

.skin-lock-price {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.6);
  padding: 6px 12px;
  border-radius: 100px;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--gold);
}

.skin-name {
  font-weight: 800;
  font-size: 0.9rem;
}

.skin-nav-btn {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  user-select: none;
}
.skin-nav-btn:active { background: rgba(255,255,255,0.18); }
.skin-nav-btn:disabled { opacity: 0.2; pointer-events: none; }

.skin-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.skin-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.2s;
}
.skin-dot.active { background: var(--gold); }


/* ══════════════════════════════════════════════════════════════
   СКИНЫ — добавить в конец style.css
   ══════════════════════════════════════════════════════════════ */

.skin-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.skin-carousel-inner {
  flex: 1;
  overflow: hidden;
}

.skin-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
  box-sizing: border-box;
}

/* Фикс рамки — чёткая золотая без размытия */
.skin-card.active-skin {
  border: 2px solid var(--gold);
  background: rgba(255, 204, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.15);
}

.skin-card.locked {
  cursor: default;
}

.skin-preview {
  width: 100px;
  height: 100px;
  image-rendering: pixelated;
  object-fit: contain;
  transition: filter 0.3s;
}

.skin-card.locked .skin-preview {
  filter: brightness(0.25) grayscale(1);
}

.skin-lock-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 20px;
}

.skin-lock-icon { font-size: 2rem; }

.skin-lock-price {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.65);
  padding: 6px 14px;
  border-radius: 100px;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--gold);
}

.skin-name {
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
}

.skin-active-badge {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.skin-nav-btn {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  padding: 0;
}
.skin-nav-btn:active { background: rgba(255,255,255,0.16); }
.skin-nav-btn:disabled { opacity: 0.18; pointer-events: none; }

.skin-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.skin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.2s;
}
.skin-dot.active { background: var(--gold); }