:root {
  --dex-red: #d7263d;
  --dex-dark: #9b0d20;
  --dex-light: #f77f85;
  --black: #0f0f14;
  --screen: #1f2533;
  --screen-glow: #3a4a6a;
  --accent: #23c483;
  --yellow: #ffc857;
  --white: #f9fafb;
  --muted: #bfc7d1;
}

/* Base */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 400px at 50% 0%, #181a20 0%, #0d0f14 60%);
  color: var(--white);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Pokedex casing */
.pokedex {
  max-width: 980px;
  margin: 4rem auto;
  padding: 2rem;
  background: linear-gradient(180deg, var(--dex-red), var(--dex-dark));
  border-radius: 28px;
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.25),
    inset 0 -8px 20px rgba(0,0,0,0.35),
    0 24px 60px rgba(0,0,0,0.35);
  border: 2px solid rgba(0,0,0,0.2);
}

/* Decorative screws */
.pokedex::before, .pokedex::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: #5a0e18;
  border-radius: 50%;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15);
}
.pokedex::before { top: 18px; left: calc(50% - 480px + 24px); }
.pokedex::after  { top: 18px; right: calc(50% - 480px + 24px); }

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.light {
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,255,255,0.25), inset 0 -2px 4px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.25);
}
.light-red { background: #ff6161; box-shadow: 0 0 18px #ff6161aa; }
.light-yellow { background: var(--yellow); box-shadow: 0 0 18px #ffc85799; }
.light-green { background: #78e08f; box-shadow: 0 0 18px #78e08f99; }

.speaker {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.speaker span {
  width: 6px; height: 24px;
  background: #7d0f1f;
  border-radius: 3px;
  box-shadow: inset 0 -2px 2px rgba(0,0,0,0.4);
}

/* Screen */
.screen {
  background: linear-gradient(180deg, #121726, var(--screen));
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    inset 0 0 40px rgba(58, 74, 106, 0.6),
    0 8px 24px rgba(0,0,0,0.35);
  border: 1px solid #0b0f18;
}
.screen-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-circle {
  position: relative;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4c5d83, #2a3348 60%, #1a2031 100%);
  box-shadow: inset 0 0 40px rgba(255,255,255,0.06), 0 12px 28px rgba(0,0,0,0.45);
  border: 2px solid #0f1422;
  overflow: hidden;
}
.avatar-circle .shine {
  position: absolute;
  top: -40%; left: -20%;
  width: 160%; height: 60%;
  background: linear-gradient(120deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
  transform: rotate(10deg);
  filter: blur(6px);
}
.avatar-circle img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: screen;
  opacity: 0.9;
}

/* Info */
.info h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  letter-spacing: 0.5px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}
.stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
}
.stat .label { color: var(--muted); }
.stat .value { color: var(--accent); font-weight: 600; }
.desc { color: #dbe2ee; line-height: 1.5; }

/* Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  margin-top: 18px;
  align-items: center;
}
.button-row {
  display: flex;
  gap: 12px;
}
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: #8c1023;
  color: var(--white);
  box-shadow: 0 4px 0 #5e0b17, 0 10px 18px rgba(0,0,0,0.3);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #5e0b17; }
.btn-primary { background: #23c483; box-shadow: 0 4px 0 #168a59, 0 10px 18px rgba(0,0,0,0.3); color: #042014; }
.btn-secondary { background: #ff6b6b; box-shadow: 0 4px 0 #c23939; color: #2c0a0a; }

/* D-pad */
.dpad {
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-items: center;
}
.d {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: #7d0f1f;
  color: #f7eaea;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 -4px 12px rgba(0,0,0,0.5), 0 6px 16px rgba(0,0,0,0.35);
  cursor: pointer;
  font-size: 18px;
}
.d-middle {
  display: grid;
  grid-template-columns: 54px 54px 54px;
  gap: 8px;
}
.d-center {
  background: #1f2533;
  border: 1px solid #0b0f18;
}

/* Bottom bar */
.bottom-bar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.port {
  width: 54px; height: 18px;
  background: #5a0e18;
  border-radius: 4px;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.5);
}
.grill {
  height: 10px;
  background: repeating-linear-gradient(
    to right,
    #7d0f1f 0, #7d0f1f 14px,
    #5a0e18 14px, #5a0e18 24px
  );
  border-radius: 6px;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.4);
}
.brand {
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
}

/* Responsive */
@media (max-width: 820px) {
  .screen-inner {
    grid-template-columns: 1fr;
  }
  .avatar-circle {
    width: 220px; height: 220px;
  }
  .stats { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
  .button-row { justify-content: center; flex-wrap: wrap; }
}
