* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

body {
  background: #0d0f17;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  overflow: hidden;
}

.app-container {
  width: 100%;
  max-width: 420px;
  height: 100vh;
  max-height: 720px;
  padding: 10px;
  display: flex;
}

.pokedex-device {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #d32020, #961212);
  border-radius: 20px;
  border: 4px solid #380707;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 3px 6px rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  padding: 12px;
  position: relative;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.currency-badge { background: #222; padding: 4px 8px; border-radius: 10px; border: 1px solid #ffd700; color: #ffd700; }
.badge-title { font-size: 9px; color: #fff; text-shadow: 1px 1px 2px #000; }
.sound-toggle { cursor: pointer; font-size: 14px; }

/* LCD Frame */
.lcd-frame {
  flex: 1;
  background: #a4b993;
  border: 6px solid #262c20;
  border-radius: 12px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
  padding: 8px;
  color: #1a2016;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.view { display: none; height: 100%; flex-direction: column; }
.view.active { display: flex; }

.pixel-h1 { font-size: 8px; text-align: center; margin-bottom: 8px; line-height: 1.3; }

/* Starter View */
.starters-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; overflow-y: auto; }
.starter-card {
  background: rgba(0,0,0,0.08);
  border: 2px solid #262c20;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  cursor: pointer;
}
.starter-card img { width: 50px; height: 50px; image-rendering: pixelated; }
.starter-card span { font-size: 7px; margin-top: 4px; }

/* Pet View */
.pet-header { display: flex; justify-content: space-between; align-items: center; font-size: 8px; margin-bottom: 4px; }
.lvl-tag { background: #262c20; color: #a4b993; padding: 2px 4px; border-radius: 4px; margin-left: 4px; }
.bar-bg { width: 70px; height: 8px; background: #687959; border: 1px solid #262c20; border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; transition: width 0.3s; }
.bar-fill.hp { background: #2ecc71; }
.bar-fill.orange { background: #e67e22; }
.bar-fill.pink { background: #e91e63; }
.bar-fill.yellow { background: #f1c40f; }

.pet-bars { display: flex; justify-content: space-between; margin-bottom: 6px; }
.mini-bar { display: flex; align-items: center; gap: 2px; font-size: 8px; }
.mini-bar .bar-bg { width: 45px; height: 6px; }

.stage-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.stage-sprite { width: 110px; height: 110px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0,0,0,0.2)); }
.status-bubble { position: absolute; top: 10px; right: 30px; font-size: 24px; animation: bounce 1.5s infinite; }
.poop-icon { position: absolute; bottom: 10px; left: 30px; font-size: 20px; }
.hidden { display: none !important; }

.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.action-btn {
  font-family: inherit;
  font-size: 7px;
  padding: 8px 4px;
  border: 2px solid #262c20;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
}
.action-btn.red { background: #e74c3c; }
.action-btn.blue { background: #3498db; }
.action-btn.green { background: #27ae60; }
.action-btn.purple { background: #8e44ad; }

/* Battle View */
.battle-arena {
  height: 180px;
  position: relative;
  border-bottom: 2px dashed #262c20;
  margin-bottom: 6px;
}
.foe-box { position: absolute; top: 5px; left: 5px; font-size: 7px; }
.foe-box .bar-bg { width: 90px; }
.battle-sprite.foe { position: absolute; top: 15px; right: 15px; width: 75px; height: 75px; image-rendering: pixelated; }

.ally-box { position: absolute; bottom: 5px; right: 5px; font-size: 7px; }
.ally-box .bar-bg { width: 90px; }
.battle-sprite.ally { position: absolute; bottom: 10px; left: 15px; width: 75px; height: 75px; image-rendering: pixelated; }

.battle-log { font-size: 7px; min-height: 30px; padding: 4px; line-height: 1.3; background: rgba(0,0,0,0.06); border-radius: 4px; }
.battle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.battle-btn { font-family: inherit; font-size: 7px; padding: 8px 4px; border: 2px solid #262c20; border-radius: 6px; cursor: pointer; color: #fff; }
.battle-btn.attack { background: #c0392b; }
.battle-btn.special { background: #9b59b6; }
.battle-btn.catch { background: #d35400; }
.battle-btn.run { background: #7f8c8d; }

/* Team & Pokedex */
.team-grid, .pokedex-grid { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.team-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.08);
  border: 2px solid #262c20;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 7px;
}
.team-slot img { width: 35px; height: 35px; image-rendering: pixelated; }

.pokedex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dex-slot {
  background: rgba(0,0,0,0.05);
  border: 1px solid #262c20;
  border-radius: 4px;
  padding: 4px;
  text-align: center;
  font-size: 6px;
}
.dex-slot.unseen img { filter: brightness(0); opacity: 0.3; }
.dex-slot img { width: 40px; height: 40px; image-rendering: pixelated; }
.pokedex-counter { font-size: 7px; margin-bottom: 6px; text-align: center; }

/* Shop */
.shop-list { display: flex; flex-direction: column; gap: 6px; }
.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7px;
  background: rgba(0,0,0,0.08);
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #262c20;
}
.shop-item button {
  font-family: inherit;
  font-size: 6px;
  padding: 4px 6px;
  background: #27ae60;
  color: #fff;
  border: 1px solid #262c20;
  border-radius: 4px;
  cursor: pointer;
}

/* Bottom Menu */
.bottom-menu {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 4px;
}
.nav-btn {
  flex: 1;
  font-family: inherit;
  font-size: 6px;
  padding: 8px 2px;
  background: #333;
  color: #fff;
  border: 2px solid #111;
  border-radius: 8px;
  cursor: pointer;
}
.nav-btn.active { background: #ffd700; color: #111; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
