* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1115;
  color: #e6e6e6;
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 21, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1f232c;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
}

.balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #161a22;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid #1f232c;
}

.balance-icon { font-size: 16px; }

/* Экраны */
.screen { display: none; padding: 16px; }
.screen.active { display: block; }

.screen-title {
  font-size: 20px;
  margin-bottom: 16px;
  font-weight: 700;
}

/* Кейсы */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.case-card {
  background: linear-gradient(180deg, #161a22 0%, #0f1115 100%);
  border: 1px solid #1f232c;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.case-card:active { transform: scale(0.97); }
.case-card:hover { border-color: #f0b90b44; }

.case-emoji { font-size: 42px; margin-bottom: 8px; }

.case-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-price {
  font-size: 14px;
  color: #f0b90b;
  font-weight: 700;
}

/* Инвентарь */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.inv-item {
  background: linear-gradient(180deg, #161a22 0%, #0f1115 100%);
  border: 1px solid #1f232c;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  position: relative;
}

.inv-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}

.inv-item.rarity-common::before { background: #7a8ba3; }
.inv-item.rarity-uncommon::before { background: #4a90e2; }
.inv-item.rarity-rare::before { background: #9b59b6; }
.inv-item.rarity-epic::before { background: #e91e63; }
.inv-item.rarity-legendary::before { background: #f0b90b; }
.inv-item.rarity-arcane::before { background: #ff4757; }

.inv-name {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-price {
  font-size: 13px;
  color: #f0b90b;
  font-weight: 700;
  margin-bottom: 8px;
}

.inv-sell-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: #2ecc71;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.inv-sell-btn:active { transform: scale(0.97); }

/* Рулетка */
.roulette-wrapper {
  position: relative;
  overflow: hidden;
  height: 140px;
  background: #0b0d12;
  border-radius: 14px;
  margin: 24px 0 20px;
  border: 1px solid #1f232c;
}

.roulette-track {
  display: flex;
  gap: 8px;
  padding: 8px;
  height: 100%;
  transform: translateX(0);
  transition: transform 3.5s cubic-bezier(0.15, 0.9, 0.25, 1);
}

.roulette-item {
  min-width: 100px;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1f29 0%, #0f1115 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-align: center;
  padding: 6px;
  font-weight: 600;
  position: relative;
}

.roulette-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 0 0 10px 10px;
}

.roulette-item.rarity-common::after { background: #7a8ba3; }
.roulette-item.rarity-uncommon::after { background: #4a90e2; }
.roulette-item.rarity-rare::after { background: #9b59b6; }
.roulette-item.rarity-epic::after { background: #e91e63; }
.roulette-item.rarity-legendary::after { background: #f0b90b; }
.roulette-item.rarity-arcane::after { background: #ff4757; }

.roulette-pointer {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, #f0b90b, #f0b90b80);
  box-shadow: 0 0 12px #f0b90b;
  transform: translateX(-50%);
  z-index: 2;
}

.roulette-result {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  min-height: 60px;
}

.roulette-result .win-name { color: #f0b90b; }

/* Кнопки */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #f0b90b;
  color: #000;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 12px;
}

.btn-primary:active { transform: scale(0.98); }

.hidden { display: none !important; }

/* Нижнее меню */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(15, 17, 21, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #1f232c;
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: #8a92a6;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 22px;
}

.nav-btn.active { color: #f0b90b; }
.nav-label { font-size: 11px; font-weight: 600; }

.empty-msg {
  text-align: center;
  color: #8a92a6;
  padding: 40px 0;
  font-size: 14px;
}