@font-face {
  font-family: 'OverchargeFont';
  src: url('https://image2url.com/r2/default/files/1770944508264-e3ec0b97-4ea0-44e2-9a2e-4d08294a2628.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f5f5f0;
  color: #2a2a2a;
  font-family: 'OverchargeFont', 'Segoe UI', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

:root {
  --electric-blue: #0088cc;
  --neon-yellow: #cc9900;
  --hot-pink: #cc0077;
  --electric-green: #00995a;
  --deep-purple: #7c3aed;
  --danger-red: #cc2222;
}

/* Battery Container */
.battery-outer {
  position: relative;
  width: 160px;
  height: 280px;
  border: 4px solid #bbb;
  border-radius: 16px;
  background: #e8e8e0;
  overflow: hidden;
  transition: border-color 0.3s;
}

.battery-nub {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 16px;
  background: #bbb;
  border-radius: 6px 6px 0 0;
  z-index: 2;
}

.battery-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transition: height 0.3s ease, background 0.5s ease;
}

/* Charge level color states */
.battery-fill.level-green {
  background: linear-gradient(to top, #00aa44, #33cc77);
}

.battery-fill.level-yellow {
  background: linear-gradient(to top, #dd8800, #eebb00);
  box-shadow: 0 0 20px rgba(200, 180, 0, 0.3) inset;
}

.battery-fill.level-red {
  background: linear-gradient(to top, #bb0000, #ee3333);
  animation: pulse-red 1s ease-in-out infinite;
}

.battery-fill.level-ultra {
  background: linear-gradient(to top, #5500aa, #0088cc, #cc0077);
  background-size: 200% 200%;
  animation: ultra-gradient 2s ease infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 20px rgba(200, 50, 50, 0.3) inset; }
  50% { box-shadow: 0 0 40px rgba(200, 50, 50, 0.6) inset, 0 0 60px rgba(200, 50, 50, 0.2); }
}

@keyframes ultra-gradient {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* Shake animation */
.shake-mild {
  animation: shake-mild 0.3s ease-in-out;
}

.shake-heavy {
  animation: shake-heavy 0.15s ease-in-out infinite;
}

@keyframes shake-mild {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes shake-heavy {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}

/* Charge button */
.charge-btn {
  font-family: 'OverchargeFont', sans-serif;
  font-size: 1.4rem;
  padding: 16px 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0088cc, #005588);
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0, 100, 180, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: btn-pulse 2s ease-in-out infinite;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.charge-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 10px rgba(0, 136, 204, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.charge-btn:hover {
  box-shadow: 0 0 20px rgba(0, 136, 204, 0.4), 0 4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(0, 100, 180, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 25px rgba(0, 100, 180, 0.5), 0 4px 20px rgba(0, 0, 0, 0.15); }
}

.charge-btn .flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  animation: flash-once 0.15s ease-out;
}

@keyframes flash-once {
  0% { opacity: 0.5; }
  100% { opacity: 0; }
}

/* Spark particles */
.spark {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  animation: spark-fly 0.8s ease-out forwards;
  z-index: 10;
}

@keyframes spark-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* Lightning bolts */
.lightning {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  animation: lightning-flash 0.6s ease-out forwards;
  z-index: 10;
  text-shadow: 0 0 10px var(--electric-blue), 0 0 20px var(--electric-blue);
}

@keyframes lightning-flash {
  0% { opacity: 1; transform: scale(1.2); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5) translateY(-30px); }
}

/* Shop modal */
.shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.shop-modal {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  width: 90vw;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.shop-modal::-webkit-scrollbar {
  width: 6px;
}

.shop-modal::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.shop-modal::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.shop-item {
  background: #f8f8f5;
  border: 1px solid #e0e0d8;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s, transform 0.15s;
}

.shop-item:hover {
  border-color: #ccc;
}

.shop-item.affordable:hover {
  border-color: var(--electric-blue);
}

.shop-item.unaffordable {
  opacity: 0.5;
}

.shop-item .buy-btn {
  font-family: 'OverchargeFont', sans-serif;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--electric-green), #00aa55);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  font-size: 0.9rem;
}

.shop-item .buy-btn:active {
  transform: scale(0.9);
}

.shop-item .buy-btn:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
}

.shop-item .buy-btn.just-bought {
  animation: buy-flash 0.3s ease;
}

@keyframes buy-flash {
  0% { background: #fff; transform: scale(1.1); }
  100% { background: linear-gradient(135deg, var(--electric-green), #00aa55); transform: scale(1); }
}

/* Event notifications */
.event-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 16px 28px;
  border-radius: 12px;
  font-family: 'OverchargeFont', sans-serif;
  font-size: 1.1rem;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
  text-align: center;
  max-width: 90vw;
}

.event-toast.short-circuit {
  background: #fff0f0;
  border: 2px solid var(--danger-red);
  color: #aa0000;
  box-shadow: 0 4px 20px rgba(200, 0, 0, 0.15);
}

.event-toast.power-surge {
  background: #f0f8ff;
  border: 2px solid var(--electric-blue);
  color: var(--electric-blue);
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.15);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Percentage text glow */
.charge-text {
  font-family: 'OverchargeFont', sans-serif;
  transition: text-shadow 0.3s, color 0.3s;
}

.charge-text.level-green {
  color: #00884a;
  text-shadow: 0 0 10px rgba(0, 150, 80, 0.2);
}

.charge-text.level-yellow {
  color: #bb8800;
  text-shadow: 0 0 15px rgba(200, 150, 0, 0.25);
}

.charge-text.level-red {
  color: #cc2222;
  text-shadow: 0 0 20px rgba(200, 30, 30, 0.3);
}

.charge-text.level-ultra {
  background: linear-gradient(90deg, var(--deep-purple), var(--electric-blue), var(--hot-pink), var(--electric-blue));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 2s linear infinite;
  filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.3));
}

@keyframes text-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Stats bar */
.stats-bar {
  background: #eeeee8;
  border-top: 1px solid #ddd;
  font-size: 0.75rem;
  color: #777;
}

/* Footer */
.app-footer a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: var(--electric-blue);
}

/* Background effect */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0, 136, 204, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(204, 0, 119, 0.02) 0%, transparent 50%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f5f5f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Custom heading font */
.font-custom {
  font-family: 'OverchargeFont', sans-serif;
}

/* Shop button */
.shop-btn {
  font-family: 'OverchargeFont', sans-serif;
  background: #fff;
  border: 1px solid #ddd;
  color: var(--neon-yellow);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shop-btn:hover {
  border-color: var(--neon-yellow);
  box-shadow: 0 4px 15px rgba(200, 150, 0, 0.15);
}

.reset-btn {
  font-family: 'OverchargeFont', sans-serif;
  background: transparent;
  border: 1px solid #ddd;
  color: #999;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  border-color: var(--danger-red);
  color: var(--danger-red);
}